@hedia/web-public 3.9.0-1237 → 3.9.0-1238
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`hedia-web@3.9.0+1237`};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`5d4fb105-7841-4743-9fc5-9a797656767b`,e._sentryDebugIdIdentifier=`sentry-dbid-5d4fb105-7841-4743-9fc5-9a797656767b`)}catch{}})();var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(e&&(t=e(e=0)),t),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.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function ee(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function te(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ne(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ne(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ee(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),ne(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ee(a,u),c+=ne(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+ee(a,u++),c+=ne(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ne(te(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function re(e,t,n){if(e==null)return e;var r=[],i=0;return ne(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ie(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 j=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},ae={map:re,forEach:function(e,t,n){re(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return re(e,function(){t++}),t},toArray:function(e){return re(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ae,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ie}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,j)}catch(e){j(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.3`})),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(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&ee(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ee(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function ee(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ee(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),h=s(((e,t)=>{t.exports=m()})),g=s((e=>{var t=p();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.3`})),_=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=h(),n=p(),r=_();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(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 s(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 c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,m=Symbol.for(`react.element`),g=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),A=Symbol.for(`react.memo_cache_sentinel`),ee=Symbol.iterator;function te(e){return typeof e!=`object`||!e?null:(e=ee&&e[ee]||e[`@@iterator`],typeof e==`function`?e:null)}var ne=Symbol.for(`react.client.reference`);function re(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ne?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?re(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return re(e(t))}catch{}}return null}var ie=Array.isArray,j=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe={pending:!1,data:null,method:null,action:null},se=[],M=-1;function ce(e){return{current:e}}function N(e){0>M||(e.current=se[M],se[M]=null,M--)}function P(e,t){M++,se[M]=e.current,e.current=t}var le=ce(null),ue=ce(null),de=ce(null),fe=ce(null);function pe(e,t){switch(P(de,t),P(ue,e),P(le,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Ou(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Ou(t),e=ku(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}N(le),P(le,e)}function me(){N(le),N(ue),N(de)}function he(e){e.memoizedState!==null&&P(fe,e);var t=le.current,n=ku(t,e.type);t!==n&&(P(ue,e),P(le,n))}function ge(e){ue.current===e&&(N(le),N(ue)),fe.current===e&&(N(fe),xd._currentValue=oe)}var F,_e;function I(e){if(F===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);F=t&&t[1]||``,_e=-1<e.stack.indexOf(`
|
|
1
|
+
(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`hedia-web@3.9.0+1238`};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`d499c81a-e9c9-432e-9644-c58d0b5a884e`,e._sentryDebugIdIdentifier=`sentry-dbid-d499c81a-e9c9-432e-9644-c58d0b5a884e`)}catch{}})();var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(e&&(t=e(e=0)),t),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.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function ee(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function te(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ne(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ne(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ee(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),ne(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ee(a,u),c+=ne(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+ee(a,u++),c+=ne(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ne(te(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function re(e,t,n){if(e==null)return e;var r=[],i=0;return ne(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ie(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 j=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},ae={map:re,forEach:function(e,t,n){re(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return re(e,function(){t++}),t},toArray:function(e){return re(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ae,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ie}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,j)}catch(e){j(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.3`})),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(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&ee(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ee(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function ee(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ee(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),h=s(((e,t)=>{t.exports=m()})),g=s((e=>{var t=p();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.3`})),_=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=h(),n=p(),r=_();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(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 s(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 c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,m=Symbol.for(`react.element`),g=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),A=Symbol.for(`react.memo_cache_sentinel`),ee=Symbol.iterator;function te(e){return typeof e!=`object`||!e?null:(e=ee&&e[ee]||e[`@@iterator`],typeof e==`function`?e:null)}var ne=Symbol.for(`react.client.reference`);function re(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ne?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?re(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return re(e(t))}catch{}}return null}var ie=Array.isArray,j=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe={pending:!1,data:null,method:null,action:null},se=[],M=-1;function ce(e){return{current:e}}function N(e){0>M||(e.current=se[M],se[M]=null,M--)}function P(e,t){M++,se[M]=e.current,e.current=t}var le=ce(null),ue=ce(null),de=ce(null),fe=ce(null);function pe(e,t){switch(P(de,t),P(ue,e),P(le,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Ou(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Ou(t),e=ku(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}N(le),P(le,e)}function me(){N(le),N(ue),N(de)}function he(e){e.memoizedState!==null&&P(fe,e);var t=le.current,n=ku(t,e.type);t!==n&&(P(ue,e),P(le,n))}function ge(e){ue.current===e&&(N(le),N(ue)),fe.current===e&&(N(fe),xd._currentValue=oe)}var F,_e;function I(e){if(F===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);F=t&&t[1]||``,_e=-1<e.stack.indexOf(`
|
|
2
2
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
3
3
|
`+F+e+_e}var ve=!1;function ye(e,t){if(!e||ve)return``;ve=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
4
4
|
`),l=s.split(`
|
|
@@ -862,7 +862,7 @@ Event: ${E1(e)}.
|
|
|
862
862
|
Url: ${J1(e)}`),!0;if(!oQt(e,t.allowUrls))return q$&&t1.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
863
863
|
Event: ${E1(e)}.
|
|
864
864
|
Url: ${J1(e)}`),!0}else if(e.type===`transaction`&&iQt(e,t.ignoreTransactions))return q$&&t1.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
865
|
-
Event: ${E1(e)}`),!0;return!1}function rQt(e,t){return t?.length?oZt(e).some(e=>w1(e,t)):!1}function iQt(e,t){if(!t?.length)return!1;let n=e.transaction;return n?w1(n,t):!1}function aQt(e,t){if(!t?.length)return!1;let n=J1(e);return n?w1(n,t):!1}function oQt(e,t){if(!t?.length)return!0;let n=J1(e);return n?w1(n,t):!0}function sQt(e=[]){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&n.filename!==`<anonymous>`&&n.filename!==`[native code]`)return n.filename||null}return null}function J1(e){try{let t=[...e.exception?.values??[]].reverse().find(e=>e.mechanism?.parent_id===void 0&&e.stacktrace?.frames?.length)?.stacktrace?.frames;return t?sQt(t):null}catch{return q$&&t1.error(`Cannot extract url for event ${E1(e)}`),null}}function cQt(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(e=>e.stacktrace||e.type&&e.type!==`Error`||e.value):!1}function lQt(e,t,n,r,i,a){if(!i.exception?.values||!a||!c1(a.originalException))return;let o=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;o&&(i.exception.values=uQt(e,t,r,a.originalException,n,i.exception.values,o,0))}function uQt(e,t,n,r,i,a,o,s){if(a.length>=n+1)return a;let c=[...a];if(c1(r[i])){fQt(o,s,r);let a=e(t,r[i]),l=c.length;pQt(a,i,l,s),c=uQt(e,t,n,r[i],i,[a,...c],a,l)}return dQt(r)&&r.errors.forEach((a,l)=>{if(c1(a)){fQt(o,s,r);let u=e(t,a),d=c.length;pQt(u,`errors[${l}]`,d,s),c=uQt(e,t,n,a,i,[u,...c],u,d)}}),c}function dQt(e){return Array.isArray(e.errors)}function fQt(e,t,n){e.mechanism={handled:!0,type:`auto.core.linked_errors`,...dQt(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function pQt(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:`chained`,source:t,exception_id:n,parent_id:r}}function mQt(e){return c1(e)&&`__sentry_fetch_url_host__`in e&&typeof e.__sentry_fetch_url_host__==`string`}function hQt(e){return mQt(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}var gQt=new Set([]);function _Qt(e){let t=`console`,n=a1(t,e);return o1(t,yQt),n}var vQt=new Set;function yQt(){`console`in J$&&zKt.forEach(function(e){vQt.has(e)||!(e in J$.console)||(vQt.add(e),g1(J$.console,e,function(t){return $$[e]=t,function(...t){let n=t[0],r=$$[e],i=gQt.size&&typeof n==`string`&&w1(n,gQt);i||s1(`console`,{args:t,level:e}),(!i||q$&&t1.isEnabled())&&r?.apply(J$.console,t)}}))})}function bQt(e){return e===`warn`?`warning`:[`fatal`,`error`,`warning`,`log`,`info`,`debug`].includes(e)?e:`log`}var xQt=`Dedupe`,SQt=W1((()=>{let e;return{name:xQt,processEvent(t){if(t.type)return t;try{if(CQt(t,e))return q$&&t1.warn(`Event dropped due to being a duplicate of previously captured event.`),null}catch{}return e=t}}}));function CQt(e,t){return t?!!(wQt(e,t)||TQt(e,t)):!1}function wQt(e,t){let n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!DQt(e,t)||!EQt(e,t))}function TQt(e,t){let n=OQt(t),r=OQt(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!DQt(e,t)||!EQt(e,t))}function EQt(e,t){let n=nqt(e),r=nqt(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let e=0;e<r.length;e++){let t=r[e],i=n[e];if(t.filename!==i.filename||t.lineno!==i.lineno||t.colno!==i.colno||t.function!==i.function)return!1}return!0}function DQt(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join(``)===r.join(``)}catch{return!1}}function OQt(e){return e.exception?.values?.[0]}var kQt=`ConversationId`,AQt=W1((()=>({name:kQt,setup(e){e.on(`spanStart`,e=>{let t=P1().getScopeData(),n=F1().getScopeData(),r=t.conversationId||n.conversationId;if(r){let{op:t,data:n,description:i}=R1(e);if(!t?.startsWith(`gen_ai.`)&&!n[`ai.operationId`]&&!i?.startsWith(`ai.`))return;e.setAttribute(AJt,r)}})}})));function jQt(e){if(e!==void 0){if(e>=400&&e<500)return`warning`;if(e>=500)return`error`}}var Y1=J$;function MQt(){return`history`in Y1&&!!Y1.history}function NQt(){if(!(`fetch`in Y1))return!1;try{return new Headers,new Request(`data:,`),new Response,!0}catch{return!1}}function PQt(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function FQt(){if(typeof EdgeRuntime==`string`)return!0;if(!NQt())return!1;if(PQt(Y1.fetch))return!0;let e=!1,t=Y1.document;if(t&&typeof t.createElement==`function`)try{let n=t.createElement(`iframe`);n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=PQt(n.contentWindow.fetch)),t.head.removeChild(n)}catch(e){q$&&t1.warn(`Could not create sandbox iframe for pure fetch check, bailing to window.fetch: `,e)}return e}function IQt(e,t){let n=`fetch`,r=a1(n,e);return o1(n,()=>LQt(void 0,t)),r}function LQt(e,t=!1){t&&!FQt()||g1(J$,`fetch`,function(t){return function(...n){let r=Error(),{method:i,url:a}=zQt(n),o={args:n,fetchData:{method:i,url:a},startTimestamp:k1()*1e3,virtualError:r,headers:BQt(n)};return e||s1(`fetch`,{...o}),t.apply(J$,n).then(async t=>(e?e(t):s1(`fetch`,{...o,endTimestamp:k1()*1e3,response:t}),t),e=>{s1(`fetch`,{...o,endTimestamp:k1()*1e3,error:e}),c1(e)&&e.stack===void 0&&(e.stack=r.stack,_1(e,`framesToPop`,1));let t=I1()?.getOptions().enhanceFetchErrorMessages??`always`;if(t!==!1&&c1(e)&&e.name===`TypeError`&&(e.message===`Failed to fetch`||e.message===`Load failed`||e.message===`NetworkError when attempting to fetch resource.`))try{let n=new URL(o.fetchData.url).host;t===`always`?e.message=`${e.message} (${n})`:_1(e,`__sentry_fetch_url_host__`,n)}catch{}throw e})}})}function X1(e,t){return p1(e)&&!!e[t]}function RQt(e){return typeof e==`string`?e:e?X1(e,`url`)?e.url:e.toString?e.toString():``:``}function zQt(e){if(e.length===0)return{method:`GET`,url:``};if(e.length===2){let[t,n]=e;return{url:RQt(t),method:X1(n,`method`)?String(n.method).toUpperCase():_qt(t)&&X1(t,`method`)?String(t.method).toUpperCase():`GET`}}let t=e[0];return{url:RQt(t),method:X1(t,`method`)?String(t.method).toUpperCase():`GET`}}function BQt(e){let[t,n]=e;try{if(typeof n==`object`&&n&&`headers`in n&&n.headers)return new Headers(n.headers);if(_qt(t))return new Headers(t.headers)}catch{}}var VQt=J$;function HQt(){try{return VQt.document.location.href}catch{return``}}function UQt(e,t=5){if(!VQt.HTMLElement)return null;let n=e;for(let e=0;e<t;e++){if(!n)return null;if(n instanceof HTMLElement){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}n=n.parentNode}return null}var Z1=J$,WQt=0;function GQt(){return WQt>0}function KQt(){WQt++,setTimeout(()=>{WQt--})}function Q1(e,t={}){function n(e){return typeof e==`function`}if(!n(e))return e;try{if(Object.prototype.hasOwnProperty.call(e,`__sentry_wrapped__`)){let t=e.__sentry_wrapped__;return typeof t==`function`?t:e}if(yqt(e))return e}catch{return e}let r=function(...n){J$._sentryWrappedDepth=(J$._sentryWrappedDepth||0)+1;try{let r=n.map(e=>Q1(e,t));return e.apply(this,r)}catch(e){throw KQt(),wJt(r=>{r.addEventProcessor(e=>(t.mechanism&&(Hqt(e,void 0,void 0),D1(e,t.mechanism)),e.extra={...e.extra,arguments:n},e)),hXt(e)}),e}finally{J$._sentryWrappedDepth=(J$._sentryWrappedDepth||0)-1}};try{for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])}catch{}vqt(r,e),_1(e,`__sentry_wrapped__`,r);try{Object.getOwnPropertyDescriptor(r,`name`).configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function qQt(){let e=HQt(),{referrer:t}=Z1.document||{},{userAgent:n}=Z1.navigator||{};return{url:e,headers:{...t&&{Referer:t},...n&&{"User-Agent":n}}}}function JQt(e,t){let n=$1(e,t),r={type:t$t(t),value:n$t(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===``&&(r.value=`Unrecoverable error caught`),r}function YQt(e,t,n,r){let i=I1()?.getOptions().normalizeDepth,a=l$t(t),o={__serialized__:kqt(t,i)};if(a)return{exception:{values:[JQt(e,a)]},extra:o};let s={exception:{values:[{type:m1(t)?t.constructor.name:r?`UnhandledRejection`:`Error`,value:s$t(t,{isUnhandledRejection:r})}]},extra:o};if(n){let t=$1(e,n);t.length&&(s.exception.values[0].stacktrace={frames:t})}return s}function XQt(e,t){return{exception:{values:[JQt(e,t)]}}}function $1(e,t){let n=t.stacktrace||t.stack||``,r=QQt(t),i=$Qt(t);try{return e(n,r,i)}catch{}return[]}var ZQt=/Minified React error #\d+;/i;function QQt(e){return e&&ZQt.test(e.message)?1:0}function $Qt(e){return typeof e.framesToPop==`number`?e.framesToPop:0}function e$t(e){return typeof WebAssembly<`u`&&WebAssembly.Exception!==void 0?e instanceof WebAssembly.Exception:!1}function t$t(e){let t=e?.name;return!t&&e$t(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:`WebAssembly.Exception`:t}function n$t(e){let t=e?.message;return e$t(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:`wasm exception`:t?t.error&&typeof t.error.message==`string`?hQt(t.error):hQt(e):`No error message`}function r$t(e,t,n,r){let i=a$t(e,t,n?.syntheticException||void 0,r);return D1(i),i.level=`error`,n?.event_id&&(i.event_id=n.event_id),V1(i)}function i$t(e,t,n=`info`,r,i){let a=o$t(e,t,r?.syntheticException||void 0,i);return a.level=n,r?.event_id&&(a.event_id=r.event_id),V1(a)}function a$t(e,t,n,r,i){let a;if(dqt(t)&&t.error)return XQt(e,t.error);if(fqt(t)||pqt(t)){let i=t;if(`stack`in t){a=XQt(e,t);let i=a.exception?.values?.[0];if(r&&n&&i&&!i.stacktrace){let t=$1(e,n);t.length&&(i.stacktrace={frames:t},D1(a,{synthetic:!0}))}}else{let t=i.name||(fqt(i)?`DOMError`:`DOMException`),o=i.message?`${t}: ${i.message}`:t;a=o$t(e,o,n,r),Hqt(a,o)}return`code`in i&&(a.tags={...a.tags,"DOMException.code":`${i.code}`}),a}return c1(t)?XQt(e,t):f1(t)||m1(t)?(a=YQt(e,t,n,i),D1(a,{synthetic:!0}),a):(a=o$t(e,t,n,r),Hqt(a,`${t}`,void 0),D1(a,{synthetic:!0}),a)}function o$t(e,t,n,r){let i={};if(r&&n){let r=$1(e,n);r.length&&(i.exception={values:[{value:t,stacktrace:{frames:r}}]}),D1(i,{synthetic:!0})}if(mqt(t)){let{__sentry_template_string__:e,__sentry_template_values__:n}=t;return i.logentry={message:e,params:n},i}return i.message=t,i}function s$t(e,{isUnhandledRejection:t}){let n=Sqt(e),r=t?`promise rejection`:`exception`;return dqt(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:m1(e)?`Event \`${c$t(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function c$t(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function l$t(e){return Object.values(e).find(c1)}var u$t=class extends TZt{constructor(e){let t=d$t(e);KZt(t,`browser`,[`browser`],Z1.SENTRY_SDK_SOURCE||FXt()),super(t);let{userInfo:n}=this.getDataCollectionOptions();t._metadata?.sdk&&(t._metadata.sdk.settings={infer_ip:n?`auto`:`never`,...t._metadata.sdk.settings});let{sendClientReports:r}=this._options;Z1.document&&Z1.document.addEventListener(`visibilitychange`,()=>{Z1.document.visibilityState===`hidden`&&(r&&this._flushOutcomes(),queueMicrotask(()=>{this.flush()}))}),n&&this.on(`beforeSendSession`,GZt)}eventFromException(e,t){return r$t(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t=`info`,n){return i$t(this._options.stackParser,e,t,n,this._options.attachStacktrace)}_prepareEvent(e,t,n,r){return e.platform=e.platform||`javascript`,super._prepareEvent(e,t,n,r)}};function d$t(e){return{release:`hedia-web@3.9.0+1237`,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}var f$t=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,e0=J$;function p$t(e,t,n){e0.document&&e0.addEventListener(e,t,n)}function m$t(e,t,n){e0.document&&e0.removeEventListener(e,t,n)}var h$t=e=>{let t=!1;return()=>{t||=(e(),!0)}},g$t=e=>{let t=e0.requestIdleCallback||e0.setTimeout;e0.document?.visibilityState===`hidden`?e():(e=h$t(e),p$t(`visibilitychange`,e,{once:!0,capture:!0}),p$t(`pagehide`,e,{once:!0,capture:!0}),t(()=>{e(),m$t(`visibilitychange`,e,{capture:!0}),m$t(`pagehide`,e,{capture:!0})}))},_$t=80,t0={};try{typeof Node<`u`&&(t0.parentNode=Object.getOwnPropertyDescriptor(Node.prototype,`parentNode`).get),typeof Element<`u`&&(t0.tagName=Object.getOwnPropertyDescriptor(Element.prototype,`tagName`).get,t0.id=Object.getOwnPropertyDescriptor(Element.prototype,`id`).get,t0.className=Object.getOwnPropertyDescriptor(Element.prototype,`className`).get,t0.getAttribute=Element.prototype.getAttribute),typeof HTMLElement<`u`&&(t0.dataset=Object.getOwnPropertyDescriptor(HTMLElement.prototype,`dataset`).get)}catch{}function n0(e,t,n){let r=t0[t];if(r)try{return r.call(e,n)}catch{}let i=e[t];return typeof i==`function`?i.call(e,n):i}function v$t(e,t={}){if(!e)return`<unknown>`;try{let n=e,r=[],i=0,a=0,o,s=Array.isArray(t)?t:t.keyAttrs,c=!Array.isArray(t)&&t.maxStringLength||_$t;for(;n&&i++<5&&(o=y$t(n,s),!(o===`html`||i>1&&a+r.length*3+o.length>=c));)r.push(o),a+=o.length,n=n0(n,`parentNode`);return r.reverse().join(` > `)}catch{return`<unknown>`}}function y$t(e,t){let n=[],r=n0(e,`tagName`);if(!r)return``;if(typeof HTMLElement<`u`&&e instanceof HTMLElement){let t=n0(e,`dataset`);if(t){if(t.sentryComponent)return t.sentryComponent;if(t.sentryElement)return t.sentryElement}}n.push(r.toLowerCase());let i=t?.length?t.filter(t=>n0(e,`getAttribute`,t)).map(t=>[t,n0(e,`getAttribute`,t)]):null;if(i?.length)i.forEach(e=>{n.push(`[${e[0]}="${e[1]}"]`)});else{let t=n0(e,`id`);t&&n.push(`#${t}`);let r=n0(e,`className`);if(r&&u1(r)){let e=r.split(/\s+/);for(let t of e)n.push(`.${t}`)}}for(let t of[`aria-label`,`type`,`name`,`title`,`alt`]){let r=n0(e,`getAttribute`,t);r&&n.push(`[${t}="${r}"]`)}return n.join(``)}var b$t=1e3,x$t,S$t,C$t;function w$t(e){a1(`dom`,e),o1(`dom`,T$t)}function T$t(){if(!e0.document)return;let e=s1.bind(null,`dom`),t=O$t(e,!0);e0.document.addEventListener(`click`,t,!1),e0.document.addEventListener(`keypress`,t,!1),[`EventTarget`,`Node`].forEach(t=>{let n=e0[t]?.prototype;n?.hasOwnProperty?.(`addEventListener`)&&(g1(n,`addEventListener`,function(t){return function(n,r,i){if(n===`click`||n==`keypress`)try{let r=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},a=r[n]=r[n]||{refCount:0};if(!a.handler){let r=O$t(e);a.handler=r,t.call(this,n,r,i)}a.refCount++}catch{}return t.call(this,n,r,i)}}),g1(n,`removeEventListener`,function(e){return function(t,n,r){if(t===`click`||t==`keypress`)try{let n=this.__sentry_instrumentation_handlers__||{},i=n[t];i&&(i.refCount--,i.refCount<=0&&(e.call(this,t,i.handler,r),i.handler=void 0,delete n[t]),Object.keys(n).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return e.call(this,t,n,r)}}))})}function E$t(e){if(e.type!==S$t)return!1;try{if(!e.target||e.target._sentryId!==C$t)return!1}catch{}return!0}function D$t(e,t){return e===`keypress`?t?.tagName?!(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable):!0:!1}function O$t(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;let r=k$t(n);if(D$t(n.type,r))return;_1(n,`_sentryCaptured`,!0),r&&!r._sentryId&&_1(r,`_sentryId`,T1());let i=n.type===`keypress`?`input`:n.type;E$t(n)||(e({event:n,name:i,global:t}),S$t=n.type,C$t=r?r._sentryId:void 0),clearTimeout(x$t),x$t=e0.setTimeout(()=>{C$t=void 0,S$t=void 0},b$t)}}function k$t(e){try{return e.target}catch{return null}}var r0;function A$t(e){let t=`history`;a1(t,e),o1(t,j$t)}function j$t(){if(e0.addEventListener(`popstate`,()=>{let e=e0.location.href,t=r0;r0=e,t!==e&&s1(`history`,{from:t,to:e})}),!MQt())return;function e(e){return function(...t){let n=t.length>2?t[2]:void 0;if(n){let r=r0,i=M$t(String(n));if(r0=i,r===i)return e.apply(this,t);s1(`history`,{from:r,to:i})}return e.apply(this,t)}}g1(e0.history,`pushState`,e),g1(e0.history,`replaceState`,e)}function M$t(e){try{return new URL(e,e0.location.origin).toString()}catch{return e}}var i0={};function N$t(e){let t=i0[e];if(t)return t;let n=e0[e];if(PQt(n))return i0[e]=n.bind(e0);let r=e0.document;if(r&&typeof r.createElement==`function`)try{let t=r.createElement(`iframe`);t.hidden=!0,r.head.appendChild(t);let i=t.contentWindow;i?.[e]&&(n=i[e]),r.head.removeChild(t)}catch(t){f$t&&t1.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,t)}return n&&(i0[e]=n.bind(e0))}function P$t(e){i0[e]=void 0}var a0=`__sentry_xhr_v3__`;function F$t(e){a1(`xhr`,e),o1(`xhr`,I$t)}function I$t(){if(!e0.XMLHttpRequest)return;let e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(e,t,n){let r=Error(),i=k1()*1e3,a=u1(n[0])?n[0].toUpperCase():void 0,o=L$t(n[1]);if(!a||!o)return e.apply(t,n);t[a0]={method:a,url:o,request_headers:{}},a===`POST`&&o.match(/sentry_key/)&&(t.__sentry_own_request__=!0);let s=()=>{let e=t[a0];if(e&&t.readyState===4){try{e.status_code=t.status}catch{}s1(`xhr`,{endTimestamp:k1()*1e3,startTimestamp:i,xhr:t,virtualError:r}),r=void 0,t.removeEventListener(`readystatechange`,s)}};return`onreadystatechange`in t&&typeof t.onreadystatechange==`function`?t.onreadystatechange=new Proxy(t.onreadystatechange,{apply(e,t,n){return s(),e.apply(t,n)}}):t.addEventListener(`readystatechange`,s),t.setRequestHeader=new Proxy(t.setRequestHeader,{apply(e,t,n){let[r,i]=n,a=t[a0];return a&&u1(r)&&u1(i)&&(a.request_headers[r.toLowerCase()]=i),e.apply(t,n)}}),e.apply(t,n)}}),e.send=new Proxy(e.send,{apply(e,t,n){let r=t[a0];return r?(n[0]!==void 0&&(r.body=n[0]),s1(`xhr`,{startTimestamp:k1()*1e3,xhr:t}),e.apply(t,n)):e.apply(t,n)}})}function L$t(e){if(u1(e))return e;try{return e.toString()}catch{}}function R$t(e){if(typeof Element>`u`)return!1;try{return e instanceof Element}catch{return!1}}var z$t=40;function B$t(e,t=N$t(`fetch`)){let n=0,r=0;async function i(i){let a=i.body.length;n+=a,r++;let o={body:i.body,method:`POST`,referrerPolicy:`strict-origin`,headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{let n=await t(e.url,o);return{statusCode:n.status,headers:{"x-sentry-rate-limits":n.headers.get(`X-Sentry-Rate-Limits`),"retry-after":n.headers.get(`Retry-After`)}}}catch(e){throw P$t(`fetch`),e}finally{n-=a,r--}}return iZt(e,i,QXt(e.bufferSize||z$t))}var o0=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,V$t=30,H$t=50;function U$t(e,t,n,r){let i={filename:e,function:t===`<anonymous>`?`?`:t,in_app:!0};return n!==void 0&&(i.lineno=n),r!==void 0&&(i.colno=r),i}var W$t=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,G$t=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,K$t=/\((\S*)(?::(\d+))(?::(\d+))\)/,q$t=/at (.+?) ?\(data:(.+?),/,J$t=[V$t,e=>{let t=e.match(q$t);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};let n=W$t.exec(e);if(n){let[,e,t,r]=n;return U$t(e,`?`,+t,+r)}let r=G$t.exec(e);if(r){if(r[2]?.indexOf(`eval`)===0){let e=K$t.exec(r[2]);e&&(r[2]=e[1],r[3]=e[2],r[4]=e[3])}let[e,t]=Q$t(r[1]||`?`,r[2]);return U$t(t,e,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}}],Y$t=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,X$t=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Z$t=QKt(J$t,[H$t,e=>{let t=Y$t.exec(e);if(t){if(t[3]&&t[3].indexOf(` > eval`)>-1){let e=X$t.exec(t[3]);e&&(t[1]=t[1]||`eval`,t[3]=e[1],t[4]=e[2],t[5]=``)}let e=t[3],n=t[1]||`?`;return[n,e]=Q$t(n,e),U$t(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]),Q$t=(e,t)=>{let n=e.indexOf(`safari-extension`)!==-1,r=e.indexOf(`safari-web-extension`)!==-1;return n||r?[e.indexOf(`@`)===-1?`?`:e.split(`@`)[0],n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},s0=1024,$$t=`Breadcrumbs`,e1t=W1(((e={})=>{let t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:$$t,setup(e){t.console&&_Qt(r1t(e)),t.dom&&w$t(n1t(e,t.dom)),t.xhr&&F$t(i1t(e)),t.fetch&&IQt(a1t(e)),t.history&&A$t(o1t(e)),t.sentry&&e.on(`beforeSendEvent`,t1t(e))}}}));function t1t(e){return function(t){I1()===e&&q1({category:`sentry.${t.type===`transaction`?`transaction`:`event`}`,event_id:t.event_id,level:t.level,message:E1(t)},{event:t})}}function n1t(e,t){return function(n){if(I1()!==e)return;let r,i,a=typeof t==`object`?t.serializeAttribute:void 0,o=typeof t==`object`&&typeof t.maxStringLength==`number`?t.maxStringLength:void 0;o&&o>s0&&(o0&&t1.warn(`\`dom.maxStringLength\` cannot exceed ${s0}, but a value of ${o} was configured. Sentry will use ${s0} instead.`),o=s0),typeof a==`string`&&(a=[a]);try{let e=n.event,t=s1t(e)?e.target:e;r=v$t(t,{keyAttrs:a,maxStringLength:o}),i=UQt(t)}catch{r=`<unknown>`}if(r.length===0)return;let s={category:`ui.${n.name}`,message:r};i&&(s.data={"ui.component_name":i}),q1(s,{event:n.event,name:n.name,global:n.global})}}function r1t(e){return function(t){if(I1()!==e)return;let n={category:`console`,data:{arguments:t.args,logger:`console`},level:bQt(t.level),message:Lqt(t.args,` `)};if(t.level===`assert`)if(t.args[0]===!1)n.message=`Assertion failed: ${Lqt(t.args.slice(1),` `)||`console.assert`}`,n.data.arguments=t.args.slice(1);else return;q1(n,{input:t.args,level:t.level})}}function i1t(e){return function(t){if(I1()!==e)return;let{startTimestamp:n,endTimestamp:r}=t,i=t.xhr[a0];if(!n||!r||!i)return;let{method:a,url:o,status_code:s,body:c}=i,l={method:a,url:o,status_code:s},u={xhr:t.xhr,input:c,startTimestamp:n,endTimestamp:r},d={category:`xhr`,data:l,type:`http`,level:jQt(s)};e.emit(`beforeOutgoingRequestBreadcrumb`,d,u),q1(d,u)}}function a1t(e){return function(t){if(I1()!==e)return;let{startTimestamp:n,endTimestamp:r}=t;if(r&&!(t.fetchData.url.match(/sentry_key/)&&t.fetchData.method===`POST`))if(t.error){let i={data:t.error,input:t.args,startTimestamp:n,endTimestamp:r},a={category:`fetch`,data:t.fetchData,level:`error`,type:`http`};e.emit(`beforeOutgoingRequestBreadcrumb`,a,i),q1(a,i)}else{let i=t.response,a={...t.fetchData,status_code:i?.status},o={input:t.args,response:i,startTimestamp:n,endTimestamp:r},s={category:`fetch`,data:a,type:`http`,level:jQt(a.status_code)};e.emit(`beforeOutgoingRequestBreadcrumb`,s,o),q1(s,o)}}}function o1t(e){return function(t){if(I1()!==e)return;let n=t.from,r=t.to,i=UZt(Z1.location.href),a=n?UZt(n):void 0,o=UZt(r);a?.path||(a=i),i.protocol===o.protocol&&i.host===o.host&&(r=o.relative),i.protocol===a.protocol&&i.host===a.host&&(n=a.relative),q1({category:`navigation`,data:{from:n,to:r}})}}function s1t(e){return!!e&&!!e.target}var c1t=`EventTarget,Window,Node,ApplicationCache,AudioTrackList,BroadcastChannel,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload`.split(`,`),l1t=`BrowserApiErrors`,u1t=W1(((e={})=>{let t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:l1t,setupOnce(){t.setTimeout&&g1(Z1,`setTimeout`,d1t),t.setInterval&&g1(Z1,`setInterval`,d1t),t.requestAnimationFrame&&g1(Z1,`requestAnimationFrame`,f1t),t.XMLHttpRequest&&`XMLHttpRequest`in Z1&&g1(XMLHttpRequest.prototype,`send`,p1t);let e=t.eventTarget;e&&(Array.isArray(e)?e:c1t).forEach(e=>m1t(e,t))}}}));function d1t(e){return function(...t){let n=t[0];return t[0]=Q1(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${r1(e)}`}}),e.apply(this,t)}}function f1t(e){return function(t){return e.apply(this,[Q1(t,{mechanism:{data:{handler:r1(e)},handled:!1,type:`auto.browser.browserapierrors.requestAnimationFrame`}})])}}function p1t(e){return function(...t){let n=this;return[`onload`,`onerror`,`onprogress`,`onreadystatechange`].forEach(e=>{e in n&&typeof n[e]==`function`&&g1(n,e,function(t){let n={mechanism:{data:{handler:r1(t)},handled:!1,type:`auto.browser.browserapierrors.xhr.${e}`}},r=yqt(t);return r&&(n.mechanism.data.handler=r1(r)),Q1(t,n)})}),e.apply(this,t)}}function m1t(e,t){let n=Z1[e]?.prototype;n?.hasOwnProperty?.(`addEventListener`)&&(g1(n,`addEventListener`,function(n){return function(r,i,a){try{h1t(i)&&(i.handleEvent=Q1(i.handleEvent,{mechanism:{data:{handler:r1(i),target:e},handled:!1,type:`auto.browser.browserapierrors.handleEvent`}}))}catch{}return t.unregisterOriginalCallbacks&&g1t(this,r,i),n.apply(this,[r,Q1(i,{mechanism:{data:{handler:r1(i),target:e},handled:!1,type:`auto.browser.browserapierrors.addEventListener`}}),a])}}),g1(n,`removeEventListener`,function(e){return function(t,n,r){try{if(Object.prototype.hasOwnProperty.call(n,`__sentry_wrapped__`)){let i=n.__sentry_wrapped__;i&&e.call(this,t,i,r)}}catch{}return e.call(this,t,n,r)}}))}function h1t(e){return typeof e.handleEvent==`function`}function g1t(e,t,n){e&&typeof e==`object`&&`removeEventListener`in e&&typeof e.removeEventListener==`function`&&e.removeEventListener(t,n)}var _1t=W1((e={})=>{let t=e.lifecycle??`route`;return{name:`BrowserSession`,setupOnce(){if(Z1.document===void 0){o0&&t1.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}yXt({ignoreDuration:!0});let e=!1;g$t(()=>{e||=(SXt(),!0)});let n=F1(),r=n.getUser();n.addScopeListener(t=>{let n=t.getUser();(r?.id!==n?.id||r?.ip_address!==n?.ip_address)&&(r=n,e&&SXt())}),t===`route`&&A$t(({from:t,to:n})=>{t!==n&&(yXt({ignoreDuration:!0}),SXt(),e=!0)})}}}),v1t=`CultureContext`,y1t=W1((()=>({name:v1t,preprocessEvent(e){let t=b1t();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})},processSegmentSpan(e){let t=b1t();t&&qYt(e,{"culture.locale":t.locale,"culture.timezone":t.timezone,"culture.calendar":t.calendar})}})));function b1t(){try{let e=Z1.Intl;if(!e)return;let t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}var x1t=`GlobalHandlers`,S1t=W1(((e={})=>{let t={onerror:!0,onunhandledrejection:!0,...e};return{name:x1t,setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(C1t(e),O1t(`onerror`)),t.onunhandledrejection&&(w1t(e),O1t(`onunhandledrejection`))}}}));function C1t(e){aqt(t=>{let{stackParser:n,attachStacktrace:r}=k1t();if(I1()!==e||GQt())return;let{msg:i,url:a,line:o,column:s,error:c}=t,l=D1t(a$t(n,c||i,void 0,r,!1),a,o,s);l.level=`error`,gXt(l,{originalException:c,mechanism:{handled:!1,type:`auto.browser.global_handlers.onerror`}})})}function w1t(e){cqt(t=>{let{stackParser:n,attachStacktrace:r}=k1t();if(I1()!==e||GQt())return;let i=T1t(t),a=d1(i)?E1t(i):a$t(n,i,void 0,r,!0);a.level=`error`,gXt(a,{originalException:i,mechanism:{handled:!1,type:`auto.browser.global_handlers.onunhandledrejection`}})})}function T1t(e){if(d1(e))return e;try{if(`reason`in e)return e.reason;if(`detail`in e&&`reason`in e.detail)return e.detail.reason}catch{}return e}function E1t(e){return{exception:{values:[{type:`UnhandledRejection`,value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function D1t(e,t,n,r){let i=e.exception=e.exception||{},a=i.values=i.values||[],o=a[0]=a[0]||{},s=o.stacktrace=o.stacktrace||{},c=s.frames=s.frames||[];return c.length===0&&c.push({colno:r,lineno:n,filename:A1t(t)??HQt(),function:`?`,in_app:!0}),e}function O1t(e){o0&&t1.log(`Global Handler attached: ${e}`)}function k1t(){return I1()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function A1t(e){if(!(!u1(e)||e.length===0))return e.startsWith(`data:`)?`<${WZt(e,!1)}>`:e}var j1t=W1(()=>({name:`HttpContext`,preprocessEvent(e){if(!Z1.navigator&&!Z1.location&&!Z1.document)return;let t=qQt(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}},processSpan(e){if(!Z1.navigator&&!Z1.location&&!Z1.document)return;let t=qQt();qYt(e,{[KYt]:t.headers[`User-Agent`],...e.is_segment&&{"url.full":e.attributes?.[`sentry.op`]===`http.client`?void 0:HZt(t.url),"http.request.header.referer":t.headers.Referer}})}})),M1t=`cause`,N1t=5,P1t=`LinkedErrors`,F1t=W1(((e={})=>{let t=e.limit||N1t,n=e.key||M1t;return{name:P1t,preprocessEvent(e,r,i){lQt(JQt,i.getOptions().stackParser,n,t,e,r)}}})),I1t=/^HTML(\w*)Element$/;function L1t(e){if(typeof window<`u`&&e===window)return`[Window]`;if(typeof document<`u`&&e===document)return`[Document]`;if(R$t(e)){let t=R1t(e);if(I1t.test(t))return`[HTMLElement: ${v$t(e)}]`}}function R1t(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:`null prototype`}function z1t(){return B1t()?(o0&&e1(()=>{console.error(`[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/`)}),!0):!1}function B1t(){if(Z1.window===void 0)return!1;let e=Z1;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;let t=HQt();return!(Z1===Z1.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(t))}function V1t(e){return[eQt(),XZt(),AQt(),u1t(),e1t(),S1t(),F1t(),SQt(),j1t(),y1t(),_1t()]}function H1t(e={}){let t=!e.skipBrowserExtensionCheck&&z1t(),n=e.defaultIntegrations==null?V1t():e.defaultIntegrations,r={...e,enabled:t?!1:e.enabled,stackParser:$Kt(e.stackParser||Z$t),integrations:AXt({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||B$t};return Oqt(L1t),FZt(u$t,r)}function U1t(e){return f1(e)&&`nativeEvent`in e&&`preventDefault`in e&&`stopPropagation`in e}function W1t(e){let t={...e};KZt(t,`react`),_Xt(`react`,{version:H.version});let n=H1t(t);return Oqt(G1t),n}function G1t(e){return U1t(e)?`[SyntheticEvent]`:L1t(e)}var c0=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(){}},l0=typeof window>`u`||`Deno`in globalThis;function u0(){}function K1t(e,t){return typeof e==`function`?e(t):e}function q1t(e){return typeof e==`number`&&e>=0&&e!==1/0}function J1t(e,t){return Math.max(e+(t||0)-Date.now(),0)}function d0(e,t){return typeof e==`function`?e(t):e}function f0(e,t){return typeof e==`function`?e(t):e}function Y1t(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Z1t(o,t.options))return!1}else if(!m0(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 X1t(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(p0(t.options.mutationKey)!==p0(a))return!1}else if(!m0(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Z1t(e,t){return(t?.queryKeyHashFn||p0)(e)}function p0(e){return JSON.stringify(e,(e,t)=>e0t(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function m0(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>m0(e[n],t[n])):!1}function Q1t(e,t){if(e===t)return e;let n=$1t(e)&&$1t(t);if(n||e0t(e)&&e0t(t)){let r=n?e:Object.keys(e),i=r.length,a=n?t:Object.keys(t),o=a.length,s=n?[]:{},c=new Set(r),l=0;for(let r=0;r<o;r++){let i=n?r:a[r];(!n&&c.has(i)||n)&&e[i]===void 0&&t[i]===void 0?(s[i]=void 0,l++):(s[i]=Q1t(e[i],t[i]),s[i]===e[i]&&e[i]!==void 0&&l++)}return i===o&&l===i?e:s}return t}function h0(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 $1t(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function e0t(e){if(!t0t(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!t0t(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function t0t(e){return Object.prototype.toString.call(e)===`[object Object]`}function n0t(e){return new Promise(t=>{setTimeout(t,e)})}function r0t(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Q1t(e,t)}function i0t(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function a0t(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var o0t=Symbol();function s0t(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===o0t?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function c0t(e,t){return typeof e==`function`?e(...t):!!e}var l0t=new class extends c0{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!l0&&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();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},g0=new class extends c0{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!l0&&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 u0t(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}function d0t(e){return Math.min(1e3*2**e,3e4)}function f0t(e){return(e??`online`)===`online`?g0.isOnline():!0}var p0t=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function m0t(e){return e instanceof p0t}function h0t(e){let t=!1,n=0,r=!1,i,a=u0t(),o=t=>{r||(f(new p0t(t)),e.abort?.())},s=()=>{t=!0},c=()=>{t=!1},l=()=>l0t.isFocused()&&(e.networkMode===`always`||g0.isOnline())&&e.canRun(),u=()=>f0t(e.networkMode)&&e.canRun(),d=t=>{r||(r=!0,e.onSuccess?.(t),i?.(),a.resolve(t))},f=t=>{r||(r=!0,e.onError?.(t),i?.(),a.reject(t))},p=()=>new Promise(t=>{i=e=>{(r||l())&&t(e)},e.onPause?.()}).then(()=>{i=void 0,r||e.onContinue?.()}),m=()=>{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(d).catch(i=>{if(r)return;let a=e.retry??(l0?0:3),o=e.retryDelay??d0t,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){f(i);return}n++,e.onFail?.(n,i),n0t(s).then(()=>l()?void 0:p()).then(()=>{t?f(i):m()})})};return{promise:a,cancel:o,continue:()=>(i?.(),a),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),a)}}var g0t=e=>setTimeout(e,0);function _0t(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=g0t,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 _0=_0t(),v0t=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),q1t(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(l0?1/0:300*1e3))}clearGcTimeout(){this.#e&&=(clearTimeout(this.#e),void 0)}},y0t=class extends v0t{#e;#t;#n;#r;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=x0t(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=r0t(this.state.data,e,this.options);return this.#s({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(u0).catch(u0):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>f0(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===o0t||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>d0(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!J1t(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.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.#i&&(this.#o?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({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.#i)return this.#i.continueRetry(),this.#i.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.#o=!0,n.signal)})},i=()=>{let e=s0t(this.options,t),n=(()=>{let e={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#o=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(e),e})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#s({type:`fetch`,meta:a.fetchOptions?.meta});let o=e=>{m0t(e)&&e.silent||this.#s({type:`error`,error:e}),m0t(e)||(this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this)),this.scheduleGc()};return this.#i=h0t({initialPromise:t?.initialPromise,fn:a.fetchFn,abort:n.abort.bind(n),onSuccess:e=>{if(e===void 0){o(Error(`${this.queryHash} data is undefined`));return}try{this.setData(e)}catch(e){o(e);return}this.#n.config.onSuccess?.(e,this),this.#n.config.onSettled?.(e,this.state.error,this),this.scheduleGc()},onError:o,onFail:(e,t)=>{this.#s({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#s({type:`pause`})},onContinue:()=>{this.#s({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}),this.#i.start()}#s(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,...b0t(t.data,this.options),fetchMeta:e.meta??null};case`success`:return this.#t=void 0,{...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 m0t(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),_0.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function b0t(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:f0t(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function x0t(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 S0t=class extends c0{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??Z1t(r,t),a=this.get(i);return a||(a=new y0t({client:e,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(){_0.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=>Y1t(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Y1t(e,t)):t}notify(e){_0.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){_0.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){_0.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},C0t=class extends v0t{#e;#t;#n;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||w0t(),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})}optionalRemove(){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){let t=()=>{this.#r({type:`continue`})};this.#n=h0t({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:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});let n=this.state.status===`pending`,r=!this.#n.canStart();try{if(n)t();else{this.#r({type:`pending`,variables:e,isPaused:r}),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:r})}let i=await this.#n.start();return await this.#t.config.onSuccess?.(i,e,this.state.context,this),await this.options.onSuccess?.(i,e,this.state.context),await this.#t.config.onSettled?.(i,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(i,null,e,this.state.context),this.#r({type:`success`,data:i}),i}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),_0.batch(()=>{this.#e.forEach(t=>{t.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:`updated`,action:e})})}};function w0t(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var T0t=class extends c0{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new C0t({mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=v0(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=v0(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=v0(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=v0(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){_0.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>X1t(t,e))}findAll(e={}){return this.getAll().filter(t=>X1t(e,t))}notify(e){_0.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return _0.batch(()=>Promise.all(e.map(e=>e.continue().catch(u0))))}};function v0(e){return e.options.scope?.id}function E0t(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=s0t(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=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?a0t:i0t;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?O0t:D0t,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:D0t(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,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function D0t(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 O0t(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var k0t=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new S0t,this.#t=e.mutationCache||new T0t,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=l0t.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=g0.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.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(d0(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}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=K1t(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return _0.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;_0.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return _0.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=_0.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(u0).catch(u0)}invalidateQueries(e,t={}){return _0.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=_0.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(u0)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(u0)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(d0(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(u0).catch(u0)}fetchInfiniteQuery(e){return e.behavior=E0t(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(u0).catch(u0)}ensureInfiniteQueryData(e){return e.behavior=E0t(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return g0.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(p0(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{m0(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(p0(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{m0(e,t.mutationKey)&&Object.assign(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||=Z1t(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.queryFn===o0t&&(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()}},A0t=class extends c0{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=u0t(),this.options.experimental_prefetchInRender||this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`)),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;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),M0t(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return N0t(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return N0t(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=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 f0(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!h0(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&P0t(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||f0(this.options.enabled,this.#t)!==f0(t.enabled,this.#t)||d0(this.options.staleTime,this.#t)!==d0(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||f0(this.options.enabled,this.#t)!==f0(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return I0t(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#m.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.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(u0)),t}#g(){this.#b();let e=d0(this.options.staleTime,this.#t);if(l0||this.#r.isStale||!q1t(e))return;let t=J1t(this.#r.dataUpdatedAt,e)+1;this.#d=setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(l0||f0(this.options.enabled,this.#t)===!1||!q1t(this.#p)||this.#p===0)&&(this.#f=setInterval(()=>{(this.options.refetchIntervalInBackground||l0t.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d&&=(clearTimeout(this.#d),void 0)}#x(){this.#f&&=(clearInterval(this.#f),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&&M0t(e,t),o=i&&P0t(e,n,t,r);(a||o)&&(l={...l,...b0t(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=r0t(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=r0t(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,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:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:F0t(e,t),refetch:this.refetch,promise:this.#o,isEnabled:f0(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=e=>{x.status===`error`?e.reject(x.error):x.data!==void 0&&e.resolve(x.data)},r=()=>{t(this.#o=x.promise=u0t())},i=this.#o;switch(i.status){case`pending`:e.queryHash===n.queryHash&&t(i);break;case`fulfilled`:(x.status===`error`||x.data!==i.value)&&r();break;case`rejected`:(x.status!==`error`||x.error!==i.reason)&&r();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!h0(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){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.#y()}#C(e){_0.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function j0t(e,t){return f0(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&t.retryOnMount===!1)}function M0t(e,t){return j0t(e,t)||e.state.data!==void 0&&N0t(e,t,t.refetchOnMount)}function N0t(e,t,n){if(f0(t.enabled,e)!==!1&&d0(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&F0t(e,t)}return!1}function P0t(e,t,n,r){return(e!==t||f0(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&F0t(e,n)}function F0t(e,t){return f0(t.enabled,e)!==!1&&e.isStaleByTime(d0(t.staleTime,e))}function I0t(e,t){return!h0(e.getCurrentResult(),t)}var L0t=class extends c0{#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),h0(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&p0(t.mutationKey)!==p0(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??w0t();this.#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){_0.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)})})}},R0t=H.createContext(void 0),y0=e=>{let t=H.useContext(R0t);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},z0t=({client:e,children:t})=>(H.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,W.jsx)(R0t.Provider,{value:e,children:t})),B0t=H.createContext(!1),V0t=()=>H.useContext(B0t);B0t.Provider;function H0t(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var U0t=H.createContext(H0t()),W0t=()=>H.useContext(U0t),G0t=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},K0t=e=>{H.useEffect(()=>{e.clearReset()},[e])},q0t=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||c0t(n,[e.error,r])),J0t=e=>{if(e.suspense){let t=e=>e===`static`?e:Math.max(e??1e3,1e3),n=e.staleTime;e.staleTime=typeof n==`function`?(...e)=>t(n(...e)):t(n),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,1e3))}},Y0t=(e,t)=>e.isLoading&&e.isFetching&&!t,X0t=(e,t)=>e?.suspense&&t.isPending,Z0t=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Q0t(e,t,n){let r=V0t(),i=W0t(),a=y0(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o),o._optimisticResults=r?`isRestoring`:`optimistic`,J0t(o),G0t(o,i),K0t(i);let s=!a.getQueryCache().get(o.queryHash),[c]=H.useState(()=>new t(a,o)),l=c.getOptimisticResult(o),u=!r&&e.subscribed!==!1;if(H.useSyncExternalStore(H.useCallback(e=>{let t=u?c.subscribe(_0.batchCalls(e)):u0;return c.updateResult(),t},[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),H.useEffect(()=>{c.setOptions(o)},[o,c]),X0t(o,l))throw Z0t(o,c,i);if(q0t({result:l,errorResetBoundary:i,throwOnError:o.throwOnError,query:a.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw l.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,l),o.experimental_prefetchInRender&&!l0&&Y0t(l,r)&&(s?Z0t(o,c,i):a.getQueryCache().get(o.queryHash)?.promise)?.catch(u0).finally(()=>{c.updateResult()}),o.notifyOnChangeProps?l:c.trackResult(l)}function b0(e,t){return Q0t(e,A0t,t)}function $0t(e,t){let n=y0(t),[r]=H.useState(()=>new L0t(n,e));H.useEffect(()=>{r.setOptions(e)},[r,e]);let i=H.useSyncExternalStore(H.useCallback(e=>r.subscribe(_0.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=H.useCallback((e,t)=>{r.mutate(e,t).catch(u0)},[r]);if(i.error&&c0t(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}V();var x0=()=>{},S0={setDefaultMode:x0,setInputMode:x0,preload:x0,setTranslucent:x0,dismiss:x0,setFocusTo:x0,viewPositionInWindow:()=>Promise.resolve({x:0,y:0,width:0,height:0}),addListener:x0,removeListeners:x0,getConstants:()=>({keyboardBorderRadius:0})},C0={addListener:()=>({remove:x0})},e2t={addListener:()=>({remove:x0})},t2t={addListener:()=>({remove:x0})},n2t=B,r2t={synchronizeFocusedInputLayout:e=>{}},i2t=B,a2t=B,o2t=B;V();var w0=()=>{},s2t=()=>w0,c2t=e=>({value:e,addListener:w0,removeListener:w0,modify:w0,get:()=>e,set:w0}),l2t=c2t(0),u2t=c2t(null),d2t={enabled:!0,animated:{progress:new lf.Value(0),height:new lf.Value(0)},reanimated:{progress:l2t,height:l2t},layout:u2t,update:Promise.resolve,setKeyboardHandlers:s2t,setInputHandlers:s2t,setEnabled:w0},f2t=(0,H.createContext)(d2t),T0=()=>(0,H.useContext)(f2t),p2t=e=>e;V();function m2t(e){return t=>{let n=t,r=null,i=!1,a=()=>{if(i)return;let t=p2t(e.current);t&&(`workletEventHandler`in n?n.workletEventHandler.registerForEvents(t):n.current.registerForEvents(t),r=t)};return e.current?a():queueMicrotask(a),()=>{i=!0,r&&(`workletEventHandler`in n?n.workletEventHandler.unregisterFromEvents(r):n.current.unregisterFromEvents(r))}}}function h2t(e,t){let n=(0,H.useRef)(null);return n.current===null&&(n.current=new lf.Value(e,t)),n.current}var E0=!0,g2t={height:0,duration:0,timestamp:new Date().getTime(),target:-1,type:`default`,appearance:`light`};C0.addListener(`keyboardDidHide`,e=>{E0=!0,g2t=e}),C0.addListener(`keyboardWillShow`,e=>{E0=!1,g2t=e});var D0={setDefaultMode:S0.setDefaultMode,setInputMode:S0.setInputMode,setFocusTo:S0.setFocusTo,preload:S0.preload,setTranslucent:S0.setTranslucent,dismiss:async e=>{let t=e?.keepFocus??!1,n=e?.animated??!0;return new Promise(e=>{if(E0){e();return}let r=C0.addListener(`keyboardDidHide`,()=>{e(void 0),r.remove()});S0.dismiss(t,n)})},isVisible:()=>!E0,state:()=>g2t};YQ();var _2t=()=>()=>{},v2t=_2t,y2t=_2t;V(),EOt(),YQ();var b2t=TOt(),x2t=JQ.createAnimatedComponent(lf.createAnimatedComponent(n2t)),S2t=R.create({container:{flex:1},hidden:{display:`none`,position:`absolute`}}),O0=z.OS,C2t=e=>{let{children:t,statusBarTranslucent:n,navigationBarTranslucent:r,preserveEdgeToEdge:i,enabled:a=!0,preload:o=!0}=e,s=(0,H.useRef)(null),[c,l]=(0,H.useState)(a),u=h2t(0),d=h2t(0),f=fQ(0),p=fQ(0),m=fQ(null),h=m2t(s),g=m2t(s),_=(0,H.useCallback)(async()=>{r2t.synchronizeFocusedInputLayout(s.current),await new Promise(e=>{let t=e2t.addListener(`layoutDidSynchronize`,()=>{t.remove(),e(null)})})},[]),v=(0,H.useMemo)(()=>({enabled:c,animated:{progress:u,height:lf.multiply(d,-1)},reanimated:{progress:f,height:p},layout:m,update:_,setKeyboardHandlers:h,setInputHandlers:g,setEnabled:l}),[c]),y=(0,H.useMemo)(()=>[S2t.hidden,{transform:[{translateX:d},{translateY:u}]}],[]),b=(0,H.useMemo)(()=>lf.event([{nativeEvent:{progress:u,height:d}}],{useNativeDriver:z.OS!==`web`}),[]),x=(e,t)=>{"worklet";t.includes(O0)&&(f.value=e.progress,p.value=-e.height)},S=v2t({onKeyboardMoveStart:e=>{"worklet";x(e,[`ios`])},onKeyboardMove:e=>{"worklet";x(e,[`android`])},onKeyboardMoveInteractive:e=>{"worklet";x(e,[`android`,`ios`])},onKeyboardMoveEnd:e=>{"worklet";x(e,[`android`])}},[]),C=y2t({onFocusedInputLayoutChanged:e=>{"worklet";e.target===-1?m.value=null:m.value=e}},[]);return(0,H.useEffect)(()=>{o&&D0.preload()},[o]),H.createElement(f2t.Provider,{value:v},H.createElement(x2t,{ref:s,enabled:c,navigationBarTranslucent:b2t||r,statusBarTranslucent:b2t||n,preserveEdgeToEdge:b2t||i,style:S2t.container,onKeyboardMoveReanimated:S,onKeyboardMoveStart:O0===`ios`?b:void 0,onKeyboardMove:O0===`android`?b:void 0,onKeyboardMoveInteractive:b,onKeyboardMoveEnd:O0===`android`?b:void 0,onFocusedInputLayoutChangedReanimated:C},t),H.createElement(lf.View,{style:y}))},w2t=function(e){return e[e.SOFT_INPUT_ADJUST_NOTHING=48]=`SOFT_INPUT_ADJUST_NOTHING`,e[e.SOFT_INPUT_ADJUST_PAN=32]=`SOFT_INPUT_ADJUST_PAN`,e[e.SOFT_INPUT_ADJUST_RESIZE=16]=`SOFT_INPUT_ADJUST_RESIZE`,e[e.SOFT_INPUT_ADJUST_UNSPECIFIED=0]=`SOFT_INPUT_ADJUST_UNSPECIFIED`,e[e.SOFT_INPUT_IS_FORWARD_NAVIGATION=256]=`SOFT_INPUT_IS_FORWARD_NAVIGATION`,e[e.SOFT_INPUT_MASK_ADJUST=240]=`SOFT_INPUT_MASK_ADJUST`,e[e.SOFT_INPUT_MASK_STATE=15]=`SOFT_INPUT_MASK_STATE`,e[e.SOFT_INPUT_MODE_CHANGED=512]=`SOFT_INPUT_MODE_CHANGED`,e[e.SOFT_INPUT_STATE_ALWAYS_HIDDEN=3]=`SOFT_INPUT_STATE_ALWAYS_HIDDEN`,e[e.SOFT_INPUT_STATE_ALWAYS_VISIBLE=5]=`SOFT_INPUT_STATE_ALWAYS_VISIBLE`,e[e.SOFT_INPUT_STATE_HIDDEN=2]=`SOFT_INPUT_STATE_HIDDEN`,e[e.SOFT_INPUT_STATE_UNCHANGED=1]=`SOFT_INPUT_STATE_UNCHANGED`,e[e.SOFT_INPUT_STATE_UNSPECIFIED=0]=`SOFT_INPUT_STATE_UNSPECIFIED`,e[e.SOFT_INPUT_STATE_VISIBLE=4]=`SOFT_INPUT_STATE_VISIBLE`,e}({}),T2t=S0.getConstants().keyboardBorderRadius,k0=T2t>0;V();var E2t=Wo.get(`window`),D2t={width:E2t.width,height:E2t.height};t2t.addListener(`windowDidResize`,e=>{D2t=e});var O2t=()=>{let[e,t]=(0,H.useState)(D2t);return(0,H.useEffect)(()=>{let e=t2t.addListener(`windowDidResize`,e=>{t(e)});return t(D2t),()=>{e.remove()}},[]),e},k2t=[`keyboardWillShow`,`keyboardDidHide`],A2t=()=>({...D0.state(),isVisible:D0.isVisible()}),j2t=e=>e;function A0(e=j2t){let[t,n]=(0,H.useState)(()=>e(A2t()));return(0,H.useEffect)(()=>{let t=k2t.map(t=>C0.addListener(t,()=>n(e(A2t()))));return n(e(A2t())),()=>{t.forEach(e=>e.remove())}},[]),t}YQ();var M2t=()=>{(0,H.useEffect)(()=>(D0.setInputMode(w2t.SOFT_INPUT_ADJUST_RESIZE),()=>D0.setDefaultMode()),[])},N2t=()=>(M2t(),T0().reanimated);function P2t(e,t){let n=T0(),{doDependenciesDiffer:r}=xQ(e,t),i=yQ(t=>{"worklet";if(t.eventName.endsWith(`onKeyboardMoveStart`)){var n;(n=e.onStart)==null||n.call(e,t)}if(t.eventName.endsWith(`onKeyboardMove`)){var r;(r=e.onMove)==null||r.call(e,t)}if(t.eventName.endsWith(`onKeyboardMoveEnd`)){var i;(i=e.onEnd)==null||i.call(e,t)}if(t.eventName.endsWith(`onKeyboardMoveInteractive`)){var a;(a=e.onInteractive)==null||a.call(e,t)}},[`onKeyboardMoveStart`,`onKeyboardMove`,`onKeyboardMoveEnd`,`onKeyboardMoveInteractive`],r);(0,H.useLayoutEffect)(()=>{let e=n.setKeyboardHandlers(i);return()=>e()},t)}function F2t(e,t){M2t(),P2t(e,t)}function I2t(){let e=T0();return{input:e.layout,update:e.update}}function L2t(e,t){let n=T0(),{doDependenciesDiffer:r}=xQ(e,t),i=yQ(t=>{"worklet";if(t.eventName.endsWith(`onFocusedInputTextChanged`)){var n;(n=e.onChangeText)==null||n.call(e,t)}if(t.eventName.endsWith(`onFocusedInputSelectionChanged`)){var r;(r=e.onSelectionChange)==null||r.call(e,t)}},[`onFocusedInputTextChanged`,`onFocusedInputSelectionChanged`],r);(0,H.useLayoutEffect)(()=>{let e=n.setInputHandlers(i);return()=>e()},t)}YQ();var R2t=(...e)=>(0,H.useCallback)(t=>{for(let n of e)n&&(typeof n==`function`?n(t):n.current=t)},e);V(),YQ(),z.OS,YQ(),YQ();function z2t(){return z2t=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},z2t.apply(null,arguments)}var B2t=(0,H.forwardRef)(({children:e,offset:{closed:t=0,opened:n=0}={},style:r,enabled:i=!0,...a},o)=>{let{height:s,progress:c}=N2t(),l=mQ(()=>{let e=AQ(c.value,[0,1],[t,n]);return{transform:[{translateY:i?s.value+e:t}]}},[t,n,i]),u=(0,H.useMemo)(()=>[r,l],[r,l]);return H.createElement(JQ.View,z2t({ref:o,style:u},a),e)});YQ();var V2t=[`onScroll`,`onScrollBeginDrag`,`onScrollEndDrag`,`onMomentumScrollBegin`,`onMomentumScrollEnd`],H2t=(e,t=0)=>{let n=fQ(t),r=fQ({width:0,height:0}),i=fQ({width:0,height:0}),a=m2t(e),o=yQ(e=>{"worklet";n.value=e.contentOffset.y,r.value=e.layoutMeasurement,i.value=e.contentSize},V2t);return(0,H.useEffect)(()=>{let e=a(o);return()=>{e()}},[]),{offset:n,layout:r,size:i,onLayout:(0,H.useCallback)(e=>{r.value={width:e.nativeEvent.layout.width,height:e.nativeEvent.layout.height}},[r]),onContentSizeChange:(0,H.useCallback)((e,t)=>{i.value={width:e,height:t}},[i])}};V();var U2t=R.create({container:{flexGrow:1,flexShrink:1}});V(),YQ();function W2t(){return W2t=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},W2t.apply(null,arguments)}var G2t=z.OS===`android`?JQ.createAnimatedComponent(a2t):a2t,K2t=(0,H.forwardRef)(({ScrollViewComponent:e,bottomPadding:t,scrollIndicatorPadding:n,contentInset:r,scrollIndicatorInsets:i,inverted:a,contentOffsetY:o,applyWorkaroundForContentInsetHitTestBug:s,onContentInsetChange:c,children:l,...u},d)=>{let{contentOffset:f}=u,p=fQ(null);(0,H.useEffect)(()=>{o&&(o.value=f?.y??0)},[o,f?.y]);let m=CQ(()=>{let e=a?t.value:0,n=a?0:t.value;return{dynamic:{top:e,bottom:n},effective:{top:e+(r?.top||0),bottom:n+(r?.bottom||0),left:r?.left||0,right:r?.right||0}}},[a,r?.top,r?.bottom,r?.left,r?.right]);_Q(()=>m.value.effective,(e,t)=>{c&&(t&&e.top===t.top&&e.bottom===t.bottom&&e.left===t.left&&e.right===t.right||KQ(c)(e))},[c]);let h=gQ(()=>{let{dynamic:e,effective:r}=m.value,s=n??t,c=(a?s.value:0)+(i?.top||0),l={contentInset:r,scrollIndicatorInsets:{bottom:(a?0:s.value)+(i?.bottom||0),top:c,right:i?.right,left:i?.left},contentInsetBottom:e.bottom,contentInsetTop:e.top};if(o){let e=o.value;e!==p.value&&(p.value=e,l.contentOffset={x:f?.x??0,y:e})}return l},[i?.bottom,i?.top,i?.right,i?.left,a,o,f?.x]);return H.createElement(G2t,{animatedProps:h,applyWorkaroundForContentInsetHitTestBug:s,style:U2t.container},H.createElement(e,W2t({ref:d,animatedProps:h},u),l))});V(),YQ();var j0=z.OS===`android`&&z.Version>=30||z.OS===`ios`,q2t={duration:250,easing:XX.bezier(.19919472913616398,.010644531250000006,.27920937042459737,.91025390625)},J2t=(e,t)=>{let n=(0,H.useMemo)(()=>e,t??[]),r=fQ(-1),i=fQ(0),a=fQ(0),o=fQ(0);_Q(()=>{if(!j0&&a.value!==0)return{duration:q2t.duration,target:r.value,height:o.value,progress:o.value/a.value}},e=>{var t;if(e&&((t=n.onMove)==null||t.call(n,e),e.height===i.value)){var r;(r=n.onEnd)==null||r.call(n,e),a.value=i.value}},t&&[...t]),F2t({onStart:e=>{"worklet";var t;if(!j0&&e.height===a.value){var s,c;(s=n.onStart)==null||s.call(n,e),(c=n.onEnd)==null||c.call(n,e);return}r.value=e.target,i.value=e.height,e.height>0&&(a.value=e.height),j0||(o.value=QX(e.height,q2t)),(t=n.onStart)==null||t.call(n,{...e,duration:j0?e.duration:q2t.duration})},onMove:e=>{"worklet";if(j0){var t;(t=n.onMove)==null||t.call(n,e)}},onEnd:e=>{"worklet";if(j0){var t;(t=n.onEnd)==null||t.call(n,e)}}},t)},Y2t=(e,t=0)=>{"worklet";let n={time:0};return(...r)=>{"worklet";let i=Date.now();if(i-n.time<t){n.time=i;return}return n.time=i,e(...r)}},X2t=(e,t)=>{"worklet";let n;return t&&(n=t.find(t=>t>=e)),n??e};YQ();function M0(){return M0=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},M0.apply(null,arguments)}var Z2t=(0,H.forwardRef)(({children:e,onLayout:t,bottomOffset:n=0,disableScrollOnKeyboardHide:r=!1,enabled:i=!0,extraKeyboardSpace:a=0,mode:o=`insets`,ScrollViewComponent:s=JQ.ScrollView,snapToOffsets:c,...l},u)=>{let d=MFt(),f=H.useRef(null),p=R2t(d,f),m=fQ(null),h=fQ(0),{offset:g,layout:_,size:v}=H2t(d),y=fQ(0),b=fQ(0),x=fQ(!1),S=fQ(!1),C=fQ(-1),w=fQ(0),T=fQ(0),{input:E,update:D}=I2t(),O=fQ(null),k=fQ(null),A=fQ(-1),ee=fQ(!1),te=fQ(!1),ne=fQ(0),{height:re}=O2t(),ie=(0,H.useCallback)(async()=>{let e=p2t(d.current);if(m.value=e,e!==null)try{let{y:t}=await S0.viewPositionInWindow(e);ne.value=t}catch{}},[]),j=(0,H.useCallback)(e=>{ie(),t?.(e)},[t,ie]);(0,H.useEffect)(()=>{ie()},[ie]);let ae=(0,H.useCallback)((e,t=!1)=>{"worklet";if(!i||O.value?.parentScrollViewTarget!==m.value)return 0;let r=re-b.value,a=(O.value?.layout.absoluteY||0)+(O.value?.layout.height||0);if(r-a<=n){let r=b.value-(re-a)+n,i=AQ(e,[w.value,b.value],[0,X2t(r+h.value,c)-h.value]);return HQ(d,0,Math.max(i,0)+h.value,t),i}if(a<ne.value){let e=r-n;HQ(d,0,h.value+a-e,t)}return 0},[n,i,re,c]),oe=(0,H.useCallback)(e=>{"worklet";return o===`layout`?!1:S.value&&A.value>0?(HQ(d,0,h.value-AQ(e,[w.value,b.value],[A.value,0]),!1),!0):!1},[o]),se=(0,H.useCallback)(e=>{"worklet";let t=h.value;h.value=e,ae(b.value,!0),h.value=t},[h,b,ae]),M=(0,H.useCallback)(e=>{"worklet";y.value=AQ(e.height,[0,b.value],[0,b.value+a])},[a]),ce=(0,H.useCallback)(()=>{"worklet";var e;let t=k.value?.selection.end.y;return!((e=E.value)!=null&&e.layout)||t===void 0?!1:(O.value={...E.value,layout:{...E.value.layout,height:ALt(t,0,E.value.layout.height)}},!0)},[E,k,O]),N=(0,H.useCallback)(()=>{"worklet";let e=O.value;ce()&&(se(g.value),O.value=e)},[se]),P=(0,H.useCallback)(()=>{"worklet";N()},[N]),le=(0,H.useMemo)(()=>Y2t(P,200),[P]),ue=(0,H.useCallback)(e=>{"worklet";let t=k.value?.target,n=k.value?.selection;if(k.value=e,te.value=!0,e.target!==t||ee.value){ee.value&&(ee.value=!1,ce(),!x.value&&b.value>0&&(g.value+=ae(b.value,!0)));return}if(e.selection.end.position===e.selection.start.position&&n?.end.y!==e.selection.end.y||e.selection.start.position!==e.selection.end.position)return N();le()},[N,le,ce,ae]);L2t({onSelectionChange:ue},[ue]),J2t({onStart:e=>{"worklet";let t=b.value!==e.height&&e.height>0;x.value=e.height>0&&b.value===0,S.value=e.height===0;let n=C.value!==e.target&&e.target!==-1||t;t&&(w.value=b.value),S.value&&(w.value=0,h.value=T.value,ee.value=!1),(x.value||t||n)&&(h.value=g.value,b.value=e.height,o===`insets`&&M(e)),n&&(C.value=e.target,k.value?.target===e.target&&te.value?(ce(),ee.value=!1):(k.value?.target===e.target?ce():E.value&&(O.value=E.value),ee.value=!0),T.value=g.value),n&&!x.value&&(ee.value||(g.value+=ae(e.height,!0))),o===`insets`&&(A.value=g.value+_.value.height-v.value.height,A.value>0&&(h.value=g.value))},onMove:e=>{"worklet";ee.value&&k.value?.target!==C.value||oe(e.height)||(o===`layout`&&M(e),(!r||x.value)&&ae(e.height))},onEnd:e=>{"worklet";e.height===0&&oe(e.height),b.value=e.height,h.value=g.value,e.height===0?te.value=!1:x.value&&(ee.value=!1),M(e)}},[o,ae,oe,r,M]);let de=(0,H.useCallback)(async()=>{await D(),requestAnimationFrame(()=>{qQ(()=>{"worklet";N()})()})},[D,N]);(0,H.useImperativeHandle)(u,()=>{let e=f.current;if(e){let t=e;return t.assureFocusedInputVisible=()=>{de()},t}return{assureFocusedInputVisible:()=>{de()}}},[de]),(0,H.useEffect)(()=>{de()},[n]),_Q(()=>E.value,(e,t)=>{e?.target===t?.target&&e?.layout.height!==t?.layout.height&&N()},[]);let fe=CQ(()=>i?y.value:0,[i]),pe=mQ(()=>i&&o===`layout`?{paddingBottom:y.value+1}:{},[i,o]);return o===`layout`?H.createElement(s,M0({ref:p},l,{scrollEventThrottle:16,onLayout:j}),e,i&&H.createElement(JQ.View,{style:pe})):H.createElement(K2t,M0({ref:p},l,{bottomPadding:fe,scrollEventThrottle:16,ScrollViewComponent:s,onLayout:j}),e)});V();var Q2t=({type:e,disabled:t,theme:n})=>{let r=A0(e=>e.appearance),i=(0,H.useMemo)(()=>({backgroundColor:t?n[r].disabled:n[r].primary}),[t,n,r]),a=(0,H.useMemo)(()=>[N0.arrowLeftLine,i],[i]),o=(0,H.useMemo)(()=>[N0.arrowRightLine,i],[i]);return H.createElement(B,{style:e===`next`?N0.arrowDownContainer:N0.arrowUpContainer},H.createElement(B,{style:N0.arrow},H.createElement(lf.View,{style:a}),H.createElement(lf.View,{style:o})))},$2t={width:13,height:2,borderRadius:1},e4t={marginHorizontal:5,width:30,height:30,justifyContent:`center`,alignItems:`center`},N0=R.create({arrowUpContainer:e4t,arrowDownContainer:{...e4t,transform:[{rotate:`180deg`}]},arrow:{width:20,height:20,flexDirection:`row`,alignItems:`center`,justifyContent:`space-between`},arrowLeftLine:{...$2t,transform:[{rotate:`-45deg`}],left:-.5},arrowRightLine:{...$2t,transform:[{rotate:`45deg`}],left:-5.5}});V();var P0=z.select({android:({children:e,onPress:t,disabled:n,accessibilityLabel:r,accessibilityHint:i,testID:a,rippleRadius:o=18,style:s,theme:c})=>{let l=A0(e=>e.appearance),u=(0,H.useMemo)(()=>({disabled:n}),[n]),d=(0,H.useMemo)(()=>Zp.Ripple(c[l].ripple,!0,o),[l,o,c]);return H.createElement(Zp,{accessibilityHint:i,accessibilityLabel:r,accessibilityRole:`button`,accessibilityState:u,background:d,style:s,testID:a,onPress:t},H.createElement(B,{style:s},e))},default:({children:e,onPress:t,disabled:n,accessibilityLabel:r,accessibilityHint:i,testID:a,style:o})=>{let s=n?B:Yf,c=(0,H.useMemo)(()=>({disabled:n}),[n]);return H.createElement(s,{accessibilityHint:i,accessibilityLabel:r,accessibilityRole:`button`,accessibilityState:c,style:o,testID:a,onPress:t},e)}}),t4t={light:{primary:`#2c2c2c`,disabled:`#B0BEC5`,background:`#f3f3f4`,ripple:`#bcbcbcbc`},dark:{primary:`#fafafa`,disabled:`#707070`,background:`#2C2C2E`,ripple:`#F8F8F888`}},n4t=({children:e})=>H.createElement(H.Fragment,null,e),F0=`keyboard.toolbar`,r4t=`${F0}.previous`,i4t=`${F0}.next`,a4t=`${F0}.content`,o4t=`${F0}.done`,s4t=k0?-11:0;V();var I0=({children:e})=>H.createElement(B,{style:c4t.flex,testID:a4t},e),c4t=R.create({flex:{flex:1}}),l4t=(0,H.createContext)(void 0),u4t=()=>{let e=(0,H.useContext)(l4t);if(!e)throw Error(`KeyboardToolbar.* component must be used inside <KeyboardToolbar>`);return e};V();var d4t=({children:e,onPress:t,rippleRadius:n=28,text:r,button:i=P0})=>{let a=A0(e=>e.appearance),{theme:o}=u4t(),s=(0,H.useMemo)(()=>[f4t.doneButton,{color:o[a].primary}],[a,o]),c=(0,H.useCallback)(e=>{t?.(e),e.isDefaultPrevented()||D0.dismiss()},[t]);return H.createElement(i,{accessibilityHint:`Closes the keyboard`,accessibilityLabel:`Done`,rippleRadius:n,style:f4t.doneButtonContainer,testID:o4t,theme:o,onPress:c},H.createElement(_d,{maxFontSizeMultiplier:1.3,style:s},e??r??`Done`))},f4t=R.create({doneButton:{fontWeight:`600`,fontSize:15},doneButtonContainer:{marginRight:16,marginLeft:8}}),p4t=({children:e,onPress:t,disabled:n,rippleRadius:r,style:i,button:a=P0,icon:o=Q2t})=>{let{theme:s,isNextDisabled:c}=u4t(),l=n??c,u=(0,H.useCallback)(e=>{t?.(e),e.isDefaultPrevented()||D0.setFocusTo(`next`)},[t]);return H.createElement(a,{accessibilityHint:`Moves focus to the next field`,accessibilityLabel:`Next`,disabled:l,rippleRadius:r,style:i,testID:i4t,theme:s,onPress:u},e??H.createElement(o,{disabled:l,theme:s,type:`next`}))},m4t=({children:e,onPress:t,disabled:n,rippleRadius:r,style:i,button:a=P0,icon:o=Q2t})=>{let{theme:s,isPrevDisabled:c}=u4t(),l=n??c,u=(0,H.useCallback)(e=>{t?.(e),e.isDefaultPrevented()||D0.setFocusTo(`prev`)},[t]);return H.createElement(a,{accessibilityHint:`Moves focus to the previous field`,accessibilityLabel:`Previous`,disabled:l,rippleRadius:r,style:i,testID:r4t,theme:s,onPress:u},e??H.createElement(o,{disabled:l,theme:s,type:`prev`}))};V();function h4t(){return h4t=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},h4t.apply(null,arguments)}var L0=e=>{let{children:t,content:n,theme:r=t4t,doneText:i=`Done`,button:a,icon:o,showArrows:s=!0,onNextCallback:c,onPrevCallback:l,onDoneCallback:u,blur:d=null,opacity:f=`FF`,offset:{closed:p=0,opened:m=0}={},enabled:h=!0,insets:g,..._}=e,v=A0(e=>e.appearance),[y,b]=(0,H.useState)({current:0,count:0}),x=y.current===0,S=y.current===y.count-1,C=a??P0,w=o??Q2t;(0,H.useEffect)(()=>e2t.addListener(`focusDidSet`,e=>{b(e)}).remove,[]);let T=(0,H.useMemo)(()=>[R0.toolbar,{backgroundColor:`${r[v].background}${f}`},k0?null:{paddingLeft:g?.left,paddingRight:g?.right},k0?R0.floating:null],[v,f,r,g]),E=(0,H.useMemo)(()=>[R0.sticky,k0?{left:(g?.left??0)+16,right:(g?.right??0)+16}:null],[g]),D=(0,H.useMemo)(()=>({closed:p+42,opened:m+s4t}),[p,m]),O=null,k=null,A=null,ee=null;if(t){let e=null,n=null,r=null,i=null,a=null;H.Children.forEach(t,t=>{if(!H.isValidElement(t))return;let o=t.type;o===n4t?a=t:o===I0?r=t:o===m4t?e=t:o===p4t?n=t:o===d4t&&(i=t)}),O=a,ee=i,k=e||n?H.createElement(B,{style:R0.arrows},e,n):null,A=r??H.createElement(I0,null,r)}else O=d,k=s?H.createElement(B,{style:R0.arrows},H.createElement(m4t,{button:C,icon:w,onPress:l}),H.createElement(p4t,{button:C,icon:w,onPress:c})):null,A=H.createElement(I0,null,n),ee=i?H.createElement(d4t,{button:C,text:i,onPress:u}):null;let te=(0,H.useMemo)(()=>({theme:r,isPrevDisabled:x,isNextDisabled:S}),[r,x,S]);return H.createElement(l4t.Provider,{value:te},H.createElement(B2t,{enabled:h,offset:D,style:E},H.createElement(B,h4t({},_,{style:T,testID:F0}),O,k,A,ee)))},R0=R.create({sticky:{position:`absolute`,left:0,right:0,bottom:0,height:42},toolbar:{position:`absolute`,bottom:0,alignItems:`center`,width:`100%`,flexDirection:`row`,height:42},arrows:{flexDirection:`row`,paddingLeft:8},floating:{alignSelf:`center`,borderRadius:20,overflow:`hidden`}});L0.Background=n4t,L0.Content=I0,L0.Prev=m4t,L0.Next=p4t,L0.Done=d4t,L0.Group=o2t,YQ(),YQ(),YQ(),`nativeFabricUIManager`in globalThis,V(),YQ(),z.OS,YQ(),V(),YQ(),dX(0),dX(0),R.create({commitView:{display:`none`,position:`absolute`}}),V(),R.create({container:{position:`absolute`,bottom:0,top:0,left:0,right:0,height:999},rounded:{borderTopLeftRadius:T2t,borderTopRightRadius:T2t,overflow:`hidden`}}),V(),R.create({absolute:{position:`absolute`},stretch:{top:0,bottom:0,left:0,right:0}}),V(),lf.createAnimatedComponent(i2t);function g4t({children:e,style:t,onInsetsChange:n}){return b4t.useEffect(()=>{if(typeof document>`u`)return;let e=y4t();document.body.appendChild(e);let t=()=>{let{paddingTop:t,paddingBottom:r,paddingLeft:i,paddingRight:a}=window.getComputedStyle(e);n({nativeEvent:{insets:{top:t?parseInt(t,10):0,bottom:r?parseInt(r,10):0,left:i?parseInt(i,10):0,right:a?parseInt(a,10):0},frame:{x:0,y:0,width:document.documentElement.offsetWidth,height:document.documentElement.offsetHeight}}})};return e.addEventListener(_4t(),t),t(),()=>{document.body.removeChild(e),e.removeEventListener(_4t(),t)}},[n]),b4t.createElement(B,{style:t},e)}function _4t(){if(V0!=null)return V0;let e=document.createElement(`invalidtype`);V0=B0.Transition;for(let t in B0)if(e.style[t]!==void 0){V0=B0[t];break}return V0}function v4t(){if(H0!==null)return H0;let{CSS:e}=window;return H0=e&&e.supports&&e.supports(`top: constant(safe-area-inset-top)`)?`constant`:`env`,H0}function z0(e){return`${v4t()}(safe-area-inset-${e})`}function y4t(){let e=document.createElement(`div`),{style:t}=e;return t.position=`fixed`,t.left=`0`,t.top=`0`,t.width=`0`,t.height=`0`,t.zIndex=`-1`,t.overflow=`hidden`,t.visibility=`hidden`,t.transitionDuration=`0.05s`,t.transitionProperty=`padding`,t.transitionDelay=`0s`,t.paddingTop=z0(`top`),t.paddingBottom=z0(`bottom`),t.paddingLeft=z0(`left`),t.paddingRight=z0(`right`),e}var b4t,B0,V0,H0,x4t=o((()=>{b4t=u(p()),V(),B0={WebkitTransition:`webkitTransitionEnd`,Transition:`transitionEnd`,MozTransition:`transitionend`,MSTransition:`msTransitionEnd`,OTransition:`oTransitionEnd`},V0=null,H0=null}));function U0(){return U0=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},U0.apply(null,arguments)}function S4t({children:e,initialMetrics:t,initialSafeAreaInsets:n,style:r,...i}){let a=w4t(),o=T4t(),[s,c]=G0.useState(t?.insets??n??a??null),[l,u]=G0.useState(t?.frame??o??{x:0,y:0,width:Wo.get(`window`).width,height:Wo.get(`window`).height}),d=G0.useCallback(e=>{let{nativeEvent:{frame:t,insets:n}}=e;u(e=>t&&(t.height!==e.height||t.width!==e.width||t.x!==e.x||t.y!==e.y)?t:e),c(e=>!e||n.bottom!==e.bottom||n.left!==e.left||n.right!==e.right||n.top!==e.top?n:e)},[]);return G0.createElement(g4t,U0({style:[k4t.fill,r],onInsetsChange:d},i),s==null?null:G0.createElement(q0.Provider,{value:l},G0.createElement(K0.Provider,{value:s},e)))}function C4t({onChange:e,style:t,children:n,...r}){return G0.createElement(g4t,U0({},r,{style:[k4t.fill,t],onInsetsChange:t=>{e({insets:t.nativeEvent.insets,frame:t.nativeEvent.frame})}}),n)}function w4t(){return G0.useContext(K0)}function T4t(){return G0.useContext(q0)}function W0(){let e=G0.useContext(K0);if(e==null)throw Error(A4t);return e}function E4t(){let e=G0.useContext(q0);if(e==null)throw Error(A4t);return e}function D4t(e){return G0.forwardRef((t,n)=>{let r=W0();return G0.createElement(e,U0({},t,{insets:r,ref:n}))})}function O4t(){return W0()}var G0,K0,q0,k4t,A4t,j4t,M4t,N4t=o((()=>{G0=u(p()),V(),x4t(),K0=G0.createContext(null),q0=G0.createContext(null),k4t=R.create({fill:{flex:1}}),A4t="No safe area value available. Make sure you are rendering `<SafeAreaProvider>` at the top of your app.",j4t=K0.Consumer,M4t=K0}));function P4t(){return P4t=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},P4t.apply(null,arguments)}function J0(e,t,n){switch(n){case`maximum`:return Math.max(t,e);case`additive`:return t+e;default:return t}}var Y0,F4t,X0,I4t=o((()=>{Y0=u(p()),V(),N4t(),F4t={top:`additive`,left:`additive`,bottom:`additive`,right:`additive`},X0=Y0.forwardRef(({style:e={},mode:t,edges:n,...r},i)=>{let a=W0(),o=Y0.useMemo(()=>n==null?F4t:Array.isArray(n)?n.reduce((e,t)=>(e[t]=`additive`,e),{}):n,[n]),s=Y0.useMemo(()=>{let n=R.flatten(e);if(t===`margin`){let{margin:t=0,marginVertical:r=t,marginHorizontal:i=t,marginTop:s=r,marginRight:c=i,marginBottom:l=r,marginLeft:u=i}=n;return[e,{marginTop:J0(a.top,s,o.top),marginRight:J0(a.right,c,o.right),marginBottom:J0(a.bottom,l,o.bottom),marginLeft:J0(a.left,u,o.left)}]}else{let{padding:t=0,paddingVertical:r=t,paddingHorizontal:i=t,paddingTop:s=r,paddingRight:c=i,paddingBottom:l=r,paddingLeft:u=i}=n;return[e,{paddingTop:J0(a.top,s,o.top),paddingRight:J0(a.right,c,o.right),paddingBottom:J0(a.bottom,l,o.bottom),paddingLeft:J0(a.left,u,o.left)}]}},[o.bottom,o.left,o.right,o.top,a.bottom,a.left,a.right,a.top,t,e]);return Y0.createElement(B,P4t({style:s},r,{ref:i}))})})),L4t=o((()=>{})),R4t=o((()=>{})),z4t=c({SafeAreaConsumer:()=>j4t,SafeAreaContext:()=>M4t,SafeAreaFrameContext:()=>q0,SafeAreaInsetsContext:()=>K0,SafeAreaListener:()=>C4t,SafeAreaProvider:()=>S4t,SafeAreaView:()=>X0,initialWindowMetrics:()=>null,initialWindowSafeAreaInsets:()=>null,useSafeArea:()=>O4t,useSafeAreaFrame:()=>E4t,useSafeAreaInsets:()=>W0,withSafeAreaInsets:()=>D4t}),Z0=o((()=>{N4t(),I4t(),L4t(),R4t()}));Z0();var B4t=new k0t({defaultOptions:{queries:{gcTime:1/0}}});V();function V4t(e){let t=e.uri;if(typeof e==`string`)return{sourceName:e};if(typeof e==`object`&&!t)return{sourceJson:JSON.stringify(e)};if(typeof e==`object`&&t)return t.includes(`.lottie`)?{sourceDotLottieURI:t}:{sourceURL:t};if(typeof e==`number`)return{sourceDotLottieURI:Zu.resolveAssetSource(e).uri}}function Q0(e){"@babel/helpers - typeof";return Q0=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},Q0(e)}function H4t(e,t){if(Q0(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Q0(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function U4t(e){var t=H4t(e,`string`);return Q0(t)==`symbol`?t:t+``}function $0(e,t,n){return(t=U4t(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var W4t=class{requestAnimationFrame(e){return requestAnimationFrame(e)}cancelAnimationFrame(e){cancelAnimationFrame(e)}},G4t=class{constructor(){$0(this,`_lastHandleId`,0),$0(this,`_lastImmediate`,null)}requestAnimationFrame(e){return this._lastHandleId>=2**53-1&&(this._lastHandleId=0),this._lastHandleId+=1,this._lastImmediate=setImmediate(()=>{e(Date.now())}),this._lastHandleId}cancelAnimationFrame(e){this._lastImmediate&&clearImmediate(this._lastImmediate)}},K4t=class{constructor(){$0(this,`_strategy`,void 0),this._strategy=typeof requestAnimationFrame==`function`?new W4t:new G4t}requestAnimationFrame(e){return this._strategy.requestAnimationFrame(e)}cancelAnimationFrame(e){this._strategy.cancelAnimationFrame(e)}},e2=typeof window<`u`&&window.document!==void 0,q4t=new Uint8Array([80,75,3,4]),J4t=[`v`,`ip`,`op`,`layers`,`fr`,`w`,`h`],Y4t=`0.70.0`,X4t=`@lottiefiles/dotlottie-web`,G,Z4t=typeof TextDecoder<`u`?new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error(`TextDecoder not available`)}};typeof TextDecoder<`u`&&Z4t.decode();var t2=null;function n2(){return(t2===null||t2.byteLength===0)&&(t2=new Uint8Array(G.memory.buffer)),t2}function r2(e,t){return e>>>=0,Z4t.decode(n2().subarray(e,e+t))}function Q4t(e){let t=G.__externref_table_alloc_command_export();return G.__wbindgen_export_3.set(t,e),t}function $4t(e,t){try{return e.apply(this,t)}catch(e){let t=Q4t(e);G.__wbindgen_exn_store_command_export(t)}}var i2=0,a2=typeof TextEncoder<`u`?new TextEncoder(`utf-8`):{encode:()=>{throw Error(`TextEncoder not available`)}},e3t=typeof a2.encodeInto==`function`?function(e,t){return a2.encodeInto(e,t)}:function(e,t){let n=a2.encode(e);return t.set(n),{read:e.length,written:n.length}};function o2(e,t,n){if(n===void 0){let n=a2.encode(e),r=t(n.length,1)>>>0;return n2().subarray(r,r+n.length).set(n),i2=n.length,r}let r=e.length,i=t(r,1)>>>0,a=n2(),o=0;for(;o<r;o++){let t=e.charCodeAt(o);if(t>127)break;a[i+o]=t}if(o!==r){o!==0&&(e=e.slice(o)),i=n(i,r,r=o+e.length*3,1)>>>0;let t=n2().subarray(i+o,i+r),a=e3t(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return i2=o,i}var s2=null;function c2(){return(s2===null||s2.buffer.detached===!0||s2.buffer.detached===void 0&&s2.buffer!==G.memory.buffer)&&(s2=new DataView(G.memory.buffer)),s2}function t3t(e){return e==null}var l2=null;function n3t(){return(l2===null||l2.byteLength===0)&&(l2=new Float32Array(G.memory.buffer)),l2}function r3t(e,t){let n=t(e.length*4,4)>>>0;return n3t().set(e,n/4),i2=e.length,n}function i3t(e,t){let n=t(e.length*1,1)>>>0;return n2().set(e,n/1),i2=e.length,n}function a3t(e,t){let n=t(e.length*4,4)>>>0;for(let t=0;t<e.length;t++){let r=Q4t(e[t]);c2().setUint32(n+4*t,r,!0)}return i2=e.length,n}function o3t(e,t){let n=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),r=i2,i=i3t(t,G.__wbindgen_malloc_command_export),a=i2;return G.register_font(n,r,i,a)!==0}var u2=Object.freeze({Forward:0,0:`Forward`,Reverse:1,1:`Reverse`,Bounce:2,2:`Bounce`,ReverseBounce:3,3:`ReverseBounce`}),s3t=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>G.__wbg_dotlottieplayerwasm_free(e>>>0,1)),c3t=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,s3t.unregister(this),e}free(){let e=this.__destroy_into_raw();G.__wbg_dotlottieplayerwasm_free(e,0)}clear_slot(e){let t=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),n=i2;return G.dotlottieplayerwasm_clear_slot(this.__wbg_ptr,t,n)!==0}is_playing(){return G.dotlottieplayerwasm_is_playing(this.__wbg_ptr)!==0}is_stopped(){return G.dotlottieplayerwasm_is_stopped(this.__wbg_ptr)!==0}layout_fit(){let e,t;try{let n=G.dotlottieplayerwasm_layout_fit(this.__wbg_ptr);return e=n[0],t=n[1],r2(n[0],n[1])}finally{G.__wbindgen_free_command_export(e,t,1)}}loop_count(){return G.dotlottieplayerwasm_loop_count(this.__wbg_ptr)>>>0}poll_event(){return G.dotlottieplayerwasm_poll_event(this.__wbg_ptr)}reset_slot(e){let t=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),n=i2;return G.dotlottieplayerwasm_reset_slot(this.__wbg_ptr,t,n)!==0}set_layout(e,t,n){let r=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),i=i2;return G.dotlottieplayerwasm_set_layout(this.__wbg_ptr,r,i,t,n)!==0}set_marker(e){let t=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),n=i2;G.dotlottieplayerwasm_set_marker(this.__wbg_ptr,t,n)}clear_slots(){return G.dotlottieplayerwasm_clear_slots(this.__wbg_ptr)!==0}has_segment(){return G.dotlottieplayerwasm_has_segment(this.__wbg_ptr)!==0}is_complete(){return G.dotlottieplayerwasm_is_complete(this.__wbg_ptr)!==0}is_tweening(){return G.dotlottieplayerwasm_is_tweening(this.__wbg_ptr)!==0}reset_slots(){return G.dotlottieplayerwasm_reset_slots(this.__wbg_ptr)!==0}reset_theme(){return G.dotlottieplayerwasm_reset_theme(this.__wbg_ptr)!==0}segment_end(){return G.dotlottieplayerwasm_segment_end(this.__wbg_ptr)}set_quality(e){return G.dotlottieplayerwasm_set_quality(this.__wbg_ptr,e)!==0}set_segment(e,t){return G.dotlottieplayerwasm_set_segment(this.__wbg_ptr,e,t)!==0}static unload_font(e){let t=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),n=i2;return G.dotlottieplayerwasm_unload_font(t,n)!==0}animation_id(){let e=G.dotlottieplayerwasm_animation_id(this.__wbg_ptr),t;return e[0]!==0&&(t=r2(e[0],e[1]).slice(),G.__wbindgen_free_command_export(e[0],e[1]*1,1)),t}clear_marker(){G.dotlottieplayerwasm_clear_marker(this.__wbg_ptr)}emit_on_loop(){G.dotlottieplayerwasm_emit_on_loop(this.__wbg_ptr)}get_slot_ids(){return G.dotlottieplayerwasm_get_slot_ids(this.__wbg_ptr)}get_slot_str(e){let t=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),n=i2,r=G.dotlottieplayerwasm_get_slot_str(this.__wbg_ptr,t,n),i;return r[0]!==0&&(i=r2(r[0],r[1]).slice(),G.__wbindgen_free_command_export(r[0],r[1]*1,1)),i}marker_names(){return G.dotlottieplayerwasm_marker_names(this.__wbg_ptr)}set_autoplay(e){G.dotlottieplayerwasm_set_autoplay(this.__wbg_ptr,e)}set_slot_str(e,t){let n=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),r=i2,i=o2(t,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),a=i2;return G.dotlottieplayerwasm_set_slot_str(this.__wbg_ptr,n,r,i,a)!==0}set_viewport(e,t,n,r){return G.dotlottieplayerwasm_set_viewport(this.__wbg_ptr,e,t,n,r)!==0}total_frames(){return G.dotlottieplayerwasm_total_frames(this.__wbg_ptr)}clear_segment(){return G.dotlottieplayerwasm_clear_segment(this.__wbg_ptr)!==0}current_frame(){return G.dotlottieplayerwasm_current_frame(this.__wbg_ptr)}get_slot_type(e){let t=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),n=i2,r=G.dotlottieplayerwasm_get_slot_type(this.__wbg_ptr,t,n),i;return r[0]!==0&&(i=r2(r[0],r[1]).slice(),G.__wbindgen_free_command_export(r[0],r[1]*1,1)),i}get_slots_str(){let e,t;try{let n=G.dotlottieplayerwasm_get_slots_str(this.__wbg_ptr);return e=n[0],t=n[1],r2(n[0],n[1])}finally{G.__wbindgen_free_command_export(e,t,1)}}get_transform(){return G.dotlottieplayerwasm_get_transform(this.__wbg_ptr)}request_frame(){return G.dotlottieplayerwasm_request_frame(this.__wbg_ptr)}segment_start(){return G.dotlottieplayerwasm_segment_start(this.__wbg_ptr)}set_slots_str(e){let t=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),n=i2;return G.dotlottieplayerwasm_set_slots_str(this.__wbg_ptr,t,n)!==0}set_text_slot(e,t){let n=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),r=i2,i=o2(t,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),a=i2;return G.dotlottieplayerwasm_set_text_slot(this.__wbg_ptr,n,r,i,a)!==0}set_transform(e){let t=r3t(e,G.__wbindgen_malloc_command_export),n=i2;return G.dotlottieplayerwasm_set_transform(this.__wbg_ptr,t,n)!==0}sm_get_inputs(){return G.dotlottieplayerwasm_sm_get_inputs(this.__wbg_ptr)}sm_poll_event(){return G.dotlottieplayerwasm_sm_poll_event(this.__wbg_ptr)}sm_post_click(e,t){G.dotlottieplayerwasm_sm_post_click(this.__wbg_ptr,e,t)}animation_size(){return G.dotlottieplayerwasm_animation_size(this.__wbg_ptr)}current_marker(){let e=G.dotlottieplayerwasm_current_marker(this.__wbg_ptr),t;return e[0]!==0&&(t=r2(e[0],e[1]).slice(),G.__wbindgen_free_command_export(e[0],e[1]*1,1)),t}layout_align_x(){return G.dotlottieplayerwasm_layout_align_x(this.__wbg_ptr)}layout_align_y(){return G.dotlottieplayerwasm_layout_align_y(this.__wbg_ptr)}load_animation(e,t,n){let r=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),i=i2;return G.dotlottieplayerwasm_load_animation(this.__wbg_ptr,r,i,t,n)!==0}loop_animation(){return G.dotlottieplayerwasm_loop_animation(this.__wbg_ptr)!==0}set_color_slot(e,t,n,r){let i=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),a=i2;return G.dotlottieplayerwasm_set_color_slot(this.__wbg_ptr,i,a,t,n,r)!==0}set_loop_count(e){G.dotlottieplayerwasm_set_loop_count(this.__wbg_ptr,e)}set_theme_data(e){let t=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),n=i2;return G.dotlottieplayerwasm_set_theme_data(this.__wbg_ptr,t,n)!==0}sm_reset_input(e){let t=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),n=i2;G.dotlottieplayerwasm_sm_reset_input(this.__wbg_ptr,t,n)}manifest_string(){let e,t;try{let n=G.dotlottieplayerwasm_manifest_string(this.__wbg_ptr);return e=n[0],t=n[1],r2(n[0],n[1])}finally{G.__wbindgen_free_command_export(e,t,1)}}set_scalar_slot(e,t){let n=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),r=i2;return G.dotlottieplayerwasm_set_scalar_slot(this.__wbg_ptr,n,r,t)!==0}set_vector_slot(e,t,n){let r=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),i=i2;return G.dotlottieplayerwasm_set_vector_slot(this.__wbg_ptr,r,i,t,n)!==0}background_color(){return G.dotlottieplayerwasm_background_color(this.__wbg_ptr)>>>0}get_layer_bounds(e){let t=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),n=i2;return G.dotlottieplayerwasm_get_layer_bounds(this.__wbg_ptr,t,n)}get_pixel_buffer(){return G.dotlottieplayerwasm_get_pixel_buffer(this.__wbg_ptr)}segment_duration(){return G.dotlottieplayerwasm_segment_duration(this.__wbg_ptr)}sm_current_state(){let e,t;try{let n=G.dotlottieplayerwasm_sm_current_state(this.__wbg_ptr);return e=n[0],t=n[1],r2(n[0],n[1])}finally{G.__wbindgen_free_command_export(e,t,1)}}state_machine_id(){let e=G.dotlottieplayerwasm_state_machine_id(this.__wbg_ptr),t;return e[0]!==0&&(t=r2(e[0],e[1]).slice(),G.__wbindgen_free_command_export(e[0],e[1]*1,1)),t}get_state_machine(e){let t=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),n=i2,r=G.dotlottieplayerwasm_get_state_machine(this.__wbg_ptr,t,n),i;return r[0]!==0&&(i=r2(r[0],r[1]).slice(),G.__wbindgen_free_command_export(r[0],r[1]*1,1)),i}set_position_slot(e,t,n){let r=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),i=i2;return G.dotlottieplayerwasm_set_position_slot(this.__wbg_ptr,r,i,t,n)!==0}current_loop_count(){return G.dotlottieplayerwasm_current_loop_count(this.__wbg_ptr)>>>0}sm_framework_setup(){return G.dotlottieplayerwasm_sm_framework_setup(this.__wbg_ptr)}sm_post_pointer_up(e,t){G.dotlottieplayerwasm_sm_post_pointer_up(this.__wbg_ptr,e,t)}state_machine_load(e){let t=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),n=i2;return G.dotlottieplayerwasm_state_machine_load(this.__wbg_ptr,t,n)!==0}load_dotlottie_data(e,t,n){let r=i3t(e,G.__wbindgen_malloc_command_export),i=i2;return G.dotlottieplayerwasm_load_dotlottie_data(this.__wbg_ptr,r,i,t,n)!==0}sm_get_string_input(e){let t=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),n=i2,r=G.dotlottieplayerwasm_sm_get_string_input(this.__wbg_ptr,t,n),i;return r[0]!==0&&(i=r2(r[0],r[1]).slice(),G.__wbindgen_free_command_export(r[0],r[1]*1,1)),i}sm_set_string_input(e,t){let n=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),r=i2,i=o2(t,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),a=i2;return G.dotlottieplayerwasm_sm_set_string_input(this.__wbg_ptr,n,r,i,a)!==0}set_background_color(e){return G.dotlottieplayerwasm_set_background_color(this.__wbg_ptr,e)!==0}sm_get_boolean_input(e){let t=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),n=i2,r=G.dotlottieplayerwasm_sm_get_boolean_input(this.__wbg_ptr,t,n);return r===16777215?void 0:r!==0}sm_get_numeric_input(e){let t=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),n=i2,r=G.dotlottieplayerwasm_sm_get_numeric_input(this.__wbg_ptr,t,n);return r===4294967297?void 0:r}sm_post_pointer_down(e,t){G.dotlottieplayerwasm_sm_post_pointer_down(this.__wbg_ptr,e,t)}sm_post_pointer_exit(e,t){G.dotlottieplayerwasm_sm_post_pointer_exit(this.__wbg_ptr,e,t)}sm_post_pointer_move(e,t){G.dotlottieplayerwasm_sm_post_pointer_move(this.__wbg_ptr,e,t)}sm_set_boolean_input(e,t){let n=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),r=i2;return G.dotlottieplayerwasm_sm_set_boolean_input(this.__wbg_ptr,n,r,t)!==0}sm_set_numeric_input(e,t){let n=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),r=i2;return G.dotlottieplayerwasm_sm_set_numeric_input(this.__wbg_ptr,n,r,t)!==0}state_machine_unload(){G.dotlottieplayerwasm_state_machine_unload(this.__wbg_ptr)}sm_post_pointer_enter(e,t){G.dotlottieplayerwasm_sm_post_pointer_enter(this.__wbg_ptr,e,t)}clear_background_color(){return G.dotlottieplayerwasm_clear_background_color(this.__wbg_ptr)!==0}load_animation_from_id(e,t,n){let r=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),i=i2;return G.dotlottieplayerwasm_load_animation_from_id(this.__wbg_ptr,r,i,t,n)!==0}sm_poll_internal_event(){return G.dotlottieplayerwasm_sm_poll_internal_event(this.__wbg_ptr)}use_frame_interpolation(){return G.dotlottieplayerwasm_use_frame_interpolation(this.__wbg_ptr)!==0}reset_current_loop_count(){G.dotlottieplayerwasm_reset_current_loop_count(this.__wbg_ptr)}sm_override_current_state(e,t){let n=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),r=i2;return G.dotlottieplayerwasm_sm_override_current_state(this.__wbg_ptr,n,r,t)!==0}state_machine_load_from_id(e){let t=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),n=i2;return G.dotlottieplayerwasm_state_machine_load_from_id(this.__wbg_ptr,t,n)!==0}set_use_frame_interpolation(e){G.dotlottieplayerwasm_set_use_frame_interpolation(this.__wbg_ptr,e)}constructor(){return this.__wbg_ptr=G.dotlottieplayerwasm_new()>>>0,s3t.register(this,this.__wbg_ptr,this),this}mode(){return G.dotlottieplayerwasm_mode(this.__wbg_ptr)}play(){return G.dotlottieplayerwasm_play(this.__wbg_ptr)!==0}seek(e){return G.dotlottieplayerwasm_seek(this.__wbg_ptr,e)!==0}stop(){return G.dotlottieplayerwasm_stop(this.__wbg_ptr)!==0}tick(){return G.dotlottieplayerwasm_tick(this.__wbg_ptr)!==0}clear(){G.dotlottieplayerwasm_clear(this.__wbg_ptr)}pause(){return G.dotlottieplayerwasm_pause(this.__wbg_ptr)!==0}speed(){return G.dotlottieplayerwasm_speed(this.__wbg_ptr)}width(){return G.dotlottieplayerwasm_width(this.__wbg_ptr)>>>0}height(){return G.dotlottieplayerwasm_height(this.__wbg_ptr)>>>0}render(){return G.dotlottieplayerwasm_render(this.__wbg_ptr)!==0}resize(e,t){return G.dotlottieplayerwasm_resize(this.__wbg_ptr,e,t)!==0}markers(){return G.dotlottieplayerwasm_markers(this.__wbg_ptr)}sm_fire(e){let t=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),n=i2;return G.dotlottieplayerwasm_sm_fire(this.__wbg_ptr,t,n)!==0}sm_stop(){return G.dotlottieplayerwasm_sm_stop(this.__wbg_ptr)!==0}sm_tick(){return G.dotlottieplayerwasm_sm_tick(this.__wbg_ptr)!==0}autoplay(){return G.dotlottieplayerwasm_autoplay(this.__wbg_ptr)!==0}duration(){return G.dotlottieplayerwasm_duration(this.__wbg_ptr)}set_loop(e){G.dotlottieplayerwasm_set_loop(this.__wbg_ptr,e)}set_mode(e){G.dotlottieplayerwasm_set_mode(this.__wbg_ptr,e)}sm_start(e,t){let n=a3t(t,G.__wbindgen_malloc_command_export),r=i2;return G.dotlottieplayerwasm_sm_start(this.__wbg_ptr,e,n,r)!==0}theme_id(){let e=G.dotlottieplayerwasm_theme_id(this.__wbg_ptr),t;return e[0]!==0&&(t=r2(e[0],e[1]).slice(),G.__wbindgen_free_command_export(e[0],e[1]*1,1)),t}intersect(e,t,n){let r=o2(n,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),i=i2;return G.dotlottieplayerwasm_intersect(this.__wbg_ptr,e,t,r,i)!==0}is_loaded(){return G.dotlottieplayerwasm_is_loaded(this.__wbg_ptr)!==0}is_paused(){return G.dotlottieplayerwasm_is_paused(this.__wbg_ptr)!==0}load_font(e,t){let n=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),r=i2,i=i3t(t,G.__wbindgen_malloc_command_export),a=i2;return G.dotlottieplayerwasm_load_font(this.__wbg_ptr,n,r,i,a)!==0}set_frame(e){return G.dotlottieplayerwasm_set_frame(this.__wbg_ptr,e)!==0}set_speed(e){G.dotlottieplayerwasm_set_speed(this.__wbg_ptr,e)}set_theme(e){let t=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),n=i2;return G.dotlottieplayerwasm_set_theme(this.__wbg_ptr,t,n)!==0}sm_status(){let e,t;try{let n=G.dotlottieplayerwasm_sm_status(this.__wbg_ptr);return e=n[0],t=n[1],r2(n[0],n[1])}finally{G.__wbindgen_free_command_export(e,t,1)}}};async function l3t(e,t){if(typeof Response==`function`&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming==`function`)try{return await WebAssembly.instantiateStreaming(e,t)}catch(t){if(e.headers.get(`Content-Type`)!=`application/wasm`)console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",t);else throw t}let n=await e.arrayBuffer();return await WebAssembly.instantiate(n,t)}else{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}}function u3t(){let e={};return e.wbg={},e.wbg.__wbg_buffer_609cc3eee51ed158=function(e){return e.buffer},e.wbg.__wbg_error_7534b8e9a36f1ab4=function(e,t){let n,r;try{n=e,r=t,console.error(r2(e,t))}finally{G.__wbindgen_free_command_export(n,r,1)}},e.wbg.__wbg_new_405e22f390576ce2=function(){return{}},e.wbg.__wbg_new_78feb108b6472713=function(){return[]},e.wbg.__wbg_new_8a6f238a6ece86ea=function(){return Error()},e.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a=function(e,t,n){return new Uint8Array(e,t>>>0,n>>>0)},e.wbg.__wbg_newwithlength_5a5efe313cfd59f1=function(e){return new Float32Array(e>>>0)},e.wbg.__wbg_now_807e54c39636c349=function(){return Date.now()},e.wbg.__wbg_push_737cfc8c1432c2c6=function(e,t){return e.push(t)},e.wbg.__wbg_set_bb8cecf6a62b9f46=function(){return $4t(function(e,t,n){return Reflect.set(e,t,n)},arguments)},e.wbg.__wbg_setindex_4e73afdcd9bb95cd=function(e,t,n){e[t>>>0]=n},e.wbg.__wbg_stack_0ed75d68575b0f3c=function(e,t){let n=t.stack,r=o2(n,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),i=i2;c2().setInt32(e+4,i,!0),c2().setInt32(e+0,r,!0)},e.wbg.__wbindgen_init_externref_table=function(){let e=G.__wbindgen_export_3,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)},e.wbg.__wbindgen_memory=function(){return G.memory},e.wbg.__wbindgen_number_new=function(e){return e},e.wbg.__wbindgen_string_get=function(e,t){let n=t,r=typeof n==`string`?n:void 0;var i=t3t(r)?0:o2(r,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),a=i2;c2().setInt32(e+4,a,!0),c2().setInt32(e+0,i,!0)},e.wbg.__wbindgen_string_new=function(e,t){return r2(e,t)},e.wbg.__wbindgen_throw=function(e,t){throw Error(r2(e,t))},e}function d3t(e,t){return G=e.exports,f3t.__wbindgen_wasm_module=t,s2=null,l2=null,t2=null,G.__wbindgen_start(),G}async function f3t(e){if(G!==void 0)return G;if(e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn(`using deprecated parameters for the initialization function; pass a single object instead`)),e===void 0)throw Error(`WASM module URL must be provided via DotLottieWasmLoader or setWasmUrl().`);let t=u3t();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await l3t(await e,t);return d3t(n,r)}var p3t=class{constructor(){$0(this,`_eventListeners`,new Map)}addEventListener(e,t){let n=this._eventListeners.get(e);n||(n=new Set,this._eventListeners.set(e,n)),n.add(t)}removeEventListener(e,t){let n=this._eventListeners.get(e);n&&(t?(n.delete(t),n.size===0&&this._eventListeners.delete(e)):this._eventListeners.delete(e))}dispatch(e){this._eventListeners.get(e.type)?.forEach(t=>t(e))}removeAllEventListeners(){this._eventListeners.clear()}},d2=class e{static _initializeObserver(){e._observer||=new IntersectionObserver(t=>{t.forEach(t=>{let n=e._observedCanvases.get(t.target);n&&(t.isIntersecting?n.unfreeze():n.freeze())})},{threshold:0})}static observe(t,n){e._initializeObserver(),!e._observedCanvases.has(t)&&(e._observedCanvases.set(t,n),e._observer?.observe(t))}static unobserve(t){e._observer?.unobserve(t),e._observedCanvases.delete(t),e._observedCanvases.size===0&&(e._observer?.disconnect(),e._observer=null)}};$0(d2,`_observer`,null),$0(d2,`_observedCanvases`,new Map);var f2=class e{static _initializeObserver(){e._observer||=new ResizeObserver(t=>{t.forEach(t=>{let n=e._observedCanvases.get(t.target);if(!n)return;let[r,i]=n;clearTimeout(i);let a=setTimeout(()=>{r.resize()},100);e._observedCanvases.set(t.target,[r,a])})})}static observe(t,n){e._initializeObserver(),!e._observedCanvases.has(t)&&(e._observedCanvases.set(t,[n,0]),e._observer?.observe(t))}static unobserve(t){let n=e._observedCanvases.get(t);if(n){let e=n[1];e&&clearTimeout(e)}e._observer?.unobserve(t),e._observedCanvases.delete(t),!e._observedCanvases.size&&e._observer&&(e._observer.disconnect(),e._observer=null)}};$0(f2,`_observer`,null),$0(f2,`_observedCanvases`,new Map);function m3t(e){return/^#([\da-f]{6}|[\da-f]{8})$/iu.test(e)}function h3t(e){if(!m3t(e))return 0;let t=e.replace(`#`,``);return t=t.length===6?`${t}ff`:t,parseInt(t,16)}function g3t(e){if(e.byteLength<4)return!1;let t=new Uint8Array(e.slice(0,q4t.byteLength));for(let e=0;e<q4t.length;e+=1)if(q4t[e]!==t[e])return!1;return!0}function _3t(e){return J4t.every(t=>Object.hasOwn(e,t))}function v3t(e){if(typeof e==`string`)try{return _3t(JSON.parse(e))}catch{return!1}else return _3t(e)}function p2(){return 1+((e2?window.devicePixelRatio:1)-1)*.75}function m2(e){let t=e.getBoundingClientRect(),n=window.innerHeight||document.documentElement.clientHeight,r=window.innerWidth||document.documentElement.clientWidth;return!(t.bottom<0||t.top>n||t.right<0||t.left>r)}function h2(e){let t=e.target;if(t instanceof HTMLCanvasElement){let n=t.getBoundingClientRect();if(n.width===0||n.height===0||t.width===0||t.height===0)return null;let r=t.width/n.width,i=t.height/n.height,a=(e.clientX-n.left)*r,o=(e.clientY-n.top)*i;return!Number.isFinite(a)||!Number.isFinite(o)||Number.isNaN(a)||Number.isNaN(o)?null:{x:a,y:o}}return null}function y3t(e){let t=e.replace(`OpenUrl: `,``),n=t.indexOf(` | Target: `),r,i;n===-1?(r=t,i=`_blank`):(r=t.substring(0,n),i=t.substring(n+11)),window.open(r,i)}function b3t(e,t,n){let r=null,i=t;return{load(){return r||=e({module_or_path:i}).then(()=>void 0).catch(async t=>{console.warn(`Primary WASM load failed from ${i}: ${t.message}`),console.warn(`Attempting to load WASM from backup URL: ${n}`);try{await e({module_or_path:n})}catch(e){throw console.error(`Primary WASM URL failed: ${t.message}`),console.error(`Backup WASM URL failed: ${e.message}`),r=null,Error(`WASM loading failed from all sources.`)}}),r},setWasmUrl(e){e!==i&&(i=e,r=null)}}}var x3t=b3t(f3t,`https://cdn.jsdelivr.net/npm/${X4t}@${Y4t}/dist/dotlottie-player.wasm`,`https://unpkg.com/${X4t}@${Y4t}/dist/dotlottie-player.wasm`),S3t=e=>{switch(e){case`reverse`:return u2.Reverse;case`bounce`:return u2.Bounce;case`reverse-bounce`:return u2.ReverseBounce;default:return u2.Forward}},C3t=e=>{switch(e){case u2.Reverse:return`reverse`;case u2.Bounce:return`bounce`;case u2.ReverseBounce:return`reverse-bounce`;default:return`forward`}},w3t=e=>{switch(e){case`contain`:return`contain`;case`cover`:return`cover`;case`fill`:return`fill`;case`fit-height`:return`fit-height`;case`fit-width`:return`fit-width`;case`none`:return`none`;default:return`contain`}},T3t=class{constructor(e){$0(this,`_canvas`,null),$0(this,`_pendingLoad`,null),$0(this,`_context`,null),$0(this,`_eventManager`,void 0),$0(this,`_animationFrameId`,null),$0(this,`_frameManager`,void 0),$0(this,`_dotLottieCore`,null),$0(this,`_stateMachineId`,``),$0(this,`_stateMachineConfig`,null),$0(this,`_isStateMachineRunning`,!1),$0(this,`_renderConfig`,{}),$0(this,`_isFrozen`,!1),$0(this,`_backgroundColor`,null),$0(this,`_boundOnClick`,null),$0(this,`_boundOnPointerUp`,null),$0(this,`_boundOnPointerDown`,null),$0(this,`_boundOnPointerMove`,null),$0(this,`_boundOnPointerEnter`,null),$0(this,`_boundOnPointerLeave`,null),$0(this,`_bufferMismatchCount`,0),$0(this,`_lastExpectedBufferSize`,0),$0(this,`_marker`,``),this._canvas=e.canvas??null,this._eventManager=new p3t,this._frameManager=new K4t,this._renderConfig={...e.renderConfig,devicePixelRatio:e.renderConfig?.devicePixelRatio||p2(),freezeOnOffscreen:e.renderConfig?.freezeOnOffscreen??!0},this._initWasm().then(()=>{this._dotLottieCore=this._createCore(),this._dotLottieCore.set_autoplay(e.autoplay??!1),this._dotLottieCore.set_loop(e.loop??!1),this._dotLottieCore.set_loop_count(e.loopCount??0),this._dotLottieCore.set_mode(S3t(e.mode??`forward`)),this._dotLottieCore.set_speed(e.speed??1),this._dotLottieCore.set_use_frame_interpolation(e.useFrameInterpolation??!0),e.segment&&e.segment.length===2&&this._dotLottieCore.set_segment(e.segment[0],e.segment[1]),this._marker=e.marker??``,this._marker&&this._dotLottieCore.set_marker(this._marker),this._dotLottieCore.set_layout(e.layout?.fit??`contain`,e.layout?.align?.[0]??.5,e.layout?.align?.[1]??.5),this._stateMachineId=e.stateMachineId??``,this._stateMachineConfig=e.stateMachineConfig??null,this._onCoreCreated(),this._eventManager.dispatch({type:`ready`}),e.data?this._canvas?this._loadFromData(e.data):this._pendingLoad={data:e.data}:e.src&&(this._canvas?this._loadFromSrc(e.src):this._pendingLoad={src:e.src}),e.backgroundColor&&this.setBackgroundColor(e.backgroundColor)}).catch(e=>{console.error(`[dotlottie-web] Initialization failed:`,e),this._eventManager.dispatch({type:`loadError`,error:Error(`Failed to load wasm module: ${e}`)})})}async _initWasm(){return x3t.load()}_createCore(){return new c3t}_onCoreCreated(){}_drainPlayerEvents(){if(!this._dotLottieCore)return;let e;for(;(e=this._dotLottieCore.poll_event())!=null;){let t=e;switch(t.type){case`Load`:setTimeout(()=>this._eventManager.dispatch({type:`load`}),0);break;case`LoadError`:setTimeout(()=>this._eventManager.dispatch({type:`loadError`,error:Error(`failed to load`)}),0);break;case`Play`:setTimeout(()=>this._eventManager.dispatch({type:`play`}),0);break;case`Pause`:setTimeout(()=>this._eventManager.dispatch({type:`pause`}),0);break;case`Stop`:setTimeout(()=>this._eventManager.dispatch({type:`stop`}),0);break;case`Frame`:setTimeout(()=>this._eventManager.dispatch({type:`frame`,currentFrame:t.frameNo??0}),0);break;case`Render`:setTimeout(()=>this._eventManager.dispatch({type:`render`,currentFrame:t.frameNo??0}),0);break;case`Loop`:setTimeout(()=>this._eventManager.dispatch({type:`loop`,loopCount:t.loopCount??0}),0);break;case`Complete`:setTimeout(()=>this._eventManager.dispatch({type:`complete`}),0);break;default:break}}}_drainSmEvents(){if(!this._dotLottieCore)return;let e;for(;(e=this._dotLottieCore.sm_poll_event())!=null;){let t=e;switch(t.type){case`Start`:setTimeout(()=>{this._isStateMachineRunning=!0,this._eventManager.dispatch({type:`stateMachineStart`}),this._startAnimationLoop()},0);break;case`Stop`:setTimeout(()=>{this._isStateMachineRunning=!1,this._eventManager.dispatch({type:`stateMachineStop`}),this._dotLottieCore?.is_playing()||this._stopAnimationLoop()},0);break;case`CustomEvent`:this._eventManager.dispatch({type:`stateMachineCustomEvent`,eventName:t.message??``});break;case`BooleanInputChange`:this._eventManager.dispatch({type:`stateMachineBooleanInputValueChange`,inputName:t.name??``,newValue:t.newValue,oldValue:t.oldValue});break;case`NumericInputChange`:this._eventManager.dispatch({type:`stateMachineNumericInputValueChange`,inputName:t.name??``,newValue:t.newValue,oldValue:t.oldValue});break;case`StringInputChange`:this._eventManager.dispatch({type:`stateMachineStringInputValueChange`,inputName:t.name??``,newValue:t.newValue,oldValue:t.oldValue});break;case`InputFired`:this._eventManager.dispatch({type:`stateMachineInputFired`,inputName:t.name??``});break;case`Transition`:this._eventManager.dispatch({type:`stateMachineTransition`,fromState:t.previousState??``,toState:t.newState??``});break;case`StateEntered`:this._eventManager.dispatch({type:`stateMachineStateEntered`,state:t.state??``});break;case`StateExit`:this._eventManager.dispatch({type:`stateMachineStateExit`,state:t.state??``});break;case`Error`:this._eventManager.dispatch({type:`stateMachineError`,error:t.message??``});break;default:break}}let t;for(;(t=this._dotLottieCore.sm_poll_internal_event())!=null;){let e=t;if(e.type===`Message`){let t=e.message??``;e2&&t.startsWith(`OpenUrl: `)?y3t(t):this._eventManager.dispatch({type:`stateMachineInternalMessage`,message:t})}}}_dispatchError(e){console.error(e),this._eventManager.dispatch({type:`loadError`,error:Error(e)})}async _fetchData(e){let t=await fetch(e);if(!t.ok)throw Error(`Failed to fetch animation data from URL: ${e}. ${t.status}: ${t.statusText}`);let n=await t.arrayBuffer();return g3t(n)?n:new TextDecoder().decode(n)}_loadFromData(e){if(this._dotLottieCore===null)return;if(!this._canvas){console.warn(`[dotlottie-web] Cannot load animation without canvas. Call setCanvas() first.`);return}let t=this._canvas.width,n=this._canvas.height,r=!1;if(typeof e==`string`){if(!v3t(e)){this._dispatchError(`Invalid Lottie JSON string: The provided string does not conform to the Lottie JSON format.`);return}r=this._dotLottieCore.load_animation(e,t,n)}else if(e instanceof ArrayBuffer){if(!g3t(e)){this._dispatchError(`Invalid dotLottie ArrayBuffer: The provided ArrayBuffer does not conform to the dotLottie format.`);return}r=this._dotLottieCore.load_dotlottie_data(new Uint8Array(e),t,n)}else if(typeof e==`object`){if(!v3t(e)){this._dispatchError(`Invalid Lottie JSON object: The provided object does not conform to the Lottie JSON format.`);return}r=this._dotLottieCore.load_animation(JSON.stringify(e),t,n)}else{this._dispatchError(`Unsupported data type for animation data. Expected:
|
|
865
|
+
Event: ${E1(e)}`),!0;return!1}function rQt(e,t){return t?.length?oZt(e).some(e=>w1(e,t)):!1}function iQt(e,t){if(!t?.length)return!1;let n=e.transaction;return n?w1(n,t):!1}function aQt(e,t){if(!t?.length)return!1;let n=J1(e);return n?w1(n,t):!1}function oQt(e,t){if(!t?.length)return!0;let n=J1(e);return n?w1(n,t):!0}function sQt(e=[]){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&n.filename!==`<anonymous>`&&n.filename!==`[native code]`)return n.filename||null}return null}function J1(e){try{let t=[...e.exception?.values??[]].reverse().find(e=>e.mechanism?.parent_id===void 0&&e.stacktrace?.frames?.length)?.stacktrace?.frames;return t?sQt(t):null}catch{return q$&&t1.error(`Cannot extract url for event ${E1(e)}`),null}}function cQt(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(e=>e.stacktrace||e.type&&e.type!==`Error`||e.value):!1}function lQt(e,t,n,r,i,a){if(!i.exception?.values||!a||!c1(a.originalException))return;let o=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;o&&(i.exception.values=uQt(e,t,r,a.originalException,n,i.exception.values,o,0))}function uQt(e,t,n,r,i,a,o,s){if(a.length>=n+1)return a;let c=[...a];if(c1(r[i])){fQt(o,s,r);let a=e(t,r[i]),l=c.length;pQt(a,i,l,s),c=uQt(e,t,n,r[i],i,[a,...c],a,l)}return dQt(r)&&r.errors.forEach((a,l)=>{if(c1(a)){fQt(o,s,r);let u=e(t,a),d=c.length;pQt(u,`errors[${l}]`,d,s),c=uQt(e,t,n,a,i,[u,...c],u,d)}}),c}function dQt(e){return Array.isArray(e.errors)}function fQt(e,t,n){e.mechanism={handled:!0,type:`auto.core.linked_errors`,...dQt(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function pQt(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:`chained`,source:t,exception_id:n,parent_id:r}}function mQt(e){return c1(e)&&`__sentry_fetch_url_host__`in e&&typeof e.__sentry_fetch_url_host__==`string`}function hQt(e){return mQt(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}var gQt=new Set([]);function _Qt(e){let t=`console`,n=a1(t,e);return o1(t,yQt),n}var vQt=new Set;function yQt(){`console`in J$&&zKt.forEach(function(e){vQt.has(e)||!(e in J$.console)||(vQt.add(e),g1(J$.console,e,function(t){return $$[e]=t,function(...t){let n=t[0],r=$$[e],i=gQt.size&&typeof n==`string`&&w1(n,gQt);i||s1(`console`,{args:t,level:e}),(!i||q$&&t1.isEnabled())&&r?.apply(J$.console,t)}}))})}function bQt(e){return e===`warn`?`warning`:[`fatal`,`error`,`warning`,`log`,`info`,`debug`].includes(e)?e:`log`}var xQt=`Dedupe`,SQt=W1((()=>{let e;return{name:xQt,processEvent(t){if(t.type)return t;try{if(CQt(t,e))return q$&&t1.warn(`Event dropped due to being a duplicate of previously captured event.`),null}catch{}return e=t}}}));function CQt(e,t){return t?!!(wQt(e,t)||TQt(e,t)):!1}function wQt(e,t){let n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!DQt(e,t)||!EQt(e,t))}function TQt(e,t){let n=OQt(t),r=OQt(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!DQt(e,t)||!EQt(e,t))}function EQt(e,t){let n=nqt(e),r=nqt(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let e=0;e<r.length;e++){let t=r[e],i=n[e];if(t.filename!==i.filename||t.lineno!==i.lineno||t.colno!==i.colno||t.function!==i.function)return!1}return!0}function DQt(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join(``)===r.join(``)}catch{return!1}}function OQt(e){return e.exception?.values?.[0]}var kQt=`ConversationId`,AQt=W1((()=>({name:kQt,setup(e){e.on(`spanStart`,e=>{let t=P1().getScopeData(),n=F1().getScopeData(),r=t.conversationId||n.conversationId;if(r){let{op:t,data:n,description:i}=R1(e);if(!t?.startsWith(`gen_ai.`)&&!n[`ai.operationId`]&&!i?.startsWith(`ai.`))return;e.setAttribute(AJt,r)}})}})));function jQt(e){if(e!==void 0){if(e>=400&&e<500)return`warning`;if(e>=500)return`error`}}var Y1=J$;function MQt(){return`history`in Y1&&!!Y1.history}function NQt(){if(!(`fetch`in Y1))return!1;try{return new Headers,new Request(`data:,`),new Response,!0}catch{return!1}}function PQt(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function FQt(){if(typeof EdgeRuntime==`string`)return!0;if(!NQt())return!1;if(PQt(Y1.fetch))return!0;let e=!1,t=Y1.document;if(t&&typeof t.createElement==`function`)try{let n=t.createElement(`iframe`);n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=PQt(n.contentWindow.fetch)),t.head.removeChild(n)}catch(e){q$&&t1.warn(`Could not create sandbox iframe for pure fetch check, bailing to window.fetch: `,e)}return e}function IQt(e,t){let n=`fetch`,r=a1(n,e);return o1(n,()=>LQt(void 0,t)),r}function LQt(e,t=!1){t&&!FQt()||g1(J$,`fetch`,function(t){return function(...n){let r=Error(),{method:i,url:a}=zQt(n),o={args:n,fetchData:{method:i,url:a},startTimestamp:k1()*1e3,virtualError:r,headers:BQt(n)};return e||s1(`fetch`,{...o}),t.apply(J$,n).then(async t=>(e?e(t):s1(`fetch`,{...o,endTimestamp:k1()*1e3,response:t}),t),e=>{s1(`fetch`,{...o,endTimestamp:k1()*1e3,error:e}),c1(e)&&e.stack===void 0&&(e.stack=r.stack,_1(e,`framesToPop`,1));let t=I1()?.getOptions().enhanceFetchErrorMessages??`always`;if(t!==!1&&c1(e)&&e.name===`TypeError`&&(e.message===`Failed to fetch`||e.message===`Load failed`||e.message===`NetworkError when attempting to fetch resource.`))try{let n=new URL(o.fetchData.url).host;t===`always`?e.message=`${e.message} (${n})`:_1(e,`__sentry_fetch_url_host__`,n)}catch{}throw e})}})}function X1(e,t){return p1(e)&&!!e[t]}function RQt(e){return typeof e==`string`?e:e?X1(e,`url`)?e.url:e.toString?e.toString():``:``}function zQt(e){if(e.length===0)return{method:`GET`,url:``};if(e.length===2){let[t,n]=e;return{url:RQt(t),method:X1(n,`method`)?String(n.method).toUpperCase():_qt(t)&&X1(t,`method`)?String(t.method).toUpperCase():`GET`}}let t=e[0];return{url:RQt(t),method:X1(t,`method`)?String(t.method).toUpperCase():`GET`}}function BQt(e){let[t,n]=e;try{if(typeof n==`object`&&n&&`headers`in n&&n.headers)return new Headers(n.headers);if(_qt(t))return new Headers(t.headers)}catch{}}var VQt=J$;function HQt(){try{return VQt.document.location.href}catch{return``}}function UQt(e,t=5){if(!VQt.HTMLElement)return null;let n=e;for(let e=0;e<t;e++){if(!n)return null;if(n instanceof HTMLElement){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}n=n.parentNode}return null}var Z1=J$,WQt=0;function GQt(){return WQt>0}function KQt(){WQt++,setTimeout(()=>{WQt--})}function Q1(e,t={}){function n(e){return typeof e==`function`}if(!n(e))return e;try{if(Object.prototype.hasOwnProperty.call(e,`__sentry_wrapped__`)){let t=e.__sentry_wrapped__;return typeof t==`function`?t:e}if(yqt(e))return e}catch{return e}let r=function(...n){J$._sentryWrappedDepth=(J$._sentryWrappedDepth||0)+1;try{let r=n.map(e=>Q1(e,t));return e.apply(this,r)}catch(e){throw KQt(),wJt(r=>{r.addEventProcessor(e=>(t.mechanism&&(Hqt(e,void 0,void 0),D1(e,t.mechanism)),e.extra={...e.extra,arguments:n},e)),hXt(e)}),e}finally{J$._sentryWrappedDepth=(J$._sentryWrappedDepth||0)-1}};try{for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])}catch{}vqt(r,e),_1(e,`__sentry_wrapped__`,r);try{Object.getOwnPropertyDescriptor(r,`name`).configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function qQt(){let e=HQt(),{referrer:t}=Z1.document||{},{userAgent:n}=Z1.navigator||{};return{url:e,headers:{...t&&{Referer:t},...n&&{"User-Agent":n}}}}function JQt(e,t){let n=$1(e,t),r={type:t$t(t),value:n$t(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===``&&(r.value=`Unrecoverable error caught`),r}function YQt(e,t,n,r){let i=I1()?.getOptions().normalizeDepth,a=l$t(t),o={__serialized__:kqt(t,i)};if(a)return{exception:{values:[JQt(e,a)]},extra:o};let s={exception:{values:[{type:m1(t)?t.constructor.name:r?`UnhandledRejection`:`Error`,value:s$t(t,{isUnhandledRejection:r})}]},extra:o};if(n){let t=$1(e,n);t.length&&(s.exception.values[0].stacktrace={frames:t})}return s}function XQt(e,t){return{exception:{values:[JQt(e,t)]}}}function $1(e,t){let n=t.stacktrace||t.stack||``,r=QQt(t),i=$Qt(t);try{return e(n,r,i)}catch{}return[]}var ZQt=/Minified React error #\d+;/i;function QQt(e){return e&&ZQt.test(e.message)?1:0}function $Qt(e){return typeof e.framesToPop==`number`?e.framesToPop:0}function e$t(e){return typeof WebAssembly<`u`&&WebAssembly.Exception!==void 0?e instanceof WebAssembly.Exception:!1}function t$t(e){let t=e?.name;return!t&&e$t(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:`WebAssembly.Exception`:t}function n$t(e){let t=e?.message;return e$t(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:`wasm exception`:t?t.error&&typeof t.error.message==`string`?hQt(t.error):hQt(e):`No error message`}function r$t(e,t,n,r){let i=a$t(e,t,n?.syntheticException||void 0,r);return D1(i),i.level=`error`,n?.event_id&&(i.event_id=n.event_id),V1(i)}function i$t(e,t,n=`info`,r,i){let a=o$t(e,t,r?.syntheticException||void 0,i);return a.level=n,r?.event_id&&(a.event_id=r.event_id),V1(a)}function a$t(e,t,n,r,i){let a;if(dqt(t)&&t.error)return XQt(e,t.error);if(fqt(t)||pqt(t)){let i=t;if(`stack`in t){a=XQt(e,t);let i=a.exception?.values?.[0];if(r&&n&&i&&!i.stacktrace){let t=$1(e,n);t.length&&(i.stacktrace={frames:t},D1(a,{synthetic:!0}))}}else{let t=i.name||(fqt(i)?`DOMError`:`DOMException`),o=i.message?`${t}: ${i.message}`:t;a=o$t(e,o,n,r),Hqt(a,o)}return`code`in i&&(a.tags={...a.tags,"DOMException.code":`${i.code}`}),a}return c1(t)?XQt(e,t):f1(t)||m1(t)?(a=YQt(e,t,n,i),D1(a,{synthetic:!0}),a):(a=o$t(e,t,n,r),Hqt(a,`${t}`,void 0),D1(a,{synthetic:!0}),a)}function o$t(e,t,n,r){let i={};if(r&&n){let r=$1(e,n);r.length&&(i.exception={values:[{value:t,stacktrace:{frames:r}}]}),D1(i,{synthetic:!0})}if(mqt(t)){let{__sentry_template_string__:e,__sentry_template_values__:n}=t;return i.logentry={message:e,params:n},i}return i.message=t,i}function s$t(e,{isUnhandledRejection:t}){let n=Sqt(e),r=t?`promise rejection`:`exception`;return dqt(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:m1(e)?`Event \`${c$t(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function c$t(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function l$t(e){return Object.values(e).find(c1)}var u$t=class extends TZt{constructor(e){let t=d$t(e);KZt(t,`browser`,[`browser`],Z1.SENTRY_SDK_SOURCE||FXt()),super(t);let{userInfo:n}=this.getDataCollectionOptions();t._metadata?.sdk&&(t._metadata.sdk.settings={infer_ip:n?`auto`:`never`,...t._metadata.sdk.settings});let{sendClientReports:r}=this._options;Z1.document&&Z1.document.addEventListener(`visibilitychange`,()=>{Z1.document.visibilityState===`hidden`&&(r&&this._flushOutcomes(),queueMicrotask(()=>{this.flush()}))}),n&&this.on(`beforeSendSession`,GZt)}eventFromException(e,t){return r$t(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t=`info`,n){return i$t(this._options.stackParser,e,t,n,this._options.attachStacktrace)}_prepareEvent(e,t,n,r){return e.platform=e.platform||`javascript`,super._prepareEvent(e,t,n,r)}};function d$t(e){return{release:`hedia-web@3.9.0+1238`,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}var f$t=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,e0=J$;function p$t(e,t,n){e0.document&&e0.addEventListener(e,t,n)}function m$t(e,t,n){e0.document&&e0.removeEventListener(e,t,n)}var h$t=e=>{let t=!1;return()=>{t||=(e(),!0)}},g$t=e=>{let t=e0.requestIdleCallback||e0.setTimeout;e0.document?.visibilityState===`hidden`?e():(e=h$t(e),p$t(`visibilitychange`,e,{once:!0,capture:!0}),p$t(`pagehide`,e,{once:!0,capture:!0}),t(()=>{e(),m$t(`visibilitychange`,e,{capture:!0}),m$t(`pagehide`,e,{capture:!0})}))},_$t=80,t0={};try{typeof Node<`u`&&(t0.parentNode=Object.getOwnPropertyDescriptor(Node.prototype,`parentNode`).get),typeof Element<`u`&&(t0.tagName=Object.getOwnPropertyDescriptor(Element.prototype,`tagName`).get,t0.id=Object.getOwnPropertyDescriptor(Element.prototype,`id`).get,t0.className=Object.getOwnPropertyDescriptor(Element.prototype,`className`).get,t0.getAttribute=Element.prototype.getAttribute),typeof HTMLElement<`u`&&(t0.dataset=Object.getOwnPropertyDescriptor(HTMLElement.prototype,`dataset`).get)}catch{}function n0(e,t,n){let r=t0[t];if(r)try{return r.call(e,n)}catch{}let i=e[t];return typeof i==`function`?i.call(e,n):i}function v$t(e,t={}){if(!e)return`<unknown>`;try{let n=e,r=[],i=0,a=0,o,s=Array.isArray(t)?t:t.keyAttrs,c=!Array.isArray(t)&&t.maxStringLength||_$t;for(;n&&i++<5&&(o=y$t(n,s),!(o===`html`||i>1&&a+r.length*3+o.length>=c));)r.push(o),a+=o.length,n=n0(n,`parentNode`);return r.reverse().join(` > `)}catch{return`<unknown>`}}function y$t(e,t){let n=[],r=n0(e,`tagName`);if(!r)return``;if(typeof HTMLElement<`u`&&e instanceof HTMLElement){let t=n0(e,`dataset`);if(t){if(t.sentryComponent)return t.sentryComponent;if(t.sentryElement)return t.sentryElement}}n.push(r.toLowerCase());let i=t?.length?t.filter(t=>n0(e,`getAttribute`,t)).map(t=>[t,n0(e,`getAttribute`,t)]):null;if(i?.length)i.forEach(e=>{n.push(`[${e[0]}="${e[1]}"]`)});else{let t=n0(e,`id`);t&&n.push(`#${t}`);let r=n0(e,`className`);if(r&&u1(r)){let e=r.split(/\s+/);for(let t of e)n.push(`.${t}`)}}for(let t of[`aria-label`,`type`,`name`,`title`,`alt`]){let r=n0(e,`getAttribute`,t);r&&n.push(`[${t}="${r}"]`)}return n.join(``)}var b$t=1e3,x$t,S$t,C$t;function w$t(e){a1(`dom`,e),o1(`dom`,T$t)}function T$t(){if(!e0.document)return;let e=s1.bind(null,`dom`),t=O$t(e,!0);e0.document.addEventListener(`click`,t,!1),e0.document.addEventListener(`keypress`,t,!1),[`EventTarget`,`Node`].forEach(t=>{let n=e0[t]?.prototype;n?.hasOwnProperty?.(`addEventListener`)&&(g1(n,`addEventListener`,function(t){return function(n,r,i){if(n===`click`||n==`keypress`)try{let r=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},a=r[n]=r[n]||{refCount:0};if(!a.handler){let r=O$t(e);a.handler=r,t.call(this,n,r,i)}a.refCount++}catch{}return t.call(this,n,r,i)}}),g1(n,`removeEventListener`,function(e){return function(t,n,r){if(t===`click`||t==`keypress`)try{let n=this.__sentry_instrumentation_handlers__||{},i=n[t];i&&(i.refCount--,i.refCount<=0&&(e.call(this,t,i.handler,r),i.handler=void 0,delete n[t]),Object.keys(n).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return e.call(this,t,n,r)}}))})}function E$t(e){if(e.type!==S$t)return!1;try{if(!e.target||e.target._sentryId!==C$t)return!1}catch{}return!0}function D$t(e,t){return e===`keypress`?t?.tagName?!(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable):!0:!1}function O$t(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;let r=k$t(n);if(D$t(n.type,r))return;_1(n,`_sentryCaptured`,!0),r&&!r._sentryId&&_1(r,`_sentryId`,T1());let i=n.type===`keypress`?`input`:n.type;E$t(n)||(e({event:n,name:i,global:t}),S$t=n.type,C$t=r?r._sentryId:void 0),clearTimeout(x$t),x$t=e0.setTimeout(()=>{C$t=void 0,S$t=void 0},b$t)}}function k$t(e){try{return e.target}catch{return null}}var r0;function A$t(e){let t=`history`;a1(t,e),o1(t,j$t)}function j$t(){if(e0.addEventListener(`popstate`,()=>{let e=e0.location.href,t=r0;r0=e,t!==e&&s1(`history`,{from:t,to:e})}),!MQt())return;function e(e){return function(...t){let n=t.length>2?t[2]:void 0;if(n){let r=r0,i=M$t(String(n));if(r0=i,r===i)return e.apply(this,t);s1(`history`,{from:r,to:i})}return e.apply(this,t)}}g1(e0.history,`pushState`,e),g1(e0.history,`replaceState`,e)}function M$t(e){try{return new URL(e,e0.location.origin).toString()}catch{return e}}var i0={};function N$t(e){let t=i0[e];if(t)return t;let n=e0[e];if(PQt(n))return i0[e]=n.bind(e0);let r=e0.document;if(r&&typeof r.createElement==`function`)try{let t=r.createElement(`iframe`);t.hidden=!0,r.head.appendChild(t);let i=t.contentWindow;i?.[e]&&(n=i[e]),r.head.removeChild(t)}catch(t){f$t&&t1.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,t)}return n&&(i0[e]=n.bind(e0))}function P$t(e){i0[e]=void 0}var a0=`__sentry_xhr_v3__`;function F$t(e){a1(`xhr`,e),o1(`xhr`,I$t)}function I$t(){if(!e0.XMLHttpRequest)return;let e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(e,t,n){let r=Error(),i=k1()*1e3,a=u1(n[0])?n[0].toUpperCase():void 0,o=L$t(n[1]);if(!a||!o)return e.apply(t,n);t[a0]={method:a,url:o,request_headers:{}},a===`POST`&&o.match(/sentry_key/)&&(t.__sentry_own_request__=!0);let s=()=>{let e=t[a0];if(e&&t.readyState===4){try{e.status_code=t.status}catch{}s1(`xhr`,{endTimestamp:k1()*1e3,startTimestamp:i,xhr:t,virtualError:r}),r=void 0,t.removeEventListener(`readystatechange`,s)}};return`onreadystatechange`in t&&typeof t.onreadystatechange==`function`?t.onreadystatechange=new Proxy(t.onreadystatechange,{apply(e,t,n){return s(),e.apply(t,n)}}):t.addEventListener(`readystatechange`,s),t.setRequestHeader=new Proxy(t.setRequestHeader,{apply(e,t,n){let[r,i]=n,a=t[a0];return a&&u1(r)&&u1(i)&&(a.request_headers[r.toLowerCase()]=i),e.apply(t,n)}}),e.apply(t,n)}}),e.send=new Proxy(e.send,{apply(e,t,n){let r=t[a0];return r?(n[0]!==void 0&&(r.body=n[0]),s1(`xhr`,{startTimestamp:k1()*1e3,xhr:t}),e.apply(t,n)):e.apply(t,n)}})}function L$t(e){if(u1(e))return e;try{return e.toString()}catch{}}function R$t(e){if(typeof Element>`u`)return!1;try{return e instanceof Element}catch{return!1}}var z$t=40;function B$t(e,t=N$t(`fetch`)){let n=0,r=0;async function i(i){let a=i.body.length;n+=a,r++;let o={body:i.body,method:`POST`,referrerPolicy:`strict-origin`,headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{let n=await t(e.url,o);return{statusCode:n.status,headers:{"x-sentry-rate-limits":n.headers.get(`X-Sentry-Rate-Limits`),"retry-after":n.headers.get(`Retry-After`)}}}catch(e){throw P$t(`fetch`),e}finally{n-=a,r--}}return iZt(e,i,QXt(e.bufferSize||z$t))}var o0=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,V$t=30,H$t=50;function U$t(e,t,n,r){let i={filename:e,function:t===`<anonymous>`?`?`:t,in_app:!0};return n!==void 0&&(i.lineno=n),r!==void 0&&(i.colno=r),i}var W$t=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,G$t=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,K$t=/\((\S*)(?::(\d+))(?::(\d+))\)/,q$t=/at (.+?) ?\(data:(.+?),/,J$t=[V$t,e=>{let t=e.match(q$t);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};let n=W$t.exec(e);if(n){let[,e,t,r]=n;return U$t(e,`?`,+t,+r)}let r=G$t.exec(e);if(r){if(r[2]?.indexOf(`eval`)===0){let e=K$t.exec(r[2]);e&&(r[2]=e[1],r[3]=e[2],r[4]=e[3])}let[e,t]=Q$t(r[1]||`?`,r[2]);return U$t(t,e,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}}],Y$t=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,X$t=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Z$t=QKt(J$t,[H$t,e=>{let t=Y$t.exec(e);if(t){if(t[3]&&t[3].indexOf(` > eval`)>-1){let e=X$t.exec(t[3]);e&&(t[1]=t[1]||`eval`,t[3]=e[1],t[4]=e[2],t[5]=``)}let e=t[3],n=t[1]||`?`;return[n,e]=Q$t(n,e),U$t(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]),Q$t=(e,t)=>{let n=e.indexOf(`safari-extension`)!==-1,r=e.indexOf(`safari-web-extension`)!==-1;return n||r?[e.indexOf(`@`)===-1?`?`:e.split(`@`)[0],n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},s0=1024,$$t=`Breadcrumbs`,e1t=W1(((e={})=>{let t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:$$t,setup(e){t.console&&_Qt(r1t(e)),t.dom&&w$t(n1t(e,t.dom)),t.xhr&&F$t(i1t(e)),t.fetch&&IQt(a1t(e)),t.history&&A$t(o1t(e)),t.sentry&&e.on(`beforeSendEvent`,t1t(e))}}}));function t1t(e){return function(t){I1()===e&&q1({category:`sentry.${t.type===`transaction`?`transaction`:`event`}`,event_id:t.event_id,level:t.level,message:E1(t)},{event:t})}}function n1t(e,t){return function(n){if(I1()!==e)return;let r,i,a=typeof t==`object`?t.serializeAttribute:void 0,o=typeof t==`object`&&typeof t.maxStringLength==`number`?t.maxStringLength:void 0;o&&o>s0&&(o0&&t1.warn(`\`dom.maxStringLength\` cannot exceed ${s0}, but a value of ${o} was configured. Sentry will use ${s0} instead.`),o=s0),typeof a==`string`&&(a=[a]);try{let e=n.event,t=s1t(e)?e.target:e;r=v$t(t,{keyAttrs:a,maxStringLength:o}),i=UQt(t)}catch{r=`<unknown>`}if(r.length===0)return;let s={category:`ui.${n.name}`,message:r};i&&(s.data={"ui.component_name":i}),q1(s,{event:n.event,name:n.name,global:n.global})}}function r1t(e){return function(t){if(I1()!==e)return;let n={category:`console`,data:{arguments:t.args,logger:`console`},level:bQt(t.level),message:Lqt(t.args,` `)};if(t.level===`assert`)if(t.args[0]===!1)n.message=`Assertion failed: ${Lqt(t.args.slice(1),` `)||`console.assert`}`,n.data.arguments=t.args.slice(1);else return;q1(n,{input:t.args,level:t.level})}}function i1t(e){return function(t){if(I1()!==e)return;let{startTimestamp:n,endTimestamp:r}=t,i=t.xhr[a0];if(!n||!r||!i)return;let{method:a,url:o,status_code:s,body:c}=i,l={method:a,url:o,status_code:s},u={xhr:t.xhr,input:c,startTimestamp:n,endTimestamp:r},d={category:`xhr`,data:l,type:`http`,level:jQt(s)};e.emit(`beforeOutgoingRequestBreadcrumb`,d,u),q1(d,u)}}function a1t(e){return function(t){if(I1()!==e)return;let{startTimestamp:n,endTimestamp:r}=t;if(r&&!(t.fetchData.url.match(/sentry_key/)&&t.fetchData.method===`POST`))if(t.error){let i={data:t.error,input:t.args,startTimestamp:n,endTimestamp:r},a={category:`fetch`,data:t.fetchData,level:`error`,type:`http`};e.emit(`beforeOutgoingRequestBreadcrumb`,a,i),q1(a,i)}else{let i=t.response,a={...t.fetchData,status_code:i?.status},o={input:t.args,response:i,startTimestamp:n,endTimestamp:r},s={category:`fetch`,data:a,type:`http`,level:jQt(a.status_code)};e.emit(`beforeOutgoingRequestBreadcrumb`,s,o),q1(s,o)}}}function o1t(e){return function(t){if(I1()!==e)return;let n=t.from,r=t.to,i=UZt(Z1.location.href),a=n?UZt(n):void 0,o=UZt(r);a?.path||(a=i),i.protocol===o.protocol&&i.host===o.host&&(r=o.relative),i.protocol===a.protocol&&i.host===a.host&&(n=a.relative),q1({category:`navigation`,data:{from:n,to:r}})}}function s1t(e){return!!e&&!!e.target}var c1t=`EventTarget,Window,Node,ApplicationCache,AudioTrackList,BroadcastChannel,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload`.split(`,`),l1t=`BrowserApiErrors`,u1t=W1(((e={})=>{let t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:l1t,setupOnce(){t.setTimeout&&g1(Z1,`setTimeout`,d1t),t.setInterval&&g1(Z1,`setInterval`,d1t),t.requestAnimationFrame&&g1(Z1,`requestAnimationFrame`,f1t),t.XMLHttpRequest&&`XMLHttpRequest`in Z1&&g1(XMLHttpRequest.prototype,`send`,p1t);let e=t.eventTarget;e&&(Array.isArray(e)?e:c1t).forEach(e=>m1t(e,t))}}}));function d1t(e){return function(...t){let n=t[0];return t[0]=Q1(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${r1(e)}`}}),e.apply(this,t)}}function f1t(e){return function(t){return e.apply(this,[Q1(t,{mechanism:{data:{handler:r1(e)},handled:!1,type:`auto.browser.browserapierrors.requestAnimationFrame`}})])}}function p1t(e){return function(...t){let n=this;return[`onload`,`onerror`,`onprogress`,`onreadystatechange`].forEach(e=>{e in n&&typeof n[e]==`function`&&g1(n,e,function(t){let n={mechanism:{data:{handler:r1(t)},handled:!1,type:`auto.browser.browserapierrors.xhr.${e}`}},r=yqt(t);return r&&(n.mechanism.data.handler=r1(r)),Q1(t,n)})}),e.apply(this,t)}}function m1t(e,t){let n=Z1[e]?.prototype;n?.hasOwnProperty?.(`addEventListener`)&&(g1(n,`addEventListener`,function(n){return function(r,i,a){try{h1t(i)&&(i.handleEvent=Q1(i.handleEvent,{mechanism:{data:{handler:r1(i),target:e},handled:!1,type:`auto.browser.browserapierrors.handleEvent`}}))}catch{}return t.unregisterOriginalCallbacks&&g1t(this,r,i),n.apply(this,[r,Q1(i,{mechanism:{data:{handler:r1(i),target:e},handled:!1,type:`auto.browser.browserapierrors.addEventListener`}}),a])}}),g1(n,`removeEventListener`,function(e){return function(t,n,r){try{if(Object.prototype.hasOwnProperty.call(n,`__sentry_wrapped__`)){let i=n.__sentry_wrapped__;i&&e.call(this,t,i,r)}}catch{}return e.call(this,t,n,r)}}))}function h1t(e){return typeof e.handleEvent==`function`}function g1t(e,t,n){e&&typeof e==`object`&&`removeEventListener`in e&&typeof e.removeEventListener==`function`&&e.removeEventListener(t,n)}var _1t=W1((e={})=>{let t=e.lifecycle??`route`;return{name:`BrowserSession`,setupOnce(){if(Z1.document===void 0){o0&&t1.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}yXt({ignoreDuration:!0});let e=!1;g$t(()=>{e||=(SXt(),!0)});let n=F1(),r=n.getUser();n.addScopeListener(t=>{let n=t.getUser();(r?.id!==n?.id||r?.ip_address!==n?.ip_address)&&(r=n,e&&SXt())}),t===`route`&&A$t(({from:t,to:n})=>{t!==n&&(yXt({ignoreDuration:!0}),SXt(),e=!0)})}}}),v1t=`CultureContext`,y1t=W1((()=>({name:v1t,preprocessEvent(e){let t=b1t();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})},processSegmentSpan(e){let t=b1t();t&&qYt(e,{"culture.locale":t.locale,"culture.timezone":t.timezone,"culture.calendar":t.calendar})}})));function b1t(){try{let e=Z1.Intl;if(!e)return;let t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}var x1t=`GlobalHandlers`,S1t=W1(((e={})=>{let t={onerror:!0,onunhandledrejection:!0,...e};return{name:x1t,setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(C1t(e),O1t(`onerror`)),t.onunhandledrejection&&(w1t(e),O1t(`onunhandledrejection`))}}}));function C1t(e){aqt(t=>{let{stackParser:n,attachStacktrace:r}=k1t();if(I1()!==e||GQt())return;let{msg:i,url:a,line:o,column:s,error:c}=t,l=D1t(a$t(n,c||i,void 0,r,!1),a,o,s);l.level=`error`,gXt(l,{originalException:c,mechanism:{handled:!1,type:`auto.browser.global_handlers.onerror`}})})}function w1t(e){cqt(t=>{let{stackParser:n,attachStacktrace:r}=k1t();if(I1()!==e||GQt())return;let i=T1t(t),a=d1(i)?E1t(i):a$t(n,i,void 0,r,!0);a.level=`error`,gXt(a,{originalException:i,mechanism:{handled:!1,type:`auto.browser.global_handlers.onunhandledrejection`}})})}function T1t(e){if(d1(e))return e;try{if(`reason`in e)return e.reason;if(`detail`in e&&`reason`in e.detail)return e.detail.reason}catch{}return e}function E1t(e){return{exception:{values:[{type:`UnhandledRejection`,value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function D1t(e,t,n,r){let i=e.exception=e.exception||{},a=i.values=i.values||[],o=a[0]=a[0]||{},s=o.stacktrace=o.stacktrace||{},c=s.frames=s.frames||[];return c.length===0&&c.push({colno:r,lineno:n,filename:A1t(t)??HQt(),function:`?`,in_app:!0}),e}function O1t(e){o0&&t1.log(`Global Handler attached: ${e}`)}function k1t(){return I1()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function A1t(e){if(!(!u1(e)||e.length===0))return e.startsWith(`data:`)?`<${WZt(e,!1)}>`:e}var j1t=W1(()=>({name:`HttpContext`,preprocessEvent(e){if(!Z1.navigator&&!Z1.location&&!Z1.document)return;let t=qQt(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}},processSpan(e){if(!Z1.navigator&&!Z1.location&&!Z1.document)return;let t=qQt();qYt(e,{[KYt]:t.headers[`User-Agent`],...e.is_segment&&{"url.full":e.attributes?.[`sentry.op`]===`http.client`?void 0:HZt(t.url),"http.request.header.referer":t.headers.Referer}})}})),M1t=`cause`,N1t=5,P1t=`LinkedErrors`,F1t=W1(((e={})=>{let t=e.limit||N1t,n=e.key||M1t;return{name:P1t,preprocessEvent(e,r,i){lQt(JQt,i.getOptions().stackParser,n,t,e,r)}}})),I1t=/^HTML(\w*)Element$/;function L1t(e){if(typeof window<`u`&&e===window)return`[Window]`;if(typeof document<`u`&&e===document)return`[Document]`;if(R$t(e)){let t=R1t(e);if(I1t.test(t))return`[HTMLElement: ${v$t(e)}]`}}function R1t(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:`null prototype`}function z1t(){return B1t()?(o0&&e1(()=>{console.error(`[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/`)}),!0):!1}function B1t(){if(Z1.window===void 0)return!1;let e=Z1;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;let t=HQt();return!(Z1===Z1.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(t))}function V1t(e){return[eQt(),XZt(),AQt(),u1t(),e1t(),S1t(),F1t(),SQt(),j1t(),y1t(),_1t()]}function H1t(e={}){let t=!e.skipBrowserExtensionCheck&&z1t(),n=e.defaultIntegrations==null?V1t():e.defaultIntegrations,r={...e,enabled:t?!1:e.enabled,stackParser:$Kt(e.stackParser||Z$t),integrations:AXt({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||B$t};return Oqt(L1t),FZt(u$t,r)}function U1t(e){return f1(e)&&`nativeEvent`in e&&`preventDefault`in e&&`stopPropagation`in e}function W1t(e){let t={...e};KZt(t,`react`),_Xt(`react`,{version:H.version});let n=H1t(t);return Oqt(G1t),n}function G1t(e){return U1t(e)?`[SyntheticEvent]`:L1t(e)}var c0=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(){}},l0=typeof window>`u`||`Deno`in globalThis;function u0(){}function K1t(e,t){return typeof e==`function`?e(t):e}function q1t(e){return typeof e==`number`&&e>=0&&e!==1/0}function J1t(e,t){return Math.max(e+(t||0)-Date.now(),0)}function d0(e,t){return typeof e==`function`?e(t):e}function f0(e,t){return typeof e==`function`?e(t):e}function Y1t(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Z1t(o,t.options))return!1}else if(!m0(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 X1t(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(p0(t.options.mutationKey)!==p0(a))return!1}else if(!m0(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Z1t(e,t){return(t?.queryKeyHashFn||p0)(e)}function p0(e){return JSON.stringify(e,(e,t)=>e0t(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function m0(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>m0(e[n],t[n])):!1}function Q1t(e,t){if(e===t)return e;let n=$1t(e)&&$1t(t);if(n||e0t(e)&&e0t(t)){let r=n?e:Object.keys(e),i=r.length,a=n?t:Object.keys(t),o=a.length,s=n?[]:{},c=new Set(r),l=0;for(let r=0;r<o;r++){let i=n?r:a[r];(!n&&c.has(i)||n)&&e[i]===void 0&&t[i]===void 0?(s[i]=void 0,l++):(s[i]=Q1t(e[i],t[i]),s[i]===e[i]&&e[i]!==void 0&&l++)}return i===o&&l===i?e:s}return t}function h0(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 $1t(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function e0t(e){if(!t0t(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!t0t(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function t0t(e){return Object.prototype.toString.call(e)===`[object Object]`}function n0t(e){return new Promise(t=>{setTimeout(t,e)})}function r0t(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Q1t(e,t)}function i0t(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function a0t(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var o0t=Symbol();function s0t(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===o0t?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function c0t(e,t){return typeof e==`function`?e(...t):!!e}var l0t=new class extends c0{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!l0&&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();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},g0=new class extends c0{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!l0&&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 u0t(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}function d0t(e){return Math.min(1e3*2**e,3e4)}function f0t(e){return(e??`online`)===`online`?g0.isOnline():!0}var p0t=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function m0t(e){return e instanceof p0t}function h0t(e){let t=!1,n=0,r=!1,i,a=u0t(),o=t=>{r||(f(new p0t(t)),e.abort?.())},s=()=>{t=!0},c=()=>{t=!1},l=()=>l0t.isFocused()&&(e.networkMode===`always`||g0.isOnline())&&e.canRun(),u=()=>f0t(e.networkMode)&&e.canRun(),d=t=>{r||(r=!0,e.onSuccess?.(t),i?.(),a.resolve(t))},f=t=>{r||(r=!0,e.onError?.(t),i?.(),a.reject(t))},p=()=>new Promise(t=>{i=e=>{(r||l())&&t(e)},e.onPause?.()}).then(()=>{i=void 0,r||e.onContinue?.()}),m=()=>{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(d).catch(i=>{if(r)return;let a=e.retry??(l0?0:3),o=e.retryDelay??d0t,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){f(i);return}n++,e.onFail?.(n,i),n0t(s).then(()=>l()?void 0:p()).then(()=>{t?f(i):m()})})};return{promise:a,cancel:o,continue:()=>(i?.(),a),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),a)}}var g0t=e=>setTimeout(e,0);function _0t(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=g0t,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 _0=_0t(),v0t=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),q1t(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(l0?1/0:300*1e3))}clearGcTimeout(){this.#e&&=(clearTimeout(this.#e),void 0)}},y0t=class extends v0t{#e;#t;#n;#r;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=x0t(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=r0t(this.state.data,e,this.options);return this.#s({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(u0).catch(u0):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>f0(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===o0t||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>d0(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!J1t(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.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.#i&&(this.#o?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({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.#i)return this.#i.continueRetry(),this.#i.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.#o=!0,n.signal)})},i=()=>{let e=s0t(this.options,t),n=(()=>{let e={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#o=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(e),e})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#s({type:`fetch`,meta:a.fetchOptions?.meta});let o=e=>{m0t(e)&&e.silent||this.#s({type:`error`,error:e}),m0t(e)||(this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this)),this.scheduleGc()};return this.#i=h0t({initialPromise:t?.initialPromise,fn:a.fetchFn,abort:n.abort.bind(n),onSuccess:e=>{if(e===void 0){o(Error(`${this.queryHash} data is undefined`));return}try{this.setData(e)}catch(e){o(e);return}this.#n.config.onSuccess?.(e,this),this.#n.config.onSettled?.(e,this.state.error,this),this.scheduleGc()},onError:o,onFail:(e,t)=>{this.#s({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#s({type:`pause`})},onContinue:()=>{this.#s({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}),this.#i.start()}#s(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,...b0t(t.data,this.options),fetchMeta:e.meta??null};case`success`:return this.#t=void 0,{...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 m0t(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),_0.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function b0t(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:f0t(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function x0t(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 S0t=class extends c0{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??Z1t(r,t),a=this.get(i);return a||(a=new y0t({client:e,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(){_0.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=>Y1t(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Y1t(e,t)):t}notify(e){_0.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){_0.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){_0.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},C0t=class extends v0t{#e;#t;#n;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||w0t(),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})}optionalRemove(){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){let t=()=>{this.#r({type:`continue`})};this.#n=h0t({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:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});let n=this.state.status===`pending`,r=!this.#n.canStart();try{if(n)t();else{this.#r({type:`pending`,variables:e,isPaused:r}),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:r})}let i=await this.#n.start();return await this.#t.config.onSuccess?.(i,e,this.state.context,this),await this.options.onSuccess?.(i,e,this.state.context),await this.#t.config.onSettled?.(i,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(i,null,e,this.state.context),this.#r({type:`success`,data:i}),i}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),_0.batch(()=>{this.#e.forEach(t=>{t.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:`updated`,action:e})})}};function w0t(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var T0t=class extends c0{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new C0t({mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=v0(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=v0(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=v0(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=v0(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){_0.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>X1t(t,e))}findAll(e={}){return this.getAll().filter(t=>X1t(e,t))}notify(e){_0.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return _0.batch(()=>Promise.all(e.map(e=>e.continue().catch(u0))))}};function v0(e){return e.options.scope?.id}function E0t(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=s0t(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=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?a0t:i0t;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?O0t:D0t,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:D0t(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,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function D0t(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 O0t(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var k0t=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new S0t,this.#t=e.mutationCache||new T0t,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=l0t.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=g0.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.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(d0(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}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=K1t(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return _0.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;_0.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return _0.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=_0.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(u0).catch(u0)}invalidateQueries(e,t={}){return _0.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=_0.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(u0)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(u0)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(d0(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(u0).catch(u0)}fetchInfiniteQuery(e){return e.behavior=E0t(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(u0).catch(u0)}ensureInfiniteQueryData(e){return e.behavior=E0t(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return g0.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(p0(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{m0(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(p0(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{m0(e,t.mutationKey)&&Object.assign(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||=Z1t(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.queryFn===o0t&&(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()}},A0t=class extends c0{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=u0t(),this.options.experimental_prefetchInRender||this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`)),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;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),M0t(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return N0t(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return N0t(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=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 f0(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!h0(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&P0t(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||f0(this.options.enabled,this.#t)!==f0(t.enabled,this.#t)||d0(this.options.staleTime,this.#t)!==d0(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||f0(this.options.enabled,this.#t)!==f0(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return I0t(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#m.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.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(u0)),t}#g(){this.#b();let e=d0(this.options.staleTime,this.#t);if(l0||this.#r.isStale||!q1t(e))return;let t=J1t(this.#r.dataUpdatedAt,e)+1;this.#d=setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(l0||f0(this.options.enabled,this.#t)===!1||!q1t(this.#p)||this.#p===0)&&(this.#f=setInterval(()=>{(this.options.refetchIntervalInBackground||l0t.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d&&=(clearTimeout(this.#d),void 0)}#x(){this.#f&&=(clearInterval(this.#f),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&&M0t(e,t),o=i&&P0t(e,n,t,r);(a||o)&&(l={...l,...b0t(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=r0t(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=r0t(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,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:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:F0t(e,t),refetch:this.refetch,promise:this.#o,isEnabled:f0(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=e=>{x.status===`error`?e.reject(x.error):x.data!==void 0&&e.resolve(x.data)},r=()=>{t(this.#o=x.promise=u0t())},i=this.#o;switch(i.status){case`pending`:e.queryHash===n.queryHash&&t(i);break;case`fulfilled`:(x.status===`error`||x.data!==i.value)&&r();break;case`rejected`:(x.status!==`error`||x.error!==i.reason)&&r();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!h0(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){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.#y()}#C(e){_0.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function j0t(e,t){return f0(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&t.retryOnMount===!1)}function M0t(e,t){return j0t(e,t)||e.state.data!==void 0&&N0t(e,t,t.refetchOnMount)}function N0t(e,t,n){if(f0(t.enabled,e)!==!1&&d0(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&F0t(e,t)}return!1}function P0t(e,t,n,r){return(e!==t||f0(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&F0t(e,n)}function F0t(e,t){return f0(t.enabled,e)!==!1&&e.isStaleByTime(d0(t.staleTime,e))}function I0t(e,t){return!h0(e.getCurrentResult(),t)}var L0t=class extends c0{#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),h0(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&p0(t.mutationKey)!==p0(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??w0t();this.#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){_0.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)})})}},R0t=H.createContext(void 0),y0=e=>{let t=H.useContext(R0t);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},z0t=({client:e,children:t})=>(H.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,W.jsx)(R0t.Provider,{value:e,children:t})),B0t=H.createContext(!1),V0t=()=>H.useContext(B0t);B0t.Provider;function H0t(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var U0t=H.createContext(H0t()),W0t=()=>H.useContext(U0t),G0t=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},K0t=e=>{H.useEffect(()=>{e.clearReset()},[e])},q0t=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||c0t(n,[e.error,r])),J0t=e=>{if(e.suspense){let t=e=>e===`static`?e:Math.max(e??1e3,1e3),n=e.staleTime;e.staleTime=typeof n==`function`?(...e)=>t(n(...e)):t(n),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,1e3))}},Y0t=(e,t)=>e.isLoading&&e.isFetching&&!t,X0t=(e,t)=>e?.suspense&&t.isPending,Z0t=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Q0t(e,t,n){let r=V0t(),i=W0t(),a=y0(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o),o._optimisticResults=r?`isRestoring`:`optimistic`,J0t(o),G0t(o,i),K0t(i);let s=!a.getQueryCache().get(o.queryHash),[c]=H.useState(()=>new t(a,o)),l=c.getOptimisticResult(o),u=!r&&e.subscribed!==!1;if(H.useSyncExternalStore(H.useCallback(e=>{let t=u?c.subscribe(_0.batchCalls(e)):u0;return c.updateResult(),t},[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),H.useEffect(()=>{c.setOptions(o)},[o,c]),X0t(o,l))throw Z0t(o,c,i);if(q0t({result:l,errorResetBoundary:i,throwOnError:o.throwOnError,query:a.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw l.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,l),o.experimental_prefetchInRender&&!l0&&Y0t(l,r)&&(s?Z0t(o,c,i):a.getQueryCache().get(o.queryHash)?.promise)?.catch(u0).finally(()=>{c.updateResult()}),o.notifyOnChangeProps?l:c.trackResult(l)}function b0(e,t){return Q0t(e,A0t,t)}function $0t(e,t){let n=y0(t),[r]=H.useState(()=>new L0t(n,e));H.useEffect(()=>{r.setOptions(e)},[r,e]);let i=H.useSyncExternalStore(H.useCallback(e=>r.subscribe(_0.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=H.useCallback((e,t)=>{r.mutate(e,t).catch(u0)},[r]);if(i.error&&c0t(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}V();var x0=()=>{},S0={setDefaultMode:x0,setInputMode:x0,preload:x0,setTranslucent:x0,dismiss:x0,setFocusTo:x0,viewPositionInWindow:()=>Promise.resolve({x:0,y:0,width:0,height:0}),addListener:x0,removeListeners:x0,getConstants:()=>({keyboardBorderRadius:0})},C0={addListener:()=>({remove:x0})},e2t={addListener:()=>({remove:x0})},t2t={addListener:()=>({remove:x0})},n2t=B,r2t={synchronizeFocusedInputLayout:e=>{}},i2t=B,a2t=B,o2t=B;V();var w0=()=>{},s2t=()=>w0,c2t=e=>({value:e,addListener:w0,removeListener:w0,modify:w0,get:()=>e,set:w0}),l2t=c2t(0),u2t=c2t(null),d2t={enabled:!0,animated:{progress:new lf.Value(0),height:new lf.Value(0)},reanimated:{progress:l2t,height:l2t},layout:u2t,update:Promise.resolve,setKeyboardHandlers:s2t,setInputHandlers:s2t,setEnabled:w0},f2t=(0,H.createContext)(d2t),T0=()=>(0,H.useContext)(f2t),p2t=e=>e;V();function m2t(e){return t=>{let n=t,r=null,i=!1,a=()=>{if(i)return;let t=p2t(e.current);t&&(`workletEventHandler`in n?n.workletEventHandler.registerForEvents(t):n.current.registerForEvents(t),r=t)};return e.current?a():queueMicrotask(a),()=>{i=!0,r&&(`workletEventHandler`in n?n.workletEventHandler.unregisterFromEvents(r):n.current.unregisterFromEvents(r))}}}function h2t(e,t){let n=(0,H.useRef)(null);return n.current===null&&(n.current=new lf.Value(e,t)),n.current}var E0=!0,g2t={height:0,duration:0,timestamp:new Date().getTime(),target:-1,type:`default`,appearance:`light`};C0.addListener(`keyboardDidHide`,e=>{E0=!0,g2t=e}),C0.addListener(`keyboardWillShow`,e=>{E0=!1,g2t=e});var D0={setDefaultMode:S0.setDefaultMode,setInputMode:S0.setInputMode,setFocusTo:S0.setFocusTo,preload:S0.preload,setTranslucent:S0.setTranslucent,dismiss:async e=>{let t=e?.keepFocus??!1,n=e?.animated??!0;return new Promise(e=>{if(E0){e();return}let r=C0.addListener(`keyboardDidHide`,()=>{e(void 0),r.remove()});S0.dismiss(t,n)})},isVisible:()=>!E0,state:()=>g2t};YQ();var _2t=()=>()=>{},v2t=_2t,y2t=_2t;V(),EOt(),YQ();var b2t=TOt(),x2t=JQ.createAnimatedComponent(lf.createAnimatedComponent(n2t)),S2t=R.create({container:{flex:1},hidden:{display:`none`,position:`absolute`}}),O0=z.OS,C2t=e=>{let{children:t,statusBarTranslucent:n,navigationBarTranslucent:r,preserveEdgeToEdge:i,enabled:a=!0,preload:o=!0}=e,s=(0,H.useRef)(null),[c,l]=(0,H.useState)(a),u=h2t(0),d=h2t(0),f=fQ(0),p=fQ(0),m=fQ(null),h=m2t(s),g=m2t(s),_=(0,H.useCallback)(async()=>{r2t.synchronizeFocusedInputLayout(s.current),await new Promise(e=>{let t=e2t.addListener(`layoutDidSynchronize`,()=>{t.remove(),e(null)})})},[]),v=(0,H.useMemo)(()=>({enabled:c,animated:{progress:u,height:lf.multiply(d,-1)},reanimated:{progress:f,height:p},layout:m,update:_,setKeyboardHandlers:h,setInputHandlers:g,setEnabled:l}),[c]),y=(0,H.useMemo)(()=>[S2t.hidden,{transform:[{translateX:d},{translateY:u}]}],[]),b=(0,H.useMemo)(()=>lf.event([{nativeEvent:{progress:u,height:d}}],{useNativeDriver:z.OS!==`web`}),[]),x=(e,t)=>{"worklet";t.includes(O0)&&(f.value=e.progress,p.value=-e.height)},S=v2t({onKeyboardMoveStart:e=>{"worklet";x(e,[`ios`])},onKeyboardMove:e=>{"worklet";x(e,[`android`])},onKeyboardMoveInteractive:e=>{"worklet";x(e,[`android`,`ios`])},onKeyboardMoveEnd:e=>{"worklet";x(e,[`android`])}},[]),C=y2t({onFocusedInputLayoutChanged:e=>{"worklet";e.target===-1?m.value=null:m.value=e}},[]);return(0,H.useEffect)(()=>{o&&D0.preload()},[o]),H.createElement(f2t.Provider,{value:v},H.createElement(x2t,{ref:s,enabled:c,navigationBarTranslucent:b2t||r,statusBarTranslucent:b2t||n,preserveEdgeToEdge:b2t||i,style:S2t.container,onKeyboardMoveReanimated:S,onKeyboardMoveStart:O0===`ios`?b:void 0,onKeyboardMove:O0===`android`?b:void 0,onKeyboardMoveInteractive:b,onKeyboardMoveEnd:O0===`android`?b:void 0,onFocusedInputLayoutChangedReanimated:C},t),H.createElement(lf.View,{style:y}))},w2t=function(e){return e[e.SOFT_INPUT_ADJUST_NOTHING=48]=`SOFT_INPUT_ADJUST_NOTHING`,e[e.SOFT_INPUT_ADJUST_PAN=32]=`SOFT_INPUT_ADJUST_PAN`,e[e.SOFT_INPUT_ADJUST_RESIZE=16]=`SOFT_INPUT_ADJUST_RESIZE`,e[e.SOFT_INPUT_ADJUST_UNSPECIFIED=0]=`SOFT_INPUT_ADJUST_UNSPECIFIED`,e[e.SOFT_INPUT_IS_FORWARD_NAVIGATION=256]=`SOFT_INPUT_IS_FORWARD_NAVIGATION`,e[e.SOFT_INPUT_MASK_ADJUST=240]=`SOFT_INPUT_MASK_ADJUST`,e[e.SOFT_INPUT_MASK_STATE=15]=`SOFT_INPUT_MASK_STATE`,e[e.SOFT_INPUT_MODE_CHANGED=512]=`SOFT_INPUT_MODE_CHANGED`,e[e.SOFT_INPUT_STATE_ALWAYS_HIDDEN=3]=`SOFT_INPUT_STATE_ALWAYS_HIDDEN`,e[e.SOFT_INPUT_STATE_ALWAYS_VISIBLE=5]=`SOFT_INPUT_STATE_ALWAYS_VISIBLE`,e[e.SOFT_INPUT_STATE_HIDDEN=2]=`SOFT_INPUT_STATE_HIDDEN`,e[e.SOFT_INPUT_STATE_UNCHANGED=1]=`SOFT_INPUT_STATE_UNCHANGED`,e[e.SOFT_INPUT_STATE_UNSPECIFIED=0]=`SOFT_INPUT_STATE_UNSPECIFIED`,e[e.SOFT_INPUT_STATE_VISIBLE=4]=`SOFT_INPUT_STATE_VISIBLE`,e}({}),T2t=S0.getConstants().keyboardBorderRadius,k0=T2t>0;V();var E2t=Wo.get(`window`),D2t={width:E2t.width,height:E2t.height};t2t.addListener(`windowDidResize`,e=>{D2t=e});var O2t=()=>{let[e,t]=(0,H.useState)(D2t);return(0,H.useEffect)(()=>{let e=t2t.addListener(`windowDidResize`,e=>{t(e)});return t(D2t),()=>{e.remove()}},[]),e},k2t=[`keyboardWillShow`,`keyboardDidHide`],A2t=()=>({...D0.state(),isVisible:D0.isVisible()}),j2t=e=>e;function A0(e=j2t){let[t,n]=(0,H.useState)(()=>e(A2t()));return(0,H.useEffect)(()=>{let t=k2t.map(t=>C0.addListener(t,()=>n(e(A2t()))));return n(e(A2t())),()=>{t.forEach(e=>e.remove())}},[]),t}YQ();var M2t=()=>{(0,H.useEffect)(()=>(D0.setInputMode(w2t.SOFT_INPUT_ADJUST_RESIZE),()=>D0.setDefaultMode()),[])},N2t=()=>(M2t(),T0().reanimated);function P2t(e,t){let n=T0(),{doDependenciesDiffer:r}=xQ(e,t),i=yQ(t=>{"worklet";if(t.eventName.endsWith(`onKeyboardMoveStart`)){var n;(n=e.onStart)==null||n.call(e,t)}if(t.eventName.endsWith(`onKeyboardMove`)){var r;(r=e.onMove)==null||r.call(e,t)}if(t.eventName.endsWith(`onKeyboardMoveEnd`)){var i;(i=e.onEnd)==null||i.call(e,t)}if(t.eventName.endsWith(`onKeyboardMoveInteractive`)){var a;(a=e.onInteractive)==null||a.call(e,t)}},[`onKeyboardMoveStart`,`onKeyboardMove`,`onKeyboardMoveEnd`,`onKeyboardMoveInteractive`],r);(0,H.useLayoutEffect)(()=>{let e=n.setKeyboardHandlers(i);return()=>e()},t)}function F2t(e,t){M2t(),P2t(e,t)}function I2t(){let e=T0();return{input:e.layout,update:e.update}}function L2t(e,t){let n=T0(),{doDependenciesDiffer:r}=xQ(e,t),i=yQ(t=>{"worklet";if(t.eventName.endsWith(`onFocusedInputTextChanged`)){var n;(n=e.onChangeText)==null||n.call(e,t)}if(t.eventName.endsWith(`onFocusedInputSelectionChanged`)){var r;(r=e.onSelectionChange)==null||r.call(e,t)}},[`onFocusedInputTextChanged`,`onFocusedInputSelectionChanged`],r);(0,H.useLayoutEffect)(()=>{let e=n.setInputHandlers(i);return()=>e()},t)}YQ();var R2t=(...e)=>(0,H.useCallback)(t=>{for(let n of e)n&&(typeof n==`function`?n(t):n.current=t)},e);V(),YQ(),z.OS,YQ(),YQ();function z2t(){return z2t=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},z2t.apply(null,arguments)}var B2t=(0,H.forwardRef)(({children:e,offset:{closed:t=0,opened:n=0}={},style:r,enabled:i=!0,...a},o)=>{let{height:s,progress:c}=N2t(),l=mQ(()=>{let e=AQ(c.value,[0,1],[t,n]);return{transform:[{translateY:i?s.value+e:t}]}},[t,n,i]),u=(0,H.useMemo)(()=>[r,l],[r,l]);return H.createElement(JQ.View,z2t({ref:o,style:u},a),e)});YQ();var V2t=[`onScroll`,`onScrollBeginDrag`,`onScrollEndDrag`,`onMomentumScrollBegin`,`onMomentumScrollEnd`],H2t=(e,t=0)=>{let n=fQ(t),r=fQ({width:0,height:0}),i=fQ({width:0,height:0}),a=m2t(e),o=yQ(e=>{"worklet";n.value=e.contentOffset.y,r.value=e.layoutMeasurement,i.value=e.contentSize},V2t);return(0,H.useEffect)(()=>{let e=a(o);return()=>{e()}},[]),{offset:n,layout:r,size:i,onLayout:(0,H.useCallback)(e=>{r.value={width:e.nativeEvent.layout.width,height:e.nativeEvent.layout.height}},[r]),onContentSizeChange:(0,H.useCallback)((e,t)=>{i.value={width:e,height:t}},[i])}};V();var U2t=R.create({container:{flexGrow:1,flexShrink:1}});V(),YQ();function W2t(){return W2t=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},W2t.apply(null,arguments)}var G2t=z.OS===`android`?JQ.createAnimatedComponent(a2t):a2t,K2t=(0,H.forwardRef)(({ScrollViewComponent:e,bottomPadding:t,scrollIndicatorPadding:n,contentInset:r,scrollIndicatorInsets:i,inverted:a,contentOffsetY:o,applyWorkaroundForContentInsetHitTestBug:s,onContentInsetChange:c,children:l,...u},d)=>{let{contentOffset:f}=u,p=fQ(null);(0,H.useEffect)(()=>{o&&(o.value=f?.y??0)},[o,f?.y]);let m=CQ(()=>{let e=a?t.value:0,n=a?0:t.value;return{dynamic:{top:e,bottom:n},effective:{top:e+(r?.top||0),bottom:n+(r?.bottom||0),left:r?.left||0,right:r?.right||0}}},[a,r?.top,r?.bottom,r?.left,r?.right]);_Q(()=>m.value.effective,(e,t)=>{c&&(t&&e.top===t.top&&e.bottom===t.bottom&&e.left===t.left&&e.right===t.right||KQ(c)(e))},[c]);let h=gQ(()=>{let{dynamic:e,effective:r}=m.value,s=n??t,c=(a?s.value:0)+(i?.top||0),l={contentInset:r,scrollIndicatorInsets:{bottom:(a?0:s.value)+(i?.bottom||0),top:c,right:i?.right,left:i?.left},contentInsetBottom:e.bottom,contentInsetTop:e.top};if(o){let e=o.value;e!==p.value&&(p.value=e,l.contentOffset={x:f?.x??0,y:e})}return l},[i?.bottom,i?.top,i?.right,i?.left,a,o,f?.x]);return H.createElement(G2t,{animatedProps:h,applyWorkaroundForContentInsetHitTestBug:s,style:U2t.container},H.createElement(e,W2t({ref:d,animatedProps:h},u),l))});V(),YQ();var j0=z.OS===`android`&&z.Version>=30||z.OS===`ios`,q2t={duration:250,easing:XX.bezier(.19919472913616398,.010644531250000006,.27920937042459737,.91025390625)},J2t=(e,t)=>{let n=(0,H.useMemo)(()=>e,t??[]),r=fQ(-1),i=fQ(0),a=fQ(0),o=fQ(0);_Q(()=>{if(!j0&&a.value!==0)return{duration:q2t.duration,target:r.value,height:o.value,progress:o.value/a.value}},e=>{var t;if(e&&((t=n.onMove)==null||t.call(n,e),e.height===i.value)){var r;(r=n.onEnd)==null||r.call(n,e),a.value=i.value}},t&&[...t]),F2t({onStart:e=>{"worklet";var t;if(!j0&&e.height===a.value){var s,c;(s=n.onStart)==null||s.call(n,e),(c=n.onEnd)==null||c.call(n,e);return}r.value=e.target,i.value=e.height,e.height>0&&(a.value=e.height),j0||(o.value=QX(e.height,q2t)),(t=n.onStart)==null||t.call(n,{...e,duration:j0?e.duration:q2t.duration})},onMove:e=>{"worklet";if(j0){var t;(t=n.onMove)==null||t.call(n,e)}},onEnd:e=>{"worklet";if(j0){var t;(t=n.onEnd)==null||t.call(n,e)}}},t)},Y2t=(e,t=0)=>{"worklet";let n={time:0};return(...r)=>{"worklet";let i=Date.now();if(i-n.time<t){n.time=i;return}return n.time=i,e(...r)}},X2t=(e,t)=>{"worklet";let n;return t&&(n=t.find(t=>t>=e)),n??e};YQ();function M0(){return M0=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},M0.apply(null,arguments)}var Z2t=(0,H.forwardRef)(({children:e,onLayout:t,bottomOffset:n=0,disableScrollOnKeyboardHide:r=!1,enabled:i=!0,extraKeyboardSpace:a=0,mode:o=`insets`,ScrollViewComponent:s=JQ.ScrollView,snapToOffsets:c,...l},u)=>{let d=MFt(),f=H.useRef(null),p=R2t(d,f),m=fQ(null),h=fQ(0),{offset:g,layout:_,size:v}=H2t(d),y=fQ(0),b=fQ(0),x=fQ(!1),S=fQ(!1),C=fQ(-1),w=fQ(0),T=fQ(0),{input:E,update:D}=I2t(),O=fQ(null),k=fQ(null),A=fQ(-1),ee=fQ(!1),te=fQ(!1),ne=fQ(0),{height:re}=O2t(),ie=(0,H.useCallback)(async()=>{let e=p2t(d.current);if(m.value=e,e!==null)try{let{y:t}=await S0.viewPositionInWindow(e);ne.value=t}catch{}},[]),j=(0,H.useCallback)(e=>{ie(),t?.(e)},[t,ie]);(0,H.useEffect)(()=>{ie()},[ie]);let ae=(0,H.useCallback)((e,t=!1)=>{"worklet";if(!i||O.value?.parentScrollViewTarget!==m.value)return 0;let r=re-b.value,a=(O.value?.layout.absoluteY||0)+(O.value?.layout.height||0);if(r-a<=n){let r=b.value-(re-a)+n,i=AQ(e,[w.value,b.value],[0,X2t(r+h.value,c)-h.value]);return HQ(d,0,Math.max(i,0)+h.value,t),i}if(a<ne.value){let e=r-n;HQ(d,0,h.value+a-e,t)}return 0},[n,i,re,c]),oe=(0,H.useCallback)(e=>{"worklet";return o===`layout`?!1:S.value&&A.value>0?(HQ(d,0,h.value-AQ(e,[w.value,b.value],[A.value,0]),!1),!0):!1},[o]),se=(0,H.useCallback)(e=>{"worklet";let t=h.value;h.value=e,ae(b.value,!0),h.value=t},[h,b,ae]),M=(0,H.useCallback)(e=>{"worklet";y.value=AQ(e.height,[0,b.value],[0,b.value+a])},[a]),ce=(0,H.useCallback)(()=>{"worklet";var e;let t=k.value?.selection.end.y;return!((e=E.value)!=null&&e.layout)||t===void 0?!1:(O.value={...E.value,layout:{...E.value.layout,height:ALt(t,0,E.value.layout.height)}},!0)},[E,k,O]),N=(0,H.useCallback)(()=>{"worklet";let e=O.value;ce()&&(se(g.value),O.value=e)},[se]),P=(0,H.useCallback)(()=>{"worklet";N()},[N]),le=(0,H.useMemo)(()=>Y2t(P,200),[P]),ue=(0,H.useCallback)(e=>{"worklet";let t=k.value?.target,n=k.value?.selection;if(k.value=e,te.value=!0,e.target!==t||ee.value){ee.value&&(ee.value=!1,ce(),!x.value&&b.value>0&&(g.value+=ae(b.value,!0)));return}if(e.selection.end.position===e.selection.start.position&&n?.end.y!==e.selection.end.y||e.selection.start.position!==e.selection.end.position)return N();le()},[N,le,ce,ae]);L2t({onSelectionChange:ue},[ue]),J2t({onStart:e=>{"worklet";let t=b.value!==e.height&&e.height>0;x.value=e.height>0&&b.value===0,S.value=e.height===0;let n=C.value!==e.target&&e.target!==-1||t;t&&(w.value=b.value),S.value&&(w.value=0,h.value=T.value,ee.value=!1),(x.value||t||n)&&(h.value=g.value,b.value=e.height,o===`insets`&&M(e)),n&&(C.value=e.target,k.value?.target===e.target&&te.value?(ce(),ee.value=!1):(k.value?.target===e.target?ce():E.value&&(O.value=E.value),ee.value=!0),T.value=g.value),n&&!x.value&&(ee.value||(g.value+=ae(e.height,!0))),o===`insets`&&(A.value=g.value+_.value.height-v.value.height,A.value>0&&(h.value=g.value))},onMove:e=>{"worklet";ee.value&&k.value?.target!==C.value||oe(e.height)||(o===`layout`&&M(e),(!r||x.value)&&ae(e.height))},onEnd:e=>{"worklet";e.height===0&&oe(e.height),b.value=e.height,h.value=g.value,e.height===0?te.value=!1:x.value&&(ee.value=!1),M(e)}},[o,ae,oe,r,M]);let de=(0,H.useCallback)(async()=>{await D(),requestAnimationFrame(()=>{qQ(()=>{"worklet";N()})()})},[D,N]);(0,H.useImperativeHandle)(u,()=>{let e=f.current;if(e){let t=e;return t.assureFocusedInputVisible=()=>{de()},t}return{assureFocusedInputVisible:()=>{de()}}},[de]),(0,H.useEffect)(()=>{de()},[n]),_Q(()=>E.value,(e,t)=>{e?.target===t?.target&&e?.layout.height!==t?.layout.height&&N()},[]);let fe=CQ(()=>i?y.value:0,[i]),pe=mQ(()=>i&&o===`layout`?{paddingBottom:y.value+1}:{},[i,o]);return o===`layout`?H.createElement(s,M0({ref:p},l,{scrollEventThrottle:16,onLayout:j}),e,i&&H.createElement(JQ.View,{style:pe})):H.createElement(K2t,M0({ref:p},l,{bottomPadding:fe,scrollEventThrottle:16,ScrollViewComponent:s,onLayout:j}),e)});V();var Q2t=({type:e,disabled:t,theme:n})=>{let r=A0(e=>e.appearance),i=(0,H.useMemo)(()=>({backgroundColor:t?n[r].disabled:n[r].primary}),[t,n,r]),a=(0,H.useMemo)(()=>[N0.arrowLeftLine,i],[i]),o=(0,H.useMemo)(()=>[N0.arrowRightLine,i],[i]);return H.createElement(B,{style:e===`next`?N0.arrowDownContainer:N0.arrowUpContainer},H.createElement(B,{style:N0.arrow},H.createElement(lf.View,{style:a}),H.createElement(lf.View,{style:o})))},$2t={width:13,height:2,borderRadius:1},e4t={marginHorizontal:5,width:30,height:30,justifyContent:`center`,alignItems:`center`},N0=R.create({arrowUpContainer:e4t,arrowDownContainer:{...e4t,transform:[{rotate:`180deg`}]},arrow:{width:20,height:20,flexDirection:`row`,alignItems:`center`,justifyContent:`space-between`},arrowLeftLine:{...$2t,transform:[{rotate:`-45deg`}],left:-.5},arrowRightLine:{...$2t,transform:[{rotate:`45deg`}],left:-5.5}});V();var P0=z.select({android:({children:e,onPress:t,disabled:n,accessibilityLabel:r,accessibilityHint:i,testID:a,rippleRadius:o=18,style:s,theme:c})=>{let l=A0(e=>e.appearance),u=(0,H.useMemo)(()=>({disabled:n}),[n]),d=(0,H.useMemo)(()=>Zp.Ripple(c[l].ripple,!0,o),[l,o,c]);return H.createElement(Zp,{accessibilityHint:i,accessibilityLabel:r,accessibilityRole:`button`,accessibilityState:u,background:d,style:s,testID:a,onPress:t},H.createElement(B,{style:s},e))},default:({children:e,onPress:t,disabled:n,accessibilityLabel:r,accessibilityHint:i,testID:a,style:o})=>{let s=n?B:Yf,c=(0,H.useMemo)(()=>({disabled:n}),[n]);return H.createElement(s,{accessibilityHint:i,accessibilityLabel:r,accessibilityRole:`button`,accessibilityState:c,style:o,testID:a,onPress:t},e)}}),t4t={light:{primary:`#2c2c2c`,disabled:`#B0BEC5`,background:`#f3f3f4`,ripple:`#bcbcbcbc`},dark:{primary:`#fafafa`,disabled:`#707070`,background:`#2C2C2E`,ripple:`#F8F8F888`}},n4t=({children:e})=>H.createElement(H.Fragment,null,e),F0=`keyboard.toolbar`,r4t=`${F0}.previous`,i4t=`${F0}.next`,a4t=`${F0}.content`,o4t=`${F0}.done`,s4t=k0?-11:0;V();var I0=({children:e})=>H.createElement(B,{style:c4t.flex,testID:a4t},e),c4t=R.create({flex:{flex:1}}),l4t=(0,H.createContext)(void 0),u4t=()=>{let e=(0,H.useContext)(l4t);if(!e)throw Error(`KeyboardToolbar.* component must be used inside <KeyboardToolbar>`);return e};V();var d4t=({children:e,onPress:t,rippleRadius:n=28,text:r,button:i=P0})=>{let a=A0(e=>e.appearance),{theme:o}=u4t(),s=(0,H.useMemo)(()=>[f4t.doneButton,{color:o[a].primary}],[a,o]),c=(0,H.useCallback)(e=>{t?.(e),e.isDefaultPrevented()||D0.dismiss()},[t]);return H.createElement(i,{accessibilityHint:`Closes the keyboard`,accessibilityLabel:`Done`,rippleRadius:n,style:f4t.doneButtonContainer,testID:o4t,theme:o,onPress:c},H.createElement(_d,{maxFontSizeMultiplier:1.3,style:s},e??r??`Done`))},f4t=R.create({doneButton:{fontWeight:`600`,fontSize:15},doneButtonContainer:{marginRight:16,marginLeft:8}}),p4t=({children:e,onPress:t,disabled:n,rippleRadius:r,style:i,button:a=P0,icon:o=Q2t})=>{let{theme:s,isNextDisabled:c}=u4t(),l=n??c,u=(0,H.useCallback)(e=>{t?.(e),e.isDefaultPrevented()||D0.setFocusTo(`next`)},[t]);return H.createElement(a,{accessibilityHint:`Moves focus to the next field`,accessibilityLabel:`Next`,disabled:l,rippleRadius:r,style:i,testID:i4t,theme:s,onPress:u},e??H.createElement(o,{disabled:l,theme:s,type:`next`}))},m4t=({children:e,onPress:t,disabled:n,rippleRadius:r,style:i,button:a=P0,icon:o=Q2t})=>{let{theme:s,isPrevDisabled:c}=u4t(),l=n??c,u=(0,H.useCallback)(e=>{t?.(e),e.isDefaultPrevented()||D0.setFocusTo(`prev`)},[t]);return H.createElement(a,{accessibilityHint:`Moves focus to the previous field`,accessibilityLabel:`Previous`,disabled:l,rippleRadius:r,style:i,testID:r4t,theme:s,onPress:u},e??H.createElement(o,{disabled:l,theme:s,type:`prev`}))};V();function h4t(){return h4t=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},h4t.apply(null,arguments)}var L0=e=>{let{children:t,content:n,theme:r=t4t,doneText:i=`Done`,button:a,icon:o,showArrows:s=!0,onNextCallback:c,onPrevCallback:l,onDoneCallback:u,blur:d=null,opacity:f=`FF`,offset:{closed:p=0,opened:m=0}={},enabled:h=!0,insets:g,..._}=e,v=A0(e=>e.appearance),[y,b]=(0,H.useState)({current:0,count:0}),x=y.current===0,S=y.current===y.count-1,C=a??P0,w=o??Q2t;(0,H.useEffect)(()=>e2t.addListener(`focusDidSet`,e=>{b(e)}).remove,[]);let T=(0,H.useMemo)(()=>[R0.toolbar,{backgroundColor:`${r[v].background}${f}`},k0?null:{paddingLeft:g?.left,paddingRight:g?.right},k0?R0.floating:null],[v,f,r,g]),E=(0,H.useMemo)(()=>[R0.sticky,k0?{left:(g?.left??0)+16,right:(g?.right??0)+16}:null],[g]),D=(0,H.useMemo)(()=>({closed:p+42,opened:m+s4t}),[p,m]),O=null,k=null,A=null,ee=null;if(t){let e=null,n=null,r=null,i=null,a=null;H.Children.forEach(t,t=>{if(!H.isValidElement(t))return;let o=t.type;o===n4t?a=t:o===I0?r=t:o===m4t?e=t:o===p4t?n=t:o===d4t&&(i=t)}),O=a,ee=i,k=e||n?H.createElement(B,{style:R0.arrows},e,n):null,A=r??H.createElement(I0,null,r)}else O=d,k=s?H.createElement(B,{style:R0.arrows},H.createElement(m4t,{button:C,icon:w,onPress:l}),H.createElement(p4t,{button:C,icon:w,onPress:c})):null,A=H.createElement(I0,null,n),ee=i?H.createElement(d4t,{button:C,text:i,onPress:u}):null;let te=(0,H.useMemo)(()=>({theme:r,isPrevDisabled:x,isNextDisabled:S}),[r,x,S]);return H.createElement(l4t.Provider,{value:te},H.createElement(B2t,{enabled:h,offset:D,style:E},H.createElement(B,h4t({},_,{style:T,testID:F0}),O,k,A,ee)))},R0=R.create({sticky:{position:`absolute`,left:0,right:0,bottom:0,height:42},toolbar:{position:`absolute`,bottom:0,alignItems:`center`,width:`100%`,flexDirection:`row`,height:42},arrows:{flexDirection:`row`,paddingLeft:8},floating:{alignSelf:`center`,borderRadius:20,overflow:`hidden`}});L0.Background=n4t,L0.Content=I0,L0.Prev=m4t,L0.Next=p4t,L0.Done=d4t,L0.Group=o2t,YQ(),YQ(),YQ(),`nativeFabricUIManager`in globalThis,V(),YQ(),z.OS,YQ(),V(),YQ(),dX(0),dX(0),R.create({commitView:{display:`none`,position:`absolute`}}),V(),R.create({container:{position:`absolute`,bottom:0,top:0,left:0,right:0,height:999},rounded:{borderTopLeftRadius:T2t,borderTopRightRadius:T2t,overflow:`hidden`}}),V(),R.create({absolute:{position:`absolute`},stretch:{top:0,bottom:0,left:0,right:0}}),V(),lf.createAnimatedComponent(i2t);function g4t({children:e,style:t,onInsetsChange:n}){return b4t.useEffect(()=>{if(typeof document>`u`)return;let e=y4t();document.body.appendChild(e);let t=()=>{let{paddingTop:t,paddingBottom:r,paddingLeft:i,paddingRight:a}=window.getComputedStyle(e);n({nativeEvent:{insets:{top:t?parseInt(t,10):0,bottom:r?parseInt(r,10):0,left:i?parseInt(i,10):0,right:a?parseInt(a,10):0},frame:{x:0,y:0,width:document.documentElement.offsetWidth,height:document.documentElement.offsetHeight}}})};return e.addEventListener(_4t(),t),t(),()=>{document.body.removeChild(e),e.removeEventListener(_4t(),t)}},[n]),b4t.createElement(B,{style:t},e)}function _4t(){if(V0!=null)return V0;let e=document.createElement(`invalidtype`);V0=B0.Transition;for(let t in B0)if(e.style[t]!==void 0){V0=B0[t];break}return V0}function v4t(){if(H0!==null)return H0;let{CSS:e}=window;return H0=e&&e.supports&&e.supports(`top: constant(safe-area-inset-top)`)?`constant`:`env`,H0}function z0(e){return`${v4t()}(safe-area-inset-${e})`}function y4t(){let e=document.createElement(`div`),{style:t}=e;return t.position=`fixed`,t.left=`0`,t.top=`0`,t.width=`0`,t.height=`0`,t.zIndex=`-1`,t.overflow=`hidden`,t.visibility=`hidden`,t.transitionDuration=`0.05s`,t.transitionProperty=`padding`,t.transitionDelay=`0s`,t.paddingTop=z0(`top`),t.paddingBottom=z0(`bottom`),t.paddingLeft=z0(`left`),t.paddingRight=z0(`right`),e}var b4t,B0,V0,H0,x4t=o((()=>{b4t=u(p()),V(),B0={WebkitTransition:`webkitTransitionEnd`,Transition:`transitionEnd`,MozTransition:`transitionend`,MSTransition:`msTransitionEnd`,OTransition:`oTransitionEnd`},V0=null,H0=null}));function U0(){return U0=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},U0.apply(null,arguments)}function S4t({children:e,initialMetrics:t,initialSafeAreaInsets:n,style:r,...i}){let a=w4t(),o=T4t(),[s,c]=G0.useState(t?.insets??n??a??null),[l,u]=G0.useState(t?.frame??o??{x:0,y:0,width:Wo.get(`window`).width,height:Wo.get(`window`).height}),d=G0.useCallback(e=>{let{nativeEvent:{frame:t,insets:n}}=e;u(e=>t&&(t.height!==e.height||t.width!==e.width||t.x!==e.x||t.y!==e.y)?t:e),c(e=>!e||n.bottom!==e.bottom||n.left!==e.left||n.right!==e.right||n.top!==e.top?n:e)},[]);return G0.createElement(g4t,U0({style:[k4t.fill,r],onInsetsChange:d},i),s==null?null:G0.createElement(q0.Provider,{value:l},G0.createElement(K0.Provider,{value:s},e)))}function C4t({onChange:e,style:t,children:n,...r}){return G0.createElement(g4t,U0({},r,{style:[k4t.fill,t],onInsetsChange:t=>{e({insets:t.nativeEvent.insets,frame:t.nativeEvent.frame})}}),n)}function w4t(){return G0.useContext(K0)}function T4t(){return G0.useContext(q0)}function W0(){let e=G0.useContext(K0);if(e==null)throw Error(A4t);return e}function E4t(){let e=G0.useContext(q0);if(e==null)throw Error(A4t);return e}function D4t(e){return G0.forwardRef((t,n)=>{let r=W0();return G0.createElement(e,U0({},t,{insets:r,ref:n}))})}function O4t(){return W0()}var G0,K0,q0,k4t,A4t,j4t,M4t,N4t=o((()=>{G0=u(p()),V(),x4t(),K0=G0.createContext(null),q0=G0.createContext(null),k4t=R.create({fill:{flex:1}}),A4t="No safe area value available. Make sure you are rendering `<SafeAreaProvider>` at the top of your app.",j4t=K0.Consumer,M4t=K0}));function P4t(){return P4t=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},P4t.apply(null,arguments)}function J0(e,t,n){switch(n){case`maximum`:return Math.max(t,e);case`additive`:return t+e;default:return t}}var Y0,F4t,X0,I4t=o((()=>{Y0=u(p()),V(),N4t(),F4t={top:`additive`,left:`additive`,bottom:`additive`,right:`additive`},X0=Y0.forwardRef(({style:e={},mode:t,edges:n,...r},i)=>{let a=W0(),o=Y0.useMemo(()=>n==null?F4t:Array.isArray(n)?n.reduce((e,t)=>(e[t]=`additive`,e),{}):n,[n]),s=Y0.useMemo(()=>{let n=R.flatten(e);if(t===`margin`){let{margin:t=0,marginVertical:r=t,marginHorizontal:i=t,marginTop:s=r,marginRight:c=i,marginBottom:l=r,marginLeft:u=i}=n;return[e,{marginTop:J0(a.top,s,o.top),marginRight:J0(a.right,c,o.right),marginBottom:J0(a.bottom,l,o.bottom),marginLeft:J0(a.left,u,o.left)}]}else{let{padding:t=0,paddingVertical:r=t,paddingHorizontal:i=t,paddingTop:s=r,paddingRight:c=i,paddingBottom:l=r,paddingLeft:u=i}=n;return[e,{paddingTop:J0(a.top,s,o.top),paddingRight:J0(a.right,c,o.right),paddingBottom:J0(a.bottom,l,o.bottom),paddingLeft:J0(a.left,u,o.left)}]}},[o.bottom,o.left,o.right,o.top,a.bottom,a.left,a.right,a.top,t,e]);return Y0.createElement(B,P4t({style:s},r,{ref:i}))})})),L4t=o((()=>{})),R4t=o((()=>{})),z4t=c({SafeAreaConsumer:()=>j4t,SafeAreaContext:()=>M4t,SafeAreaFrameContext:()=>q0,SafeAreaInsetsContext:()=>K0,SafeAreaListener:()=>C4t,SafeAreaProvider:()=>S4t,SafeAreaView:()=>X0,initialWindowMetrics:()=>null,initialWindowSafeAreaInsets:()=>null,useSafeArea:()=>O4t,useSafeAreaFrame:()=>E4t,useSafeAreaInsets:()=>W0,withSafeAreaInsets:()=>D4t}),Z0=o((()=>{N4t(),I4t(),L4t(),R4t()}));Z0();var B4t=new k0t({defaultOptions:{queries:{gcTime:1/0}}});V();function V4t(e){let t=e.uri;if(typeof e==`string`)return{sourceName:e};if(typeof e==`object`&&!t)return{sourceJson:JSON.stringify(e)};if(typeof e==`object`&&t)return t.includes(`.lottie`)?{sourceDotLottieURI:t}:{sourceURL:t};if(typeof e==`number`)return{sourceDotLottieURI:Zu.resolveAssetSource(e).uri}}function Q0(e){"@babel/helpers - typeof";return Q0=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},Q0(e)}function H4t(e,t){if(Q0(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Q0(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function U4t(e){var t=H4t(e,`string`);return Q0(t)==`symbol`?t:t+``}function $0(e,t,n){return(t=U4t(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var W4t=class{requestAnimationFrame(e){return requestAnimationFrame(e)}cancelAnimationFrame(e){cancelAnimationFrame(e)}},G4t=class{constructor(){$0(this,`_lastHandleId`,0),$0(this,`_lastImmediate`,null)}requestAnimationFrame(e){return this._lastHandleId>=2**53-1&&(this._lastHandleId=0),this._lastHandleId+=1,this._lastImmediate=setImmediate(()=>{e(Date.now())}),this._lastHandleId}cancelAnimationFrame(e){this._lastImmediate&&clearImmediate(this._lastImmediate)}},K4t=class{constructor(){$0(this,`_strategy`,void 0),this._strategy=typeof requestAnimationFrame==`function`?new W4t:new G4t}requestAnimationFrame(e){return this._strategy.requestAnimationFrame(e)}cancelAnimationFrame(e){this._strategy.cancelAnimationFrame(e)}},e2=typeof window<`u`&&window.document!==void 0,q4t=new Uint8Array([80,75,3,4]),J4t=[`v`,`ip`,`op`,`layers`,`fr`,`w`,`h`],Y4t=`0.70.0`,X4t=`@lottiefiles/dotlottie-web`,G,Z4t=typeof TextDecoder<`u`?new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error(`TextDecoder not available`)}};typeof TextDecoder<`u`&&Z4t.decode();var t2=null;function n2(){return(t2===null||t2.byteLength===0)&&(t2=new Uint8Array(G.memory.buffer)),t2}function r2(e,t){return e>>>=0,Z4t.decode(n2().subarray(e,e+t))}function Q4t(e){let t=G.__externref_table_alloc_command_export();return G.__wbindgen_export_3.set(t,e),t}function $4t(e,t){try{return e.apply(this,t)}catch(e){let t=Q4t(e);G.__wbindgen_exn_store_command_export(t)}}var i2=0,a2=typeof TextEncoder<`u`?new TextEncoder(`utf-8`):{encode:()=>{throw Error(`TextEncoder not available`)}},e3t=typeof a2.encodeInto==`function`?function(e,t){return a2.encodeInto(e,t)}:function(e,t){let n=a2.encode(e);return t.set(n),{read:e.length,written:n.length}};function o2(e,t,n){if(n===void 0){let n=a2.encode(e),r=t(n.length,1)>>>0;return n2().subarray(r,r+n.length).set(n),i2=n.length,r}let r=e.length,i=t(r,1)>>>0,a=n2(),o=0;for(;o<r;o++){let t=e.charCodeAt(o);if(t>127)break;a[i+o]=t}if(o!==r){o!==0&&(e=e.slice(o)),i=n(i,r,r=o+e.length*3,1)>>>0;let t=n2().subarray(i+o,i+r),a=e3t(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return i2=o,i}var s2=null;function c2(){return(s2===null||s2.buffer.detached===!0||s2.buffer.detached===void 0&&s2.buffer!==G.memory.buffer)&&(s2=new DataView(G.memory.buffer)),s2}function t3t(e){return e==null}var l2=null;function n3t(){return(l2===null||l2.byteLength===0)&&(l2=new Float32Array(G.memory.buffer)),l2}function r3t(e,t){let n=t(e.length*4,4)>>>0;return n3t().set(e,n/4),i2=e.length,n}function i3t(e,t){let n=t(e.length*1,1)>>>0;return n2().set(e,n/1),i2=e.length,n}function a3t(e,t){let n=t(e.length*4,4)>>>0;for(let t=0;t<e.length;t++){let r=Q4t(e[t]);c2().setUint32(n+4*t,r,!0)}return i2=e.length,n}function o3t(e,t){let n=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),r=i2,i=i3t(t,G.__wbindgen_malloc_command_export),a=i2;return G.register_font(n,r,i,a)!==0}var u2=Object.freeze({Forward:0,0:`Forward`,Reverse:1,1:`Reverse`,Bounce:2,2:`Bounce`,ReverseBounce:3,3:`ReverseBounce`}),s3t=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>G.__wbg_dotlottieplayerwasm_free(e>>>0,1)),c3t=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,s3t.unregister(this),e}free(){let e=this.__destroy_into_raw();G.__wbg_dotlottieplayerwasm_free(e,0)}clear_slot(e){let t=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),n=i2;return G.dotlottieplayerwasm_clear_slot(this.__wbg_ptr,t,n)!==0}is_playing(){return G.dotlottieplayerwasm_is_playing(this.__wbg_ptr)!==0}is_stopped(){return G.dotlottieplayerwasm_is_stopped(this.__wbg_ptr)!==0}layout_fit(){let e,t;try{let n=G.dotlottieplayerwasm_layout_fit(this.__wbg_ptr);return e=n[0],t=n[1],r2(n[0],n[1])}finally{G.__wbindgen_free_command_export(e,t,1)}}loop_count(){return G.dotlottieplayerwasm_loop_count(this.__wbg_ptr)>>>0}poll_event(){return G.dotlottieplayerwasm_poll_event(this.__wbg_ptr)}reset_slot(e){let t=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),n=i2;return G.dotlottieplayerwasm_reset_slot(this.__wbg_ptr,t,n)!==0}set_layout(e,t,n){let r=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),i=i2;return G.dotlottieplayerwasm_set_layout(this.__wbg_ptr,r,i,t,n)!==0}set_marker(e){let t=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),n=i2;G.dotlottieplayerwasm_set_marker(this.__wbg_ptr,t,n)}clear_slots(){return G.dotlottieplayerwasm_clear_slots(this.__wbg_ptr)!==0}has_segment(){return G.dotlottieplayerwasm_has_segment(this.__wbg_ptr)!==0}is_complete(){return G.dotlottieplayerwasm_is_complete(this.__wbg_ptr)!==0}is_tweening(){return G.dotlottieplayerwasm_is_tweening(this.__wbg_ptr)!==0}reset_slots(){return G.dotlottieplayerwasm_reset_slots(this.__wbg_ptr)!==0}reset_theme(){return G.dotlottieplayerwasm_reset_theme(this.__wbg_ptr)!==0}segment_end(){return G.dotlottieplayerwasm_segment_end(this.__wbg_ptr)}set_quality(e){return G.dotlottieplayerwasm_set_quality(this.__wbg_ptr,e)!==0}set_segment(e,t){return G.dotlottieplayerwasm_set_segment(this.__wbg_ptr,e,t)!==0}static unload_font(e){let t=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),n=i2;return G.dotlottieplayerwasm_unload_font(t,n)!==0}animation_id(){let e=G.dotlottieplayerwasm_animation_id(this.__wbg_ptr),t;return e[0]!==0&&(t=r2(e[0],e[1]).slice(),G.__wbindgen_free_command_export(e[0],e[1]*1,1)),t}clear_marker(){G.dotlottieplayerwasm_clear_marker(this.__wbg_ptr)}emit_on_loop(){G.dotlottieplayerwasm_emit_on_loop(this.__wbg_ptr)}get_slot_ids(){return G.dotlottieplayerwasm_get_slot_ids(this.__wbg_ptr)}get_slot_str(e){let t=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),n=i2,r=G.dotlottieplayerwasm_get_slot_str(this.__wbg_ptr,t,n),i;return r[0]!==0&&(i=r2(r[0],r[1]).slice(),G.__wbindgen_free_command_export(r[0],r[1]*1,1)),i}marker_names(){return G.dotlottieplayerwasm_marker_names(this.__wbg_ptr)}set_autoplay(e){G.dotlottieplayerwasm_set_autoplay(this.__wbg_ptr,e)}set_slot_str(e,t){let n=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),r=i2,i=o2(t,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),a=i2;return G.dotlottieplayerwasm_set_slot_str(this.__wbg_ptr,n,r,i,a)!==0}set_viewport(e,t,n,r){return G.dotlottieplayerwasm_set_viewport(this.__wbg_ptr,e,t,n,r)!==0}total_frames(){return G.dotlottieplayerwasm_total_frames(this.__wbg_ptr)}clear_segment(){return G.dotlottieplayerwasm_clear_segment(this.__wbg_ptr)!==0}current_frame(){return G.dotlottieplayerwasm_current_frame(this.__wbg_ptr)}get_slot_type(e){let t=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),n=i2,r=G.dotlottieplayerwasm_get_slot_type(this.__wbg_ptr,t,n),i;return r[0]!==0&&(i=r2(r[0],r[1]).slice(),G.__wbindgen_free_command_export(r[0],r[1]*1,1)),i}get_slots_str(){let e,t;try{let n=G.dotlottieplayerwasm_get_slots_str(this.__wbg_ptr);return e=n[0],t=n[1],r2(n[0],n[1])}finally{G.__wbindgen_free_command_export(e,t,1)}}get_transform(){return G.dotlottieplayerwasm_get_transform(this.__wbg_ptr)}request_frame(){return G.dotlottieplayerwasm_request_frame(this.__wbg_ptr)}segment_start(){return G.dotlottieplayerwasm_segment_start(this.__wbg_ptr)}set_slots_str(e){let t=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),n=i2;return G.dotlottieplayerwasm_set_slots_str(this.__wbg_ptr,t,n)!==0}set_text_slot(e,t){let n=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),r=i2,i=o2(t,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),a=i2;return G.dotlottieplayerwasm_set_text_slot(this.__wbg_ptr,n,r,i,a)!==0}set_transform(e){let t=r3t(e,G.__wbindgen_malloc_command_export),n=i2;return G.dotlottieplayerwasm_set_transform(this.__wbg_ptr,t,n)!==0}sm_get_inputs(){return G.dotlottieplayerwasm_sm_get_inputs(this.__wbg_ptr)}sm_poll_event(){return G.dotlottieplayerwasm_sm_poll_event(this.__wbg_ptr)}sm_post_click(e,t){G.dotlottieplayerwasm_sm_post_click(this.__wbg_ptr,e,t)}animation_size(){return G.dotlottieplayerwasm_animation_size(this.__wbg_ptr)}current_marker(){let e=G.dotlottieplayerwasm_current_marker(this.__wbg_ptr),t;return e[0]!==0&&(t=r2(e[0],e[1]).slice(),G.__wbindgen_free_command_export(e[0],e[1]*1,1)),t}layout_align_x(){return G.dotlottieplayerwasm_layout_align_x(this.__wbg_ptr)}layout_align_y(){return G.dotlottieplayerwasm_layout_align_y(this.__wbg_ptr)}load_animation(e,t,n){let r=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),i=i2;return G.dotlottieplayerwasm_load_animation(this.__wbg_ptr,r,i,t,n)!==0}loop_animation(){return G.dotlottieplayerwasm_loop_animation(this.__wbg_ptr)!==0}set_color_slot(e,t,n,r){let i=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),a=i2;return G.dotlottieplayerwasm_set_color_slot(this.__wbg_ptr,i,a,t,n,r)!==0}set_loop_count(e){G.dotlottieplayerwasm_set_loop_count(this.__wbg_ptr,e)}set_theme_data(e){let t=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),n=i2;return G.dotlottieplayerwasm_set_theme_data(this.__wbg_ptr,t,n)!==0}sm_reset_input(e){let t=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),n=i2;G.dotlottieplayerwasm_sm_reset_input(this.__wbg_ptr,t,n)}manifest_string(){let e,t;try{let n=G.dotlottieplayerwasm_manifest_string(this.__wbg_ptr);return e=n[0],t=n[1],r2(n[0],n[1])}finally{G.__wbindgen_free_command_export(e,t,1)}}set_scalar_slot(e,t){let n=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),r=i2;return G.dotlottieplayerwasm_set_scalar_slot(this.__wbg_ptr,n,r,t)!==0}set_vector_slot(e,t,n){let r=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),i=i2;return G.dotlottieplayerwasm_set_vector_slot(this.__wbg_ptr,r,i,t,n)!==0}background_color(){return G.dotlottieplayerwasm_background_color(this.__wbg_ptr)>>>0}get_layer_bounds(e){let t=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),n=i2;return G.dotlottieplayerwasm_get_layer_bounds(this.__wbg_ptr,t,n)}get_pixel_buffer(){return G.dotlottieplayerwasm_get_pixel_buffer(this.__wbg_ptr)}segment_duration(){return G.dotlottieplayerwasm_segment_duration(this.__wbg_ptr)}sm_current_state(){let e,t;try{let n=G.dotlottieplayerwasm_sm_current_state(this.__wbg_ptr);return e=n[0],t=n[1],r2(n[0],n[1])}finally{G.__wbindgen_free_command_export(e,t,1)}}state_machine_id(){let e=G.dotlottieplayerwasm_state_machine_id(this.__wbg_ptr),t;return e[0]!==0&&(t=r2(e[0],e[1]).slice(),G.__wbindgen_free_command_export(e[0],e[1]*1,1)),t}get_state_machine(e){let t=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),n=i2,r=G.dotlottieplayerwasm_get_state_machine(this.__wbg_ptr,t,n),i;return r[0]!==0&&(i=r2(r[0],r[1]).slice(),G.__wbindgen_free_command_export(r[0],r[1]*1,1)),i}set_position_slot(e,t,n){let r=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),i=i2;return G.dotlottieplayerwasm_set_position_slot(this.__wbg_ptr,r,i,t,n)!==0}current_loop_count(){return G.dotlottieplayerwasm_current_loop_count(this.__wbg_ptr)>>>0}sm_framework_setup(){return G.dotlottieplayerwasm_sm_framework_setup(this.__wbg_ptr)}sm_post_pointer_up(e,t){G.dotlottieplayerwasm_sm_post_pointer_up(this.__wbg_ptr,e,t)}state_machine_load(e){let t=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),n=i2;return G.dotlottieplayerwasm_state_machine_load(this.__wbg_ptr,t,n)!==0}load_dotlottie_data(e,t,n){let r=i3t(e,G.__wbindgen_malloc_command_export),i=i2;return G.dotlottieplayerwasm_load_dotlottie_data(this.__wbg_ptr,r,i,t,n)!==0}sm_get_string_input(e){let t=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),n=i2,r=G.dotlottieplayerwasm_sm_get_string_input(this.__wbg_ptr,t,n),i;return r[0]!==0&&(i=r2(r[0],r[1]).slice(),G.__wbindgen_free_command_export(r[0],r[1]*1,1)),i}sm_set_string_input(e,t){let n=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),r=i2,i=o2(t,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),a=i2;return G.dotlottieplayerwasm_sm_set_string_input(this.__wbg_ptr,n,r,i,a)!==0}set_background_color(e){return G.dotlottieplayerwasm_set_background_color(this.__wbg_ptr,e)!==0}sm_get_boolean_input(e){let t=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),n=i2,r=G.dotlottieplayerwasm_sm_get_boolean_input(this.__wbg_ptr,t,n);return r===16777215?void 0:r!==0}sm_get_numeric_input(e){let t=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),n=i2,r=G.dotlottieplayerwasm_sm_get_numeric_input(this.__wbg_ptr,t,n);return r===4294967297?void 0:r}sm_post_pointer_down(e,t){G.dotlottieplayerwasm_sm_post_pointer_down(this.__wbg_ptr,e,t)}sm_post_pointer_exit(e,t){G.dotlottieplayerwasm_sm_post_pointer_exit(this.__wbg_ptr,e,t)}sm_post_pointer_move(e,t){G.dotlottieplayerwasm_sm_post_pointer_move(this.__wbg_ptr,e,t)}sm_set_boolean_input(e,t){let n=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),r=i2;return G.dotlottieplayerwasm_sm_set_boolean_input(this.__wbg_ptr,n,r,t)!==0}sm_set_numeric_input(e,t){let n=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),r=i2;return G.dotlottieplayerwasm_sm_set_numeric_input(this.__wbg_ptr,n,r,t)!==0}state_machine_unload(){G.dotlottieplayerwasm_state_machine_unload(this.__wbg_ptr)}sm_post_pointer_enter(e,t){G.dotlottieplayerwasm_sm_post_pointer_enter(this.__wbg_ptr,e,t)}clear_background_color(){return G.dotlottieplayerwasm_clear_background_color(this.__wbg_ptr)!==0}load_animation_from_id(e,t,n){let r=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),i=i2;return G.dotlottieplayerwasm_load_animation_from_id(this.__wbg_ptr,r,i,t,n)!==0}sm_poll_internal_event(){return G.dotlottieplayerwasm_sm_poll_internal_event(this.__wbg_ptr)}use_frame_interpolation(){return G.dotlottieplayerwasm_use_frame_interpolation(this.__wbg_ptr)!==0}reset_current_loop_count(){G.dotlottieplayerwasm_reset_current_loop_count(this.__wbg_ptr)}sm_override_current_state(e,t){let n=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),r=i2;return G.dotlottieplayerwasm_sm_override_current_state(this.__wbg_ptr,n,r,t)!==0}state_machine_load_from_id(e){let t=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),n=i2;return G.dotlottieplayerwasm_state_machine_load_from_id(this.__wbg_ptr,t,n)!==0}set_use_frame_interpolation(e){G.dotlottieplayerwasm_set_use_frame_interpolation(this.__wbg_ptr,e)}constructor(){return this.__wbg_ptr=G.dotlottieplayerwasm_new()>>>0,s3t.register(this,this.__wbg_ptr,this),this}mode(){return G.dotlottieplayerwasm_mode(this.__wbg_ptr)}play(){return G.dotlottieplayerwasm_play(this.__wbg_ptr)!==0}seek(e){return G.dotlottieplayerwasm_seek(this.__wbg_ptr,e)!==0}stop(){return G.dotlottieplayerwasm_stop(this.__wbg_ptr)!==0}tick(){return G.dotlottieplayerwasm_tick(this.__wbg_ptr)!==0}clear(){G.dotlottieplayerwasm_clear(this.__wbg_ptr)}pause(){return G.dotlottieplayerwasm_pause(this.__wbg_ptr)!==0}speed(){return G.dotlottieplayerwasm_speed(this.__wbg_ptr)}width(){return G.dotlottieplayerwasm_width(this.__wbg_ptr)>>>0}height(){return G.dotlottieplayerwasm_height(this.__wbg_ptr)>>>0}render(){return G.dotlottieplayerwasm_render(this.__wbg_ptr)!==0}resize(e,t){return G.dotlottieplayerwasm_resize(this.__wbg_ptr,e,t)!==0}markers(){return G.dotlottieplayerwasm_markers(this.__wbg_ptr)}sm_fire(e){let t=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),n=i2;return G.dotlottieplayerwasm_sm_fire(this.__wbg_ptr,t,n)!==0}sm_stop(){return G.dotlottieplayerwasm_sm_stop(this.__wbg_ptr)!==0}sm_tick(){return G.dotlottieplayerwasm_sm_tick(this.__wbg_ptr)!==0}autoplay(){return G.dotlottieplayerwasm_autoplay(this.__wbg_ptr)!==0}duration(){return G.dotlottieplayerwasm_duration(this.__wbg_ptr)}set_loop(e){G.dotlottieplayerwasm_set_loop(this.__wbg_ptr,e)}set_mode(e){G.dotlottieplayerwasm_set_mode(this.__wbg_ptr,e)}sm_start(e,t){let n=a3t(t,G.__wbindgen_malloc_command_export),r=i2;return G.dotlottieplayerwasm_sm_start(this.__wbg_ptr,e,n,r)!==0}theme_id(){let e=G.dotlottieplayerwasm_theme_id(this.__wbg_ptr),t;return e[0]!==0&&(t=r2(e[0],e[1]).slice(),G.__wbindgen_free_command_export(e[0],e[1]*1,1)),t}intersect(e,t,n){let r=o2(n,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),i=i2;return G.dotlottieplayerwasm_intersect(this.__wbg_ptr,e,t,r,i)!==0}is_loaded(){return G.dotlottieplayerwasm_is_loaded(this.__wbg_ptr)!==0}is_paused(){return G.dotlottieplayerwasm_is_paused(this.__wbg_ptr)!==0}load_font(e,t){let n=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),r=i2,i=i3t(t,G.__wbindgen_malloc_command_export),a=i2;return G.dotlottieplayerwasm_load_font(this.__wbg_ptr,n,r,i,a)!==0}set_frame(e){return G.dotlottieplayerwasm_set_frame(this.__wbg_ptr,e)!==0}set_speed(e){G.dotlottieplayerwasm_set_speed(this.__wbg_ptr,e)}set_theme(e){let t=o2(e,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),n=i2;return G.dotlottieplayerwasm_set_theme(this.__wbg_ptr,t,n)!==0}sm_status(){let e,t;try{let n=G.dotlottieplayerwasm_sm_status(this.__wbg_ptr);return e=n[0],t=n[1],r2(n[0],n[1])}finally{G.__wbindgen_free_command_export(e,t,1)}}};async function l3t(e,t){if(typeof Response==`function`&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming==`function`)try{return await WebAssembly.instantiateStreaming(e,t)}catch(t){if(e.headers.get(`Content-Type`)!=`application/wasm`)console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",t);else throw t}let n=await e.arrayBuffer();return await WebAssembly.instantiate(n,t)}else{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}}function u3t(){let e={};return e.wbg={},e.wbg.__wbg_buffer_609cc3eee51ed158=function(e){return e.buffer},e.wbg.__wbg_error_7534b8e9a36f1ab4=function(e,t){let n,r;try{n=e,r=t,console.error(r2(e,t))}finally{G.__wbindgen_free_command_export(n,r,1)}},e.wbg.__wbg_new_405e22f390576ce2=function(){return{}},e.wbg.__wbg_new_78feb108b6472713=function(){return[]},e.wbg.__wbg_new_8a6f238a6ece86ea=function(){return Error()},e.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a=function(e,t,n){return new Uint8Array(e,t>>>0,n>>>0)},e.wbg.__wbg_newwithlength_5a5efe313cfd59f1=function(e){return new Float32Array(e>>>0)},e.wbg.__wbg_now_807e54c39636c349=function(){return Date.now()},e.wbg.__wbg_push_737cfc8c1432c2c6=function(e,t){return e.push(t)},e.wbg.__wbg_set_bb8cecf6a62b9f46=function(){return $4t(function(e,t,n){return Reflect.set(e,t,n)},arguments)},e.wbg.__wbg_setindex_4e73afdcd9bb95cd=function(e,t,n){e[t>>>0]=n},e.wbg.__wbg_stack_0ed75d68575b0f3c=function(e,t){let n=t.stack,r=o2(n,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),i=i2;c2().setInt32(e+4,i,!0),c2().setInt32(e+0,r,!0)},e.wbg.__wbindgen_init_externref_table=function(){let e=G.__wbindgen_export_3,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)},e.wbg.__wbindgen_memory=function(){return G.memory},e.wbg.__wbindgen_number_new=function(e){return e},e.wbg.__wbindgen_string_get=function(e,t){let n=t,r=typeof n==`string`?n:void 0;var i=t3t(r)?0:o2(r,G.__wbindgen_malloc_command_export,G.__wbindgen_realloc_command_export),a=i2;c2().setInt32(e+4,a,!0),c2().setInt32(e+0,i,!0)},e.wbg.__wbindgen_string_new=function(e,t){return r2(e,t)},e.wbg.__wbindgen_throw=function(e,t){throw Error(r2(e,t))},e}function d3t(e,t){return G=e.exports,f3t.__wbindgen_wasm_module=t,s2=null,l2=null,t2=null,G.__wbindgen_start(),G}async function f3t(e){if(G!==void 0)return G;if(e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn(`using deprecated parameters for the initialization function; pass a single object instead`)),e===void 0)throw Error(`WASM module URL must be provided via DotLottieWasmLoader or setWasmUrl().`);let t=u3t();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await l3t(await e,t);return d3t(n,r)}var p3t=class{constructor(){$0(this,`_eventListeners`,new Map)}addEventListener(e,t){let n=this._eventListeners.get(e);n||(n=new Set,this._eventListeners.set(e,n)),n.add(t)}removeEventListener(e,t){let n=this._eventListeners.get(e);n&&(t?(n.delete(t),n.size===0&&this._eventListeners.delete(e)):this._eventListeners.delete(e))}dispatch(e){this._eventListeners.get(e.type)?.forEach(t=>t(e))}removeAllEventListeners(){this._eventListeners.clear()}},d2=class e{static _initializeObserver(){e._observer||=new IntersectionObserver(t=>{t.forEach(t=>{let n=e._observedCanvases.get(t.target);n&&(t.isIntersecting?n.unfreeze():n.freeze())})},{threshold:0})}static observe(t,n){e._initializeObserver(),!e._observedCanvases.has(t)&&(e._observedCanvases.set(t,n),e._observer?.observe(t))}static unobserve(t){e._observer?.unobserve(t),e._observedCanvases.delete(t),e._observedCanvases.size===0&&(e._observer?.disconnect(),e._observer=null)}};$0(d2,`_observer`,null),$0(d2,`_observedCanvases`,new Map);var f2=class e{static _initializeObserver(){e._observer||=new ResizeObserver(t=>{t.forEach(t=>{let n=e._observedCanvases.get(t.target);if(!n)return;let[r,i]=n;clearTimeout(i);let a=setTimeout(()=>{r.resize()},100);e._observedCanvases.set(t.target,[r,a])})})}static observe(t,n){e._initializeObserver(),!e._observedCanvases.has(t)&&(e._observedCanvases.set(t,[n,0]),e._observer?.observe(t))}static unobserve(t){let n=e._observedCanvases.get(t);if(n){let e=n[1];e&&clearTimeout(e)}e._observer?.unobserve(t),e._observedCanvases.delete(t),!e._observedCanvases.size&&e._observer&&(e._observer.disconnect(),e._observer=null)}};$0(f2,`_observer`,null),$0(f2,`_observedCanvases`,new Map);function m3t(e){return/^#([\da-f]{6}|[\da-f]{8})$/iu.test(e)}function h3t(e){if(!m3t(e))return 0;let t=e.replace(`#`,``);return t=t.length===6?`${t}ff`:t,parseInt(t,16)}function g3t(e){if(e.byteLength<4)return!1;let t=new Uint8Array(e.slice(0,q4t.byteLength));for(let e=0;e<q4t.length;e+=1)if(q4t[e]!==t[e])return!1;return!0}function _3t(e){return J4t.every(t=>Object.hasOwn(e,t))}function v3t(e){if(typeof e==`string`)try{return _3t(JSON.parse(e))}catch{return!1}else return _3t(e)}function p2(){return 1+((e2?window.devicePixelRatio:1)-1)*.75}function m2(e){let t=e.getBoundingClientRect(),n=window.innerHeight||document.documentElement.clientHeight,r=window.innerWidth||document.documentElement.clientWidth;return!(t.bottom<0||t.top>n||t.right<0||t.left>r)}function h2(e){let t=e.target;if(t instanceof HTMLCanvasElement){let n=t.getBoundingClientRect();if(n.width===0||n.height===0||t.width===0||t.height===0)return null;let r=t.width/n.width,i=t.height/n.height,a=(e.clientX-n.left)*r,o=(e.clientY-n.top)*i;return!Number.isFinite(a)||!Number.isFinite(o)||Number.isNaN(a)||Number.isNaN(o)?null:{x:a,y:o}}return null}function y3t(e){let t=e.replace(`OpenUrl: `,``),n=t.indexOf(` | Target: `),r,i;n===-1?(r=t,i=`_blank`):(r=t.substring(0,n),i=t.substring(n+11)),window.open(r,i)}function b3t(e,t,n){let r=null,i=t;return{load(){return r||=e({module_or_path:i}).then(()=>void 0).catch(async t=>{console.warn(`Primary WASM load failed from ${i}: ${t.message}`),console.warn(`Attempting to load WASM from backup URL: ${n}`);try{await e({module_or_path:n})}catch(e){throw console.error(`Primary WASM URL failed: ${t.message}`),console.error(`Backup WASM URL failed: ${e.message}`),r=null,Error(`WASM loading failed from all sources.`)}}),r},setWasmUrl(e){e!==i&&(i=e,r=null)}}}var x3t=b3t(f3t,`https://cdn.jsdelivr.net/npm/${X4t}@${Y4t}/dist/dotlottie-player.wasm`,`https://unpkg.com/${X4t}@${Y4t}/dist/dotlottie-player.wasm`),S3t=e=>{switch(e){case`reverse`:return u2.Reverse;case`bounce`:return u2.Bounce;case`reverse-bounce`:return u2.ReverseBounce;default:return u2.Forward}},C3t=e=>{switch(e){case u2.Reverse:return`reverse`;case u2.Bounce:return`bounce`;case u2.ReverseBounce:return`reverse-bounce`;default:return`forward`}},w3t=e=>{switch(e){case`contain`:return`contain`;case`cover`:return`cover`;case`fill`:return`fill`;case`fit-height`:return`fit-height`;case`fit-width`:return`fit-width`;case`none`:return`none`;default:return`contain`}},T3t=class{constructor(e){$0(this,`_canvas`,null),$0(this,`_pendingLoad`,null),$0(this,`_context`,null),$0(this,`_eventManager`,void 0),$0(this,`_animationFrameId`,null),$0(this,`_frameManager`,void 0),$0(this,`_dotLottieCore`,null),$0(this,`_stateMachineId`,``),$0(this,`_stateMachineConfig`,null),$0(this,`_isStateMachineRunning`,!1),$0(this,`_renderConfig`,{}),$0(this,`_isFrozen`,!1),$0(this,`_backgroundColor`,null),$0(this,`_boundOnClick`,null),$0(this,`_boundOnPointerUp`,null),$0(this,`_boundOnPointerDown`,null),$0(this,`_boundOnPointerMove`,null),$0(this,`_boundOnPointerEnter`,null),$0(this,`_boundOnPointerLeave`,null),$0(this,`_bufferMismatchCount`,0),$0(this,`_lastExpectedBufferSize`,0),$0(this,`_marker`,``),this._canvas=e.canvas??null,this._eventManager=new p3t,this._frameManager=new K4t,this._renderConfig={...e.renderConfig,devicePixelRatio:e.renderConfig?.devicePixelRatio||p2(),freezeOnOffscreen:e.renderConfig?.freezeOnOffscreen??!0},this._initWasm().then(()=>{this._dotLottieCore=this._createCore(),this._dotLottieCore.set_autoplay(e.autoplay??!1),this._dotLottieCore.set_loop(e.loop??!1),this._dotLottieCore.set_loop_count(e.loopCount??0),this._dotLottieCore.set_mode(S3t(e.mode??`forward`)),this._dotLottieCore.set_speed(e.speed??1),this._dotLottieCore.set_use_frame_interpolation(e.useFrameInterpolation??!0),e.segment&&e.segment.length===2&&this._dotLottieCore.set_segment(e.segment[0],e.segment[1]),this._marker=e.marker??``,this._marker&&this._dotLottieCore.set_marker(this._marker),this._dotLottieCore.set_layout(e.layout?.fit??`contain`,e.layout?.align?.[0]??.5,e.layout?.align?.[1]??.5),this._stateMachineId=e.stateMachineId??``,this._stateMachineConfig=e.stateMachineConfig??null,this._onCoreCreated(),this._eventManager.dispatch({type:`ready`}),e.data?this._canvas?this._loadFromData(e.data):this._pendingLoad={data:e.data}:e.src&&(this._canvas?this._loadFromSrc(e.src):this._pendingLoad={src:e.src}),e.backgroundColor&&this.setBackgroundColor(e.backgroundColor)}).catch(e=>{console.error(`[dotlottie-web] Initialization failed:`,e),this._eventManager.dispatch({type:`loadError`,error:Error(`Failed to load wasm module: ${e}`)})})}async _initWasm(){return x3t.load()}_createCore(){return new c3t}_onCoreCreated(){}_drainPlayerEvents(){if(!this._dotLottieCore)return;let e;for(;(e=this._dotLottieCore.poll_event())!=null;){let t=e;switch(t.type){case`Load`:setTimeout(()=>this._eventManager.dispatch({type:`load`}),0);break;case`LoadError`:setTimeout(()=>this._eventManager.dispatch({type:`loadError`,error:Error(`failed to load`)}),0);break;case`Play`:setTimeout(()=>this._eventManager.dispatch({type:`play`}),0);break;case`Pause`:setTimeout(()=>this._eventManager.dispatch({type:`pause`}),0);break;case`Stop`:setTimeout(()=>this._eventManager.dispatch({type:`stop`}),0);break;case`Frame`:setTimeout(()=>this._eventManager.dispatch({type:`frame`,currentFrame:t.frameNo??0}),0);break;case`Render`:setTimeout(()=>this._eventManager.dispatch({type:`render`,currentFrame:t.frameNo??0}),0);break;case`Loop`:setTimeout(()=>this._eventManager.dispatch({type:`loop`,loopCount:t.loopCount??0}),0);break;case`Complete`:setTimeout(()=>this._eventManager.dispatch({type:`complete`}),0);break;default:break}}}_drainSmEvents(){if(!this._dotLottieCore)return;let e;for(;(e=this._dotLottieCore.sm_poll_event())!=null;){let t=e;switch(t.type){case`Start`:setTimeout(()=>{this._isStateMachineRunning=!0,this._eventManager.dispatch({type:`stateMachineStart`}),this._startAnimationLoop()},0);break;case`Stop`:setTimeout(()=>{this._isStateMachineRunning=!1,this._eventManager.dispatch({type:`stateMachineStop`}),this._dotLottieCore?.is_playing()||this._stopAnimationLoop()},0);break;case`CustomEvent`:this._eventManager.dispatch({type:`stateMachineCustomEvent`,eventName:t.message??``});break;case`BooleanInputChange`:this._eventManager.dispatch({type:`stateMachineBooleanInputValueChange`,inputName:t.name??``,newValue:t.newValue,oldValue:t.oldValue});break;case`NumericInputChange`:this._eventManager.dispatch({type:`stateMachineNumericInputValueChange`,inputName:t.name??``,newValue:t.newValue,oldValue:t.oldValue});break;case`StringInputChange`:this._eventManager.dispatch({type:`stateMachineStringInputValueChange`,inputName:t.name??``,newValue:t.newValue,oldValue:t.oldValue});break;case`InputFired`:this._eventManager.dispatch({type:`stateMachineInputFired`,inputName:t.name??``});break;case`Transition`:this._eventManager.dispatch({type:`stateMachineTransition`,fromState:t.previousState??``,toState:t.newState??``});break;case`StateEntered`:this._eventManager.dispatch({type:`stateMachineStateEntered`,state:t.state??``});break;case`StateExit`:this._eventManager.dispatch({type:`stateMachineStateExit`,state:t.state??``});break;case`Error`:this._eventManager.dispatch({type:`stateMachineError`,error:t.message??``});break;default:break}}let t;for(;(t=this._dotLottieCore.sm_poll_internal_event())!=null;){let e=t;if(e.type===`Message`){let t=e.message??``;e2&&t.startsWith(`OpenUrl: `)?y3t(t):this._eventManager.dispatch({type:`stateMachineInternalMessage`,message:t})}}}_dispatchError(e){console.error(e),this._eventManager.dispatch({type:`loadError`,error:Error(e)})}async _fetchData(e){let t=await fetch(e);if(!t.ok)throw Error(`Failed to fetch animation data from URL: ${e}. ${t.status}: ${t.statusText}`);let n=await t.arrayBuffer();return g3t(n)?n:new TextDecoder().decode(n)}_loadFromData(e){if(this._dotLottieCore===null)return;if(!this._canvas){console.warn(`[dotlottie-web] Cannot load animation without canvas. Call setCanvas() first.`);return}let t=this._canvas.width,n=this._canvas.height,r=!1;if(typeof e==`string`){if(!v3t(e)){this._dispatchError(`Invalid Lottie JSON string: The provided string does not conform to the Lottie JSON format.`);return}r=this._dotLottieCore.load_animation(e,t,n)}else if(e instanceof ArrayBuffer){if(!g3t(e)){this._dispatchError(`Invalid dotLottie ArrayBuffer: The provided ArrayBuffer does not conform to the dotLottie format.`);return}r=this._dotLottieCore.load_dotlottie_data(new Uint8Array(e),t,n)}else if(typeof e==`object`){if(!v3t(e)){this._dispatchError(`Invalid Lottie JSON object: The provided object does not conform to the Lottie JSON format.`);return}r=this._dotLottieCore.load_animation(JSON.stringify(e),t,n)}else{this._dispatchError(`Unsupported data type for animation data. Expected:
|
|
866
866
|
- string (Lottie JSON),
|
|
867
867
|
- ArrayBuffer (dotLottie),
|
|
868
868
|
- object (Lottie JSON).
|
|
@@ -877,7 +877,7 @@ Event: ${E1(e)}`),!0;return!1}function rQt(e,t){return t?.length?oZt(e).some(e=>
|
|
|
877
877
|
`,`\r`],!1,!1),ce=Te([`+`,`-`],!1,!1),N=Te([[`0`,`9`]],!1,!1),P=we(`.`,!1),le=we(`e`,!1),ue=function(e,t){let n=Array.isArray(e)?e:[e];return t.forEach(e=>{Array.isArray(e[1])?n.push(...e[1]):n.push(e[1])}),n},de=function(e,t,n,r,i,a,o,s,c){return{matrix:[e,t,n,r,i,a,o,s,c]}},fe=function(e,t){return t==null?{translate:e}:{translate:[e,t]}},pe=function(e,t){return t==null?{scale:e}:[{scaleX:e},{scaleY:t}]},me=function(e,t){return t===null?[{rotate:`${e}deg`}]:{rotate:`${e}deg`}},he=function(e,t){return[e,t]},ge=function(e){return[{skewX:`${e}deg`}]},F=function(e){return[{skewY:`${e}deg`}]},_e=function(){return parseFloat(Ce())},I=t.peg$currPos|0,ve=I,ye=[{line:1,column:1}],be=I,xe=t.peg$maxFailExpected||[],L=t.peg$silentFails|0,Se;if(t.startRule){if(!(t.startRule in a))throw Error(`Can't start parsing from rule "`+t.startRule+`".`);o=a[t.startRule]}function Ce(){return e.substring(ve,I)}function we(e,t){return{type:`literal`,text:e,ignoreCase:t}}function Te(e,t,n){return{type:`class`,parts:e,inverted:t,ignoreCase:n}}function Ee(){return{type:`end`}}function De(e){return{type:`other`,description:e}}function Oe(t){var n=ye[t],r;if(n)return n;if(t>=ye.length)r=ye.length-1;else for(r=t;!ye[--r];);for(n=ye[r],n={line:n.line,column:n.column};r<t;)e.charCodeAt(r)===10?(n.line++,n.column=1):n.column++,r++;return ye[t]=n,n}function ke(e,t,n){var r=Oe(e),a=Oe(t),o={source:i,start:{offset:e,line:r.line,column:r.column},end:{offset:t,line:a.line,column:a.column}};return n&&i&&typeof i.offset==`function`&&(o.start=i.offset(o.start),o.end=i.offset(o.end)),o}function Ae(e){I<be||(I>be&&(be=I,xe=[]),xe.push(e))}function je(e,t,n){return new r(r.buildMessage(e,t),e,t,n)}function Me(){var e;return L++,e=Ne(),L--,e===n&&L===0&&Ae(b),e}function Ne(){var e,t,r,i,a,o;if(L++,e=I,t=Pe(),t!==n){for(r=[],i=I,a=Ue(),o=Pe(),o===n?(I=i,i=n):(a=[a,o],i=a);i!==n;)r.push(i),i=I,a=Ue(),o=Pe(),o===n?(I=i,i=n):(a=[a,o],i=a);ve=e,e=ue(t,r)}else I=e,e=n;return L--,e===n&&(t=n,L===0&&Ae(x)),e}function Pe(){var e;return L++,e=Fe(),e===n&&(e=Ie(),e===n&&(e=Le(),e===n&&(e=Re(),e===n&&(e=Be(),e===n&&(e=Ve()))))),L--,e===n&&L===0&&Ae(S),e}function Fe(){var t,r,i,a,o,l,u,d,f,p,m,h;return L++,t=I,Ue(),e.substr(I,7)===s?(r=s,I+=7):(r=n,L===0&&Ae(w)),r===n?(I=t,t=n):(Ue(),i=We(),i===n?(I=t,t=n):(He(),a=We(),a===n?(I=t,t=n):(He(),o=We(),o===n?(I=t,t=n):(He(),l=We(),l===n?(I=t,t=n):(He(),u=We(),u===n?(I=t,t=n):(He(),d=We(),d===n?(I=t,t=n):(He(),f=We(),f===n?(I=t,t=n):(He(),p=We(),p===n?(I=t,t=n):(He(),m=We(),m===n?(I=t,t=n):(Ue(),e.charCodeAt(I)===41?(h=c,I++):(h=n,L===0&&Ae(T)),h===n?(I=t,t=n):(Ue(),ve=t,t=de(i,a,o,l,u,d,f,p,m)))))))))))),L--,t===n&&L===0&&Ae(C),t}function Ie(){var t,r,i,a,o;return L++,t=I,Ue(),e.substr(I,10)===l?(r=l,I+=10):(r=n,L===0&&Ae(D)),r===n?(I=t,t=n):(Ue(),i=We(),i===n?(I=t,t=n):(He(),a=We(),a===n&&(a=null),Ue(),e.charCodeAt(I)===41?(o=c,I++):(o=n,L===0&&Ae(T)),o===n?(I=t,t=n):(Ue(),ve=t,t=fe(i,a)))),L--,t===n&&L===0&&Ae(E),t}function Le(){var t,r,i,a,o;return L++,t=I,Ue(),e.substr(I,6)===u?(r=u,I+=6):(r=n,L===0&&Ae(k)),r===n?(I=t,t=n):(Ue(),i=We(),i===n?(I=t,t=n):(He(),a=We(),a===n&&(a=null),Ue(),e.charCodeAt(I)===41?(o=c,I++):(o=n,L===0&&Ae(T)),o===n?(I=t,t=n):(Ue(),ve=t,t=pe(i,a)))),L--,t===n&&L===0&&Ae(O),t}function Re(){var t,r,i,a,o;return L++,t=I,Ue(),e.substr(I,7)===d?(r=d,I+=7):(r=n,L===0&&Ae(ee)),r===n?(I=t,t=n):(Ue(),i=We(),i===n?(I=t,t=n):(a=ze(),a===n&&(a=null),Ue(),e.charCodeAt(I)===41?(o=c,I++):(o=n,L===0&&Ae(T)),o===n?(I=t,t=n):(Ue(),ve=t,t=me(i,a)))),L--,t===n&&L===0&&Ae(A),t}function ze(){var e,t,r;return L++,e=I,He(),t=We(),t===n?(I=e,e=n):(He(),r=We(),r===n?(I=e,e=n):(ve=e,e=he(t,r))),L--,e===n&&L===0&&Ae(te),e}function Be(){var t,r,i,a;return L++,t=I,Ue(),e.substr(I,6)===f?(r=f,I+=6):(r=n,L===0&&Ae(re)),r===n?(I=t,t=n):(Ue(),i=We(),i===n?(I=t,t=n):(Ue(),e.charCodeAt(I)===41?(a=c,I++):(a=n,L===0&&Ae(T)),a===n?(I=t,t=n):(Ue(),ve=t,t=ge(i)))),L--,t===n&&L===0&&Ae(ne),t}function Ve(){var t,r,i,a;return L++,t=I,Ue(),e.substr(I,6)===p?(r=p,I+=6):(r=n,L===0&&Ae(j)),r===n?(I=t,t=n):(Ue(),i=We(),i===n?(I=t,t=n):(Ue(),e.charCodeAt(I)===41?(a=c,I++):(a=n,L===0&&Ae(T)),a===n?(I=t,t=n):(Ue(),ve=t,t=F(i)))),L--,t===n&&L===0&&Ae(ie),t}function He(){var t,r;for(L++,t=[],r=e.charAt(I),g.test(r)?I++:(r=n,L===0&&Ae(oe));r!==n;)t.push(r),r=e.charAt(I),g.test(r)?I++:(r=n,L===0&&Ae(oe));return L--,r=n,L===0&&Ae(ae),t}function Ue(){var t,r;for(L++,t=[],r=e.charAt(I),_.test(r)?I++:(r=n,L===0&&Ae(M));r!==n;)t.push(r),r=e.charAt(I),_.test(r)?I++:(r=n,L===0&&Ae(M));return L--,r=n,L===0&&Ae(se),t}function We(){var t=I,r=e.charAt(I),i,a,o,s,c,l;for(v.test(r)?I++:(r=n,L===0&&Ae(ce)),r===n&&(r=null),i=I,a=[],o=e.charAt(I),y.test(o)?I++:(o=n,L===0&&Ae(N));o!==n;)a.push(o),o=e.charAt(I),y.test(o)?I++:(o=n,L===0&&Ae(N));if(e.charCodeAt(I)===46?(o=m,I++):(o=n,L===0&&Ae(P)),o!==n){if(s=[],c=e.charAt(I),y.test(c)?I++:(c=n,L===0&&Ae(N)),c!==n)for(;c!==n;)s.push(c),c=e.charAt(I),y.test(c)?I++:(c=n,L===0&&Ae(N));else s=n;s===n?(I=i,i=n):(a=[a,o,s],i=a)}else I=i,i=n;if(i===n)if(i=[],a=e.charAt(I),y.test(a)?I++:(a=n,L===0&&Ae(N)),a!==n)for(;a!==n;)i.push(a),a=e.charAt(I),y.test(a)?I++:(a=n,L===0&&Ae(N));else i=n;if(i!==n){if(a=I,e.charCodeAt(I)===101?(o=h,I++):(o=n,L===0&&Ae(le)),o!==n){if(s=e.charAt(I),v.test(s)?I++:(s=n,L===0&&Ae(ce)),s===n&&(s=null),c=[],l=e.charAt(I),y.test(l)?I++:(l=n,L===0&&Ae(N)),l!==n)for(;l!==n;)c.push(l),l=e.charAt(I),y.test(l)?I++:(l=n,L===0&&Ae(N));else c=n;c===n?(I=a,a=n):(o=[o,s,c],a=o)}else I=a,a=n;a===n&&(a=null),ve=t,t=_e()}else I=t,t=n;return t}if(Se=o(),t.peg$library)return{peg$result:Se,peg$currPos:I,peg$FAILED:n,peg$maxFailExpected:xe,peg$maxFailPos:be};if(Se!==n&&I===e.length)return Se;throw Se!==n&&I<e.length&&Ae(Ee()),je(xe,be<e.length?e.charAt(be):null,be<e.length?ke(be,be+1):ke(be,be))}t.exports={StartRules:[`start`],SyntaxError:r,parse:a}}));function C8t(e){return e?e.map(e=>{let[t,n]=Object.entries(e)[0];switch(t){case`translateX`:return`translate(${n}, 0)`;case`translateY`:return`translate(0, ${n})`;case`rotate`:return`rotate(${v4(n)})`;case`scale`:return`scale(${n})`;case`scaleX`:return`scale(${n}, 1)`;case`scaleY`:return`scale(1, ${n})`;case`skewX`:return`skewX(${v4(n)})`;case`skewY`:return`skewY(${v4(n)})`;case`matrix`:return`matrix(${n.join(`, `)})`;default:return``}}).join(` `):``}var v4,w8t=o((()=>{b8t(),x8t(),S8t(),v4=e=>{if(e.endsWith(`rad`))return 180/Math.PI*parseFloat(e);if(e.endsWith(`deg`))return parseFloat(e)}}));function T8t(e,t){let n=[];if(t&&n.push(...E8t(t)),Array.isArray(e))if(typeof e[0]==`number`)n.push(`matrix(${e.join(` `)})`);else{let t=C8t(e).split(` `);n.push(...t)}else typeof e==`string`&&n.push(e);return n.length?n.join(` `):void 0}function E8t(e){let t=[];return e.translate!=null&&t.push(`translate(${e.translate})`),(e.translateX!=null||e.translateY!=null)&&t.push(`translate(${e.translateX||0}, ${e.translateY||0})`),e.scale!=null&&t.push(`scale(${e.scale})`),(e.scaleX!=null||e.scaleY!=null)&&t.push(`scale(${e.scaleX||1}, ${e.scaleY||1})`),e.rotation!=null&&t.push(`rotate(${e.rotation})`),e.skewX!=null&&t.push(`skewX(${e.skewX})`),e.skewY!=null&&t.push(`skewY(${e.skewY})`),t}var D8t=o((()=>{w8t()}));function O8t(e,t){return e?R?[e,t]:e[Symbol.iterator]?Object.assign({},...e,t):Object.assign({},e,t):t}var k8t=o((()=>{V()})),A8t=s(((e,t)=>{var n=[];function r(e){return n.push(e)}function i(e){return n[e-1]}t.exports={registerAsset:r,getAssetByID:i}}));function j8t(e){let t={};if(typeof e==`number`){let n=(0,M8t.getAssetByID)(e);if(n==null)throw Error(`Image: asset with ID "${e}" could not be found. Please check the image source or packager.`);if(t={width:n.width,height:n.height,scale:n.scales[0]},n.scales.length>1){let e=Ru.get();t.scale=n.scales.reduce((t,n)=>Math.abs(n-e)<Math.abs(t-e)?n:t)}let r=t.scale===1?``:`@${t.scale}x`;t.uri=n?`${n.httpServerLocation}/${n.name}${r}.${n.type}`:``}else typeof e==`string`?t.uri=e:e&&!Array.isArray(e)&&typeof e.uri==`string`&&(t.uri=e.uri);if(t.uri){var n;let e=(n=t)==null||(n=n.uri)==null?void 0:n.match(N8t);if(e){let[,n,r]=e;return t.uri=`${n}${encodeURIComponent(r)}`,t}}return t}var M8t,N8t,P8t=o((()=>{V(),M8t=A8t(),N8t=/^(data:image\/svg\+xml;utf8,)(.*)/})),F8t,I8t=o((()=>{y8t(),D8t(),k8t(),P8t(),F8t=(e,t=e.props)=>{let{transform:n,origin:r,originX:i,originY:a,fontFamily:o,fontSize:s,fontWeight:c,fontStyle:l,style:u,forwardedRef:d,gradientTransform:f,patternTransform:p,onPress:m,...h}=t,g={...v8t(t)?{onStartShouldSetResponder:e.touchableHandleStartShouldSetResponder,onResponderTerminationRequest:e.touchableHandleResponderTerminationRequest,onResponderGrant:e.touchableHandleResponderGrant,onResponderMove:e.touchableHandleResponderMove,onResponderRelease:e.touchableHandleResponderRelease,onResponderTerminate:e.touchableHandleResponderTerminate}:null,...h};r==null?(i!=null||a!=null)&&(g[`transform-origin`]=`${i||0} ${a||0}`):g[`transform-origin`]=r.toString().replace(`,`,` `);let _=T8t(n,t);_&&(g.transform=_);let v=T8t(f);v&&(g.gradientTransform=v);let y=T8t(p);y&&(g.patternTransform=y),g.ref=t=>{e.elementRef.current=t,typeof d==`function`?d(t):d&&(d.current=t)};let b={};return o!=null&&(b.fontFamily=o),s!=null&&(b.fontSize=s),c!=null&&(b.fontWeight=c),l!=null&&(b.fontStyle=l),g.style=O8t(u,b),m!==null&&(g.onClick=t.onPress),t.href!==null&&t.href!==void 0&&(g.href=j8t(t.href)?.uri),g}}));function L8t(e){return`rgba(${e>>16&255},${e>>8&255},${e&255},${((e>>24&255)/255).toFixed(2)})`}var R8t=o((()=>{})),z8t,B8t,V8t,H8t,U8t,W8t,G8t,K8t,q8t,J8t,y4,Y8t,X8t,Z8t,Q8t=o((()=>{V(),z8t={top:20,left:20,right:20,bottom:30},{Mixin:B8t}=Jp,{touchableHandleStartShouldSetResponder:V8t,touchableHandleResponderTerminationRequest:H8t,touchableHandleResponderGrant:U8t,touchableHandleResponderMove:W8t,touchableHandleResponderRelease:G8t,touchableHandleResponderTerminate:K8t,touchableGetInitialState:q8t}=B8t,J8t={...B8t,touchableHandleStartShouldSetResponder(e){let{onStartShouldSetResponder:t}=this.props;return t?t(e):V8t.call(this,e)},touchableHandleResponderTerminationRequest(e){let{onResponderTerminationRequest:t}=this.props;return t?t(e):H8t.call(this,e)},touchableHandleResponderGrant(e){let{onResponderGrant:t}=this.props;return t?t(e):U8t.call(this,e)},touchableHandleResponderMove(e){let{onResponderMove:t}=this.props;return t?t(e):W8t.call(this,e)},touchableHandleResponderRelease(e){let{onResponderRelease:t}=this.props;return t?t(e):G8t.call(this,e)},touchableHandleResponderTerminate(e){let{onResponderTerminate:t}=this.props;return t?t(e):K8t.call(this,e)},touchableHandlePress(e){let{onPress:t}=this.props;t&&t(e)},touchableHandleActivePressIn(e){let{onPressIn:t}=this.props;t&&t(e)},touchableHandleActivePressOut(e){let{onPressOut:t}=this.props;t&&t(e)},touchableHandleLongPress(e){let{onLongPress:t}=this.props;t&&t(e)},touchableGetPressRectOffset(){let{pressRetentionOffset:e}=this.props;return e||z8t},touchableGetHitSlop(){let{hitSlop:e}=this.props;return e},touchableGetHighlightDelayMS(){let{delayPressIn:e}=this.props;return e||0},touchableGetLongPressDelayMS(){let{delayLongPress:e}=this.props;return e===0?0:e||500},touchableGetPressOutDelayMS(){let{delayPressOut:e}=this.props;return e||0}},y4=Object.keys(J8t),Y8t=y4.map(e=>J8t[e]),X8t=y4.length,Z8t=e=>{for(let t=0;t<X8t;t++){let n=y4[t],r=Y8t[t];typeof r==`function`?e[n]=r.bind(e):e[n]=r}e.state=q8t()}})),$8t,b4,e5t=o((()=>{$8t=u(p()),V(),I8t(),R8t(),_8t(),y8t(),Q8t(),b4=class extends $8t.Component{prepareProps(e){return e}elementRef=$8t.createRef();lastMergedProps={};setNativeProps(e){let t=Object.assign({},this.props,this.lastMergedProps,e.style);this.lastMergedProps=t;let n=F8t(this,this.prepareProps(t)),r=this.elementRef.current;if(r)for(let e of Object.keys(n)){let t=n[e];switch(e){case`ref`:case`children`:break;case`style`:for(let e of[].concat(n.style??[]))Object.assign(r.style,e);break;case`fill`:if(t&&typeof t==`object`){let e=t;r.setAttribute(`fill`,L8t(e.payload))}break;case`stroke`:if(t&&typeof t==`object`){let e=t;r.setAttribute(`stroke`,L8t(e.payload))}break;default:r.setAttribute(g8t(e),t);break}}}constructor(e){super(e),v8t(e)&&Z8t(this),this._remeasureMetricsOnActivation=d8t.bind(this)}render(){if(!this.tag)throw Error("When extending `WebShape` you need to overwrite either `tag` or `render`!");return this.lastMergedProps={},Xr(this.tag,F8t(this,this.prepareProps(this.props)))}}})),x4,t5t,S4,n5t,r5t,i5t,a5t,o5t,s5t,c5t,l5t,u5t,d5t,f5t,p5t,m5t,h5t,g5t,_5t,v5t,y5t,b5t,x5t,S5t,C5t,w5t,T5t,E5t,D5t,O5t,k5t,A5t,j5t,M5t,C4,N5t,P5t,w4,F5t,I5t,L5t,R5t,z5t,T4,E4,B5t,V5t,D4,H5t,U5t,W5t=o((()=>{_8t(),e5t(),x4=class extends b4{tag=`circle`},t5t=class extends b4{tag=`clipPath`},S4=class extends b4{tag=`defs`},n5t=class extends b4{tag=`ellipse`},r5t=class extends b4{tag=`feBlend`},i5t=class extends b4{tag=`feColorMatrix`},a5t=class extends b4{tag=`feComponentTransfer`},o5t=class extends b4{tag=`feComposite`},s5t=class extends b4{tag=`feConvolveMatrix`},c5t=class extends b4{tag=`feDiffuseLighting`},l5t=class extends b4{tag=`feDisplacementMap`},u5t=class extends b4{tag=`feDistantLight`},d5t=class extends b4{tag=`feDropShadow`},f5t=class extends b4{tag=`feFlood`},p5t=class extends b4{tag=`feFuncA`},m5t=class extends b4{tag=`feFuncB`},h5t=class extends b4{tag=`feFuncG`},g5t=class extends b4{tag=`feFuncR`},_5t=class extends b4{tag=`feGaussianBlur`},v5t=class extends b4{tag=`feImage`},y5t=class extends b4{tag=`feMerge`},b5t=class extends b4{tag=`feMergeNode`},x5t=class extends b4{tag=`feMorphology`},S5t=class extends b4{tag=`feOffset`},C5t=class extends b4{tag=`fePointLight`},w5t=class extends b4{tag=`feSpecularLighting`},T5t=class extends b4{tag=`feSpotLight`},E5t=class extends b4{tag=`feTile`},D5t=class extends b4{tag=`feTurbulence`},O5t=class extends b4{tag=`filter`},k5t=class extends b4{tag=`foreignObject`},A5t=class extends b4{tag=`g`;prepareProps(e){let{x:t,y:n,...r}=e;return(t||n)&&!r.translate&&(r.translate=`${t||0}, ${n||0}`),r}},j5t=class extends b4{tag=`image`},M5t=class extends b4{tag=`line`},C4=class extends b4{tag=`linearGradient`},N5t=class extends b4{tag=`marker`},P5t=class extends b4{tag=`mask`},w4=class extends b4{tag=`path`},F5t=class extends b4{tag=`pattern`},I5t=class extends b4{tag=`polygon`},L5t=class extends b4{tag=`polyline`},R5t=class extends b4{tag=`radialGradient`},z5t=class extends b4{tag=`rect`},T4=class extends b4{tag=`stop`},E4=class extends b4{tag=`svg`;toDataURL(e,t={}){let n=this.elementRef.current;if(n===null)return;let r=_4(n),i=Number(t.width)||r.width,a=Number(t.height)||r.height,o=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);o.setAttribute(`viewBox`,`0 0 ${r.width} ${r.height}`),o.setAttribute(`width`,String(i)),o.setAttribute(`height`,String(a)),o.appendChild(n.cloneNode(!0));let s=new window.Image;s.onload=()=>{let t=document.createElement(`canvas`);t.width=i,t.height=a,t.getContext(`2d`)?.drawImage(s,0,0),e(t.toDataURL().replace(`data:image/png;base64,`,``))},s.src=`data:image/svg+xml;utf8,${f8t(new window.XMLSerializer().serializeToString(o))}`}},B5t=class extends b4{tag=`symbol`},V5t=class extends b4{tag=`tspan`},D4=class extends b4{tag=`text`},H5t=class extends b4{tag=`textPath`},U5t=class extends b4{tag=`use`}})),G5t,K5t=o((()=>{W5t(),G5t={circle:x4,clipPath:t5t,defs:S4,ellipse:n5t,filter:O5t,feBlend:r5t,feColorMatrix:i5t,feComponentTransfer:a5t,feComposite:o5t,feConvolveMatrix:s5t,feDiffuseLighting:c5t,feDisplacementMap:l5t,feDistantLight:u5t,feDropShadow:d5t,feFlood:f5t,feGaussianBlur:_5t,feImage:v5t,feMerge:y5t,feMergeNode:b5t,feMorphology:x5t,feOffset:S5t,fePointLight:C5t,feSpecularLighting:w5t,feSpotLight:T5t,feTile:E5t,feTurbulence:D5t,foreignObject:k5t,g:A5t,image:j5t,line:M5t,linearGradient:C4,marker:N5t,mask:P5t,path:w4,pattern:F5t,polygon:I5t,polyline:L5t,radialGradient:R5t,rect:z5t,stop:T4,svg:E4,symbol:B5t,text:D4,textPath:H5t,tspan:V5t,use:U5t}}));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)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},O4.apply(null,arguments)}function q5t(){return null}function J5t({ast:e,override:t}){if(!e)return null;let{props:n,children:r}=e,i=G5t.svg;return k4.createElement(i,O4({},n,t),r)}function Y5t(e){let{onError:t=j4,xml:n,override:r,fallback:i}=e;try{let t=(0,A4.useMemo)(()=>n===null?null:t7t(n),[n]);return k4.createElement(J5t,{ast:t,override:r||e})}catch(e){return t(e),i??null}}function X5t(e){let{onError:t=j4,uri:n,onLoad:r,fallback:i}=e,[a,o]=(0,A4.useState)(null),[s,c]=(0,A4.useState)(!1);return(0,A4.useEffect)(()=>{n?o8t(n).then(e=>{o(e),s&&c(!1),r?.()}).catch(e=>{t(e),c(!0)}):o(null)},[t,n,r]),s?i??null:k4.createElement(Y5t,{xml:a,override:e,fallback:i})}function Z5t(e){let t={},n=e.split(`;`).filter(e=>e.trim()),{length:r}=n;for(let e=0;e<r;e++){let r=n[e];if(r.length!==0){let e=r.split(`:`),n=e[0],i=e[1];t[M4(n.trim())]=i.trim()}}return t}function Q5t(e,t){if(typeof e==`object`){let{Tag:n,props:r,children:i}=e;return r!=null&&r.class&&(r.className=r.class,delete r.class),k4.createElement(n,O4({key:t},r),i.map(Q5t))}return e}function $5t(e,t){let n=``;for(;t--;)n+=e;return n}function e7t(e,t){let n=e.split(`
|
|
878
878
|
`),r=n.length,i=t,a=0;for(;a<r;a++){let{length:e}=n[a];if(i>=e)i-=e;else break}let o=e.slice(0,t).replace(/^\t+/,a7t),s=/(^|\n).*$/.exec(o),c=s&&s[0]||``,l=e.slice(t),u=/.*(\n|$)/.exec(l),d=`${c}${u&&u[0]}\n${$5t(` `,c.length)}^`;return{line:a,column:i,snippet:d}}function t7t(e,t){let n=e.length,r=null,i=l,a=null,o,s=[];function c(t){let{line:n,column:r,snippet:i}=e7t(e,S);throw Error(`${t} (${n}:${r}). If this is valid SVG, it's probably a bug. Please raise an issue\n\n${i}`)}function l(){for(;S+1<n&&(e[S]!==`<`||!(o7t.test(e[S+1])||s7t.test(e.slice(S,S+4))));)S++;return u()}function u(){let t=``,r;for(;S<n&&(r=e[S])!==`<`;)t+=r,S+=1;return/\S/.test(t)&&a.push(t),e[S]===`<`?d:u}function d(){let t=e[S];if(t===`?`)return u;if(t===`!`){let t=S+1;if(e.slice(t,S+3)===`--`)return f;let n=S+8;if(e.slice(t,n)===`[CDATA[`)return p;if(/doctype/i.test(e.slice(t,n)))return m}if(t===`/`)return h;let n=g(),i={},l={tag:n,props:i,children:[],parent:r,Tag:G5t[n]||q5t};r?a.push(l):o=l,_(i);let{style:d}=i;typeof d==`string`&&(l.styles=d,i.style=Z5t(d));let v=!1;return e[S]===`/`&&(S+=1,v=!0),e[S]!==`>`&&c(`Expected >`),v||(r=l,{children:a}=l,s.push(l)),u}function f(){let t=e.indexOf(`-->`,S);return~t||c(`expected -->`),S=t+2,u}function p(){let t=e.indexOf(`]]>`,S);return~t||c(`expected ]]>`),a.push(e.slice(S+7,t)),S=t+2,u}function m(){let t=e.indexOf(`>`,S);return t===-1&&c(`expected >`),S=t,u}function h(){let t=g();return t||c(`Expected tag name`),r&&t!==r.tag&&c(`Expected closing tag </${t}> to match opening tag <${r.tag}>`),x(),e[S]!==`>`&&c(`Expected >`),s.pop(),r=s[s.length-1],r&&({children:a}=r),u}function g(){let t=``,r;for(;S<n&&o7t.test(r=e[S]);)t+=r,S+=1;return t}function _(t){for(;S<n;){if(!c7t.test(e[S]))return;x();let n=g();if(!n)return;let r=!0;x(),e[S]===`=`&&(S+=1,x(),r=v(),n!==`id`&&!isNaN(+r)&&r.trim()!==``&&(r=+r)),t[M4(n)]=r}}function v(){return l7t.test(e[S])?b():y()}function y(){let t=``;do{let n=e[S];if(n===` `||n===`>`||n===`/`)return t;t+=n,S+=1}while(S<n);return t}function b(){let t=e[S++],r=``,i=!1;for(;S<n;){let n=e[S++];if(n===t&&!i)return r;n===`\\`&&!i&&(i=!0),r+=i?`\\${n}`:n,i=!1}return r}function x(){for(;S<n&&c7t.test(e[S]);)S+=1}let S=0;for(;S<n;)i||c(`Unexpected character`),i=i(),S+=1;if(i!==u&&c(`Unexpected end of input`),o){let e=(t?t(o):o)||o,n=e.children.map(Q5t),r=e;return r.children=n,r}return null}var k4,A4,j4,n7t,r7t,i7t,M4,a7t,o7t,s7t,c7t,l7t,u7t=o((()=>{k4=u(p()),A4=u(p()),u8t(),K5t(),j4=console.error.bind(console),n7t=class extends A4.Component{state={ast:null};componentDidMount(){this.parse(this.props.xml)}componentDidUpdate(e){let{xml:t}=this.props;t!==e.xml&&this.parse(t)}parse(e){let{onError:t=j4}=this.props;try{this.setState({ast:e?t7t(e):null})}catch(e){let n=e;t({...n,message:`[RNSVG] Couldn't parse SVG, reason: ${n.message}`})}}render(){let{props:e,state:{ast:t}}=this;return k4.createElement(J5t,{ast:t,override:e.override||e})}},r7t=class extends A4.Component{state={xml:null};componentDidMount(){this.fetch(this.props.uri)}componentDidUpdate(e){let{uri:t}=this.props;t!==e.uri&&this.fetch(t)}async fetch(e){try{this.setState({xml:e?await o8t(e):null})}catch(e){console.error(e)}}render(){let{props:e,state:{xml:t}}=this;return k4.createElement(n7t,{xml:t,override:e,onError:e.onError})}},i7t=(e,t)=>t.toUpperCase(),M4=e=>e.replace(/[:-]([a-z])/g,i7t),a7t=e=>$5t(` `,e.length),o7t=/[a-zA-Z0-9:_-]/,s7t=/<!--/,c7t=/[\s\t\r\n]/,l7t=/['"]/}));function N4(e,t){throw Error(`[react-native-svg] You are trying to import a ${t} \`${e}\` that has been moved to a sub-package. Change your import from \`react-native-svg\` to \`react-native-svg/css\`.`)}function d7t(){N4(`SvgCss`,`component`)}function f7t(){N4(`SvgCssUri`,`component`)}function p7t(){N4(`SvgWithCss`,`component`)}function m7t(){N4(`SvgWithCssUri`,`component`)}function h7t(){N4(`inlineStyles`,`function`)}function g7t(){N4(`LocalSvg`,`component`)}function _7t(){N4(`WithLocalSvg`,`component`)}function v7t(){N4(`loadLocalRawResource`,`function`)}var y7t=o((()=>{})),b7t=o((()=>{})),x7t=o((()=>{u7t(),u8t(),y7t(),b7t(),W5t(),W5t()})),P4=c({Circle:()=>x4,ClipPath:()=>t5t,Defs:()=>S4,Ellipse:()=>n5t,FeBlend:()=>r5t,FeColorMatrix:()=>i5t,FeComponentTransfer:()=>a5t,FeComposite:()=>o5t,FeConvolveMatrix:()=>s5t,FeDiffuseLighting:()=>c5t,FeDisplacementMap:()=>l5t,FeDistantLight:()=>u5t,FeDropShadow:()=>d5t,FeFlood:()=>f5t,FeFuncA:()=>p5t,FeFuncB:()=>m5t,FeFuncG:()=>h5t,FeFuncR:()=>g5t,FeGaussianBlur:()=>_5t,FeImage:()=>v5t,FeMerge:()=>y5t,FeMergeNode:()=>b5t,FeMorphology:()=>x5t,FeOffset:()=>S5t,FePointLight:()=>C5t,FeSpecularLighting:()=>w5t,FeSpotLight:()=>T5t,FeTile:()=>E5t,FeTurbulence:()=>D5t,Filter:()=>O5t,ForeignObject:()=>k5t,G:()=>A5t,Image:()=>j5t,Line:()=>M5t,LinearGradient:()=>C4,LocalSvg:()=>g7t,Marker:()=>N5t,Mask:()=>P5t,Path:()=>w4,Pattern:()=>F5t,Polygon:()=>I5t,Polyline:()=>L5t,RadialGradient:()=>R5t,Rect:()=>z5t,Stop:()=>T4,Svg:()=>E4,SvgAst:()=>J5t,SvgCss:()=>d7t,SvgCssUri:()=>f7t,SvgFromUri:()=>r7t,SvgFromXml:()=>n7t,SvgUri:()=>X5t,SvgWithCss:()=>p7t,SvgWithCssUri:()=>m7t,SvgXml:()=>Y5t,Symbol:()=>B5t,TSpan:()=>V5t,Text:()=>D4,TextPath:()=>H5t,Use:()=>U5t,WithLocalSvg:()=>_7t,camelCase:()=>M4,default:()=>E4,fetchText:()=>o8t,inlineStyles:()=>h7t,loadLocalRawResource:()=>v7t,parse:()=>t7t}),F4=o((()=>{x7t(),x7t()})),X=E2();F4(),V();function Z(e){let{COLORS:t}=J();return(0,W.jsx)(_d,{maxFontSizeMultiplier:C2.s3,...e,style:[S7t.text,{color:t.labelPrimary},e.style],children:e.children})}var S7t=R.create({text:{...Y.Poppins.regular_Base}});V();var C7t={[S2.PoppinsBold]:`700`,[S2.PoppinsSemiBold]:`600`,[S2.PoppinsMedium]:`500`,[S2.PoppinsRegular]:`400`},w7t=12,T7t=({text:e,font:t,gradientId:n,italic:r=!1,style:i})=>{let[a,o]=(0,H.useState)(0),s=C7t[t.fontFamily]??`400`,c=Math.round((t.lineHeight-t.fontSize)/2+t.fontSize*.8),l=r?Math.ceil(t.fontSize*Math.tan(w7t*Math.PI/180)):0,u=Math.ceil(t.fontSize*.15);return(0,W.jsxs)(B,{style:[E7t.gradientText,{height:t.lineHeight},i],children:[(0,W.jsx)(Z,{numberOfLines:1,onLayout:e=>o(e.nativeEvent.layout.width),style:[{fontFamily:t.fontFamily,fontWeight:s,fontSize:t.fontSize,lineHeight:t.lineHeight},E7t.gradientMeasure],children:e}),a>0&&(0,W.jsxs)(E4,{transform:[{translateX:0},{translateY:-t.lineHeight}],width:a+l*2+u,height:t.lineHeight,children:[(0,W.jsx)(S4,{children:(0,W.jsxs)(C4,{id:n,x1:`0`,y1:`0`,x2:`1`,y2:`0`,children:[(0,W.jsx)(T4,{offset:`0`,stopColor:b2[0]}),(0,W.jsx)(T4,{offset:`1`,stopColor:b2[1]})]})}),(0,W.jsx)(D4,{x:l,y:c,fontFamily:t.fontFamily,fontWeight:s,fontSize:t.fontSize,fill:`url(#${n})`,transform:r?`skewX(-${w7t})`:void 0,children:e})]})]})},E7t=R.create({gradientText:{alignSelf:`flex-start`},gradientMeasure:{alignSelf:`flex-start`,opacity:0}});V();var D7t=Oq?{outlineStyle:`none`}:{},O7t=Oq?{onClick:e=>e.stopPropagation()}:{},k7t=e=>{let[t,...n]=e.replace(/[^\d,.]/g,``).replace(/,/g,`.`).split(`.`);return n.length?`${t||`0`}.${n.join(``)}`:t},I4=({ref:e,style:t,onChangeText:n,onFocusChange:r,autoFocus:i,...a})=>{let{COLORS:o}=J(),s=(0,H.useCallback)(e=>{n(k7t(e))},[n]),c=(0,H.useCallback)(()=>{r?.(!0)},[r]),l=(0,H.useCallback)(()=>{r?.(!1)},[r]);return(0,W.jsx)(Lp,{cursorColor:o.iconBrand,placeholder:`-`,placeholderTextColor:o.labelSecondary,maxLength:3,inputMode:`numeric`,enterKeyHint:`done`,ref:e,maxFontSizeMultiplier:C2.s3,style:[t,{includeFontPadding:!1},D7t],onFocus:c,onBlur:l,autoCorrect:!1,autoFocus:i??r!==void 0,...O7t,...a,onChangeText:s})};V();var A7t=110,j7t=38,M7t=Oq?{width:0}:null,N7t=({amount:e,onChangeAmount:t,unit:n,icon:r,carbs:i,autoFocus:a=!1,onFocusChange:o,testID:s})=>{let{t:c}=Tq(),{COLORS:l}=J(),{fontScale:u}=em(),[d,f]=(0,H.useState)(!1),p=(0,H.useRef)(null),m=Math.min(u,C2.s3),h=(0,H.useCallback)(()=>{d||p.current?.focus()},[d]),g=(0,H.useCallback)(e=>{f(e),o?.(e)},[o]);return(0,W.jsxs)(B,{style:[L4.amountColumn,{minWidth:A7t*m}],children:[(0,W.jsx)(Z,{style:[L4.amountLabel,{color:l.labelSecondary}],children:c(`foodAmountInputField_weight`)}),(0,W.jsxs)(wp,{accessible:!1,onPress:h,style:[L4.inputBox,{height:Math.round(j7t*m),backgroundColor:l.bgVsInput,borderColor:d?l.borderInputFocus:l.border}],children:[r,(0,W.jsxs)(B,{style:L4.inputValue,children:[(0,W.jsx)(I4,{ref:p,value:e,onChangeText:t,onFocusChange:g,autoFocus:a,selectTextOnFocus:!0,style:[L4.input,M7t,{color:l.labelPrimary}],testID:`${s}-amount-input`}),(0,W.jsx)(Z,{style:[L4.inputUnit,{color:l.labelSecondary}],children:n})]})]}),(0,W.jsxs)(Z,{style:[L4.carbsResult,{color:l.labelSecondary}],children:[`= `,(0,W.jsx)(Z,{style:[L4.carbsResultValue,{color:l.labelPrimary}],children:e?i:``}),` `+c(`my_food_add_unit`)]})]})},L4=R.create({amountColumn:{gap:2},amountLabel:{...Y.Poppins.medium_SM,textAlign:`center`},inputBox:{flexDirection:`row`,alignItems:`center`,gap:8,paddingHorizontal:11,borderRadius:16,borderWidth:1},inputValue:{flex:1,flexDirection:`row`,alignItems:`center`,justifyContent:`flex-end`,gap:2},input:{...Y.Poppins.medium_XL,lineHeight:z.select({ios:0,default:Y.Poppins.medium_XL.lineHeight}),includeFontPadding:!1,flex:1,textAlign:`right`,paddingVertical:0},inputUnit:{...Y.Poppins.regular_Base},carbsResult:{...Y.Poppins.regular_SM,alignSelf:`stretch`,textAlign:`center`},carbsResultValue:{...Y.Poppins.semiBold_SM}}),R4=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Object.assign||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},n=`src/index.js`,r=function(){function e(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,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=p(),a=s(i),o=(V(),d(tm));function s(e){return e&&e.__esModule?e:{default:e}}function c(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function l(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function u(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function f(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var m=function(e){f(i,e);function i(){var e,t,n,r;l(this,i);var a=[...arguments];return r=(t=(n=u(this,(e=i.__proto__||Object.getPrototypeOf(i)).call.apply(e,[this].concat(a))),n),n.state={width:1,height:1},n.measure=function(e){n.setState({width:e.nativeEvent.layout.width,height:e.nativeEvent.layout.height}),n.props.onLayout&&n.props.onLayout(e)},n.getAngle=function(){return n.props.useAngle?n.props.angle+`deg`:Math.atan2(n.state.width*(n.props.end.y-n.props.start.y),n.state.height*(n.props.end.x-n.props.start.x))+Math.PI/2+`rad`},n.getColors=function(){return n.props.colors.map(function(e,t){var r=n.props.locations[t],i=``;return r&&(i=` `+r*100+`%`),e+i}).join(`,`)},t),u(n,r)}return r(i,[{key:`render`,value:function(){var e=this.props;e.start,e.end,e.colors,e.locations,e.useAngle,e.angleCenter,e.angle;var r=e.style,i=e.children,s=c(e,[`start`,`end`,`colors`,`locations`,`useAngle`,`angleCenter`,`angle`,`style`,`children`]);return a.default.createElement(o.View,t({},s,{style:[r,{backgroundImage:`linear-gradient(`+this.getAngle()+`,`+this.getColors()+`)`}],onLayout:this.measure,__source:{fileName:n,lineNumber:76}}),i)}}]),i}(i.PureComponent);m.defaultProps={start:{x:.5,y:0},end:{x:.5,y:1},locations:[],colors:[],useAngle:!1,angle:0},e.default=m}));V();var z4=u(R4());YQ(),ZY();var P7t=JQ.createAnimatedComponent(z4.default),F7t=1200;function I7t({children:e,isAnimated:t,onAnimationFinished:n,style:r}){let{COLORS:i}=J(),{width:a}=em(),o=fQ(-a),s=fQ(1),c=mQ(()=>({transform:[{translateX:o.value}]}),Oq?[o]:void 0),l=mQ(()=>({borderColor:NLt(s.value,[0,1],[i.borderInputFocus,i.bgTransparent])}),Oq?[i.bgTransparent,i.borderInputFocus,s]:void 0);return(0,H.useEffect)(()=>{t&&(o.value=-a,s.value=0,o.value=QX(a,{duration:F7t,easing:XX.linear},()=>{o.value=-a,ZDt(n)}),s.value=QX(1,{duration:F7t,easing:XX.linear}))},[t,a,n,o,s]),(0,W.jsxs)(JQ.View,{style:[L7t.container,l,r],children:[e,(0,W.jsx)(P7t,{colors:[i.bgTransparent,i.paginationActive],start:{x:0,y:1},end:{x:1,y:1},style:[L7t.gradient,c]})]})}var L7t=R.create({container:{position:`relative`,overflow:`hidden`,borderRadius:16,borderWidth:1},gradient:{position:`absolute`,top:0,bottom:0,right:0,left:0,borderRadius:20}});YQ();var R7t={duration:70,easing:XX.inOut(XX.ease)},z7t=3,B7t=4;function B4({isAnimated:e,message:t,type:n=`error`,children:r}){let i=fQ(0),a=(0,H.useCallback)(()=>{i.value=UX(QX(z7t,R7t),bjt(QX(-3,R7t),B7t,!0),QX(0,R7t))},[i]);(0,H.useEffect)(()=>{e&&a()},[e,a]);let o=mQ(()=>({transform:[{translateX:i.value}]}),Oq?[i]:void 0);return(0,W.jsxs)(JQ.View,{style:o,children:[r,e&&!!t&&(0,W.jsx)(m3,{message:t,type:n})]})}V();function V4(e){let{COLORS:t}=J();return(0,W.jsx)(B,{style:[V7t.backdropWrapper,{backgroundColor:t.bgTransparent}],children:(0,W.jsx)(iWt,{...e,disappearsOnIndex:-1,appearsOnIndex:0,pressBehavior:`none`})})}var V7t=R.create({backdropWrapper:{position:`absolute`,top:0,left:0,right:0,bottom:0}});V();var H4=function(e){return e.Primary=`Primary`,e.Secondary=`Secondary`,e.Plain=`Plain`,e.Error=`Error`,e.ErrorSecondary=`ErrorSecondary`,e}({});function U4({title:e,onPress:t,type:n=`Primary`,size:r=`Large`,disabled:i=!1,inactive:a=!1,leftIcon:o,rightIcon:s,style:c,testID:l}){let{COLORS:u}=J();return(0,W.jsxs)(wp,{onPress:t,disabled:i,accessibilityRole:`button`,testID:l,style:({pressed:e})=>[W4.button,{backgroundColor:u.bgButtonPrimary},r===`Small`&&W4.small,n===`Secondary`&&{backgroundColor:u.bgButtonSecondary,borderColor:u.buttonBorder,borderWidth:2},n===`Plain`&&{backgroundColor:u.bgTransparent},n===`Error`&&{backgroundColor:u.bgButtonPrimaryDanger},n===`ErrorSecondary`&&{backgroundColor:u.bgButtonSecondaryDanger,borderColor:u.buttonBorder,borderWidth:2},e&&n===`Primary`&&{backgroundColor:u.bgButtonPrimaryPressed},e&&n===`Secondary`&&{backgroundColor:u.bgButtonSecondaryPressed},e&&n===`Error`&&{backgroundColor:u.bgButtonPrimaryDangerPressed},e&&n===`ErrorSecondary`&&{backgroundColor:u.bgButtonSecondaryDangerPressed},(i||a)&&n===`Primary`&&{backgroundColor:u.bgButtonPrimaryDisabled},(i||a)&&n===`Secondary`&&{backgroundColor:u.bgButtonSecondaryDisabled},(i||a)&&n===`Error`&&{backgroundColor:u.bgButtonPrimaryDangerDisabled},c],children:[(0,W.jsx)(B,{style:W4.leftIcon,children:o}),(0,W.jsx)(Z,{style:[W4.text,{color:u.textButtonPrimary},n===`Secondary`&&{color:u.textButtonSecondary},n===`Plain`&&{color:u.textLink},r===`Small`&&W4.smallText,n===`ErrorSecondary`&&{color:u.textButtonSecondaryDanger},(i||a)&&{color:u.textButtonPrimaryDisabled}],children:e}),(0,W.jsx)(B,{style:W4.rightIcon,children:s})]})}var W4=R.create({button:{paddingHorizontal:16,paddingVertical:12,borderRadius:16,flexDirection:`row`,alignItems:`center`,justifyContent:`center`},small:{paddingVertical:8},text:{...Y.Poppins.semiBold_Base,textAlign:`center`},smallText:{...Y.Poppins.semiBold_SM},leftIcon:{marginRight:8},rightIcon:{marginLeft:8}});V();function H7t(){let{COLORS:e}=J(),t=Array.from({length:20},(e,t)=>`dot-${t}`);return(0,W.jsx)(B,{style:[U7t.container,{backgroundColor:e.bgTransparent}],children:t.map(t=>(0,W.jsx)(B,{testID:t,style:[U7t.line,{backgroundColor:e.divider}]},t))})}var U7t=R.create({container:{flexDirection:`row`,justifyContent:`space-between`,alignItems:`center`,width:`100%`},line:{width:8,height:1,borderRadius:4}});F4();var W7t=e=>{let{COLORS:t}=J();return(0,W.jsxs)(E4,{width:20,height:20,viewBox:`0 0 20 20`,fill:`none`,...e,children:[(0,W.jsx)(w4,{d:`M4.81738 6.83594C6.59811 5.11785 9.46041 4.98819 11.332 6.54199C11.5137 6.69199 11.6904 6.85158 11.8662 7.01074C12.1836 7.29814 12.483 7.56917 12.8037 7.7666C13.7245 8.3322 14.9312 8.36107 15.9902 8.31445C16.4334 8.30126 16.8393 8.65051 16.8594 9.11035C16.8795 9.5703 16.5234 9.95941 16.0635 9.97949C15.8461 9.98865 15.6177 9.99609 15.3828 9.99609C14.2795 9.99609 13.0123 9.85152 11.9307 9.18652C11.4774 8.9082 11.1062 8.5709 10.7471 8.24512C10.7287 8.22762 10.7088 8.21296 10.6904 8.19629C10.1172 8.98441 9.82944 9.63115 10.0518 10.4609C10.1526 10.8367 10.4013 11.1598 10.6904 11.5322C11.1129 12.0789 11.593 12.6983 11.6855 13.6191C11.8188 14.9432 11.2578 16.1417 10.7637 17.1982L10.5615 17.6357C10.4223 17.943 10.1192 18.1259 9.80273 18.126C9.68774 18.126 9.57064 18.1018 9.45898 18.0518C9.03993 17.8618 8.85405 17.3673 9.04297 16.9482L9.25391 16.4922C9.67724 15.588 10.1148 14.6517 10.0273 13.7842C9.98303 13.3402 9.71292 12.9924 9.37305 12.5518C9.02395 12.1027 8.62885 11.5924 8.44141 10.8926C8.03918 9.39197 8.60453 8.24175 9.28613 7.29102C8.17218 6.93024 6.85461 7.18714 5.97461 8.03516C5.64461 8.35428 5.11673 8.34627 4.7959 8.01465C4.47674 7.68298 4.48572 7.1551 4.81738 6.83594ZM7.34863 12.0977C7.75279 11.8786 8.25936 12.0285 8.47852 12.4326C8.69814 12.8367 8.54749 13.3425 8.14355 13.5625C7.58531 13.8658 6.89933 14.19 6.04785 14.2959C5.56461 14.3559 5.10089 14.3527 4.6543 14.3477C4.43596 14.346 4.21624 14.3429 3.99707 14.3496H3.97363C3.52447 14.3496 3.15312 13.9917 3.14062 13.54C3.12756 13.0803 3.48938 12.6969 3.94922 12.6836C4.19 12.6761 4.4308 12.6798 4.66992 12.6807C5.07824 12.6857 5.46916 12.6884 5.84082 12.6426C6.4158 12.5701 6.90531 12.3385 7.34863 12.0977ZM12.8105 1.875C13.9545 1.87526 14.8848 2.80633 14.8848 3.95117C14.8846 5.09419 13.9544 6.02513 12.8105 6.02539C11.6665 6.02539 10.7365 5.09435 10.7363 3.95117C10.7363 2.80617 11.6664 1.875 12.8105 1.875Z`}),(0,W.jsx)(w4,{d:`M4.81738 6.83594C6.59811 5.11785 9.46041 4.98819 11.332 6.54199C11.5137 6.69199 11.6904 6.85158 11.8662 7.01074C12.1836 7.29814 12.483 7.56917 12.8037 7.7666C13.7245 8.3322 14.9312 8.36107 15.9902 8.31445C16.4334 8.30126 16.8393 8.65051 16.8594 9.11035C16.8795 9.5703 16.5234 9.95941 16.0635 9.97949C15.8461 9.98865 15.6177 9.99609 15.3828 9.99609C14.2795 9.99609 13.0123 9.85152 11.9307 9.18652C11.4774 8.9082 11.1062 8.5709 10.7471 8.24512C10.7287 8.22762 10.7088 8.21296 10.6904 8.19629C10.1172 8.98441 9.82944 9.63115 10.0518 10.4609C10.1526 10.8367 10.4013 11.1598 10.6904 11.5322C11.1129 12.0789 11.593 12.6983 11.6855 13.6191C11.8188 14.9432 11.2578 16.1417 10.7637 17.1982L10.5615 17.6357C10.4223 17.943 10.1192 18.1259 9.80273 18.126C9.68774 18.126 9.57064 18.1018 9.45898 18.0518C9.03993 17.8618 8.85405 17.3673 9.04297 16.9482L9.25391 16.4922C9.67724 15.588 10.1148 14.6517 10.0273 13.7842C9.98303 13.3402 9.71292 12.9924 9.37305 12.5518C9.02395 12.1027 8.62885 11.5924 8.44141 10.8926C8.03918 9.39197 8.60453 8.24175 9.28613 7.29102C8.17218 6.93024 6.85461 7.18714 5.97461 8.03516C5.64461 8.35428 5.11673 8.34627 4.7959 8.01465C4.47674 7.68298 4.48572 7.1551 4.81738 6.83594ZM7.34863 12.0977C7.75279 11.8786 8.25936 12.0285 8.47852 12.4326C8.69814 12.8367 8.54749 13.3425 8.14355 13.5625C7.58531 13.8658 6.89933 14.19 6.04785 14.2959C5.56461 14.3559 5.10089 14.3527 4.6543 14.3477C4.43596 14.346 4.21624 14.3429 3.99707 14.3496H3.97363C3.52447 14.3496 3.15312 13.9917 3.14062 13.54C3.12756 13.0803 3.48938 12.6969 3.94922 12.6836C4.19 12.6761 4.4308 12.6798 4.66992 12.6807C5.07824 12.6857 5.46916 12.6884 5.84082 12.6426C6.4158 12.5701 6.90531 12.3385 7.34863 12.0977ZM12.8105 1.875C13.9545 1.87526 14.8848 2.80633 14.8848 3.95117C14.8846 5.09419 13.9544 6.02513 12.8105 6.02539C11.6665 6.02539 10.7365 5.09435 10.7363 3.95117C10.7363 2.80617 11.6664 1.875 12.8105 1.875Z`,fill:e?.color??t.labelSecondary})]})};F4(),F4(),F4(),F4();var G7t=e=>{let{COLORS:t}=J();return(0,W.jsx)(E4,{width:28,height:28,viewBox:`0 0 28 28`,fill:`none`,...e,children:(0,W.jsx)(w4,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M9.4452 3.33358C9.53721 2.85916 9.99637 2.54917 10.47079 2.64117C12.07722 2.95271 13.21017 3.76487 13.92302 4.85901C14.50532 5.75296 14.77842 6.78912 14.85252 7.80713C15.44362 7.75533 16.03492 7.64974 16.62682 7.49032C17.38252 7.28637 19.19342 7.00613 20.90932 7.77408C22.69992 8.57541 24.20662 10.43267 24.43552 14.1389C24.43622 14.1504 24.43652 14.1619 24.43662 14.1734C24.46542 17.668 23.35262 20.3065 22.07672 22.0933C21.44052 22.9841 20.76212 23.6657 20.16092 24.1381C19.86062 24.374 19.57342 24.5625 19.31412 24.6993C19.08312 24.8211 18.83432 24.9233 18.59832 24.9583C17.50482 25.2157 16.50382 25.0315 15.70462 24.8108C15.45902 24.7429 15.20402 24.6626 14.98022 24.5923C14.85492 24.5528 14.73942 24.5164 14.64082 24.487C14.32552 24.3931 14.12872 24.3525 14.00002 24.3525C13.86462 24.3525 13.66412 24.3918 13.35203 24.4796C13.25053 24.5082 13.12838 24.5447 12.99538 24.5843C12.77698 24.6496 12.52942 24.7234 12.29643 24.7852C11.49994 24.9966 10.50679 25.1771 9.41139 24.9597C9.1722 24.925 8.91798 24.8207 8.68005 24.6947C8.42049 24.5573 8.13308 24.3684 7.83257 24.1321C7.23099 23.6593 6.55306 22.9781 5.91769 22.088C4.64338 20.3028 3.53397 17.6676 3.56204 14.1735C3.56214 14.1619 3.56253 14.1505 3.56325 14.1389C3.7921 10.4326 5.29916 8.57537 7.08981 7.77407C8.80599 7.0061 10.61708 7.28639 11.37217 7.49041C11.94736 7.64528 12.52195 7.74936 13.0963 7.80263C13.02571 7.05663 12.81922 6.37071 12.45662 5.81426C12.01422 5.13507 11.29975 4.58453 10.13761 4.35915C9.66321 4.26715 9.3532 3.80799 9.4452 3.33358ZM10.09846 11.97781C10.53493 11.77038 10.7206 11.2484 10.51318 10.81193C10.30576 10.37546 9.78378 10.18978 9.34731 10.3972C8.07326 11.00266 7.15049 12.26155 6.95814 13.6597C6.89228 14.1385 7.22697 14.5799 7.70571 14.6457C8.18446 14.7117 8.62595 14.3769 8.69181 13.8983C8.80367 13.0851 9.35655 12.33038 10.09846 11.97781Z`,fill:e?.color??t.labelPrimary})})};F4(),F4(),F4(),F4(),F4(),F4(),F4(),F4(),F4(),F4(),F4(),F4();function K7t(e){let{COLORS:t}=J();return(0,W.jsxs)(E4,{width:23,height:20,viewBox:`0 0 23 20`,fill:`none`,...e,children:[(0,W.jsx)(w4,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M10.8641 15.3776C8.44108 15.3776 6.46974 13.4062 6.46974 10.9832C6.46974 8.56014 8.44108 6.5888 10.8641 6.5888C13.2871 6.5888 15.2585 8.56014 15.2585 10.9832C15.2585 13.4062 13.2871 15.3776 10.8641 15.3776ZM13.2834 1.43642C13.2484 0.769162 12.7374 0.189967 12.0692 0.182889C10.9786 0.171329 9.44257 0.156738 8.63662 0.156738C7.50001 0.156738 6.45259 0.774216 5.90144 1.77133C5.39603 2.69183 5.1822 2.95712 5.14103 3.00286C4.85402 3.30359 4.46639 3.4774 4.07304 3.49455C1.82955 3.49455 0.00228694 5.31954 0 7.56302V14.0157C0 16.9201 2.36241 19.2825 5.26682 19.2825H16.4591C19.3635 19.2825 21.7259 16.9201 21.7259 14.0157C21.7259 12.9664 21.7234 11.9162 21.722 10.8669C21.7214 10.2511 21.2307 9.75404 20.6232 9.65307C16.5966 8.98414 13.4964 5.49205 13.2834 1.43642Z`,fill:t.labelPrimary}),(0,W.jsx)(w4,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M10.8627 8.3042C9.38534 8.3042 8.18359 9.506 8.18359 10.9834C8.18359 12.4607 9.38534 13.6625 10.8627 13.6625C12.3401 13.6625 13.5419 12.4607 13.5419 10.9834C13.5419 9.506 12.3401 8.3042 10.8627 8.3042Z`,fill:t.labelPrimary}),(0,W.jsx)(w4,{d:`M19.3924 6.86087C19.3269 6.47375 19.1541 6.05686 18.8742 5.61019C18.5943 5.15756 18.1953 4.73769 17.6772 4.35058C17.165 3.96346 16.6528 3.7163 16.1406 3.6091V3.2339C16.6468 3.11479 17.1322 2.89443 17.5968 2.57283C18.0673 2.24527 18.4603 1.8522 18.776 1.39361C19.0976 0.92312 19.303 0.458582 19.3924 0H19.7676C19.8212 0.29778 19.9284 0.604495 20.0892 0.920142C20.25 1.22983 20.4554 1.52762 20.7056 1.81348C20.9617 2.0934 21.2475 2.34651 21.5632 2.57283C22.0337 2.90634 22.5131 3.1267 23.0014 3.2339V3.6091C22.6739 3.67461 22.3344 3.80862 21.983 4.01111C21.6376 4.2136 21.316 4.4548 21.0182 4.73471C20.7205 5.00867 20.4763 5.29752 20.2857 5.60126C20.0058 6.04793 19.8331 6.4678 19.7676 6.86087H19.3924Z`,fill:`url(#paint0_linear_14232_28129)`}),(0,W.jsx)(S4,{children:(0,W.jsxs)(C4,{id:`paint0_linear_14232_28129`,x1:16.1406,y1:3.43043,x2:23.0014,y2:3.43043,gradientUnits:`userSpaceOnUse`,children:[(0,W.jsx)(T4,{stopColor:b2[0]}),(0,W.jsx)(T4,{offset:.490385,stopColor:b2[1]}),(0,W.jsx)(T4,{offset:1,stopColor:b2[2]})]})})]})}F4();var q7t=e=>{let{COLORS:t}=J();return(0,W.jsxs)(E4,{width:`40`,height:`84`,viewBox:`0 0 40 84`,...e,children:[(0,W.jsx)(w4,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M40.0001 28.9285V24.5471C39.5337 24.6152 39.0574 24.65 38.5725 24.65C33.7881 24.65 29.7894 21.2357 28.8091 16.675H37.1449V12.325H28.8091C29.7894 7.76427 33.7881 4.35 38.5725 4.35C39.0574 4.35 39.5337 4.3848 40.0001 4.45247V0.0715333C39.5304 0.0241667 39.0545 0 38.5725 0C30.6878 0 24.2964 6.49165 24.2964 14.5C24.2964 22.5084 30.6878 29 38.5725 29C39.0545 29 39.5304 28.9758 40.0001 28.9285Z`,fill:t.labelPrimary}),(0,W.jsx)(w4,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M0 14.5C0 22.5084 6.35291 29 14.1901 29C14.7014 29 15.2066 28.9725 15.7037 28.9188V24.533C15.2104 24.6104 14.7047 24.65 14.1901 24.65C8.7042 24.65 4.25703 20.1057 4.25703 14.5C4.25703 8.8943 8.7042 4.35 14.1901 4.35C14.7047 4.35 15.2104 4.38963 15.7037 4.46697V0.0812C15.2066 0.02755 14.7014 0 14.1901 0C6.35291 0 0 6.49165 0 14.5Z`,fill:t.labelPrimary}),(0,W.jsx)(w4,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M3.07255 44C4.12117 44 4.89209 43.648 5.38529 42.9439C5.8785 42.2398 6.1251 41.1635 6.1251 39.7152V38.111C6.11177 36.7117 5.85851 35.6767 5.3653 35.006C4.87209 34.3353 4.1034 34 3.05922 34C2.00616 34 1.23302 34.3476 0.739811 35.0428C0.246604 35.738 0 36.8008 0 38.2313V39.8824C0.0177732 41.2504 0.275485 42.2787 0.773136 42.9672C1.27079 43.6557 2.03726 44 3.07255 44ZM3.07255 42.9906C2.45493 42.9906 1.99394 42.74 1.68957 42.2386C1.3852 41.7373 1.23302 40.9608 1.23302 39.9091V37.9305C1.24191 36.9412 1.39076 36.2081 1.67957 35.7313C1.96839 35.2545 2.42827 35.016 3.05922 35.016C3.69461 35.016 4.15894 35.2556 4.4522 35.7346C4.74546 36.2137 4.89209 36.9768 4.89209 38.0241V40.0495C4.87876 41.0655 4.72435 41.8097 4.42887 42.2821C4.13339 42.7545 3.68128 42.9906 3.07255 42.9906ZM15.4217 34.0869V43.8663H14.182V35.6243L11.696 36.5401V35.4171L15.2284 34.0869H15.4217ZM29.0572 43.8663V42.857H24.1851L26.7844 40.0294C28.0019 38.7059 28.6106 37.5651 28.6106 36.607C28.6106 35.8182 28.3485 35.1865 27.8242 34.7119C27.2998 34.2373 26.5867 34 25.6847 34C24.7205 34 23.9507 34.2763 23.3753 34.8289C22.7999 35.3815 22.5122 36.1056 22.5122 37.0013H23.7452C23.7452 36.3775 23.9151 35.8906 24.2551 35.5408C24.595 35.191 25.0715 35.016 25.6847 35.016C26.1957 35.016 26.6045 35.1787 26.911 35.504C27.2176 35.8293 27.3709 36.246 27.3709 36.754C27.3709 37.1328 27.2765 37.4993 27.0877 37.8536C26.8988 38.2079 26.5556 38.668 26.0579 39.234L22.6988 42.9773V43.8663H29.0572ZM39.1469 43.2313C38.5781 43.7438 37.8383 44 36.9275 44C36.0166 44 35.2757 43.7527 34.7047 43.258C34.1337 42.7634 33.8482 42.1105 33.8482 41.2995H35.0879C35.0879 41.8119 35.2545 42.2219 35.5878 42.5294C35.921 42.8369 36.3676 42.9906 36.9275 42.9906C37.5229 42.9906 37.9783 42.8347 38.2938 42.5227C38.6092 42.2108 38.767 41.7629 38.767 41.1791C38.767 40.6132 38.5937 40.1787 38.2471 39.8757C37.9005 39.5726 37.4007 39.4167 36.7475 39.4078H35.8211V38.3984H36.7475C37.3296 38.3895 37.7872 38.2357 38.1205 37.9372C38.4537 37.6386 38.6204 37.2353 38.6204 36.7273C38.6204 35.5865 38.0538 35.016 36.9208 35.016C36.3876 35.016 35.9621 35.1687 35.6444 35.4739C35.3267 35.7792 35.1679 36.1836 35.1679 36.6872H33.9349C33.9349 35.9162 34.2159 35.2756 34.778 34.7654C35.3401 34.2551 36.0543 34 36.9208 34C37.8361 34 38.5537 34.2429 39.0736 34.7286C39.5934 35.2143 39.8534 35.8895 39.8534 36.754C39.8534 37.1774 39.7167 37.5873 39.4435 37.984C39.1702 38.3806 38.7981 38.6769 38.3271 38.873C38.8603 39.0423 39.2724 39.3231 39.5634 39.7152C39.8545 40.1074 40 40.5865 40 41.1524C40 42.0258 39.7156 42.7188 39.1469 43.2313Z`,fill:t.labelPrimary}),(0,W.jsx)(w4,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M38.5714 58.4286H1.42857V82H38.5714V58.4286ZM0 57V83.4286H40V57H0Z`,fill:t.labelPrimary}),(0,W.jsx)(w4,{d:`M4.4248 78.0714V62.2211H9.21449L12.0905 73.033L14.934 62.2211H19.7345V78.0714H16.7612V65.5944L13.615 78.0714H10.5336L7.39809 65.5944V78.0714H4.4248Z`,fill:t.labelPrimary}),(0,W.jsx)(w4,{d:`M22.4596 62.2211H28.3088C29.6279 62.2211 30.6334 62.322 31.3253 62.5238C32.2552 62.7977 33.0517 63.2842 33.7148 63.9834C34.3779 64.6826 34.8825 65.5403 35.2285 66.5567C35.5744 67.5658 35.7474 68.8127 35.7474 70.2976C35.7474 71.6022 35.5853 72.7267 35.2609 73.6709C34.8645 74.8242 34.2986 75.7576 33.5634 76.4712C33.0084 77.0118 32.2588 77.4335 31.3145 77.7362C30.6082 77.9597 29.6639 78.0714 28.4818 78.0714H22.4596V62.2211ZM25.6599 64.9024V75.4008H28.0493C28.9431 75.4008 29.5882 75.3504 29.9847 75.2495C30.5036 75.1197 30.9325 74.8999 31.2713 74.5899C31.6173 74.28 31.8984 73.7718 32.1146 73.0654C32.3309 72.3519 32.439 71.3824 32.439 70.157C32.439 68.9317 32.3309 67.991 32.1146 67.3351C31.8984 66.6792 31.5956 66.1674 31.2064 65.7998C30.8172 65.4322 30.3234 65.1835 29.7252 65.0538C29.2783 64.9529 28.4025 64.9024 27.0979 64.9024H25.6599Z`,fill:t.labelPrimary})]})};F4(),F4();var G4=e=>{let{COLORS:t}=J();return(0,W.jsx)(E4,{width:16,height:16,viewBox:`0 0 16 16`,fill:`none`,...e,children:(0,W.jsx)(w4,{d:`M13.5169 2.91265C13.7869 3.10515 13.8469 3.48015 13.6544 3.75015L7.05442 12.9502C6.95192 13.0927 6.79192 13.1852 6.61692 13.1977C6.44192 13.2102 6.26692 13.1502 6.14192 13.0252L2.74192 9.62515C2.50692 9.39015 2.50692 9.01015 2.74192 8.77765C2.97692 8.54515 3.35692 8.54265 3.58942 8.77765L6.49192 11.6752L12.6794 3.05015C12.8719 2.78015 13.2469 2.72015 13.5169 2.91265Z`,fill:e?.color??t.labelPrimary})})};F4(),F4(),F4();var J7t=e=>{let{COLORS:t}=J();return(0,W.jsx)(E4,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,W.jsx)(w4,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M16.3344 3.38489H7.6654C4.6444 3.38489 2.7504 5.52389 2.7504 8.55089V16.7189C2.7504 19.7459 4.6354 21.8849 7.6654 21.8849H16.3334C19.3644 21.8849 21.2504 19.7459 21.2504 16.7189V8.55089C21.2504 5.52389 19.3644 3.38489 16.3344 3.38489Z`,stroke:e?.color??t.labelPrimary,strokeWidth:1.5,strokeLinecap:`round`,strokeLinejoin:`round`})})};F4();var Y7t=e=>{let{COLORS:t}=J();return(0,W.jsx)(E4,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,W.jsx)(w4,{d:`M14.5784 9.44215L14.5784 9.44219L10.8449 13.1767L9.41855 11.7512C9.41852 11.7511 9.41849 11.7511 9.41845 11.7511C8.93018 11.2629 8.13968 11.2629 7.65145 11.7512C7.16318 12.2394 7.16318 13.031 7.65145 13.5193L9.96045 15.8283C10.2049 16.0727 10.5246 16.1947 10.845 16.1947C11.1647 16.1947 11.4844 16.0724 11.7286 15.8283L16.3466 11.2103C16.8348 10.722 16.8348 9.93041 16.3466 9.44215C15.8583 8.95389 15.0667 8.95389 14.5784 9.44215ZM7.782 3.6347H16.217C17.6754 3.6347 18.8605 4.14442 19.6821 5.00394C20.5055 5.86543 21 7.11668 21 8.66171V16.6097C21 18.1541 20.5053 19.4048 19.6817 20.266C18.8599 21.1252 17.6745 21.6347 16.216 21.6347H7.782C6.32407 21.6347 5.13922 21.1252 4.31777 20.266C3.49445 19.4049 3 18.1542 3 16.6097V8.66171C3 7.11668 3.49448 5.86541 4.31784 5.00392C5.13931 4.14439 6.32414 3.6347 7.782 3.6347Z`,fill:e?.color??t.iconBrand,stroke:e?.color??t.iconBrand})})};F4(),F4(),F4();var X7t=e=>{let{COLORS:t}=J();return(0,W.jsx)(E4,{width:28,height:28,viewBox:`0 0 28 28`,fill:`none`,...e,children:(0,W.jsx)(w4,{d:`M7.41113 13.0113C6.86426 13.5582 6.86426 14.4463 7.41113 14.9932L15.8111 23.3932C16.358 23.9401 17.2461 23.9401 17.793 23.3932C18.3399 22.8463 18.3399 21.9582 17.793 21.4113L10.3818 14.0001L17.7886 6.58881C18.3355 6.04193 18.3355 5.15381 17.7886 4.60693C17.2418 4.06006 16.3536 4.06006 15.8068 4.60693L7.40676 13.0069L7.41113 13.0113Z`,fill:e.color??t.labelPrimary})})};F4();var K4=e=>{let{COLORS:t}=J();return(0,W.jsx)(E4,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,W.jsx)(w4,{d:`M8.21967 20.0899C7.9534 19.8236 7.9292 19.407 8.14705 19.1134L8.21967 19.0292L14.689 12.5596L8.21967 6.0899C7.9534 5.82363 7.9292 5.40697 8.14705 5.11336L8.21967 5.02924C8.48594 4.76297 8.9026 4.73877 9.19621 4.95662L9.28033 5.02924L16.2803 12.0292C16.5466 12.2955 16.5708 12.7122 16.3529 13.0058L16.2803 13.0899L9.28033 20.0899C8.98744 20.3828 8.51256 20.3828 8.21967 20.0899Z`,fill:e.color??t.labelSecondary})})};F4(),F4(),F4();var Z7t=e=>{let{COLORS:t}=J();return(0,W.jsx)(E4,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,W.jsx)(w4,{d:`M6.72911 6.34559C6.44794 6.06441 5.99206 6.06441 5.71088 6.34559C5.42971 6.62676 5.42971 7.08264 5.71088 7.36382L10.9617 12.6147L5.71088 17.8656C5.42971 18.1468 5.42971 18.6026 5.71088 18.8838C5.99206 19.165 6.44794 19.165 6.72911 18.8838L11.98 13.633L17.2309 18.8838C17.5121 19.165 17.9679 19.165 18.2491 18.8838C18.5303 18.6026 18.5303 18.1468 18.2491 17.8656L12.9983 12.6147L18.2491 7.36382C18.5303 7.08264 18.5303 6.62676 18.2491 6.34559C17.9679 6.06441 17.5121 6.06441 17.2309 6.34559L11.98 11.5964L6.72911 6.34559Z`,fill:e?.color??t.labelPrimary})})};F4();var Q7t=e=>{let{COLORS:t}=J();return(0,W.jsx)(E4,{width:28,height:28,viewBox:`0 0 28 28`,fill:`none`,...e,children:(0,W.jsx)(w4,{d:`M5.92758 7.39361C5.51633 6.98236 5.51633 6.31736 5.92758 5.91049C6.33883 5.50361 7.00383 5.49924 7.4107 5.91049L14.017 12.5167L20.6232 5.91049C21.0345 5.49924 21.6995 5.49924 22.1063 5.91049C22.5132 6.32174 22.5176 6.98674 22.1063 7.39361L15.5001 13.9999L22.1063 20.6061C22.5176 21.0174 22.5176 21.6824 22.1063 22.0892C21.6951 22.4961 21.0301 22.5005 20.6232 22.0892L14.017 15.483L7.4107 22.0892C6.99945 22.5005 6.33445 22.5005 5.92758 22.0892C5.5207 21.678 5.51633 21.013 5.92758 20.6061L12.5338 13.9999L5.92758 7.39361Z`,fill:e.color??t.labelPrimary})})};F4(),F4(),F4();var $7t=e=>{let{COLORS:t}=J();return(0,W.jsx)(E4,{width:28,height:28,viewBox:`0 0 28 28`,fill:`none`,...e,children:(0,W.jsx)(w4,{d:`M9.47572 16.8973L9.47563 16.8974C8.70231 17.2102 8.33375 18.0938 8.63669 18.8671C9.37596 20.7542 11.0517 22.3823 13.4637 22.6627C14.2958 22.7594 15.0352 22.1525 15.1284 21.3254L15.1284 21.3253C15.2214 20.4994 14.6377 19.741 13.8072 19.6443L13.8071 19.6443C12.6515 19.5101 11.8233 18.75 11.4309 17.7484L10.984 17.9235L11.4309 17.7484C11.1265 16.9714 10.253 16.5831 9.47572 16.8973ZM14.5 25.9455C10.7597 25.9455 8.05158 23.8421 6.67199 21.0789C5.2861 18.303 5.26321 14.906 6.85972 12.3608C9.34794 8.73088 12.9056 5.98426 14.2429 5.02279C14.3998 4.91003 14.6002 4.91003 14.7571 5.0228C16.0944 5.98427 19.6519 8.73087 22.1402 12.3608C23.7367 14.9059 23.7138 18.303 22.3279 21.0789C20.9483 23.8421 18.2402 25.9455 14.5 25.9455Z`,fill:e?.color??t.iconButtonPrimary,stroke:e?.color??t.iconButtonPrimary,strokeWidth:.96})})};F4();var e9t=e=>{let{COLORS:t}=J();return(0,W.jsx)(E4,{width:16,height:16,viewBox:`0 0 16 16`,fill:`none`,...e,children:(0,W.jsx)(w4,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M7.60028 2.02149C7.8446 2.02149 8.04288 2.21977 8.04288 2.46409C8.04288 2.7084 7.8446 2.90668 7.60028 2.90668H5.39379C3.8689 2.90668 2.88397 3.95121 2.88397 5.56757V10.4739C2.88397 12.0903 3.8689 13.1348 5.39379 13.1348H10.6011C12.126 13.1348 13.1115 12.0903 13.1115 10.4739V8.09687C13.1115 7.85255 13.3098 7.65427 13.5541 7.65427C13.7984 7.65427 13.9967 7.85255 13.9967 8.09687V10.4739C13.9967 12.5948 12.6317 14.02 10.6011 14.02H5.39379C3.36316 14.02 1.99878 12.5948 1.99878 10.4739V5.56757C1.99878 3.44665 3.36316 2.02149 5.39379 2.02149H7.60028ZM12.7401 2.53998L13.4583 3.25816C13.8082 3.60752 14.0006 4.07195 14 4.56648C14 5.06101 13.8076 5.52485 13.4583 5.87361L9.02698 10.3049C8.70182 10.6301 8.26866 10.8095 7.80836 10.8095H5.59774C5.47853 10.8095 5.36405 10.7611 5.28084 10.6755C5.19763 10.5905 5.15219 10.4754 5.15514 10.3556L5.21062 8.12555C5.22183 7.68177 5.40064 7.26455 5.71459 6.95001L10.1252 2.53998C10.8463 1.82002 12.0189 1.82002 12.7401 2.53998ZM9.76193 4.15457L6.34071 7.57614C6.18787 7.72898 6.10112 7.93198 6.09581 8.14738L6.05155 9.92426H7.80836C8.03261 9.92426 8.2427 9.83751 8.40144 9.67877L11.8433 6.23595L9.76193 4.15457ZM10.7507 3.1661L10.3875 3.52844L12.4688 5.61042L12.8327 5.24749C13.0145 5.06573 13.1148 4.82378 13.1148 4.56648C13.1148 4.30859 13.0145 4.06605 12.8327 3.88429L12.1145 3.1661C11.7386 2.79137 11.1272 2.79137 10.7507 3.1661Z`,fill:e?.color??t.labelPrimary})})};F4(),F4(),F4();var t9t=e=>{let{COLORS:t}=J();return(0,W.jsxs)(E4,{width:48,height:48,viewBox:`0 0 48 48`,fill:`none`,...e,children:[(0,W.jsx)(w4,{d:`M17.333 5.03309C16.7472 4.4473 15.7974 4.4473 15.2116 5.03309C14.6258 5.61889 14.6258 6.56862 15.2116 7.15442C15.5606 7.50335 15.559 8.06675 15.2127 8.41225C13.6935 9.93153 13.6908 12.3972 15.2127 13.916C15.7991 14.5012 16.7489 14.5002 17.3341 13.9138C17.9192 13.3274 17.9182 12.3777 17.3318 11.7925C16.9856 11.447 16.984 10.8836 17.333 10.5347C18.8538 9.01579 18.8519 6.552 17.333 5.03309Z`,fill:t.labelSecondary}),(0,W.jsx)(w4,{d:`M37.1069 11.7755C37.6927 11.1897 37.6927 10.24 37.1069 9.65418C36.5211 9.0684 35.5715 9.0684 34.9857 9.65418C33.4663 11.1735 33.4647 13.6381 34.9867 15.1569C35.5731 15.7421 36.5229 15.7411 37.1081 15.1547C37.6933 14.5683 37.6923 13.6185 37.1059 13.0333C36.7597 12.6878 36.7581 12.1244 37.1069 11.7755Z`,fill:t.labelSecondary}),(0,W.jsx)(w4,{d:`M8.40636 13.0331C7.82058 12.4473 6.87082 12.4473 6.28504 13.0331C5.69926 13.6189 5.69926 14.5686 6.28504 15.1544C6.63396 15.5033 6.63238 16.0667 6.28614 16.4122C5.69976 16.9974 5.69876 17.9472 6.28394 18.5336C6.86912 19.12 7.81886 19.121 8.40526 18.5358C9.92722 17.017 9.92564 14.5524 8.40636 13.0331Z`,fill:t.labelSecondary}),(0,W.jsx)(w4,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M23.9995 12.5234C21.7083 12.5234 19.855 14.3815 19.855 16.6699V18.0328C12.2808 19.6386 6.59484 25.5424 7.02264 32.661C7.05438 33.189 7.49186 33.601 8.02084 33.601H39.9801C40.5091 33.601 40.9467 33.189 40.9783 32.6608C41.4043 25.542 35.7177 19.6381 28.1441 18.0325V16.6699C28.1441 14.3808 26.2881 12.5234 23.9995 12.5234ZM25.1441 17.6333V16.6699C25.1441 16.0362 24.6299 15.5234 23.9995 15.5234C23.3681 15.5234 22.8551 16.0355 22.8551 16.6699V17.6334C23.2339 17.6119 23.6159 17.6011 24.0005 17.6011C24.3843 17.6011 24.7657 17.6119 25.1441 17.6333Z`,fill:t.labelSecondary}),(0,W.jsx)(w4,{d:`M5.59484 36.1688C5.99886 35.8444 6.49376 35.7188 6.99866 35.7188H40.9986C41.5036 35.7188 41.9984 35.8444 42.4026 36.1688C42.8072 36.4936 43.0106 36.9293 43.0992 37.3411C43.2644 38.1095 43.0734 38.9821 42.8434 39.6731C42.1992 41.6053 40.3884 42.9105 38.351 42.9105H9.6464C7.60886 42.9105 5.79824 41.6059 5.15416 39.6735C4.92416 38.9825 4.73288 38.1095 4.8981 37.3411C4.98664 36.9293 5.19018 36.4936 5.59484 36.1688Z`,fill:t.labelSecondary})]})};F4(),F4(),F4(),F4();var n9t=e=>{let{COLORS:t}=J();return(0,W.jsxs)(E4,{width:24,height:24,viewBox:`0 0 28 28`,...e,children:[(0,W.jsx)(w4,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M4 14C4 19.5228 8.47715 24 14 24C19.5228 24 24 19.5228 24 14C24 8.47715 19.5228 4 14 4C8.47715 4 4 8.47715 4 14ZM22.1818 14C22.1818 18.5187 18.5187 22.1818 14 22.1818C9.48128 22.1818 5.81815 18.5187 5.81815 14C5.81815 9.48128 9.48128 5.81815 14 5.81815C18.5187 5.81815 22.1818 9.48128 22.1818 14Z`,fill:e?.color??t.labelPrimary}),(0,W.jsx)(w4,{d:`M15 17.1667C15 17.6269 14.5523 18 14 18C13.4477 18 13 17.6269 13 17.1667V13.8333C13 13.3731 13.4477 13 14 13C14.5523 13 15 13.3731 15 13.8333V17.1667Z`,fill:e?.color??t.labelPrimary}),(0,W.jsx)(w4,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M14 11C14.5523 11 15 10.5523 15 10C15 9.44772 14.5523 9 14 9C13.4477 9 13 9.44772 13 10C13 10.5523 13.4477 11 14 11Z`,fill:e?.color??t.labelPrimary})]})};F4();var r9t=e=>{let{COLORS:t}=J();return(0,W.jsxs)(E4,{width:96,height:96,viewBox:`0 0 96 96`,fill:`none`,...e,children:[(0,W.jsx)(w4,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M52.2852 24.2694C50.5492 24.3303 48.6176 25.1401 46.8084 26.9493L27.7966 45.9612C21.3793 52.3784 21.3806 62.79 27.7987 69.208C34.2162 75.6256 44.6248 75.6252 51.0424 69.2072L70.0544 50.1952C71.866 48.3836 72.6772 46.4544 72.7388 44.7212C72.7996 43.0208 72.1536 41.1848 70.4272 39.457L57.5468 26.5766C55.8264 24.8581 53.9896 24.2097 52.2852 24.2694ZM52.0748 18.2731C55.6128 18.149 59.0172 19.564 61.7876 22.3321L74.6708 35.2153C77.4436 37.9905 78.8612 41.3956 78.7352 44.9348C78.61 48.4416 76.9848 51.7504 74.2972 54.438L55.2852 73.45C46.5244 82.2104 32.317 82.2116 23.556 73.4508C14.7957 64.6904 14.7927 50.48 23.5539 41.7188L42.566 22.7067C45.2556 20.0168 48.5688 18.3961 52.0748 18.2731Z`,fill:e?.color??t.labelPrimary}),(0,W.jsx)(w4,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M27.7976 69.2072C28.969 70.3788 28.9687 72.2784 27.797 73.4496L15.121 86.122C13.9492 87.2932 12.0498 87.2928 10.8784 86.1212C9.70697 84.9496 9.70724 83.05 10.879 81.8784L23.555 69.2064C24.7267 68.0352 26.6262 68.0352 27.7976 69.2072Z`,fill:e?.color??t.labelPrimary}),(0,W.jsx)(w4,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M68.1365 9.87867C69.3081 8.70711 71.2077 8.70711 72.3793 9.87867L87.1181 24.6173C88.2893 25.7889 88.2893 27.6884 87.1181 28.86C85.9465 30.0316 84.0469 30.0316 82.8753 28.86L68.1365 14.1213C66.9649 12.9497 66.9649 11.0502 68.1365 9.87867Z`,fill:e?.color??t.labelPrimary}),(0,W.jsx)(w4,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M79.7549 17.2537C80.9265 18.4252 80.9265 20.3248 79.7549 21.4963L68.2309 33.0203C67.0593 34.1918 65.1597 34.1918 63.9881 33.0203C62.8165 31.8487 62.8165 29.9492 63.9881 28.7776L75.5121 17.2537C76.6837 16.0821 78.5833 16.0821 79.7549 17.2537Z`,fill:e?.color??t.labelPrimary}),(0,W.jsx)(w4,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M47.5818 57.1287C48.753 55.9571 50.6526 55.9571 51.8242 57.1287L59.5926 64.8967C60.7642 66.0683 60.7642 67.9679 59.5926 69.1395C58.421 70.3111 56.5214 70.3111 55.3498 69.1395L47.5818 61.3711C46.4102 60.1995 46.4102 58.3003 47.5818 57.1287Z`,fill:e?.color??t.labelPrimary}),(0,W.jsx)(w4,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M53.1443 43.9725C54.3159 42.8009 56.2151 42.8009 57.3867 43.9725L68.9575 55.5433C70.1291 56.7149 70.1291 58.614 68.9575 59.7856C67.7859 60.9572 65.8863 60.9572 64.7147 59.7856L53.1443 48.2152C51.9727 47.0436 51.9727 45.1441 53.1443 43.9725Z`,fill:e?.color??t.labelPrimary})]})};F4(),F4(),F4(),F4();var i9t=e=>{let{COLORS:t}=J();return(0,W.jsx)(E4,{width:64,height:64,viewBox:`0 0 64 64`,fill:`none`,...e,children:(0,W.jsx)(w4,{d:`M32.0162 5.77637C35.6937 5.78027 39.2194 7.24459 41.817 9.84766C44.4148 12.4509 45.8724 15.9796 45.8687 19.6572V23.668C46.6175 23.8333 47.3585 24.0402 48.0875 24.2891C50.1357 25.2755 51.787 26.9291 52.772 28.9775C53.7472 31.8313 54.0844 34.864 53.7594 37.8623V43.54C54.0841 46.54 53.747 49.575 52.772 52.4307C51.7848 54.4775 50.1324 56.1285 48.0845 57.1133C45.2315 58.0909 42.1977 58.4301 39.1988 58.1074H24.7994C21.7994 58.4328 18.7645 58.0963 15.9088 57.1211C13.8627 56.1344 12.211 54.4841 11.2232 52.4385C10.2513 49.582 9.91513 46.5476 10.2388 43.5479V37.8623C9.91468 34.8635 10.2509 31.83 11.2232 28.9746C12.2103 26.9272 13.8636 25.275 15.9117 24.2891C16.6424 24.0395 17.3848 23.8315 18.1353 23.666V19.6279C18.1393 15.9504 19.6035 12.4249 22.2066 9.82716C24.8098 7.2295 28.3387 5.77257 32.0162 5.77637ZM46.357 27.8867C44.0277 27.2523 41.6009 27.052 39.1988 27.2949L24.7994 27.3027C22.3985 27.059 19.9733 27.2597 17.6451 27.8945C16.4144 28.4857 15.421 29.4779 14.8287 30.708C14.1965 33.0367 13.9962 35.4616 14.2388 37.8623V43.54C13.9969 45.9426 14.1971 48.3696 14.8287 50.7002C15.4233 51.9262 16.4149 52.9156 17.6422 53.5078C19.9714 54.1425 22.3976 54.3431 24.7994 54.0996H39.1988C41.5999 54.3428 44.0256 54.1425 46.3541 53.5078C47.5826 52.9161 48.5745 51.9252 49.1676 50.6973C49.8022 48.368 50.0025 45.9418 49.7594 43.54V37.8545C50.0028 35.4536 49.8024 33.0284 49.1676 30.7002C48.5764 29.4712 47.5854 28.479 46.357 27.8867ZM31.9996 35.7549C32.5299 35.7549 33.0387 35.9658 33.4136 36.3408C33.7888 36.7157 33.9995 37.2246 33.9996 37.7549V43.5342C33.9995 44.0644 33.7888 44.5734 33.4136 44.9482C33.0387 45.3232 32.5298 45.5342 31.9996 45.5342C31.4693 45.5341 30.9604 45.3234 30.5855 44.9482C30.2104 44.5734 29.9997 44.0644 29.9996 43.5342V37.7549C29.9997 37.2246 30.2104 36.7157 30.5855 36.3408C30.9604 35.9657 31.4693 35.755 31.9996 35.7549ZM31.8765 9.97755C29.3073 9.99688 26.8483 11.0228 25.0269 12.835C23.2056 14.6473 22.1674 17.1017 22.1353 19.6709V23.1875C23.0227 23.1685 23.9126 23.2066 24.7994 23.3027H39.1988C40.0849 23.2068 40.9743 23.1695 41.8609 23.1885V19.6924C41.8465 18.4004 41.5757 17.1234 41.065 15.9365C40.5541 14.7497 39.8126 13.676 38.8844 12.7774C37.969 11.8574 36.8754 11.1339 35.6705 10.6524C34.4652 10.1708 33.1739 9.94147 31.8765 9.97755Z`,fill:e?.color??t.labelPrimary})})};F4();var a9t=e=>{let{COLORS:t}=J();return(0,W.jsxs)(E4,{width:`40`,height:`29`,viewBox:`0 0 40 29`,...e,children:[(0,W.jsx)(w4,{d:`M29.8431 28.0756C28.6 27.6408 27.4897 26.9403 26.3499 26.2989C25.9038 26.048 25.4406 25.813 24.9615 25.6337C24.3315 25.3975 23.6719 25.5111 23.026 25.5973C22.0712 25.7234 21.1665 25.9947 20.3264 26.484C20.1788 26.5702 19.929 26.5691 19.7463 26.4953C19.6316 26.4488 19.5147 26.3727 19.3978 26.3125C18.5361 25.8755 17.6109 25.6643 16.6584 25.5394C15.7321 25.418 14.875 25.5883 14.0724 26.0651C13.4957 26.4079 12.9122 26.7394 12.3309 27.072C10.7507 27.9779 9.06826 28.5864 7.25074 28.7737C6.13367 28.8884 3.87456 28.8884 2.57812 28.5898C1.70853 28.407 0.858238 28.1312 0 27.8951C0 19.1628 0 10.4317 0 1.69951C0.662977 2.0923 1.33957 2.45444 2.09678 2.63948C3.20817 2.91081 4.33887 3.00957 5.47751 3.08563C6.8852 3.17986 8.24975 3.01865 9.54392 2.46579C10.5236 2.04803 11.467 1.54512 12.4285 1.08308C13.5025 0.566546 14.556 0.0273115 15.8081 0.0205C17.2158 0.0125534 18.5588 0.255494 19.8643 0.761808C19.9472 0.793595 20.0619 0.799268 20.1447 0.769752C21.3095 0.34858 23.6118 -0.225849 25.0422 0.0920169C25.855 0.272519 26.3726 0.516597 27.0061 0.803811C28.0119 1.26018 28.9837 1.78692 29.9827 2.25805C30.9068 2.69398 31.8763 3.02319 32.9014 3.06179C33.8289 3.09698 34.7632 3.0686 35.6895 2.99936C37.1392 2.89151 37.7942 2.87334 39.1032 2.15474C39.6458 1.85731 39.9557 1.4963 40 1.48155C40 10.207 40 19.2116 40 27.9405C38.5253 28.39 37.1301 28.7715 35.484 28.9031C32.8253 29.0473 30.9919 28.4774 29.8431 28.0756ZM19.2945 24.7198C19.2945 17.1739 19.2945 9.62345 19.2945 2.05824C19.2366 2.03327 19.1787 2.00035 19.1162 1.98332C18.5656 1.83233 18.0184 1.67 17.4633 1.53831C16.1771 1.2318 14.9454 1.36121 13.7715 2.00148C13.1086 2.36362 12.4229 2.68262 11.7485 3.02319C9.94012 3.93706 8.05222 4.72037 5.98155 4.58528C4.84745 4.51149 3.81098 4.37753 2.60082 4.17319C2.07407 4.07783 1.80275 4.00404 1.39634 3.91435C1.39634 11.5749 1.39634 19.2196 1.39634 26.8688C1.47807 26.8926 1.54619 26.9119 1.61317 26.9312C3.52945 27.483 5.47637 27.6294 7.44941 27.3433C9.26352 27.08 10.8937 26.3386 12.4331 25.3771C13.2244 24.8821 14.0292 24.3974 14.9522 24.2135C16.4405 23.9172 17.8697 24.2475 19.2945 24.7198ZM38.6264 3.92117C38.5821 3.92911 38.5537 3.93252 38.5276 3.93933C37.3299 4.25265 36.1084 4.39456 34.8744 4.47176C33.2533 4.57279 31.6515 4.48651 30.1428 3.83943C28.8906 3.30246 27.6725 2.68376 26.4408 2.09798C25.7199 1.75514 25.0047 1.38846 24.1794 1.38165C23.3234 1.37483 22.4856 1.50879 21.6637 1.74606C21.3436 1.83801 21.0291 1.94926 20.7124 2.05257C20.7124 9.63594 20.7124 17.1864 20.7124 24.705C21.2584 24.5643 21.8033 24.3974 22.3596 24.2861C23.1872 24.1215 24.0261 24.0239 24.8673 24.1681C25.7517 24.3191 26.518 24.755 27.2865 25.1977C28.1413 25.6893 28.9996 26.1888 29.901 26.5793C32.1237 27.5431 34.4521 27.6816 36.8225 27.2888C37.4253 27.1889 38.0213 27.0425 38.6252 26.9165C38.6264 19.2298 38.6264 11.5851 38.6264 3.92117Z`,fill:t.labelPrimary}),(0,W.jsx)(w4,{d:`M25.7222 22.1271C25.7222 21.6866 25.7222 21.2586 25.7222 20.8125C26.401 20.8125 27.0799 20.8125 27.7803 20.8125C27.7803 18.6669 27.7803 16.5383 27.7803 14.3916C27.131 14.3916 26.4907 14.3916 25.8391 14.3916C25.8391 13.9602 25.8391 13.547 25.8391 13.1235C27.9643 13.1235 30.094 13.1235 32.2407 13.1235C32.2407 15.6801 32.2407 18.2344 32.2407 20.8011C32.8946 20.8011 33.5314 20.8011 34.1842 20.8011C34.1842 21.2473 34.1842 21.6832 34.1842 22.1282C31.3654 22.1271 28.5546 22.1271 25.7222 22.1271Z`,fill:t.labelPrimary}),(0,W.jsx)(w4,{d:`M30.1452 11.5738C28.9521 11.5784 27.9372 10.5624 27.9292 9.3556C27.9224 8.15338 28.9339 7.13281 30.1361 7.1294C31.3576 7.126 32.3714 8.13295 32.3737 9.35219C32.376 10.5567 31.3599 11.5693 30.1452 11.5738Z`,fill:t.labelPrimary})]})};F4();var o9t=e=>{let{COLORS:t}=J();return(0,W.jsx)(E4,{width:`41`,height:`38`,viewBox:`0 0 41 38`,fill:e?.color,...e,children:(0,W.jsx)(w4,{d:`M1 36.5699V23.38L6.78992 13.95L11.38 21.1L15.77 13.95L20.2799 20.9L24.52 13.95L29.2799 21.72H29.2999V1H39.6599L39.5 36.5699H1Z`,stroke:t.labelPrimary,strokeWidth:`1.5`,strokeMiterlimit:`10`})})};F4(),F4();var s9t=e=>{let{COLORS:t}=J();return(0,W.jsx)(E4,{width:97,height:96,viewBox:`0 0 97 96`,fill:`none`,...e,children:(0,W.jsx)(w4,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12.3851 13.1468C13.5574 11.976 15.4569 11.9773 16.6277 13.1496L27.9846 24.5217C28.1023 24.6223 28.2127 24.7326 28.3146 24.8521L42.6984 39.255C42.822 39.3602 42.9376 39.4756 43.0432 39.6003L75.1832 71.7828C76.354 72.9552 76.3524 74.8548 75.1804 76.0256C74.008 77.1964 72.1084 77.1952 70.9376 76.0228L62.0424 67.1156C61.3924 67.0936 60.7448 66.8612 60.2096 66.4088C54.1684 61.3036 45.2316 61.3112 39.2382 66.4328C37.9786 67.5092 36.0849 67.3608 35.0085 66.1012C33.9321 64.8416 34.0807 62.948 35.3402 61.8716C39.9733 57.9124 45.8648 56.1808 51.6056 56.6652L39.8186 44.8624C35.3322 46.0972 31.0205 48.292 27.1617 51.3804C25.8681 52.416 23.9802 52.2064 22.9449 50.9128C21.9096 49.6192 22.1189 47.7312 23.4125 46.696C26.9883 43.8344 30.923 41.6148 35.0573 40.0948L25.3825 30.407C21.9621 32.084 18.6787 34.2088 15.5787 36.709C14.2891 37.7491 12.4003 37.5468 11.3602 36.257C10.3201 34.9674 10.5224 33.0786 11.8121 32.0385C14.6889 29.7185 17.7374 27.6685 20.9314 25.95L12.3822 17.3894C11.2114 16.2171 11.2127 14.3176 12.3851 13.1468ZM83.8028 36.7014C71.9412 27.0553 56.9396 23.1622 42.5252 25.0733C40.8828 25.2911 39.3749 24.1361 39.1571 22.4936C38.9394 20.8511 40.0943 19.3431 41.7368 19.1254C57.7328 17.0046 74.4024 21.3231 87.5884 32.0464C88.8736 33.0918 89.0684 34.9813 88.0228 36.2668C86.9776 37.5522 85.088 37.7468 83.8028 36.7014ZM59.8708 41.7084C60.416 40.144 62.1268 39.3179 63.6912 39.8634C68.0844 41.3952 72.2192 43.6924 75.9788 46.696C77.2732 47.73 77.4844 49.6176 76.45 50.9124C75.416 52.2068 73.5284 52.4176 72.2336 51.3836C68.988 48.7908 65.4484 46.8304 61.7156 45.5288C60.1512 44.9836 59.3252 43.2728 59.8708 41.7084ZM49.7016 75.7004C51.3588 75.7004 52.7016 77.0436 52.7016 78.7004V78.868C52.7016 80.5248 51.3588 81.868 49.7016 81.868C48.0448 81.868 46.7016 80.5248 46.7016 78.868V78.7004C46.7016 77.0436 48.0448 75.7004 49.7016 75.7004Z`,fill:t.labelPrimary})})};F4();function c9t(e){let{COLORS:t}=J();return(0,W.jsxs)(E4,{width:e.width??16,height:e.height??16,viewBox:`0 0 20 20`,fill:`none`,...e,children:[(0,W.jsx)(w4,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M10 3.125a6.875 6.875 0 015.34 11.206 1.058 1.058 0 00-.03 1.303l.886 1.174a.054.054 0 01.008.014.02.02 0 01.001.007c0 .004 0 .013-.005.023a.045.045 0 01-.016.018.022.022 0 01-.006.003.06.06 0 01-.016.002H10a6.875 6.875 0 010-13.75zM18.125 10A8.125 8.125 0 1010 18.125h6.162c1.066 0 1.674-1.218 1.032-2.07l-.793-1.05A8.092 8.092 0 0018.125 10z`,fill:t.labelPrimary}),(0,W.jsx)(w4,{d:`M12.155 7.5a.762.762 0 110 1.523H8.262a.762.762 0 010-1.523h3.893zM12.155 11.563a.762.762 0 110 1.523H8.262a.762.762 0 110-1.524h3.893z`,fill:t.labelPrimary})]})}F4(),F4(),F4(),F4();function l9t(e){let{COLORS:t}=J();return(0,W.jsxs)(E4,{width:20,height:20,viewBox:`0 0 20 20`,fill:`none`,...e,children:[(0,W.jsx)(w4,{d:`M3.56795 14.0095C3.82774 13.7823 4.22283 13.8092 4.45011 14.069C4.67725 14.3287 4.65103 14.723 4.39152 14.9503L4.38419 14.9568C4.1244 15.1839 3.73006 15.1571 3.50285 14.8974C3.27568 14.6376 3.30176 14.2433 3.56144 14.0161L3.56795 14.0095ZM2.07706 10.4296C2.32146 10.186 2.71713 10.1869 2.96085 10.4313C3.20458 10.6756 3.20438 11.0713 2.96004 11.315L2.95272 11.3216C2.70833 11.5653 2.31268 11.5651 2.06893 11.3207C1.82523 11.0764 1.8262 10.6807 2.07055 10.437L2.07706 10.4296ZM2.64266 6.56082C2.90226 6.33375 3.29664 6.36002 3.52401 6.61941C3.75143 6.87904 3.72581 7.27412 3.46623 7.50157L3.4589 7.50727C3.19939 7.73454 2.80504 7.70873 2.57755 7.44949C2.35017 7.1899 2.37585 6.79479 2.63533 6.56733L2.64266 6.56082ZM4.99292 3.51883C5.23729 3.27518 5.63296 3.27616 5.87671 3.52045C6.12049 3.76483 6.12027 4.16046 5.87589 4.40424L5.86938 4.41075C5.62501 4.65453 5.22856 4.65431 4.98478 4.40994C4.74118 4.16555 4.74209 3.76987 4.98641 3.52615L4.99292 3.51883ZM8.62899 2.03038C8.88828 1.8027 9.28336 1.82821 9.51115 2.08735C9.73889 2.34671 9.71351 2.74175 9.45418 2.96951L9.44767 2.97521C9.18831 3.20294 8.79327 3.17757 8.56551 2.91824C8.33776 2.65886 8.3631 2.26383 8.62248 2.03608L8.62899 2.03038Z`,fill:e?.color||t.labelPrimary}),(0,W.jsx)(w4,{d:`M16.1555 1.87505C16.5003 1.87054 16.7837 2.14627 16.7886 2.4911C16.7934 2.83613 16.5176 3.12014 16.1726 3.12505L13.5766 3.16005L13.6115 5.73817C13.6162 6.08329 13.3406 6.36657 12.9955 6.37131C12.6504 6.376 12.3671 6.1004 12.3624 5.75526L12.3184 2.55295C12.3137 2.20796 12.5895 1.92393 12.9345 1.919L16.1555 1.87505Z`,fill:e?.color||t.labelPrimary}),(0,W.jsx)(w4,{d:`M12.4156 2.8507C12.5535 2.53442 12.9219 2.38984 13.2383 2.52763C17.2681 4.28273 19.1792 8.95135 17.5092 13.0452L17.51 13.046C15.8201 17.2146 11.0668 19.2197 6.8988 17.5211C6.57915 17.3908 6.42592 17.0253 6.55619 16.7057C6.68661 16.3863 7.05129 16.2329 7.37081 16.3631C10.8992 17.801 14.922 16.1039 16.3519 12.5765V12.5748C17.7662 9.10996 16.1472 5.15788 12.7386 3.67346C12.4224 3.53553 12.2778 3.16707 12.4156 2.8507Z`,fill:e?.color||t.labelPrimary}),(0,W.jsx)(w4,{d:`M9.10156 7.33582C9.10156 6.99064 9.38138 6.71082 9.72656 6.71082C10.0717 6.71082 10.3516 6.99064 10.3516 7.33582V10.3957L12.6929 11.7955C12.9891 11.9725 13.0855 12.3561 12.9085 12.6524C12.7315 12.9486 12.3479 13.0458 12.0516 12.8689L9.40592 11.2876C9.21714 11.1748 9.10156 10.9705 9.10156 10.7505V7.33582Z`,fill:e?.color||t.labelPrimary})]})}F4(),F4();var u9t=e=>{let{COLORS:t}=J();return(0,W.jsx)(E4,{width:20,height:20,viewBox:`0 0 20 20`,fill:`none`,...e,children:(0,W.jsx)(w4,{d:`M13.5 8.5C13.5 5.7375 11.2625 3.5 8.5 3.5C5.7375 3.5 3.5 5.7375 3.5 8.5C3.5 11.2625 5.7375 13.5 8.5 13.5C11.2625 13.5 13.5 11.2625 13.5 8.5ZM12.5344 13.5969C11.4281 14.475 10.025 15 8.5 15C4.90937 15 2 12.0906 2 8.5C2 4.90937 4.90937 2 8.5 2C12.0906 2 15 4.90937 15 8.5C15 10.025 14.475 11.4281 13.5969 12.5344L17.7812 16.7188C18.075 17.0125 18.075 17.4875 17.7812 17.7781C17.4875 18.0688 17.0125 18.0719 16.7219 17.7781L12.5344 13.5969Z`,fill:e?.color??t.labelPrimary})})};F4(),F4(),F4();var d9t=e=>{let{COLORS:t}=J();return(0,W.jsx)(E4,{width:39,height:25,viewBox:`0 0 39 25`,fill:`none`,...e,children:(0,W.jsx)(w4,{d:`M0 0.569824V24.7127H39V0.569824H0ZM1.15617 1.71512H37.8438V23.5685H1.15617V1.71512ZM23.3605 6.55721C22.882 6.56019 21.2049 6.58767 21.2 6.59248C21.1908 6.60164 21.1956 18.3199 21.2049 18.4937L21.2139 18.6678L21.3242 18.6742C21.3846 18.6774 21.9166 18.6793 22.5065 18.6786C23.4462 18.6774 23.5815 18.6744 23.6007 18.6554C23.6199 18.6364 23.6234 18.5141 23.6257 17.6961C23.6271 17.1805 23.6326 16.3241 23.6382 15.7927C23.644 15.261 23.6507 14.3077 23.6532 13.6739C23.6576 12.595 23.6705 11.9472 23.6879 11.9298C23.7075 11.9103 23.763 11.9926 23.85 12.1696C23.9025 12.2764 23.9695 12.4058 23.9991 12.4569C24.0287 12.5079 24.1344 12.7077 24.2341 12.9005C24.3335 13.0936 24.4863 13.3866 24.5735 13.552C24.715 13.82 24.7967 13.9728 25.0288 14.4039C25.0649 14.4707 25.2261 14.7736 25.387 15.0766C25.8041 15.8625 26.0923 16.4056 26.246 16.6945C26.3193 16.8324 26.4368 17.0545 26.5066 17.1883C26.8722 17.8895 27.2704 18.6014 27.324 18.6495C27.3506 18.6733 27.386 18.6767 27.6529 18.6818C27.8173 18.6848 27.9551 18.6905 27.959 18.6946C27.9731 18.7097 29.6988 18.6848 29.7145 18.6692C29.7247 18.6591 29.7324 18.056 29.7384 16.8044C29.7509 14.2607 29.7548 6.61928 29.7439 6.60141C29.7379 6.59202 29.3212 6.58721 28.5313 6.58721H27.3277L27.3183 7.38411C27.3067 8.33975 27.3086 11.5502 27.3213 12.4926C27.3264 12.8628 27.3271 13.2203 27.3231 13.2872L27.316 13.4088L27.278 13.3587C27.2373 13.3048 27.0919 13.0625 27.0919 13.0487C27.0919 13.0442 27.06 12.9848 27.0214 12.9168C26.9827 12.8488 26.9141 12.7223 26.8683 12.6358C26.8225 12.5492 26.7672 12.4493 26.7455 12.414C26.7238 12.3785 26.5804 12.108 26.4271 11.8125C26.2738 11.5173 26.1383 11.2596 26.1258 11.2399C26.1135 11.2204 25.9887 10.9852 25.8481 10.7174C25.7077 10.4498 25.5294 10.1115 25.452 9.96584C25.3747 9.82016 25.2705 9.62362 25.2203 9.52925C25.1703 9.43465 24.9997 9.11259 24.8411 8.81344C24.4743 8.12214 24.1289 7.45993 23.9485 7.1026C23.7866 6.78146 23.6932 6.61699 23.6532 6.58103C23.6285 6.55881 23.5942 6.55583 23.3605 6.55721ZM14.2773 6.57507C13.5973 6.5627 12.8139 6.65662 12.1981 6.82933C11.414 7.049 10.9679 7.26111 10.4846 7.64295C10.0904 7.95447 9.80758 8.28454 9.58628 8.69181C9.35436 9.11832 9.2207 9.76175 9.27111 10.2091C9.30325 10.4947 9.34164 10.6546 9.43853 10.9041C9.67693 11.517 10.1033 12.0457 10.6525 12.4094C11.1182 12.7178 11.386 12.8279 12.3181 13.093C13.2421 13.3557 14.1053 13.5483 15.046 13.7016C15.7276 13.8124 15.9362 13.8523 16.0676 13.8965C16.342 13.989 16.6209 14.1686 16.7777 14.3537C16.8834 14.479 16.925 14.5486 16.9721 14.6799C17.0057 14.7726 17.0096 14.8049 17.0101 14.9909C17.0108 15.1462 17.0045 15.2218 16.9853 15.2915C16.8272 15.8678 16.4442 16.2407 15.7861 16.4583C15.2992 16.6193 14.5097 16.6688 13.9261 16.5751C12.8453 16.4013 12.2126 16.0048 11.8413 15.2695C11.7326 15.0544 11.6353 14.8086 11.5983 14.6545C11.5377 14.402 11.524 14.3677 11.4836 14.3704C11.4637 14.3716 11.3758 14.3796 11.2884 14.3878C11.201 14.3961 10.9538 14.4188 10.7392 14.4387C9.93822 14.5131 9.26926 14.5873 9.25261 14.6038C9.23851 14.6176 9.26672 14.8011 9.33147 15.1188C9.51507 16.0196 9.88874 16.7836 10.4368 17.3775C10.9182 17.8995 11.6704 18.2718 12.6252 18.4612C13.1468 18.5645 13.8486 18.6474 14.374 18.6678C14.9463 18.69 15.4289 18.6454 16.1515 18.5031C17.2272 18.2917 17.8074 18.0175 18.3855 17.4465C18.6058 17.2286 18.7321 17.0646 18.8888 16.7925C18.9904 16.6166 19.1462 16.2787 19.1982 16.1218C19.3152 15.7702 19.3867 15.2802 19.3687 14.9577C19.3532 14.6868 19.3076 14.3267 19.2611 14.1104C19.2123 13.8837 19.1955 13.8308 19.1039 13.6093C18.9409 13.2155 18.7742 12.9631 18.4937 12.685C18.1743 12.3684 17.8256 12.1483 17.3872 11.9866C17.1599 11.9028 17.0089 11.8654 16.5275 11.7754C15.554 11.5935 14.8251 11.43 14.1788 11.2481C14.0278 11.2055 13.7839 11.1372 13.6371 11.0965C12.4101 10.7559 12.0327 10.4863 12.0327 9.94935C12.0327 9.67837 12.165 9.40762 12.4212 9.15428C12.5354 9.04113 12.7301 8.89797 12.8552 8.8352C13.1697 8.67738 13.7991 8.54796 14.2512 8.54842C14.627 8.54888 15.249 8.65241 15.5917 8.77084C15.8271 8.85238 16.0715 9.01501 16.1977 9.17444C16.3695 9.39136 16.5434 9.7125 16.6651 10.0373C16.7557 10.2794 16.7562 10.2808 16.8057 10.2808C16.829 10.2808 16.9564 10.2746 17.0887 10.2668C17.2212 10.2593 17.479 10.2462 17.6619 10.238C18.2497 10.2109 18.8012 10.1812 18.8877 10.1715C18.9846 10.161 19.0149 10.1385 19.0059 10.0836C18.9453 9.71548 18.8329 9.28301 18.7314 9.02761C18.6558 8.83772 18.4902 8.52139 18.3822 8.36013C18.0173 7.81543 17.6048 7.45466 17.026 7.17406C16.3404 6.84216 15.5507 6.65387 14.562 6.58721C14.4697 6.58103 14.3745 6.57691 14.2773 6.57507Z`,fill:t.labelPrimary})})};F4(),F4(),F4(),F4(),F4();var f9t=e=>{let{COLORS:t}=J();return(0,W.jsxs)(E4,{width:`41`,height:`26`,viewBox:`0 0 41 26`,...e,children:[(0,W.jsx)(w4,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M38.731 1.43448H1.43448V24.5655H38.731V1.43448ZM0 0V26H40.1655V0H0Z`,fill:t.labelPrimary}),(0,W.jsx)(w4,{d:`M5.86475 6.40173H8.48226V13.423C8.48226 14.5372 8.51468 15.2594 8.57953 15.5895C8.69154 16.1201 8.95683 16.5475 9.37539 16.8718C9.79986 17.1901 10.3776 17.3493 11.1086 17.3493C11.8514 17.3493 12.4115 17.199 12.7888 16.8983C13.1661 16.5917 13.393 16.2174 13.4697 15.7753C13.5463 15.3331 13.5846 14.5991 13.5846 13.5734V6.40173H16.2021V13.2108C16.2021 14.7672 16.1314 15.8666 15.9899 16.5092C15.8484 17.1518 15.5861 17.6942 15.2029 18.1363C14.8256 18.5785 14.3186 18.9322 13.6819 19.1975C13.0452 19.4569 12.214 19.5866 11.1882 19.5866C9.95019 19.5866 9.00989 19.4451 8.3673 19.1621C7.73061 18.8732 7.22656 18.5018 6.85516 18.0479C6.48375 17.5881 6.2391 17.1076 6.12119 16.6065C5.95023 15.8637 5.86475 14.7672 5.86475 13.3169V6.40173Z`,fill:t.labelPrimary}),(0,W.jsx)(w4,{d:`M18.9611 6.40173H23.7452C24.824 6.40173 25.6464 6.48427 26.2124 6.64934C26.9728 6.87336 27.6243 7.27129 28.1666 7.84313C28.709 8.41498 29.1217 9.11652 29.4047 9.94775C29.6876 10.7731 29.8291 11.793 29.8291 13.0074C29.8291 14.0745 29.6965 14.9941 29.4312 15.7664C29.1069 16.7097 28.6442 17.4731 28.0428 18.0567C27.5889 18.4989 26.9758 18.8438 26.2035 19.0914C25.6258 19.2741 24.8535 19.3655 23.8867 19.3655H18.9611V6.40173ZM21.5787 8.59478V17.1813H23.5329C24.264 17.1813 24.7916 17.14 25.1158 17.0575C25.5403 16.9514 25.8911 16.7716 26.1681 16.5181C26.4511 16.2646 26.681 15.8489 26.8579 15.2712C27.0347 14.6876 27.1232 13.8947 27.1232 12.8925C27.1232 11.8903 27.0347 11.1209 26.8579 10.5844C26.681 10.048 26.4334 9.62941 26.1151 9.32875C25.7967 9.02809 25.3929 8.8247 24.9036 8.71858C24.5381 8.63605 23.8218 8.59478 22.7548 8.59478H21.5787Z`,fill:t.labelPrimary}),(0,W.jsx)(w4,{d:`M31.978 19.3655V6.40173H34.5955V19.3655H31.978Z`,fill:t.labelPrimary})]})};F4();var p9t=e=>{let{COLORS:t}=J();return(0,W.jsxs)(E4,{width:`82`,height:`28`,viewBox:`0 0 82 28`,...e,children:[(0,W.jsx)(w4,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M40.2613 1.10811H1.10811V26.2252H40.2613V1.10811ZM0 0V27.3333H41.3694V0H0Z`,fill:t.labelPrimary}),(0,W.jsx)(w4,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M80.8919 1.10811H41.3693V26.2252H80.8919V1.10811ZM40.2612 0V27.3333H82V0H40.2612Z`,fill:t.labelPrimary}),(0,W.jsx)(w4,{d:`M10.1362 8.20728H12.4318V14.365C12.4318 15.3422 12.4602 15.9755 12.5171 16.265C12.6153 16.7304 12.848 17.1052 13.2151 17.3896C13.5873 17.6688 14.094 17.8084 14.7351 17.8084C15.3866 17.8084 15.8777 17.6765 16.2086 17.4128C16.5395 17.144 16.7386 16.8157 16.8058 16.4279C16.873 16.0401 16.9066 15.3965 16.9066 14.4968V8.20728H19.2022V14.1789C19.2022 15.5438 19.1402 16.508 19.0161 17.0716C18.892 17.6352 18.6619 18.1108 18.3258 18.4986C17.9949 18.8863 17.5503 19.1966 16.9919 19.4292C16.4335 19.6567 15.7045 19.7704 14.8049 19.7704C13.7192 19.7704 12.8945 19.6464 12.331 19.3982C11.7726 19.1449 11.3305 18.8191 11.0048 18.421C10.6791 18.0177 10.4645 17.5964 10.3611 17.1569C10.2112 16.5055 10.1362 15.5438 10.1362 14.2719V8.20728Z`,fill:t.labelPrimary}),(0,W.jsx)(w4,{d:`M21.343 19.5766V8.20728H23.6385V13.256L28.2762 8.20728H31.3628L27.0819 12.6356L31.5955 19.5766H28.6252L25.4998 14.2409L23.6385 16.141V19.5766H21.343Z`,fill:t.labelPrimary}),(0,W.jsx)(w4,{d:`M45.9097 19.5766V8.20728H50.7412C51.9562 8.20728 52.8377 8.31068 53.3858 8.51749C53.939 8.71913 54.3811 9.08104 54.7119 9.60323C55.0428 10.1254 55.2083 10.7226 55.2083 11.3947C55.2083 12.2478 54.9575 12.9535 54.456 13.5119C53.9545 14.0651 53.2048 14.4141 52.207 14.5589C52.7033 14.8484 53.1118 15.1664 53.4323 15.5128C53.758 15.8592 54.1949 16.4744 54.743 17.3585L56.1312 19.5766H53.3858L51.7262 17.1026C51.1367 16.2185 50.7335 15.6627 50.5163 15.4352C50.2992 15.2026 50.0691 15.0449 49.8261 14.9622C49.5831 14.8743 49.1979 14.8303 48.6706 14.8303H48.2052V19.5766H45.9097ZM48.2052 13.0156H49.9037C51.0049 13.0156 51.6925 12.969 51.9666 12.876C52.2406 12.7829 52.4552 12.6226 52.6103 12.3951C52.7654 12.1677 52.8429 11.8833 52.8429 11.5421C52.8429 11.1595 52.7395 10.8518 52.5327 10.6192C52.3311 10.3813 52.0441 10.2314 51.6719 10.1694C51.4857 10.1435 50.9274 10.1306 49.9967 10.1306H48.2052V13.0156Z`,fill:t.labelPrimary}),(0,W.jsx)(w4,{d:`M57.0621 19.5766V8.20728H65.4921V10.1306H59.3577V12.6511H65.0656V14.5666H59.3577V17.661H65.7093V19.5766H57.0621Z`,fill:t.labelPrimary}),(0,W.jsx)(w4,{d:`M67.3382 19.5766V8.20728H71.022C72.4179 8.20728 73.3279 8.26415 73.7519 8.37789C74.4033 8.54851 74.9488 8.92076 75.3882 9.49466C75.8277 10.0634 76.0474 10.8001 76.0474 11.7049C76.0474 12.4029 75.9208 12.9897 75.6674 13.4654C75.4141 13.941 75.0909 14.3159 74.698 14.5899C74.3102 14.8587 73.9147 15.0371 73.5114 15.125C72.9634 15.2336 72.1698 15.2879 71.1306 15.2879H69.6338V19.5766H67.3382ZM69.6338 10.1306V13.3568H70.8902C71.7949 13.3568 72.3999 13.2973 72.7049 13.1784C73.0099 13.0595 73.2478 12.8734 73.4184 12.62C73.5942 12.3667 73.6821 12.072 73.6821 11.7359C73.6821 11.3223 73.5606 10.9811 73.3176 10.7122C73.0746 10.4434 72.7669 10.2754 72.3947 10.2081C72.1207 10.1564 71.57 10.1306 70.7428 10.1306H69.6338Z`,fill:t.labelPrimary})]})};F4(),F4();var m9t=e=>(0,W.jsx)(E4,{width:28,height:28,viewBox:`0 0 28 28`,fill:`none`,...e,children:(0,W.jsx)(w4,{d:`M13.0096 2.60985C14.4159 2.3715 15.8601 2.64736 17.0867 3.38818C18.3133 4.12901 19.2442 5.28753 19.7156 6.65966C19.784 6.88103 19.7648 7.1211 19.6629 7.3286C19.5608 7.53603 19.3837 7.69466 19.1688 7.77099C18.9538 7.84731 18.7179 7.83582 18.5115 7.73778C18.3053 7.63979 18.1444 7.46338 18.0633 7.24657C17.7299 6.26912 17.0684 5.44299 16.1961 4.91454C15.3237 4.38616 14.2966 4.18886 13.2957 4.3579C12.2947 4.52701 11.3842 5.05128 10.7254 5.83837C10.0666 6.62544 9.70188 7.62481 9.69513 8.65966V10.187C10.0793 10.1792 10.4646 10.1936 10.8485 10.2358H17.1483C18.4603 10.0912 19.7877 10.2404 21.0369 10.6743C21.933 11.1147 22.6559 11.8529 23.0877 12.7671C23.513 14.0411 23.6602 15.3946 23.5184 16.7329V19.27C23.6606 20.6083 23.5133 21.9628 23.0867 23.2368C22.6547 24.1507 21.9301 24.8871 21.033 25.3257C19.7851 25.7601 18.4592 25.9108 17.1483 25.7671H10.8485C9.53637 25.912 8.20876 25.7625 6.95978 25.3276C6.06368 24.8883 5.34071 24.1507 4.90998 23.2368C4.48343 21.9628 4.3361 20.6083 4.47834 19.27V16.7329C4.33625 15.3941 4.48358 14.0395 4.90998 12.7651C5.34124 11.852 6.06375 11.1145 6.95881 10.6743C7.2841 10.5614 7.61484 10.4683 7.94904 10.394V8.6538C7.95997 7.19978 8.47338 5.79655 9.39924 4.69091C10.3251 3.5853 11.6035 2.84824 13.0096 2.60985ZM20.2752 12.2837C19.256 12.0017 18.1942 11.9128 17.1434 12.021H10.8485C10.2385 11.9583 9.62512 11.9635 9.01838 12.0327C8.95505 12.0478 8.8901 12.0568 8.82404 12.0571L8.82111 12.0561C8.44893 12.1074 8.07952 12.1831 7.71564 12.2837C7.17874 12.5483 6.74556 12.9914 6.48713 13.5395C6.20957 14.5787 6.1219 15.6612 6.22834 16.7329V19.27C6.1232 20.344 6.21236 21.4288 6.49103 22.4702C6.75043 23.018 7.18412 23.46 7.7215 23.7241C8.74056 24.0073 9.8025 24.0973 10.8533 23.9888H17.1483C18.1994 24.0972 19.2616 24.0072 20.2811 23.7241C20.8161 23.4588 21.2477 23.0169 21.5057 22.4702C21.7821 21.4305 21.8694 20.3476 21.7635 19.2759V16.7329C21.8696 15.6615 21.7822 14.5796 21.5057 13.5405C21.2468 12.9917 20.813 12.5484 20.2752 12.2837ZM13.9988 15.8579C14.2307 15.858 14.4531 15.9523 14.617 16.1196C14.7811 16.2869 14.8738 16.5138 14.8738 16.7505V19.3227C14.8738 19.5594 14.7812 19.7873 14.617 19.9546C14.4531 20.1218 14.2306 20.2152 13.9988 20.2153C13.7669 20.2153 13.5437 20.1219 13.3797 19.9546C13.2156 19.7873 13.1238 19.5594 13.1238 19.3227V16.7505C13.1238 16.5138 13.2156 16.2869 13.3797 16.1196C13.5437 15.9522 13.7668 15.8579 13.9988 15.8579Z`,fill:`#64D9A4`})});F4();function h9t(e){let{COLORS:t}=J();return(0,W.jsxs)(E4,{width:28,height:28,viewBox:`0 0 28 28`,fill:`none`,...e,children:[(0,W.jsx)(w4,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M14.0082 16.334C16.7561 16.3574 19.169 16.6263 20.9215 17.3305C21.8096 17.6874 22.5698 18.1725 23.106 18.8293C23.65 19.4954 23.9221 20.2881 23.9162 21.1867L23.9161 21.2057L23.9151 21.2246C23.8616 22.1245 23.4957 22.9545 22.8035 23.5627C22.1066 24.1749 21.1489 24.5007 20.0457 24.5007H7.95359C6.84959 24.5007 5.88953 24.1753 5.19153 23.5631C4.49742 22.9543 4.13164 22.1226 4.08401 21.2199L4.08301 21.201V21.182C4.08301 20.282 4.35828 19.4889 4.90302 18.8224C5.44048 18.1649 6.20036 17.6791 7.08847 17.322C8.84065 16.6173 11.2495 16.3516 13.9933 16.3341L14.0082 16.334ZM5.86844 21.1629C5.90197 21.7165 6.11985 22.1375 6.43975 22.4181C6.75937 22.6985 7.24957 22.8992 7.95359 22.8992H20.0457C20.7472 22.8992 21.2351 22.6989 21.5542 22.4185C21.8743 22.1373 22.0937 21.7146 22.131 21.1582C22.131 20.5801 21.9597 20.1356 21.6657 19.7756C21.3608 19.4021 20.8827 19.0697 20.1916 18.792C18.787 18.2277 16.6807 17.9588 13.9986 17.9356C11.3219 17.9531 9.22134 18.2193 7.81883 18.7833C7.12897 19.0607 6.64986 19.3938 6.34283 19.7694C6.04634 20.132 5.87217 20.5803 5.86844 21.1629Z`,fill:e?.color??t.labelPrimary}),(0,W.jsx)(w4,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M14 5.2194C12.0499 5.2194 10.4689 6.80033 10.4689 8.7505C10.4689 10.7007 12.0499 12.2816 14 12.2816C15.9502 12.2816 17.5311 10.7007 17.5311 8.7505C17.5311 6.80033 15.9502 5.2194 14 5.2194ZM8.75 8.7505C8.75 5.851 11.1005 3.50049 14 3.50049C16.8995 3.50049 19.25 5.851 19.25 8.7505C19.25 11.65 16.8995 14.0005 14 14.0005C11.1005 14.0005 8.75 11.65 8.75 8.7505Z`,fill:e?.color??t.labelPrimary})]})}F4(),F4();var g9t=e=>{let{COLORS:t}=J();return(0,W.jsx)(E4,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,W.jsx)(w4,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12.007 3C13.0263 3 13.9386 3.52359 14.4443 4.40053L21.6252 16.836C22.1279 17.706 22.1249 18.7443 21.6163 19.6123C21.1076 20.4814 20.1992 21 19.187 21H4.81404C3.80075 21 2.89239 20.4814 2.38374 19.6123C1.8751 18.7443 1.8721 17.706 2.37475 16.836L9.5697 4.39855C10.0753 3.5226 10.9867 3 12.007 3ZM12.006 4.48466C11.5303 4.48466 11.1066 4.72814 10.8688 5.13692L3.67584 17.5734C3.442 17.9792 3.444 18.4632 3.68083 18.868C3.91767 19.2728 4.34137 19.5153 4.81404 19.5153H19.187C19.6586 19.5153 20.0823 19.2728 20.3192 18.868C20.557 18.4632 20.559 17.9792 20.3232 17.5734L13.1432 5.13692C12.9064 4.72814 12.4827 4.48466 12.006 4.48466ZM11.9992 15.3712C12.5518 15.3712 12.9985 15.8136 12.9985 16.3609C12.9985 16.9083 12.5518 17.3507 11.9992 17.3507C11.4466 17.3507 10.9949 16.9083 10.9949 16.3609C10.9949 15.8136 11.4376 15.3712 11.9892 15.3712H11.9992ZM11.9972 9.49687C12.4109 9.49687 12.7467 9.82943 12.7467 10.2392V13.3075C12.7467 13.7173 12.4109 14.0498 11.9972 14.0498C11.5835 14.0498 11.2477 13.7173 11.2477 13.3075V10.2392C11.2477 9.82943 11.5835 9.49687 11.9972 9.49687Z`,fill:e?.color??t.labelPrimary})})};F4(),F4();function _9t(e){let{COLORS:t}=J(),n=e?.color??t.labelPrimary;return(0,W.jsx)(E4,{width:14,height:14,viewBox:`0 0 14 14`,fill:`none`,...e,children:(0,W.jsx)(w4,{d:`M6.99863 0C8.32728 0 9.40441 1.07755 9.40441 2.40672C9.40441 2.80055 9.30873 3.17249 9.13923 3.50068H10.0715L10.2164 3.50615C10.9299 3.56359 11.5395 4.05314 11.75 4.7478L13.9371 12.0363C13.9809 12.1786 14 12.3262 14 12.4739L13.9918 12.6298C13.918 13.3491 13.3466 13.918 12.6303 13.9918L12.4745 14H1.52822L1.37239 13.9918C0.650654 13.9207 0.0820152 13.3518 0.00820152 12.6325L0 12.4767C0 12.3645 0.0109354 12.2551 0.0355399 12.1457L0.0628783 12.0391L2.24995 4.75054C2.45772 4.05587 3.0701 3.56632 3.78364 3.50889L3.9258 3.50342H4.85804C4.69127 3.17523 4.59285 2.80328 4.59285 2.40946C4.59285 1.08029 5.66999 0.00273491 6.99863 0.00273491V0ZM3.9258 4.81344C3.7563 4.81344 3.60594 4.90916 3.53212 5.05958L3.50478 5.12522L1.32045 12.4138C1.31498 12.4329 1.31224 12.4548 1.31224 12.4767C1.31224 12.5943 1.40793 12.69 1.52548 12.69H12.4718C12.5893 12.69 12.685 12.5943 12.685 12.4767L12.6768 12.4138L10.4925 5.12522C10.4378 4.93925 10.2656 4.81344 10.0742 4.81344H3.93126H3.9258ZM6.99863 1.31276C6.70861 1.31276 6.43046 1.42801 6.22539 1.63317C6.02031 1.83833 5.9051 2.11658 5.9051 2.40672C5.9051 2.69686 6.02031 2.97511 6.22539 3.18027C6.43046 3.38543 6.70861 3.50068 6.99863 3.50068C7.28866 3.50068 7.5668 3.38543 7.77188 3.18027C7.97696 2.97511 8.09217 2.69686 8.09217 2.40672C8.09217 2.11658 7.97696 1.83833 7.77188 1.63317C7.5668 1.42801 7.28866 1.31276 6.99863 1.31276Z`,fill:n,fillOpacity:.4})})}F4();function v9t(e){let{COLORS:t}=J(),n=e?.color??t.labelPrimary;return(0,W.jsx)(E4,{width:14,height:14,viewBox:`0 0 14 14`,fill:`none`,...e,children:(0,W.jsx)(w4,{d:`M9.88389 0C10.7431 1.37829e-08 11.7592 0.022987 12.5597 0.404297C12.9802 0.604696 13.3542 0.908863 13.6163 1.35742C13.8752 1.80087 14.0001 2.34339 14.0001 2.9834V7.69531C14 8.0265 13.7317 8.2948 13.4005 8.29492C13.0692 8.29492 12.8 8.02657 12.7999 7.69531V2.9834C12.7999 2.49693 12.7054 2.17757 12.5802 1.96289C12.4579 1.7536 12.2823 1.60187 12.044 1.48828C11.6463 1.29877 11.1156 1.23049 10.4835 1.20898V10.5723C10.4835 12.1176 9.18234 13.4111 7.8087 13.4111H4.26573C2.86703 13.411 1.66123 12.0907 1.66123 10.5723V3.52539L0.0860393 0.90918C-0.0252825 0.723997 -0.0289685 0.492846 0.0772502 0.304688C0.183693 0.11637 0.38437 0 0.600688 0H9.88389ZM2.77549 3.0498C2.83172 3.14321 2.86142 3.25035 2.86143 3.35938V4.52637H4.09971C4.43095 4.52652 4.69932 4.79568 4.69932 5.12695C4.69909 5.45803 4.43081 5.72641 4.09971 5.72656H2.86143V8.02637H4.09971C4.43095 8.02652 4.69932 8.29568 4.69932 8.62695C4.69908 8.95802 4.4308 9.22641 4.09971 9.22656H2.86143V10.5723C2.86143 11.5224 3.62037 12.2108 4.26573 12.2109H7.8087C8.4795 12.2109 9.28428 11.4957 9.28428 10.5723V1.2002H1.66221L2.77549 3.0498Z`,fill:n,fillOpacity:.4})})}V(),YQ();var y9t=({title:e,carbsPer100:t,unit:n,carbs:r,expandable:i=!0,isExpanded:a,amount:o,gradientId:s,estimate:c,imageUri:l,onPress:u,onAddPress:d,onChangeAmount:f,onAmountFocusChange:p,testID:m,children:h})=>{let{t:g}=Tq(),{COLORS:_}=J(),v=fIt(),y=(Number(o)||0)>0;return(0,W.jsx)(JQ.View,{layout:v?void 0:VQ.duration(300),children:(0,W.jsxs)(Yf,{style:[q4.card,{backgroundColor:_.bgSecondary}],disabled:!u,onPress:u,testID:m,children:[(0,W.jsxs)(B,{style:q4.cardRow,children:[(0,W.jsxs)(B,{style:q4.cardText,children:[(0,W.jsxs)(B,{children:[(0,W.jsx)(Z,{style:[q4.name,{color:_.labelPrimary}],numberOfLines:2,children:e}),(0,W.jsx)(Z,{style:[q4.carbsSubtitle,{color:_.labelSecondary}],children:g(`food_card_carb`,{value:(Math.round(t*10)/10).toString()})})]}),c!==void 0&&s&&(a||y)&&(0,W.jsx)(JQ.View,{entering:v?void 0:BQ.duration(300),children:(0,W.jsx)(T7t,{text:c===null?g(`visualSearch_suggestion_weightUnknown`):`${g(`visualSearch_suggestion_amount`)} ${c.min}${n} - ${c.max}${n}`,font:Y.Poppins.semiBold_SM,gradientId:s,italic:!0})})]}),!!l&&(0,W.jsx)(Zu,{source:{uri:l},style:q4.thumbnail,resizeMode:`cover`,testID:`${m}-thumbnail`}),i&&(0,W.jsx)(W.Fragment,{children:a||y?(0,W.jsx)(JQ.View,{entering:v?void 0:BQ.duration(300),children:(0,W.jsx)(N7t,{amount:o,onChangeAmount:f,unit:n,icon:n===`g`?(0,W.jsx)(_9t,{}):(0,W.jsx)(v9t,{}),carbs:r,autoFocus:a,onFocusChange:p,testID:m})}):(0,W.jsx)(wp,{onPress:d,testID:`${m}-add`,style:({pressed:e})=>[q4.addPill,{backgroundColor:_.bgVsAddButton},e&&q4.pressed],children:(0,W.jsx)(Z,{style:[q4.addLabel,{color:_.textLink}],children:g(`button_add`)})})})]}),h]})})},q4=R.create({card:{padding:16,borderRadius:16},cardRow:{flexDirection:`row`,alignItems:`flex-start`,gap:10},cardText:{flex:1,gap:6},name:{...Y.Poppins.medium_Base},carbsSubtitle:{...Y.Poppins.regular_SM},thumbnail:{width:46,height:46,borderRadius:12},addPill:{alignItems:`center`,justifyContent:`center`,paddingHorizontal:10,paddingVertical:4,borderRadius:1e3,minWidth:52,minHeight:28},addLabel:{...Y.Poppins.semiBold_SM},pressed:{opacity:.5}});V();var J4=function(e){return e.Single=`Single`,e.ListItem=`ListItem`,e}({}),b9t=function(e){return e.Card=`Card`,e.List=`List`,e}({});function Y4({title:e,value:t,subtitle:n,header:r,displayType:i=`Single`,displayStyle:a=`Card`,renderLeftSlot:o,renderRightSlot:s,errorMessage:c,warningMessage:l,onPress:u,testID:d,containerStyle:f,valueStyle:p,titleStyle:m,style:h}){let{COLORS:g}=J(),_={Card:{Single:[X4.card,{backgroundColor:g.bgListActive,borderColor:g.bgTransparent}],ListItem:[X4.cardListItem,{borderColor:g.divider}]},List:{Single:X4.listItemSingle,ListItem:[X4.listItemWithBottomBorder,{borderBottomColor:g.divider}]}};return(0,W.jsxs)(Yf,{testID:d,disabled:!u,onPress:u,style:f,accessibilityRole:u?`button`:`none`,children:[(0,W.jsxs)(B,{style:[_[a].Single,_[a][i],(!!n||!!r)&&X4.fieldWithSubtitle,!!c&&{borderColor:g.borderInputDanger},X4.gap,h],children:[o&&(0,W.jsx)(B,{style:X4.leftSlot,children:o()}),e!==void 0&&(0,W.jsxs)(B,{style:X4.flexibleContainer,children:[(0,W.jsxs)(B,{style:X4.textContainer,children:[!!r&&(0,W.jsx)(Z,{style:X4.subtitle,children:r}),(0,W.jsx)(Z,{style:[X4.title,{color:g.labelPrimary},m],children:e}),!!n&&(0,W.jsx)(Z,{style:[X4.subtitle,{color:g.labelSecondary}],children:n})]}),!!t&&(0,W.jsx)(Z,{style:[X4.value,{color:g.labelSecondary},p],children:t})]}),s&&(0,W.jsx)(B,{style:X4.rightSlot,children:s()})]}),!!c&&(0,W.jsx)(m3,{message:c,type:`error`}),!!l&&(0,W.jsx)(m3,{message:l,type:`warning`})]})}function x9t({children:e,testID:t,displayStyle:n=`Card`,containerStyle:r}){return(0,W.jsxs)(B,{testID:t,style:[X4.container,r],children:[H.Children.map(e,e=>H.isValidElement(e)?e.type===Y4?H.cloneElement(e,{displayType:`ListItem`,displayStyle:n}):H.cloneElement(e):null),(0,W.jsx)(B,{style:{marginTop:-1}})]})}Y4.Container=x9t;var X4=R.create({container:{borderRadius:16,overflow:`hidden`},card:{flexDirection:`row`,alignItems:`center`,justifyContent:`space-between`,paddingVertical:14,paddingHorizontal:14,borderRadius:16,borderWidth:2},cardListItem:{borderRadius:0,borderWidth:0,borderBottomWidth:1},listItemSingle:{flexDirection:`row`,alignItems:`center`,paddingVertical:14,paddingHorizontal:16},listItemWithBottomBorder:{borderBottomWidth:1},fieldWithSubtitle:{paddingVertical:8.5},flexibleContainer:{flex:1,flexWrap:`wrap`,flexDirection:`row`,alignItems:`center`,justifyContent:`space-between`},textContainer:{marginRight:8,flexShrink:1},title:{...Y.Poppins.regular_Base},value:{...Y.Poppins.regular_Base},leftSlot:{flex:1,minWidth:0},rightSlot:{marginRight:-8,flexShrink:0},subtitle:{...Y.Poppins.regular_SM},gap:{gap:8}});V();var S9t=({isActive:e,isError:t,title:n,testID:r,onPress:i})=>{let{COLORS:a}=J();return(0,W.jsx)(Yf,{style:[C9t.button,{backgroundColor:a.bgSegmentContainer},e&&{backgroundColor:a.bgSegmentPrimary},t&&{backgroundColor:a.bgInputActive}],testID:r,onPress:i,children:(0,W.jsx)(Z,{style:[C9t.text,{color:e?a.textLabelActive:a.textLabelInactive}],children:n})})},C9t=R.create({button:{flex:1,borderRadius:16},text:{...Y.Poppins.medium_Base,paddingVertical:4,paddingHorizontal:20,textAlign:`center`}});V();var w9t=Oq?{outlineStyle:`none`}:{};function T9t(e){let{value:t,type:n=`Text`,placeholder:r,error:i=!1,errorText:a,renderLeftIcon:o,renderRightIcon:s,containerStyle:c,...l}=e,{COLORS:u}=J(),[d,f]=(0,H.useState)(!1),p=(0,H.useCallback)(()=>{f(!0)},[]),m=(0,H.useCallback)(()=>{f(!1)},[]),h=(0,H.useMemo)(()=>i||t?u.labelPrimary:u.labelSecondary,[i,t,u.labelPrimary,u.labelSecondary]);return(0,W.jsxs)(B,{style:Z4.inputWrapper,children:[(0,W.jsxs)(B,{style:[Z4.inputContainer,{backgroundColor:u.bgInputActive,borderColor:u.bgInputActive},d&&{borderColor:u.borderInputFocus},i&&{borderColor:u.borderInputDanger},c],children:[o&&(0,W.jsx)(B,{style:Z4.leftIcon,children:o(h)}),(0,W.jsx)(Lp,{cursorColor:u.iconBrand,value:t,placeholder:r,placeholderTextColor:i?u.textInputDanger:u.labelSecondary,maxFontSizeMultiplier:C2.s3,style:[Z4.input,{color:u.labelPrimary}],onFocus:p,onBlur:m,secureTextEntry:n===`Password`,autoComplete:`off`,...l}),s&&(0,W.jsx)(B,{style:Z4.rightIcon,children:s()})]}),!!a&&(0,W.jsx)(m3,{message:a})]})}var Z4=R.create({inputWrapper:{marginBottom:16},inputContainer:{flexDirection:`row`,alignItems:`center`,borderRadius:16,borderWidth:2},input:{flex:1,paddingHorizontal:14,paddingVertical:12,borderRadius:16,...Y.Poppins.regular_Base,lineHeight:z.select({ios:0,default:Y.Poppins.regular_Base.lineHeight}),includeFontPadding:!1,...w9t},leftIcon:{marginRight:14},rightIcon:{marginLeft:14}}),E9t=16,D9t=24,O9t=yvt?8:0,k9t=47;function Q4(){let e=W0(),t=Math.max(e.bottom+O9t,E9t),n=Math.max(e.top,D9t);return{...e,bottom:t,bottomWithFooterButton:t+k9t+24,bottomWithScroll:t+16,top:n,topInsideModal:kq?16:n}}var A9t=365.2425,j9t=6048e5,M9t=864e5,N9t=6e4,P9t=36e5,F9t=1e3,I9t=3600*24;I9t*7,I9t*A9t/12*3;var L9t=Symbol.for(`constructDateFrom`);function $4(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&L9t in e?e[L9t](t):e instanceof Date?new e.constructor(t):new Date(t)}function e3(e,t){return $4(t||e,e)}function R9t(e,t,n){let r=+e3(e,n?.in),[i,a]=[+e3(t.start,n?.in),+e3(t.end,n?.in)].sort((e,t)=>e-t);return r>=i&&r<=a}function t3(e,t,n){let r=e3(e,n?.in);return r.setTime(r.getTime()+t*N9t),r}function n3(e,t,n){return t3(e,-t,n)}var r3=[];for(let e=0;e<256;++e)r3.push((e+256).toString(16).slice(1));function z9t(e,t=0){return(r3[e[t+0]]+r3[e[t+1]]+r3[e[t+2]]+r3[e[t+3]]+`-`+r3[e[t+4]]+r3[e[t+5]]+`-`+r3[e[t+6]]+r3[e[t+7]]+`-`+r3[e[t+8]]+r3[e[t+9]]+`-`+r3[e[t+10]]+r3[e[t+11]]+r3[e[t+12]]+r3[e[t+13]]+r3[e[t+14]]+r3[e[t+15]]).toLowerCase()}var B9t,V9t=new Uint8Array(16);function H9t(){if(!B9t){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);B9t=crypto.getRandomValues.bind(crypto)}return B9t(V9t)}var U9t={randomUUID:typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function W9t(e,t,n){if(U9t.randomUUID&&!t&&!e)return U9t.randomUUID();e||={};let r=e.random??e.rng?.()??H9t();if(r.length<16)throw Error(`Random bytes length must be >= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return z9t(r)}var i3=()=>W9t(),G9t=()=>{let e=new Date().getTimezoneOffset(),t=-e>=0?`+`:`-`,n=Math.abs(e);return`${t}${Math.floor(n/60).toString().padStart(2,`0`)}:${(n%60).toString().padStart(2,`0`)}`};function K9t(e,t){let n=Object.values(e);return Object.keys(e)[n.indexOf(t)]}var a3=(e,t)=>Array.from({length:t-e+1},(t,n)=>(e+n).toString()),o3=(e,t)=>Array.from({length:(t-e)*10+1},(t,n)=>(e+n/10).toFixed(1)),q9t=(e,t,n=.1)=>Array.from({length:Math.round((t-e)/n)+1},(t,r)=>(e+r*n).toFixed(1)),s3=(e,t)=>{if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e===null||t===null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i of n)if(!r.includes(i)||!s3(e[i],t[i]))return!1;return!0},J9t=(e,t)=>e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate();function c3(e,t){let n=Math.round(Math.max(0,Math.min(100,t))/100*255).toString(16).padStart(2,`0`).toUpperCase();return(e.length===9?e.slice(0,7):e)+n}V();var Y9t=({buttons:e})=>(0,W.jsx)(B,{style:X9t.container,children:e.map(({type:e,title:t,onPress:n,disabled:r,testID:i,rightIcon:a})=>(0,W.jsx)(U4,{testID:i,onPress:n,title:t,type:e,disabled:r,rightIcon:a},t))}),X9t=R.create({container:{paddingHorizontal:16,paddingTop:16,gap:8}});V();var Z9t=({title:e,message:t,icon:n,children:r,enableScroll:i,buttons:a})=>{let{COLORS:o}=J(),{bottom:s}=Q4(),[c,l]=(0,H.useState)(0),u=(0,H.useCallback)(e=>{l(e.nativeEvent.layout.height)},[]),d=a?c+s:s,f=n||e||t?32:0,p=(0,W.jsxs)(W.Fragment,{children:[n&&(0,W.jsx)(B,{style:l3.iconContainer,children:(0,W.jsx)(n,{})}),(!!e||!!t)&&(0,W.jsxs)(B,{style:l3.textContainer,children:[!!e&&(0,W.jsx)(Z,{testID:`modal_content_title`,style:[l3.title,{color:o.labelPrimary}],children:e}),!!t&&(0,W.jsx)(Z,{testID:`modal_content_message`,style:{color:o.labelSecondary},children:t})]}),r]});return(0,W.jsxs)(W.Fragment,{children:[i?(0,W.jsx)(fs,{contentContainerStyle:[l3.content,{paddingTop:f,paddingBottom:d}],children:p}):(0,W.jsx)(B,{style:[l3.content,{paddingTop:f,paddingBottom:d}],children:p}),a&&(0,W.jsxs)(B,{style:[l3.footer,{bottom:s}],onLayout:u,children:[(0,W.jsx)(z4.default,{colors:[c3(o.bgModal,0),o.bgModal],style:[l3.footerFade,{bottom:-s}]}),(0,W.jsx)(Y9t,{buttons:a})]})]})},l3=R.create({content:{flexGrow:1,paddingHorizontal:16},iconContainer:{marginTop:8,marginBottom:24},textContainer:{gap:8},title:{...Y.Poppins.semiBold_2XL},footer:{position:`absolute`,left:0,right:0,pointerEvents:`box-none`},footerFade:{position:`absolute`,top:-24,left:0,right:0,pointerEvents:`none`}}),Q9t=(0,H.memo)(Z9t);V();var $9t=z.select({ios:300,android:150,web:300});function een({isHiding:e}){let{COLORS:t}=J(),n=(0,H.useRef)(new lf.Value(0)).current;(0,H.useEffect)(()=>{lf.timing(n,{toValue:+!e,duration:$9t,easing:ef.out(ef.cubic),useNativeDriver:!Oq}).start()},[e,n]);let r=(0,H.useMemo)(()=>[R.absoluteFill,{backgroundColor:t.bgOverlay}],[t.bgOverlay]);return(0,W.jsx)(lf.View,{style:[r,{opacity:n}]})}var ten=H.memo(een);V();var nen=300;function ren({testID:e,isVisible:t,onModalHide:n,onModalShow:r,onRequestClose:i,title:a,accessibilityLabel:o,message:s,buttons:c,containerStyle:l,icon:u,enableScroll:d=!1,children:f,hasBackdrop:p=!0}){let{COLORS:m}=J(),{height:h}=em(),g=(0,H.useMemo)(()=>Math.ceil(h/100*85),[h]),[_,v]=(0,H.useState)(!1),[y,b]=(0,H.useState)(!1),x=(0,H.useRef)(g),S=(0,H.useRef)(!1),C=(0,H.useRef)(new lf.Value(g)).current,w=(0,H.useCallback)(()=>{v(!1),b(!1),n?.()},[n]),T=(0,H.useCallback)(()=>{C.setValue(x.current),lf.timing(C,{toValue:0,duration:nen,easing:ef.out(ef.cubic),useNativeDriver:!Oq}).start(e=>{e.finished&&r?.()})},[C,r]),E=(0,H.useCallback)(()=>{S.current=!0,v(!0)},[]),D=(0,H.useCallback)(()=>{S.current=!1,b(!0),lf.timing(C,{toValue:x.current,duration:nen,easing:ef.out(ef.cubic),useNativeDriver:!Oq}).start(e=>{e.finished&&w()})},[C,w]);(0,H.useEffect)(()=>{_!==t&&(t?E():D())},[t,_,E,D]);let O=(0,H.useCallback)(e=>{x.current=e.nativeEvent.layout.height,S.current&&(S.current=!1,T())},[T]);return(0,W.jsxs)(hae,{visible:_,transparent:!0,accessibilityRole:`alert`,accessibilityLabel:o??a,onRequestClose:i,children:[p&&(0,W.jsx)(ten,{isHiding:y}),(0,W.jsx)(lf.View,{style:[ien.container,{transform:[{translateY:C}]}],children:(0,W.jsx)(B,{testID:e,onLayout:O,style:[ien.modal,{backgroundColor:m.bgModal},l],children:(0,W.jsx)(Q9t,{title:a,message:s,icon:u,enableScroll:d,buttons:c,children:f})})})]})}var ien=R.create({container:{...R.absoluteFill,justifyContent:`flex-end`,pointerEvents:`box-none`},modal:{width:`100%`,maxHeight:`85%`,borderTopRightRadius:36,borderTopLeftRadius:36,overflow:`hidden`}}),u3=H.memo(ren);V(),R.create({pagesIndicators:{flexDirection:`row`,justifyContent:`center`,marginVertical:12},dot:{width:8,height:8,borderRadius:4,marginHorizontal:4}}),V();var aen=({onPress:e,text:t,style:n})=>{let{COLORS:r}=J();return(0,W.jsxs)(wp,{testID:`scan-food-button`,onPress:e,style:({pressed:e})=>[{opacity:e?.5:1},n],children:[(0,W.jsx)(z4.default,{colors:b2,start:{x:0,y:0},end:{x:1,y:1},style:[R.absoluteFill,{borderRadius:t?16:100}]}),(0,W.jsxs)(B,{style:[oen.scanFoodButtonContent,{backgroundColor:r.bgButtonSecondary,borderRadius:t?15:100}],children:[(0,W.jsx)(K7t,{}),t&&(0,W.jsx)(Z,{style:[oen.title,{color:r.textButtonSecondary}],children:t})]})]})},oen=R.create({scanFoodButtonContent:{flex:1,flexDirection:`row`,alignItems:`center`,justifyContent:`center`,gap:8,margin:1,paddingHorizontal:15,paddingVertical:7},title:{...Y.Poppins.medium_SM,alignSelf:`center`}});V();var d3=({title:e})=>{let{COLORS:t}=J();return(0,W.jsx)(B,{style:sen.container,children:(0,W.jsx)(Z,{style:[sen.title,{color:t.labelPrimary}],children:e})})},sen=R.create({container:{gap:8,marginBottom:8},title:{...Y.Poppins.medium_SM}});V();function f3({title:e,message:t,value:n,testID:r,onValueChange:i,style:a}){let{COLORS:o}=J();return(0,W.jsx)(B,{style:[p3.container,a],children:(0,W.jsxs)(B,{style:p3.row,children:[(0,W.jsxs)(B,{style:p3.textContainer,accessible:!0,children:[(0,W.jsx)(Z,{style:[p3.title,{color:o.labelPrimary}],children:e}),(0,W.jsx)(Z,{style:[p3.description,{color:o.labelSecondary}],children:t})]}),(0,W.jsx)(Np,{testID:`${r}-${n}`,value:n,trackColor:{true:o.bgSliderForeground,false:o.bgSliderBackground},thumbColor:o.toggleKnob,onValueChange:i,accessibilityLabel:e,activeThumbColor:o.toggleKnob,activeTrackColor:o.bgSliderForeground})]})})}var p3=R.create({container:{justifyContent:`space-between`,padding:16,borderRadius:16},row:{flexDirection:`row`,justifyContent:`space-between`},textContainer:{flex:1},title:{...Y.Poppins.semiBold_Base,marginBottom:8},description:{...Y.Poppins.regular_SM}});V();function m3({message:e,type:t=`error`}){let{COLORS:n}=J();return(0,W.jsx)(B,{style:cen.container,children:(0,W.jsx)(Z,{style:[cen.text,{color:t===`error`?n.textInputDanger:n.textWarning}],children:e})})}var cen=R.create({container:{marginTop:8},text:{...Y.Poppins.regular_SM,marginHorizontal:16,textAlign:`left`}}),len={reachabilityUrl:`/`,reachabilityMethod:`HEAD`,reachabilityHeaders:{},reachabilityTest:e=>Promise.resolve(e.status===200),reachabilityShortTimeout:5*1e3,reachabilityLongTimeout:60*1e3,reachabilityRequestTimeout:15*1e3,reachabilityShouldRun:()=>!0,shouldFetchWiFiSSID:!0,useNativeReachability:!0},h3=`netInfo.networkStatusDidChange`,g3;(function(e){e.unknown=`unknown`,e.none=`none`,e.cellular=`cellular`,e.wifi=`wifi`,e.bluetooth=`bluetooth`,e.ethernet=`ethernet`,e.wimax=`wimax`,e.vpn=`vpn`,e.other=`other`})(g3||={});var _3;(function(e){e[`2g`]=`2g`,e[`3g`]=`3g`,e[`4g`]=`4g`,e[`5g`]=`5g`})(_3||={});var v3=typeof window<`u`,y3=v3&&!window.hasOwnProperty(`tizen`)&&!window.hasOwnProperty(`webOS`)?window.navigator.connection||window.navigator.mozConnection||window.navigator.webkitConnection:void 0,uen={bluetooth:g3.bluetooth,cellular:g3.cellular,ethernet:g3.ethernet,none:g3.none,other:g3.other,unknown:g3.unknown,wifi:g3.wifi,wimax:g3.wimax,mixed:g3.other},den={"2g":_3[`2g`],"3g":_3[`3g`],"4g":_3[`4g`],"slow-2g":_3[`2g`]},fen=e=>{let t=v3?navigator.onLine:!1,n={isInternetReachable:null};if(!y3)return t?{...n,isConnected:!0,type:g3.other,details:{isConnectionExpensive:!1}}:{...n,isConnected:!1,isInternetReachable:!1,type:g3.none,details:null};let r=y3.saveData,i=y3.type?uen[y3.type]:t?g3.other:g3.unknown;return i===g3.bluetooth?{...n,isConnected:!0,type:i,details:{isConnectionExpensive:r}}:i===g3.cellular?{...n,isConnected:!0,type:i,details:{isConnectionExpensive:r,cellularGeneration:den[y3.effectiveType]||null,carrier:null}}:i===g3.ethernet?{...n,isConnected:!0,type:i,details:{isConnectionExpensive:r,ipAddress:null,subnet:null}}:i===g3.wifi?{...n,isConnected:!0,type:i,details:{isConnectionExpensive:r,ssid:null,bssid:null,strength:null,ipAddress:null,subnet:null,frequency:null,linkSpeed:null,rxLinkSpeed:null,txLinkSpeed:null}}:i===g3.wimax?{...n,isConnected:!0,type:i,details:{isConnectionExpensive:r}}:i===g3.none?{...n,isConnected:!1,isInternetReachable:!1,type:i,details:null}:i===g3.unknown?{...n,isConnected:t,isInternetReachable:null,type:i,details:null}:{...n,isConnected:!0,type:g3.other,details:{isConnectionExpensive:r}}},pen=[],men=[],hen={addListener(e,t){switch(e){case h3:{let e=()=>{t(fen())};y3?y3.addEventListener(`change`,e):v3&&(window.addEventListener(`online`,e,!1),window.addEventListener(`offline`,e,!1)),pen.push(t),men.push(e);break}}},removeListeners(e,t){switch(e){case h3:{let e=pen.indexOf(t),n=men[e];y3?y3.removeEventListener(`change`,n):v3&&(window.removeEventListener(`online`,n),window.removeEventListener(`offline`,n)),pen.splice(e,1),men.splice(e,1);break}}},async getCurrentState(e){return fen(e)},configure(){}};V();var gen=new Of;hen.addListener(h3,e=>{gen.emit(h3,e)});var _en={...hen,eventEmitter:gen};function b3(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ven=class{constructor(e,t){b3(this,`_configuration`,void 0),b3(this,`_listener`,void 0),b3(this,`_isInternetReachable`,void 0),b3(this,`_currentInternetReachabilityCheckHandler`,null),b3(this,`_currentTimeoutHandle`,null),b3(this,`_setIsInternetReachable`,e=>{this._isInternetReachable!==e&&(this._isInternetReachable=e,this._listener(this._isInternetReachable))}),b3(this,`_setExpectsConnection`,e=>{this._currentInternetReachabilityCheckHandler!==null&&(this._currentInternetReachabilityCheckHandler.cancel(),this._currentInternetReachabilityCheckHandler=null),this._currentTimeoutHandle!==null&&(clearTimeout(this._currentTimeoutHandle),this._currentTimeoutHandle=null),e&&this._configuration.reachabilityShouldRun()?(this._isInternetReachable||this._setIsInternetReachable(null),this._currentInternetReachabilityCheckHandler=this._checkInternetReachability()):this._setIsInternetReachable(!1)}),b3(this,`_checkInternetReachability`,()=>{let e=new AbortController,t=fetch(this._configuration.reachabilityUrl,{headers:this._configuration.reachabilityHeaders,method:this._configuration.reachabilityMethod,cache:`no-cache`,signal:e.signal}),n,r=new Promise((e,t)=>{n=setTimeout(()=>t(`timedout`),this._configuration.reachabilityRequestTimeout)}),i=()=>{},a=new Promise((e,t)=>{i=()=>t(`canceled`)});return{promise:Promise.race([t,r,a]).then(e=>this._configuration.reachabilityTest(e)).then(e=>{this._setIsInternetReachable(e);let t=this._isInternetReachable?this._configuration.reachabilityLongTimeout:this._configuration.reachabilityShortTimeout;this._currentTimeoutHandle=setTimeout(this._checkInternetReachability,t)}).catch(t=>{t===`canceled`?e.abort():(t===`timedout`&&e.abort(),this._setIsInternetReachable(!1),this._currentTimeoutHandle=setTimeout(this._checkInternetReachability,this._configuration.reachabilityShortTimeout))}).then(()=>{clearTimeout(n)},e=>{throw clearTimeout(n),e}),cancel:i}}),b3(this,`update`,e=>{typeof e.isInternetReachable==`boolean`&&this._configuration.useNativeReachability?this._setIsInternetReachable(e.isInternetReachable):this._setExpectsConnection(e.isConnected)}),b3(this,`currentState`,()=>this._isInternetReachable),b3(this,`tearDown`,()=>{this._currentInternetReachabilityCheckHandler!==null&&(this._currentInternetReachabilityCheckHandler.cancel(),this._currentInternetReachabilityCheckHandler=null),this._currentTimeoutHandle!==null&&(clearTimeout(this._currentTimeoutHandle),this._currentTimeoutHandle=null)}),this._configuration=e,this._listener=t}};function x3(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var yen=class{constructor(e){x3(this,`_nativeEventSubscription`,null),x3(this,`_subscriptions`,new Set),x3(this,`_latestState`,null),x3(this,`_internetReachability`,void 0),x3(this,`_handleNativeStateUpdate`,e=>{this._internetReachability.update(e);let t=this._convertState(e);this._latestState=t,this._subscriptions.forEach(e=>e(t))}),x3(this,`_handleInternetReachabilityUpdate`,e=>{if(!this._latestState)return;let t={...this._latestState,isInternetReachable:e};this._latestState=t,this._subscriptions.forEach(e=>e(t))}),x3(this,`_fetchCurrentState`,async e=>{let t=await _en.getCurrentState(e);this._internetReachability.update(t);let n=this._convertState(t);return e||(this._latestState=n,this._subscriptions.forEach(e=>e(n))),n}),x3(this,`_convertState`,e=>typeof e.isInternetReachable==`boolean`?e:{...e,isInternetReachable:this._internetReachability.currentState()}),x3(this,`latest`,e=>e?this._fetchCurrentState(e):this._latestState?Promise.resolve(this._latestState):this._fetchCurrentState()),x3(this,`add`,e=>{this._subscriptions.add(e),this._latestState?e(this._latestState):this.latest().then(e)}),x3(this,`remove`,e=>{this._subscriptions.delete(e)}),x3(this,`tearDown`,()=>{this._internetReachability&&this._internetReachability.tearDown(),this._nativeEventSubscription&&this._nativeEventSubscription.remove(),this._subscriptions.clear()}),this._internetReachability=new ven(e,this._handleInternetReachabilityUpdate),this._nativeEventSubscription=_en.eventEmitter.addListener(h3,this._handleNativeStateUpdate),this._fetchCurrentState()}};V();var ben=len,S3=null,C3=()=>new yen(ben),w3=!1,xen=[];function Sen(e){ben={...len,...e},S3&&=(S3.tearDown(),C3()),z.OS===`ios`&&_en.configure(e)}function Cen(e){return S3||=C3(),S3.latest(e)}function wen(){return S3||=C3(),w3?new Promise(e=>{xen.push(e)}):(w3=!0,S3._fetchCurrentState().then(e=>(xen.forEach(t=>t(e)),xen=[],e)).finally(()=>{w3=!1}))}function Ten(e){return S3||=C3(),S3.add(e),()=>{S3&&S3.remove(e)}}function Een(e){e&&Sen(e);let[t,n]=(0,H.useState)({type:g3.unknown,isConnected:null,isInternetReachable:null,details:null});return(0,H.useEffect)(()=>{let e=Ten(n);return()=>e()},[]),t}function Den(e=!1,t){let[n,r]=(0,H.useState)(),[i,a]=(0,H.useState)({type:g3.unknown,isConnected:null,isInternetReachable:null,details:null});return(0,H.useEffect)(()=>{if(e)return;let n=new yen({...len,...t});return r(n),n.add(a),n.tearDown},[e,t]),{netInfo:i,refresh:(0,H.useCallback)(()=>{n&&!w3&&(w3=!0,n._fetchCurrentState().finally(()=>{w3=!1}))},[n])}}var Oen={configure:Sen,fetch:Cen,refresh:wen,addEventListener:Ten,useNetInfo:Een,useNetInfoInstance:Den},ken=X.Milliseconds.Minute,T3=async(e,t,n=ken)=>{let r=new AbortController,i=setTimeout(()=>r.abort(),n),a=t?.signal,o=()=>r.abort();a?.aborted&&r.abort(),a?.addEventListener(`abort`,o);try{return await fetch(e,{...t,signal:r.signal})}catch(e){throw r.signal.aborted&&!a?.aborted?TypeError(`Network request timed out`):e}finally{clearTimeout(i),a?.removeEventListener(`abort`,o)}},Aen=s((e=>{e.byteLength=c,e.toByteArray=u,e.fromByteArray=p;for(var t=[],n=[],r=typeof Uint8Array<`u`?Uint8Array:Array,i=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,a=0,o=i.length;a<o;++a)t[a]=i[a],n[i.charCodeAt(a)]=a;n[45]=62,n[95]=63;function s(e){var t=e.length;if(t%4>0)throw Error(`Invalid string. Length must be a multiple of 4`);var n=e.indexOf(`=`);n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function c(e){var t=s(e),n=t[0],r=t[1];return(n+r)*3/4-r}function l(e,t,n){return(t+n)*3/4-n}function u(e){var t,i=s(e),a=i[0],o=i[1],c=new r(l(e,a,o)),u=0,d=o>0?a-4:a,f;for(f=0;f<d;f+=4)t=n[e.charCodeAt(f)]<<18|n[e.charCodeAt(f+1)]<<12|n[e.charCodeAt(f+2)]<<6|n[e.charCodeAt(f+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=t&255;return o===2&&(t=n[e.charCodeAt(f)]<<2|n[e.charCodeAt(f+1)]>>4,c[u++]=t&255),o===1&&(t=n[e.charCodeAt(f)]<<10|n[e.charCodeAt(f+1)]<<4|n[e.charCodeAt(f+2)]>>2,c[u++]=t>>8&255,c[u++]=t&255),c}function d(e){return t[e>>18&63]+t[e>>12&63]+t[e>>6&63]+t[e&63]}function f(e,t,n){for(var r,i=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(d(r));return i.join(``)}function p(e){for(var n,r=e.length,i=r%3,a=[],o=16383,s=0,c=r-i;s<c;s+=o)a.push(f(e,s,s+o>c?c:s+o));return i===1?(n=e[r-1],a.push(t[n>>2]+t[n<<4&63]+`==`)):i===2&&(n=(e[r-2]<<8)+e[r-1],a.push(t[n>>10]+t[n>>4&63]+t[n<<2&63]+`=`)),a.join(``)}})),jen=s((e=>{e.read=function(e,t,n,r,i){var a,o,s=i*8-r-1,c=(1<<s)-1,l=c>>1,u=-7,d=n?i-1:0,f=n?-1:1,p=e[t+d];for(d+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=a*256+e[t+d],d+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=r;u>0;o=o*256+e[t+d],d+=f,u-=8);if(a===0)a=1-l;else if(a===c)return o?NaN:(p?-1:1)*(1/0);else o+=2**r,a-=l;return(p?-1:1)*o*2**(a-r)},e.write=function(e,t,n,r,i,a){var o,s,c,l=a*8-i-1,u=(1<<l)-1,d=u>>1,f=i===23?2**-24-2**-77:0,p=r?0:a-1,m=r?1:-1,h=+(t<0||t===0&&1/t<0);for(t=Math.abs(t),isNaN(t)||t===1/0?(s=+!!isNaN(t),o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=2**-o)<1&&(o--,c*=2),o+d>=1?t+=f/c:t+=f*2**(1-d),t*c>=2&&(o++,c/=2),o+d>=u?(s=0,o=u):o+d>=1?(s=(t*c-1)*2**i,o+=d):(s=t*2**(d-1)*2**i,o=0));i>=8;e[n+p]=s&255,p+=m,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;e[n+p]=o&255,p+=m,o/=256,l-=8);e[n+p-m]|=h*128}})),Men=s((e=>{var t=Aen(),n=jen(),r=typeof Symbol==`function`&&typeof Symbol.for==`function`?Symbol.for(`nodejs.util.inspect.custom`):null;e.Buffer=s,e.SlowBuffer=v,e.INSPECT_MAX_BYTES=50;var i=2147483647;e.kMaxLength=i,s.TYPED_ARRAY_SUPPORT=a(),!s.TYPED_ARRAY_SUPPORT&&typeof console<`u`&&typeof console.error==`function`&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function a(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function o(e){if(e>i)throw RangeError(`The value "`+e+`" is invalid for option "size"`);let t=new Uint8Array(e);return Object.setPrototypeOf(t,s.prototype),t}function s(e,t,n){if(typeof e==`number`){if(typeof t==`string`)throw TypeError(`The "string" argument must be of type string. Received type number`);return d(e)}return c(e,t,n)}s.poolSize=8192;function c(e,t,n){if(typeof e==`string`)return f(e,t);if(ArrayBuffer.isView(e))return m(e);if(e==null)throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e);if(xe(e,ArrayBuffer)||e&&xe(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<`u`&&(xe(e,SharedArrayBuffer)||e&&xe(e.buffer,SharedArrayBuffer)))return h(e,t,n);if(typeof e==`number`)throw TypeError(`The "value" argument must not be of type number. Received type number`);let r=e.valueOf&&e.valueOf();if(r!=null&&r!==e)return s.from(r,t,n);let i=g(e);if(i)return i;if(typeof Symbol<`u`&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]==`function`)return s.from(e[Symbol.toPrimitive](`string`),t,n);throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e)}s.from=function(e,t,n){return c(e,t,n)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function l(e){if(typeof e!=`number`)throw TypeError(`"size" argument must be of type number`);if(e<0)throw RangeError(`The value "`+e+`" is invalid for option "size"`)}function u(e,t,n){return l(e),e<=0||t===void 0?o(e):typeof n==`string`?o(e).fill(t,n):o(e).fill(t)}s.alloc=function(e,t,n){return u(e,t,n)};function d(e){return l(e),o(e<0?0:_(e)|0)}s.allocUnsafe=function(e){return d(e)},s.allocUnsafeSlow=function(e){return d(e)};function f(e,t){if((typeof t!=`string`||t===``)&&(t=`utf8`),!s.isEncoding(t))throw TypeError(`Unknown encoding: `+t);let n=y(e,t)|0,r=o(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function p(e){let t=e.length<0?0:_(e.length)|0,n=o(t);for(let r=0;r<t;r+=1)n[r]=e[r]&255;return n}function m(e){if(xe(e,Uint8Array)){let t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return p(e)}function h(e,t,n){if(t<0||e.byteLength<t)throw RangeError(`"offset" is outside of buffer bounds`);if(e.byteLength<t+(n||0))throw RangeError(`"length" is outside of buffer bounds`);let r;return r=t===void 0&&n===void 0?new Uint8Array(e):n===void 0?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,s.prototype),r}function g(e){if(s.isBuffer(e)){let t=_(e.length)|0,n=o(t);return n.length===0||e.copy(n,0,0,t),n}if(e.length!==void 0)return typeof e.length!=`number`||L(e.length)?o(0):p(e);if(e.type===`Buffer`&&Array.isArray(e.data))return p(e.data)}function _(e){if(e>=i)throw RangeError(`Attempt to allocate Buffer larger than maximum size: 0x`+i.toString(16)+` bytes`);return e|0}function v(e){return+e!=e&&(e=0),s.alloc(+e)}s.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==s.prototype},s.compare=function(e,t){if(xe(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),xe(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw TypeError(`The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array`);if(e===t)return 0;let n=e.length,r=t.length;for(let i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:+(r<n)},s.isEncoding=function(e){switch(String(e).toLowerCase()){case`hex`:case`utf8`:case`utf-8`:case`ascii`:case`latin1`:case`binary`:case`base64`:case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return!0;default:return!1}},s.concat=function(e,t){if(!Array.isArray(e))throw TypeError(`"list" argument must be an Array of Buffers`);if(e.length===0)return s.alloc(0);let n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;let r=s.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){let t=e[n];if(xe(t,Uint8Array))i+t.length>r.length?(s.isBuffer(t)||(t=s.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else if(s.isBuffer(t))t.copy(r,i);else throw TypeError(`"list" argument must be an Array of Buffers`);i+=t.length}return r};function y(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||xe(e,ArrayBuffer))return e.byteLength;if(typeof e!=`string`)throw TypeError(`The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type `+typeof e);let n=e.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&n===0)return 0;let i=!1;for(;;)switch(t){case`ascii`:case`latin1`:case`binary`:return n;case`utf8`:case`utf-8`:return _e(e).length;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return n*2;case`hex`:return n>>>1;case`base64`:return ye(e).length;default:if(i)return r?-1:_e(e).length;t=(``+t).toLowerCase(),i=!0}}s.byteLength=y;function b(e,t,n){let r=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,t>>>=0,n<=t))return``;for(e||=`utf8`;;)switch(e){case`hex`:return ie(this,t,n);case`utf8`:case`utf-8`:return A(this,t,n);case`ascii`:return ne(this,t,n);case`latin1`:case`binary`:return re(this,t,n);case`base64`:return k(this,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return j(this,t,n);default:if(r)throw TypeError(`Unknown encoding: `+e);e=(e+``).toLowerCase(),r=!0}}s.prototype._isBuffer=!0;function x(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}s.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw RangeError(`Buffer size must be a multiple of 16-bits`);for(let t=0;t<e;t+=2)x(this,t,t+1);return this},s.prototype.swap32=function(){let e=this.length;if(e%4!=0)throw RangeError(`Buffer size must be a multiple of 32-bits`);for(let t=0;t<e;t+=4)x(this,t,t+3),x(this,t+1,t+2);return this},s.prototype.swap64=function(){let e=this.length;if(e%8!=0)throw RangeError(`Buffer size must be a multiple of 64-bits`);for(let t=0;t<e;t+=8)x(this,t,t+7),x(this,t+1,t+6),x(this,t+2,t+5),x(this,t+3,t+4);return this},s.prototype.toString=function(){let e=this.length;return e===0?``:arguments.length===0?A(this,0,e):b.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(e){if(!s.isBuffer(e))throw TypeError(`Argument must be a Buffer`);return this===e?!0:s.compare(this,e)===0},s.prototype.inspect=function(){let t=``,n=e.INSPECT_MAX_BYTES;return t=this.toString(`hex`,0,n).replace(/(.{2})/g,`$1 `).trim(),this.length>n&&(t+=` ... `),`<Buffer `+t+`>`},r&&(s.prototype[r]=s.prototype.inspect),s.prototype.compare=function(e,t,n,r,i){if(xe(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw TypeError(`The "target" argument must be one of type Buffer or Uint8Array. Received type `+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),r===void 0&&(r=0),i===void 0&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw RangeError(`out of range index`);if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;let a=i-r,o=n-t,c=Math.min(a,o),l=this.slice(r,i),u=e.slice(t,n);for(let e=0;e<c;++e)if(l[e]!==u[e]){a=l[e],o=u[e];break}return a<o?-1:+(o<a)};function S(e,t,n,r,i){if(e.length===0)return-1;if(typeof n==`string`?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,L(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0)if(i)n=0;else return-1;if(typeof t==`string`&&(t=s.from(t,r)),s.isBuffer(t))return t.length===0?-1:C(e,t,n,r,i);if(typeof t==`number`)return t&=255,typeof Uint8Array.prototype.indexOf==`function`?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):C(e,[t],n,r,i);throw TypeError(`val must be string, number or Buffer`)}function C(e,t,n,r,i){let a=1,o=e.length,s=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r===`ucs2`||r===`ucs-2`||r===`utf16le`||r===`utf-16le`)){if(e.length<2||t.length<2)return-1;a=2,o/=2,s/=2,n/=2}function c(e,t){return a===1?e[t]:e.readUInt16BE(t*a)}let l;if(i){let r=-1;for(l=n;l<o;l++)if(c(e,l)===c(t,r===-1?0:l-r)){if(r===-1&&(r=l),l-r+1===s)return r*a}else r!==-1&&(l-=l-r),r=-1}else for(n+s>o&&(n=o-s),l=n;l>=0;l--){let n=!0;for(let r=0;r<s;r++)if(c(e,l+r)!==c(t,r)){n=!1;break}if(n)return l}return-1}s.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},s.prototype.indexOf=function(e,t,n){return S(this,e,t,n,!0)},s.prototype.lastIndexOf=function(e,t,n){return S(this,e,t,n,!1)};function w(e,t,n,r){n=Number(n)||0;let i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;let a=t.length;r>a/2&&(r=a/2);let o;for(o=0;o<r;++o){let r=parseInt(t.substr(o*2,2),16);if(L(r))return o;e[n+o]=r}return o}function T(e,t,n,r){return be(_e(t,e.length-n),e,n,r)}function E(e,t,n,r){return be(I(t),e,n,r)}function D(e,t,n,r){return be(ye(t),e,n,r)}function O(e,t,n,r){return be(ve(t,e.length-n),e,n,r)}s.prototype.write=function(e,t,n,r){if(t===void 0)r=`utf8`,n=this.length,t=0;else if(n===void 0&&typeof t==`string`)r=t,n=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(n)?(n>>>=0,r===void 0&&(r=`utf8`)):(r=n,n=void 0);else throw Error(`Buffer.write(string, encoding, offset[, length]) is no longer supported`);let i=this.length-t;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw RangeError(`Attempt to write outside buffer bounds`);r||=`utf8`;let a=!1;for(;;)switch(r){case`hex`:return w(this,e,t,n);case`utf8`:case`utf-8`:return T(this,e,t,n);case`ascii`:case`latin1`:case`binary`:return E(this,e,t,n);case`base64`:return D(this,e,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return O(this,e,t,n);default:if(a)throw TypeError(`Unknown encoding: `+r);r=(``+r).toLowerCase(),a=!0}},s.prototype.toJSON=function(){return{type:`Buffer`,data:Array.prototype.slice.call(this._arr||this,0)}};function k(e,n,r){return n===0&&r===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(n,r))}function A(e,t,n){n=Math.min(e.length,n);let r=[],i=t;for(;i<n;){let t=e[i],a=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o<=n){let n,r,s,c;switch(o){case 1:t<128&&(a=t);break;case 2:n=e[i+1],(n&192)==128&&(c=(t&31)<<6|n&63,c>127&&(a=c));break;case 3:n=e[i+1],r=e[i+2],(n&192)==128&&(r&192)==128&&(c=(t&15)<<12|(n&63)<<6|r&63,c>2047&&(c<55296||c>57343)&&(a=c));break;case 4:n=e[i+1],r=e[i+2],s=e[i+3],(n&192)==128&&(r&192)==128&&(s&192)==128&&(c=(t&15)<<18|(n&63)<<12|(r&63)<<6|s&63,c>65535&&c<1114112&&(a=c))}}a===null?(a=65533,o=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),i+=o}return te(r)}var ee=4096;function te(e){let t=e.length;if(t<=ee)return String.fromCharCode.apply(String,e);let n=``,r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=ee));return n}function ne(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]&127);return r}function re(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function ie(e,t,n){let r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let i=``;for(let r=t;r<n;++r)i+=Se[e[r]];return i}function j(e,t,n){let r=e.slice(t,n),i=``;for(let e=0;e<r.length-1;e+=2)i+=String.fromCharCode(r[e]+r[e+1]*256);return i}s.prototype.slice=function(e,t){let n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);let r=this.subarray(e,t);return Object.setPrototypeOf(r,s.prototype),r};function ae(e,t,n){if(e%1!=0||e<0)throw RangeError(`offset is not uint`);if(e+t>n)throw RangeError(`Trying to access beyond buffer length`)}s.prototype.readUintLE=s.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||ae(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return r},s.prototype.readUintBE=s.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||ae(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},s.prototype.readUint8=s.prototype.readUInt8=function(e,t){return e>>>=0,t||ae(e,1,this.length),this[e]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||ae(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||ae(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||ae(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||ae(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readBigUInt64LE=Ce(function(e){e>>>=0,me(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&he(e,this.length-8);let r=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))}),s.prototype.readBigUInt64BE=Ce(function(e){e>>>=0,me(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&he(e,this.length-8);let r=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(r)<<BigInt(32))+BigInt(i)}),s.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||ae(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return i*=128,r>=i&&(r-=2**(8*t)),r},s.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||ae(e,t,this.length);let r=t,i=1,a=this[e+--r];for(;r>0&&(i*=256);)a+=this[e+--r]*i;return i*=128,a>=i&&(a-=2**(8*t)),a},s.prototype.readInt8=function(e,t){return e>>>=0,t||ae(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||ae(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},s.prototype.readInt16BE=function(e,t){e>>>=0,t||ae(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||ae(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||ae(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readBigInt64LE=Ce(function(e){e>>>=0,me(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&he(e,this.length-8);let r=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)}),s.prototype.readBigInt64BE=Ce(function(e){e>>>=0,me(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&he(e,this.length-8);let r=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)}),s.prototype.readFloatLE=function(e,t){return e>>>=0,t||ae(e,4,this.length),n.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||ae(e,4,this.length),n.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||ae(e,8,this.length),n.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||ae(e,8,this.length),n.read(this,e,!1,52,8)};function oe(e,t,n,r,i,a){if(!s.isBuffer(e))throw TypeError(`"buffer" argument must be a Buffer instance`);if(t>i||t<a)throw RangeError(`"value" argument is out of bounds`);if(n+r>e.length)throw RangeError(`Index out of range`)}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;oe(this,e,t,n,r,0)}let i=1,a=0;for(this[t]=e&255;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;oe(this,e,t,n,r,0)}let i=n-1,a=1;for(this[t+i]=e&255;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},s.prototype.writeUint8=s.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||oe(this,e,t,1,255,0),this[t]=e&255,t+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||oe(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||oe(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||oe(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||oe(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function se(e,t,n,r,i){pe(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,n}function M(e,t,n,r,i){pe(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n+7]=a,a>>=8,e[n+6]=a,a>>=8,e[n+5]=a,a>>=8,e[n+4]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=o,o>>=8,e[n+2]=o,o>>=8,e[n+1]=o,o>>=8,e[n]=o,n+8}s.prototype.writeBigUInt64LE=Ce(function(e,t=0){return se(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),s.prototype.writeBigUInt64BE=Ce(function(e,t=0){return M(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),s.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);oe(this,e,t,n,r-1,-r)}let i=0,a=1,o=0;for(this[t]=e&255;++i<n&&(a*=256);)e<0&&o===0&&this[t+i-1]!==0&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+n},s.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);oe(this,e,t,n,r-1,-r)}let i=n-1,a=1,o=0;for(this[t+i]=e&255;--i>=0&&(a*=256);)e<0&&o===0&&this[t+i+1]!==0&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+n},s.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||oe(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},s.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||oe(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||oe(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||oe(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||oe(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},s.prototype.writeBigInt64LE=Ce(function(e,t=0){return se(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))}),s.prototype.writeBigInt64BE=Ce(function(e,t=0){return M(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))});function ce(e,t,n,r,i,a){if(n+r>e.length||n<0)throw RangeError(`Index out of range`)}function N(e,t,r,i,a){return t=+t,r>>>=0,a||ce(e,t,r,4,34028234663852886e22,-34028234663852886e22),n.write(e,t,r,i,23,4),r+4}s.prototype.writeFloatLE=function(e,t,n){return N(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return N(this,e,t,!1,n)};function P(e,t,r,i,a){return t=+t,r>>>=0,a||ce(e,t,r,8,17976931348623157e292,-17976931348623157e292),n.write(e,t,r,i,52,8),r+8}s.prototype.writeDoubleLE=function(e,t,n){return P(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return P(this,e,t,!1,n)},s.prototype.copy=function(e,t,n,r){if(!s.isBuffer(e))throw TypeError(`argument should be a Buffer`);if(n||=0,!r&&r!==0&&(r=this.length),t>=e.length&&(t=e.length),t||=0,r>0&&r<n&&(r=n),r===n||e.length===0||this.length===0)return 0;if(t<0)throw RangeError(`targetStart out of bounds`);if(n<0||n>=this.length)throw RangeError(`Index out of range`);if(r<0)throw RangeError(`sourceEnd out of bounds`);r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);let i=r-n;return this===e&&typeof Uint8Array.prototype.copyWithin==`function`?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},s.prototype.fill=function(e,t,n,r){if(typeof e==`string`){if(typeof t==`string`?(r=t,t=0,n=this.length):typeof n==`string`&&(r=n,n=this.length),r!==void 0&&typeof r!=`string`)throw TypeError(`encoding must be a string`);if(typeof r==`string`&&!s.isEncoding(r))throw TypeError(`Unknown encoding: `+r);if(e.length===1){let t=e.charCodeAt(0);(r===`utf8`&&t<128||r===`latin1`)&&(e=t)}}else typeof e==`number`?e&=255:typeof e==`boolean`&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw RangeError(`Out of range index`);if(n<=t)return this;t>>>=0,n=n===void 0?this.length:n>>>0,e||=0;let i;if(typeof e==`number`)for(i=t;i<n;++i)this[i]=e;else{let a=s.isBuffer(e)?e:s.from(e,r),o=a.length;if(o===0)throw TypeError(`The value "`+e+`" is invalid for argument "value"`);for(i=0;i<n-t;++i)this[i+t]=a[i%o]}return this};var le={};function ue(e,t,n){le[e]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}ue(`ERR_BUFFER_OUT_OF_BOUNDS`,function(e){return e?`${e} is outside of buffer bounds`:`Attempt to access memory outside buffer bounds`},RangeError),ue(`ERR_INVALID_ARG_TYPE`,function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),ue(`ERR_OUT_OF_RANGE`,function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=de(String(n)):typeof n==`bigint`&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=de(i)),i+=`n`),r+=` It must be ${t}. Received ${i}`,r},RangeError);function de(e){let t=``,n=e.length,r=+(e[0]===`-`);for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function fe(e,t,n){me(t,`offset`),(e[t]===void 0||e[t+n]===void 0)&&he(t,e.length-(n+1))}function pe(e,t,n,r,i,a){if(e>n||e<t){let r=typeof t==`bigint`?`n`:``,i;throw i=a>3?t===0||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${(a+1)*8}${r}`:`>= -(2${r} ** ${(a+1)*8-1}${r}) and < 2 ** ${(a+1)*8-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new le.ERR_OUT_OF_RANGE(`value`,i,e)}fe(r,i,a)}function me(e,t){if(typeof e!=`number`)throw new le.ERR_INVALID_ARG_TYPE(t,`number`,e)}function he(e,t,n){throw Math.floor(e)===e?t<0?new le.ERR_BUFFER_OUT_OF_BOUNDS:new le.ERR_OUT_OF_RANGE(n||`offset`,`>= ${+!!n} and <= ${t}`,e):(me(e,n),new le.ERR_OUT_OF_RANGE(n||`offset`,`an integer`,e))}var ge=/[^+/0-9A-Za-z-_]/g;function F(e){if(e=e.split(`=`)[0],e=e.trim().replace(ge,``),e.length<2)return``;for(;e.length%4!=0;)e+=`=`;return e}function _e(e,t){t||=1/0;let n,r=e.length,i=null,a=[];for(let o=0;o<r;++o){if(n=e.charCodeAt(o),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}else if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if(--t<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw Error(`Invalid code point`)}return a}function I(e){let t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n)&255);return t}function ve(e,t){let n,r,i,a=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,i=n%256,a.push(i),a.push(r);return a}function ye(e){return t.toByteArray(F(e))}function be(e,t,n,r){let i;for(i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function xe(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function L(e){return e!==e}var Se=(function(){let e=`0123456789abcdef`,t=Array(256);for(let n=0;n<16;++n){let r=n*16;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t})();function Ce(e){return typeof BigInt>`u`?we:e}function we(){throw Error(`BigInt not supported`)}}))(),Nen=X.Milliseconds.Second*15,Pen=async e=>T3(new URL(bq.OAUTH_BASE_URL+`/token`).toString(),{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`,Authorization:`Basic `+Men.Buffer.from(encodeURIComponent(bq.OAUTH_CLIENT_ID)).toString(`base64`),...Aq},body:new URLSearchParams({grant_type:`refresh_token`,refresh_token:e}).toString()},Nen),Fen=async()=>{let e=`/hda/api/v1/session`,t=await fetch(e,{method:X.HTTPRequestMethod.GET,headers:{Accept:`application/json`}});return await T2(t,X.StatusCode.OK,e),t.json()},Ien={accessToken:void 0,refreshToken:void 0,isOnboardingFinished:void 0,hasCompletedSetupFlow:!1,notificationPermissionsStatus:`unknown`,pinCode:void 0,settingsUnlockedTimestamp:null,isPinSetupShouldBeShown:!1,isElevatedAuthConfirmed:!1},Len={...Ien,accessToken:xq.getString(`access_token`),refreshToken:xq.getString(`refresh_token`),isOnboardingFinished:xq.getBoolean(`isOnboardingFinished`)},E3=gq()(vq(e=>({...Len,setTokens:({accessToken:t,refreshToken:n})=>{e({accessToken:t,refreshToken:n})},setIsOnboardingFinished:t=>{e({isOnboardingFinished:t,hasCompletedSetupFlow:t})},setIsPinSetupShouldBeShown:t=>{e({isPinSetupShouldBeShown:t})},setHasCompletedSetupFlow:t=>{e({hasCompletedSetupFlow:t})},setNotificationPermissionsStatus:t=>{e({notificationPermissionsStatus:t})},setPINCode(t){e({pinCode:t})},setSettingsUnlockedTimestamp:t=>{e({settingsUnlockedTimestamp:t})},setIsElevatedAuthConfirmed:t=>{e({isElevatedAuthConfirmed:t})},clear:()=>{e(Ien)}}),{name:`AUTH_STORE`,storage:_q(Sq),partialize:({settingsUnlockedTimestamp:e,isElevatedAuthConfirmed:t,...n})=>n})),Ren=class extends Error{constructor(e){super(e),this.name=`SignedOutError`}};async function zen(e){if(bq.TRACKING_ENABLED!==`true`)return;let t={...e,uuid:void 0},n={headers:{Accept:`application/json`,"Content-Type":`application/json`,...Aq},body:JSON.stringify(t),method:X.HTTPRequestMethod.POST},r=Oq?`/events`:`/projects/${bq.TRACKING_PROJECT_ID}/events`,i=`${bq.TRACKING_BASE_URL}/api/v1${r}`;await T2(await T3(i,n),X.StatusCode.CREATED,i,X.HTTPRequestMethod.POST)}var D3=function(e){return e.MalformedDataError=`Malformed Data Error`,e.IncorrectDataError=`Incorrect Data Type Error`,e}({});function O3(e){var t=[...arguments].slice(1);throw Error(typeof e==`number`?`[MobX] minified error nr: `+e+(t.length?` `+t.map(String).join(`,`):``)+`. Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts`:`[MobX] `+e)}var Ben={};function k3(){return typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof globalThis<`u`?globalThis:typeof self<`u`?self:Ben}var Ven=Object.assign,A3=Object.getOwnPropertyDescriptor,j3=Object.defineProperty,M3=Object.prototype,Hen=[];Object.freeze(Hen);var Uen={};Object.freeze(Uen);var Wen=typeof Proxy<`u`,Gen=Object.toString();function Ken(){Wen||O3(`Proxy not available`)}function qen(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var N3=function(){};function P3(e){return typeof e==`function`}function F3(e){switch(typeof e){case`string`:case`symbol`:case`number`:return!0}return!1}function I3(e){return typeof e==`object`&&!!e}function L3(e){if(!I3(e))return!1;var t=Object.getPrototypeOf(e);if(t==null)return!0;var n=Object.hasOwnProperty.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n.toString()===Gen}function Jen(e){var t=e?.constructor;return t?t.name===`GeneratorFunction`||t.displayName===`GeneratorFunction`:!1}function R3(e,t,n){j3(e,t,{enumerable:!1,writable:!0,configurable:!0,value:n})}function Yen(e,t,n){j3(e,t,{enumerable:!1,writable:!1,configurable:!0,value:n})}function z3(e,t){var n=`isMobX`+e;return t.prototype[n]=!0,function(e){return I3(e)&&e[n]===!0}}function B3(e){return e!=null&&Object.prototype.toString.call(e)===`[object Map]`}function Xen(e){return Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(e)))===null}function V3(e){return e!=null&&Object.prototype.toString.call(e)===`[object Set]`}var Zen=Object.getOwnPropertySymbols!==void 0;function Qen(e){var t=Object.keys(e);if(!Zen)return t;var n=Object.getOwnPropertySymbols(e);return n.length?[].concat(t,n.filter(function(t){return M3.propertyIsEnumerable.call(e,t)})):t}var H3=typeof Reflect<`u`&&Reflect.ownKeys?Reflect.ownKeys:Zen?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function $en(e){return e===null?null:typeof e==`object`?``+e:e}function U3(e,t){return M3.hasOwnProperty.call(e,t)}var etn=Object.getOwnPropertyDescriptors||function(e){var t={};return H3(e).forEach(function(n){t[n]=A3(e,n)}),t};function W3(e,t){return!!(e&t)}function G3(e,t,n){return n?e|=t:e&=~t,e}function ttn(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 ntn(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,otn(r.key),r)}}function K3(e,t,n){return t&&ntn(e.prototype,t),n&&ntn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function q3(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=stn(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
879
879
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}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)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},J3.apply(null,arguments)}function rtn(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,itn(e,t)}function itn(e,t){return itn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},itn(e,t)}function atn(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function otn(e){var t=atn(e,`string`);return typeof t==`symbol`?t:t+``}function stn(e,t){if(e){if(typeof e==`string`)return ttn(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)?ttn(e,t):void 0}}var Y3=Symbol(`mobx-stored-annotations`);function X3(e){function t(t,n){if(Q3(n))return e.decorate_20223_(t,n);Z3(t,n,e)}return Object.assign(t,e)}function Z3(e,t,n){U3(e,Y3)||R3(e,Y3,J3({},e[Y3])),vtn(n)||(e[Y3][t]=n)}function ctn(e){return U3(e,Y3)||R3(e,Y3,J3({},e[Y3])),e[Y3]}function Q3(e){return typeof e==`object`&&typeof e.kind==`string`}var $3=Symbol(`mobx administration`),e6=function(){function e(e){e===void 0&&(e=`Atom`),this.name_=void 0,this.flags_=0,this.observers_=new Set,this.lastAccessedBy_=0,this.lowestObserverState_=h6.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=e}var t=e.prototype;return t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(e){return e()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(e){return e()})},t.reportObserved=function(){return knn(this)},t.reportChanged=function(){w6(),Ann(this),T6()},t.toString=function(){return this.name_},K3(e,[{key:`isBeingObserved`,get:function(){return W3(this.flags_,e.isBeingObservedMask_)},set:function(t){this.flags_=G3(this.flags_,e.isBeingObservedMask_,t)}},{key:`isPendingUnobservation`,get:function(){return W3(this.flags_,e.isPendingUnobservationMask_)},set:function(t){this.flags_=G3(this.flags_,e.isPendingUnobservationMask_,t)}},{key:`diffValue`,get:function(){return+!!W3(this.flags_,e.diffValueMask_)},set:function(t){this.flags_=G3(this.flags_,e.diffValueMask_,t===1)}}])}();e6.isBeingObservedMask_=1,e6.isPendingUnobservationMask_=2,e6.diffValueMask_=4;var ltn=z3(`Atom`,e6);function utn(e,t,n){t===void 0&&(t=N3),n===void 0&&(n=N3);var r=new e6(e);return t!==N3&&ern(r,t),n!==N3&&trn(r,n),r}function dtn(e,t){return e===t}function ftn(e,t){return $rn(e,t)}function ptn(e,t){return $rn(e,t,1)}function mtn(e,t){return Object.is?Object.is(e,t):e===t?e!==0||1/e==1/t:e!==e&&t!==t}var t6={identity:dtn,structural:ftn,default:mtn,shallow:ptn};function n6(e,t,n){return grn(e)?e:Array.isArray(e)?c6.array(e,{name:n}):L3(e)?c6.object(e,void 0,{name:n}):B3(e)?c6.map(e,{name:n}):V3(e)?c6.set(e,{name:n}):typeof e==`function`&&!j6(e)&&!P6(e)?Jen(e)?N6(e):A6(n,e):e}function htn(e,t,n){if(e==null||e8(e)||J6(e)||Z6(e)||Q6(e))return e;if(Array.isArray(e))return c6.array(e,{name:n,deep:!1});if(L3(e))return c6.object(e,void 0,{name:n,deep:!1});if(B3(e))return c6.map(e,{name:n,deep:!1});if(V3(e))return c6.set(e,{name:n,deep:!1})}function r6(e){return e}function gtn(e,t){return $rn(e,t)?t:e}var _tn=`override`;function vtn(e){return e.annotationType_===_tn}function i6(e,t){return{annotationType_:e,options_:t,make_:ytn,extend_:btn,decorate_20223_:xtn}}function ytn(e,t,n,r){var i;return(i=this.options_)!=null&&i.bound?this.extend_(e,t,n,!1)===null?0:1:r===e.target_?this.extend_(e,t,n,!1)===null?0:2:j6(n.value)?1:(j3(r,t,Ctn(e,this,t,n,!1)),2)}function btn(e,t,n,r){var i=Ctn(e,this,t,n);return e.defineProperty_(t,i,r)}function xtn(e,t){var n=t.kind,r=t.name,i=t.addInitializer,a=this,o=function(e){return d6(a.options_?.name??r.toString(),e,a.options_?.autoAction??!1)};if(n==`field`)return function(e){var t,n=e;return j6(n)||(n=o(n)),(t=a.options_)!=null&&t.bound&&(n=n.bind(this),n.isMobxAction=!0),n};if(n==`method`){var s;return j6(e)||(e=o(e)),(s=this.options_)!=null&&s.bound&&i(function(){var e=this,t=e[r].bind(e);t.isMobxAction=!0,e[r]=t}),e}O3(`Cannot apply '`+a.annotationType_+`' to '`+String(r)+`' (kind: `+n+`):`+(`
|
|
880
|
-
'`+a.annotationType_+`' can only be used on properties with a function value.`))}function Stn(e,t,n,r){t.annotationType_,r.value}function Ctn(e,t,n,r,i){var a,o;i===void 0&&(i=C6.safeDescriptors),Stn(e,t,n,r);var s=r.value;return(a=t.options_)!=null&&a.bound&&(s=s.bind(e.proxy_??e.target_)),{value:d6(t.options_?.name??n.toString(),s,t.options_?.autoAction??!1,(o=t.options_)!=null&&o.bound?e.proxy_??e.target_:void 0),configurable:i?e.isPlainObject_:!0,enumerable:!1,writable:!i}}function wtn(e,t){return{annotationType_:e,options_:t,make_:Ttn,extend_:Etn,decorate_20223_:Dtn}}function Ttn(e,t,n,r){var i;return r===e.target_?this.extend_(e,t,n,!1)===null?0:2:(i=this.options_)!=null&&i.bound&&(!U3(e.target_,t)||!P6(e.target_[t]))&&this.extend_(e,t,n,!1)===null?0:P6(n.value)?1:(j3(r,t,ktn(e,this,t,n,!1,!1)),2)}function Etn(e,t,n,r){var i=ktn(e,this,t,n,this.options_?.bound);return e.defineProperty_(t,i,r)}function Dtn(e,t){var n,r=t.name,i=t.addInitializer;return P6(e)||(e=N6(e)),(n=this.options_)!=null&&n.bound&&i(function(){var e=this,t=e[r].bind(e);t.isMobXFlow=!0,e[r]=t}),e}function Otn(e,t,n,r){t.annotationType_,r.value}function ktn(e,t,n,r,i,a){a===void 0&&(a=C6.safeDescriptors),Otn(e,t,n,r);var o=r.value;return P6(o)||(o=N6(o)),i&&(o=o.bind(e.proxy_??e.target_),o.isMobXFlow=!0),{value:o,configurable:a?e.isPlainObject_:!0,enumerable:!1,writable:!a}}function Atn(e,t){return{annotationType_:e,options_:t,make_:jtn,extend_:Mtn,decorate_20223_:Ntn}}function jtn(e,t,n){return this.extend_(e,t,n,!1)===null?0:1}function Mtn(e,t,n,r){return Ptn(e,this,t,n),e.defineComputedProperty_(t,J3({},this.options_,{get:n.get,set:n.set}),r)}function Ntn(e,t){var n=this,r=t.name,i=t.addInitializer;return i(function(){var t=$6(this)[$3],i=J3({},n.options_,{get:e,context:this});i.name||=`ObservableObject.`+r.toString(),t.values_.set(r,new p6(i))}),function(){return this[$3].getObservablePropValue_(r)}}function Ptn(e,t,n,r){t.annotationType_,r.get}function a6(e,t){return{annotationType_:e,options_:t,make_:Ftn,extend_:Itn,decorate_20223_:Ltn}}function Ftn(e,t,n){return this.extend_(e,t,n,!1)===null?0:1}function Itn(e,t,n,r){return Rtn(e,this,t,n),e.defineObservableProperty_(t,n.value,this.options_?.enhancer??n6,r)}function Ltn(e,t){var n=this,r=t.kind,i=t.name,a=new WeakSet;function o(e,t){var r=$6(e)[$3],o=new f6(t,n.options_?.enhancer??n6,`ObservableObject.`+i.toString(),!1);r.values_.set(i,o),a.add(e)}if(r==`accessor`)return{get:function(){return a.has(this)||o(this,e.get.call(this)),this[$3].getObservablePropValue_(i)},set:function(e){return a.has(this)||o(this,e),this[$3].setObservablePropValue_(i,e)},init:function(e){return a.has(this)||o(this,e),e}}}function Rtn(e,t,n,r){t.annotationType_}var ztn=`true`,Btn=Vtn();function Vtn(e){return{annotationType_:ztn,options_:e,make_:Htn,extend_:Utn,decorate_20223_:Wtn}}function Htn(e,t,n,r){var i;if(n.get)return l6.make_(e,t,n,r);if(n.set){var a=d6(t.toString(),n.set);return r===e.target_?e.defineProperty_(t,{configurable:C6.safeDescriptors?e.isPlainObject_:!0,set:a})===null?0:2:(j3(r,t,{configurable:!0,set:a}),2)}if(r!==e.target_&&typeof n.value==`function`){var o;if(Jen(n.value)){var s;return((s=this.options_)!=null&&s.autoBind?N6.bound:N6).make_(e,t,n,r)}return((o=this.options_)!=null&&o.autoBind?A6.bound:A6).make_(e,t,n,r)}var c=this.options_?.deep===!1?c6.ref:c6;return typeof n.value==`function`&&(i=this.options_)!=null&&i.autoBind&&(n.value=n.value.bind(e.proxy_??e.target_)),c.make_(e,t,n,r)}function Utn(e,t,n,r){var i;return n.get?l6.extend_(e,t,n,r):n.set?e.defineProperty_(t,{configurable:C6.safeDescriptors?e.isPlainObject_:!0,set:d6(t.toString(),n.set)},r):(typeof n.value==`function`&&(i=this.options_)!=null&&i.autoBind&&(n.value=n.value.bind(e.proxy_??e.target_)),(this.options_?.deep===!1?c6.ref:c6).extend_(e,t,n,r))}function Wtn(e,t){O3(`'`+this.annotationType_+`' cannot be used as a decorator`)}var Gtn=`observable`,Ktn=`observable.ref`,qtn=`observable.shallow`,Jtn=`observable.struct`,Ytn={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(Ytn);function o6(e){return e||Ytn}var Xtn=a6(Gtn),Ztn=a6(Ktn,{enhancer:r6}),Qtn=a6(qtn,{enhancer:htn}),$tn=a6(Jtn,{enhancer:gtn}),enn=X3(Xtn);function s6(e){return e.deep===!0?n6:e.deep===!1?r6:nnn(e.defaultDecorator)}function tnn(e){return e?e.defaultDecorator??Vtn(e):void 0}function nnn(e){return e?e.options_?.enhancer??n6:n6}function rnn(e,t,n){if(Q3(t))return Xtn.decorate_20223_(e,t);if(F3(t)){Z3(e,t,Xtn);return}return grn(e)?e:L3(e)?c6.object(e,t,n):Array.isArray(e)?c6.array(e,t):B3(e)?c6.map(e,t):V3(e)?c6.set(e,t):typeof e==`object`&&e?e:c6.box(e,t)}Ven(rnn,enn);var c6=Ven(rnn,{box:function(e,t){var n=o6(t);return new f6(e,s6(n),n.name,!0,n.equals)},array:function(e,t){var n=o6(t);return(C6.useProxies===!1||n.proxy===!1?Yrn:wrn)(e,s6(n),n.name)},map:function(e,t){var n=o6(t);return new Orn(e,s6(n),n.name)},set:function(e,t){var n=o6(t);return new Mrn(e,s6(n),n.name)},object:function(e,t,n){return n8(function(){return orn(C6.useProxies===!1||n?.proxy===!1?$6({},n):vrn({},n),e,t)})},ref:X3(Ztn),shallow:X3(Qtn),deep:enn,struct:X3($tn)}),inn=`computed`,ann=`computed.struct`,onn=Atn(inn),snn=Atn(ann,{equals:t6.structural}),l6=function(e,t){if(Q3(t))return onn.decorate_20223_(e,t);if(F3(t))return Z3(e,t,onn);if(L3(e))return X3(Atn(inn,e));var n=L3(t)?t:{};return n.get=e,n.name||=e.name||``,new p6(n)};Object.assign(l6,onn),l6.struct=X3(snn);var u6=0,cnn=1,lnn=A3(function(){},`name`)?.configurable??!1,unn={value:`action`,configurable:!0,writable:!1,enumerable:!1};function d6(e,t,n,r){n===void 0&&(n=!1);function i(){return dnn(e,n,t,r||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},lnn&&(unn.value=e,j3(i,`name`,unn)),i}function dnn(e,t,n,r,i){var a=fnn(e,t,r,i);try{return n.apply(r,i)}catch(e){throw a.error_=e,e}finally{pnn(a)}}function fnn(e,t,n,r){var i=!1,a=0,o=C6.trackingDerivation,s=!t||!o;w6();var c=C6.allowStateChanges;s&&(v6(),c=mnn(!0));var l=Snn(!0),u={runAsAction_:s,prevDerivation_:o,prevAllowStateChanges_:c,prevAllowStateReads_:l,notifySpy_:i,startTime_:a,actionId_:cnn++,parentActionId_:u6};return u6=u.actionId_,u}function pnn(e){u6!==e.actionId_&&O3(30),u6=e.parentActionId_,e.error_!==void 0&&(C6.suppressReactionErrors=!0),hnn(e.prevAllowStateChanges_),b6(e.prevAllowStateReads_),T6(),e.runAsAction_&&y6(e.prevDerivation_),C6.suppressReactionErrors=!1}function mnn(e){var t=C6.allowStateChanges;return C6.allowStateChanges=e,t}function hnn(e){C6.allowStateChanges=e}var f6=function(e){function t(t,n,r,i,a){var o;return r===void 0&&(r=`ObservableValue`),i===void 0&&(i=!0),a===void 0&&(a=t6.default),o=e.call(this,r)||this,o.enhancer=void 0,o.name_=void 0,o.equals=void 0,o.hasUnreportedChange_=!1,o.interceptors_=void 0,o.changeListeners_=void 0,o.value_=void 0,o.dehancer=void 0,o.enhancer=n,o.name_=r,o.equals=a,o.value_=n(t,void 0,r),o}rtn(t,e);var n=t.prototype;return n.dehanceValue=function(e){return this.dehancer===void 0?e:this.dehancer(e)},n.set=function(e){this.value_,e=this.prepareNewValue_(e),e!==C6.UNCHANGED&&this.setNewValue_(e)},n.prepareNewValue_=function(e){if(L6(this)){var t=z6(this,{object:this,type:U6,newValue:e});if(!t)return C6.UNCHANGED;e=t.newValue}return e=this.enhancer(e,this.value_,this.name_),this.equals(this.value_,e)?C6.UNCHANGED:e},n.setNewValue_=function(e){var t=this.value_;this.value_=e,this.reportChanged(),B6(this)&&H6(this,{type:U6,object:this,newValue:e,oldValue:t})},n.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},n.intercept_=function(e){return R6(this,e)},n.observe_=function(e,t){return t&&e({observableKind:`value`,debugObjectName:this.name_,object:this,type:U6,newValue:this.value_,oldValue:void 0}),V6(this,e)},n.raw=function(){return this.value_},n.toJSON=function(){return this.get()},n.toString=function(){return this.name_+`[`+this.value_+`]`},n.valueOf=function(){return $en(this.get())},n[Symbol.toPrimitive]=function(){return this.valueOf()},t}(e6),p6=function(){function e(e){this.dependenciesState_=h6.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=h6.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new g6(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=gnn.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,e.get||O3(31),this.derivation=e.get,this.name_=e.name||`ComputedValue`,e.set&&(this.setter_=d6(`ComputedValue-setter`,e.set)),this.equals_=e.equals||(e.compareStructural||e.struct?t6.structural:t6.default),this.scope_=e.context,this.requiresReaction_=e.requiresReaction,this.keepAlive_=!!e.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){Mnn(this)},t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(e){return e()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(e){return e()})},t.get=function(){if(this.isComputing&&O3(32,this.name_,this.derivation),C6.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)_nn(this)&&(this.warnAboutUntrackedRead_(),w6(),this.value_=this.computeValue_(!1),T6());else if(knn(this),_nn(this)){var e=C6.trackingContext;this.keepAlive_&&!e&&(C6.trackingContext=this),this.trackAndCompute()&&jnn(this),C6.trackingContext=e}var t=this.value_;if(_6(t))throw t.cause;return t},t.set=function(e){if(this.setter_){this.isRunningSetter&&O3(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,e)}finally{this.isRunningSetter=!1}}else O3(34,this.name_)},t.trackAndCompute=function(){var e=this.value_,t=this.dependenciesState_===h6.NOT_TRACKING_,n=this.computeValue_(!0),r=t||_6(e)||_6(n)||!this.equals_(e,n);return r&&(this.value_=n),r},t.computeValue_=function(e){this.isComputing=!0;var t=mnn(!1),n;if(e)n=vnn(this,this.derivation,this.scope_);else if(C6.disableErrorBoundaries===!0)n=this.derivation.call(this.scope_);else try{n=this.derivation.call(this.scope_)}catch(e){n=new g6(e)}return hnn(t),this.isComputing=!1,n},t.suspend_=function(){this.keepAlive_||(bnn(this),this.value_=void 0)},t.observe_=function(e,t){var n=this,r=!0,i=void 0;return Ynn(function(){var a=n.get();if(!r||t){var o=v6();e({observableKind:`computed`,debugObjectName:n.name_,type:U6,object:n,newValue:a,oldValue:i}),y6(o)}r=!1,i=a})},t.warnAboutUntrackedRead_=function(){},t.toString=function(){return this.name_+`[`+this.derivation.toString()+`]`},t.valueOf=function(){return $en(this.get())},t[Symbol.toPrimitive]=function(){return this.valueOf()},K3(e,[{key:`isComputing`,get:function(){return W3(this.flags_,e.isComputingMask_)},set:function(t){this.flags_=G3(this.flags_,e.isComputingMask_,t)}},{key:`isRunningSetter`,get:function(){return W3(this.flags_,e.isRunningSetterMask_)},set:function(t){this.flags_=G3(this.flags_,e.isRunningSetterMask_,t)}},{key:`isBeingObserved`,get:function(){return W3(this.flags_,e.isBeingObservedMask_)},set:function(t){this.flags_=G3(this.flags_,e.isBeingObservedMask_,t)}},{key:`isPendingUnobservation`,get:function(){return W3(this.flags_,e.isPendingUnobservationMask_)},set:function(t){this.flags_=G3(this.flags_,e.isPendingUnobservationMask_,t)}},{key:`diffValue`,get:function(){return+!!W3(this.flags_,e.diffValueMask_)},set:function(t){this.flags_=G3(this.flags_,e.diffValueMask_,t===1)}}])}();p6.isComputingMask_=1,p6.isRunningSetterMask_=2,p6.isBeingObservedMask_=4,p6.isPendingUnobservationMask_=8,p6.diffValueMask_=16;var m6=z3(`ComputedValue`,p6),h6;(function(e){e[e.NOT_TRACKING_=-1]=`NOT_TRACKING_`,e[e.UP_TO_DATE_=0]=`UP_TO_DATE_`,e[e.POSSIBLY_STALE_=1]=`POSSIBLY_STALE_`,e[e.STALE_=2]=`STALE_`})(h6||={});var gnn;(function(e){e[e.NONE=0]=`NONE`,e[e.LOG=1]=`LOG`,e[e.BREAK=2]=`BREAK`})(gnn||={});var g6=function(e){this.cause=void 0,this.cause=e};function _6(e){return e instanceof g6}function _nn(e){switch(e.dependenciesState_){case h6.UP_TO_DATE_:return!1;case h6.NOT_TRACKING_:case h6.STALE_:return!0;case h6.POSSIBLY_STALE_:for(var t=Snn(!0),n=v6(),r=e.observing_,i=r.length,a=0;a<i;a++){var o=r[a];if(m6(o)){if(C6.disableErrorBoundaries)o.get();else try{o.get()}catch{return y6(n),b6(t),!0}if(e.dependenciesState_===h6.STALE_)return y6(n),b6(t),!0}}return Cnn(e),y6(n),b6(t),!1}}function vnn(e,t,n){var r=Snn(!0);Cnn(e),e.newObserving_=Array(e.runId_===0?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++C6.runId;var i=C6.trackingDerivation;C6.trackingDerivation=e,C6.inBatch++;var a;if(C6.disableErrorBoundaries===!0)a=t.call(n);else try{a=t.call(n)}catch(e){a=new g6(e)}return C6.inBatch--,C6.trackingDerivation=i,ynn(e),b6(r),a}function ynn(e){for(var t=e.observing_,n=e.observing_=e.newObserving_,r=h6.UP_TO_DATE_,i=0,a=e.unboundDepsCount_,o=0;o<a;o++){var s=n[o];s.diffValue===0&&(s.diffValue=1,i!==o&&(n[i]=s),i++),s.dependenciesState_>r&&(r=s.dependenciesState_)}for(n.length=i,e.newObserving_=null,a=t.length;a--;){var c=t[a];c.diffValue===0&&Dnn(c,e),c.diffValue=0}for(;i--;){var l=n[i];l.diffValue===1&&(l.diffValue=0,Enn(l,e))}r!==h6.UP_TO_DATE_&&(e.dependenciesState_=r,e.onBecomeStale_())}function bnn(e){var t=e.observing_;e.observing_=[];for(var n=t.length;n--;)Dnn(t[n],e);e.dependenciesState_=h6.NOT_TRACKING_}function xnn(e){var t=v6();try{return e()}finally{y6(t)}}function v6(){var e=C6.trackingDerivation;return C6.trackingDerivation=null,e}function y6(e){C6.trackingDerivation=e}function Snn(e){var t=C6.allowStateReads;return C6.allowStateReads=e,t}function b6(e){C6.allowStateReads=e}function Cnn(e){if(e.dependenciesState_!==h6.UP_TO_DATE_){e.dependenciesState_=h6.UP_TO_DATE_;for(var t=e.observing_,n=t.length;n--;)t[n].lowestObserverState_=h6.UP_TO_DATE_}}var x6=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},S6=!0,wnn=!1,C6=function(){var e=k3();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(S6=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new x6().version&&(S6=!1),S6?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new x6):(setTimeout(function(){wnn||O3(35)},1),new x6)}();function Tnn(){if((C6.pendingReactions.length||C6.inBatch||C6.isRunningReactions)&&O3(36),wnn=!0,S6){var e=k3();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),C6=new x6}}function Enn(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function Dnn(e,t){e.observers_.delete(t),e.observers_.size===0&&Onn(e)}function Onn(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,C6.pendingUnobservations.push(e))}function w6(){C6.inBatch++}function T6(){if(--C6.inBatch===0){Fnn();for(var e=C6.pendingUnobservations,t=0;t<e.length;t++){var n=e[t];n.isPendingUnobservation=!1,n.observers_.size===0&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBUO()),n instanceof p6&&n.suspend_())}C6.pendingUnobservations=[]}}function knn(e){var t=C6.trackingDerivation;return t===null?(e.observers_.size===0&&C6.inBatch>0&&Onn(e),!1):(t.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=t.runId_,t.newObserving_[t.unboundDepsCount_++]=e,!e.isBeingObserved&&C6.trackingContext&&(e.isBeingObserved=!0,e.onBO())),e.isBeingObserved)}function Ann(e){e.lowestObserverState_!==h6.STALE_&&(e.lowestObserverState_=h6.STALE_,e.observers_.forEach(function(e){e.dependenciesState_===h6.UP_TO_DATE_&&e.onBecomeStale_(),e.dependenciesState_=h6.STALE_}))}function jnn(e){e.lowestObserverState_!==h6.STALE_&&(e.lowestObserverState_=h6.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===h6.POSSIBLY_STALE_?t.dependenciesState_=h6.STALE_:t.dependenciesState_===h6.UP_TO_DATE_&&(e.lowestObserverState_=h6.UP_TO_DATE_)}))}function Mnn(e){e.lowestObserverState_===h6.UP_TO_DATE_&&(e.lowestObserverState_=h6.POSSIBLY_STALE_,e.observers_.forEach(function(e){e.dependenciesState_===h6.UP_TO_DATE_&&(e.dependenciesState_=h6.POSSIBLY_STALE_,e.onBecomeStale_())}))}var E6=function(){function e(e,t,n,r){e===void 0&&(e=`Reaction`),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=h6.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=gnn.NONE,this.name_=e,this.onInvalidate_=t,this.errorHandler_=n,this.requiresObservable_=r}var t=e.prototype;return t.onBecomeStale_=function(){this.schedule_()},t.schedule_=function(){this.isScheduled||(this.isScheduled=!0,C6.pendingReactions.push(this),Fnn())},t.runReaction_=function(){if(!this.isDisposed){w6(),this.isScheduled=!1;var e=C6.trackingContext;if(C6.trackingContext=this,_nn(this)){this.isTrackPending=!0;try{this.onInvalidate_()}catch(e){this.reportExceptionInDerivation_(e)}}C6.trackingContext=e,T6()}},t.track=function(e){if(!this.isDisposed){w6(),this.isRunning=!0;var t=C6.trackingContext;C6.trackingContext=this;var n=vnn(this,e,void 0);C6.trackingContext=t,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&bnn(this),_6(n)&&this.reportExceptionInDerivation_(n.cause),T6()}},t.reportExceptionInDerivation_=function(e){var t=this;if(this.errorHandler_){this.errorHandler_(e,this);return}if(C6.disableErrorBoundaries)throw e;var n=`[mobx] uncaught error in '`+this+`'`;C6.suppressReactionErrors||console.error(n,e),C6.globalReactionErrorHandlers.forEach(function(n){return n(e,t)})},t.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(w6(),bnn(this),T6()))},t.getDisposer_=function(e){var t=this,n=function n(){t.dispose(),e==null||e.removeEventListener==null||e.removeEventListener(`abort`,n)};return e==null||e.addEventListener==null||e.addEventListener(`abort`,n),n[$3]=this,n},t.toString=function(){return`Reaction[`+this.name_+`]`},t.trace=function(e){e===void 0&&(e=!1)},K3(e,[{key:`isDisposed`,get:function(){return W3(this.flags_,e.isDisposedMask_)},set:function(t){this.flags_=G3(this.flags_,e.isDisposedMask_,t)}},{key:`isScheduled`,get:function(){return W3(this.flags_,e.isScheduledMask_)},set:function(t){this.flags_=G3(this.flags_,e.isScheduledMask_,t)}},{key:`isTrackPending`,get:function(){return W3(this.flags_,e.isTrackPendingMask_)},set:function(t){this.flags_=G3(this.flags_,e.isTrackPendingMask_,t)}},{key:`isRunning`,get:function(){return W3(this.flags_,e.isRunningMask_)},set:function(t){this.flags_=G3(this.flags_,e.isRunningMask_,t)}},{key:`diffValue`,get:function(){return+!!W3(this.flags_,e.diffValueMask_)},set:function(t){this.flags_=G3(this.flags_,e.diffValueMask_,t===1)}}])}();E6.isDisposedMask_=1,E6.isScheduledMask_=2,E6.isTrackPendingMask_=4,E6.isRunningMask_=8,E6.diffValueMask_=16;var Nnn=100,Pnn=function(e){return e()};function Fnn(){C6.inBatch>0||C6.isRunningReactions||Pnn(Inn)}function Inn(){C6.isRunningReactions=!0;for(var e=C6.pendingReactions,t=0;e.length>0;){++t===Nnn&&(console.error(`[mobx] cycle in reaction: `+e[0]),e.splice(0));for(var n=e.splice(0),r=0,i=n.length;r<i;r++)n[r].runReaction_()}C6.isRunningReactions=!1}var D6=z3(`Reaction`,E6);function Lnn(e){var t=Pnn;Pnn=function(n){return e(function(){return t(n)})}}function O6(){return!1}function Rnn(e){return console.warn(`[mobx.spy] Is a no-op in production builds`),function(){}}var znn=`action`,Bnn=`action.bound`,Vnn=`autoAction`,Hnn=`autoAction.bound`,Unn=`<unnamed action>`,Wnn=i6(znn),Gnn=i6(Bnn,{bound:!0}),Knn=i6(Vnn,{autoAction:!0}),qnn=i6(Hnn,{autoAction:!0,bound:!0});function Jnn(e){return function(t,n){if(P3(t))return d6(t.name||Unn,t,e);if(P3(n))return d6(t,n,e);if(Q3(n))return(e?Knn:Wnn).decorate_20223_(t,n);if(F3(n))return Z3(t,n,e?Knn:Wnn);if(F3(t))return X3(i6(e?Vnn:znn,{name:t,autoAction:e}))}}var k6=Jnn(!1);Object.assign(k6,Wnn);var A6=Jnn(!0);Object.assign(A6,Knn),k6.bound=X3(Gnn),A6.bound=X3(qnn);function j6(e){return P3(e)&&e.isMobxAction===!0}function Ynn(e,t){var n;t===void 0&&(t=Uen);var r=t?.name??`Autorun`,i=!t.scheduler&&!t.delay,a;if(i)a=new E6(r,function(){this.track(c)},t.onError,t.requiresObservable);else{var o=Znn(t),s=!1;a=new E6(r,function(){s||(s=!0,o(function(){s=!1,a.isDisposed||a.track(c)}))},t.onError,t.requiresObservable)}function c(){e(a)}return(n=t)!=null&&(n=n.signal)!=null&&n.aborted||a.schedule_(),a.getDisposer_(t?.signal)}var Xnn=function(e){return e()};function Znn(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:Xnn}var Qnn=`onBO`,$nn=`onBUO`;function ern(e,t,n){return nrn(Qnn,e,t,n)}function trn(e,t,n){return nrn($nn,e,t,n)}function nrn(e,t,n,r){var i=typeof r==`function`?t8(t,n):t8(t),a=P3(r)?r:n,o=e+`L`;return i[o]?i[o].add(a):i[o]=new Set([a]),function(){var e=i[o];e&&(e.delete(a),e.size===0&&delete i[o])}}var rrn=`never`,M6=`always`,irn=`observed`;function arn(e){e.isolateGlobalState===!0&&Tnn();var t=e.useProxies,n=e.enforceActions;if(t!==void 0&&(C6.useProxies=t===M6?!0:t===rrn?!1:typeof Proxy<`u`),t===`ifavailable`&&(C6.verifyProxies=!0),n!==void 0){var r=n===M6?M6:n===irn;C6.enforceActions=r,C6.allowStateChanges=!(r===!0||r===M6)}[`computedRequiresReaction`,`reactionRequiresObservable`,`observableRequiresReaction`,`disableErrorBoundaries`,`safeDescriptors`].forEach(function(t){t in e&&(C6[t]=!!e[t])}),C6.allowStateReads=!C6.observableRequiresReaction,e.reactionScheduler&&Lnn(e.reactionScheduler)}function orn(e,t,n,r){var i=etn(t);return n8(function(){var t=$6(e,r)[$3];H3(i).forEach(function(e){t.extend_(e,i[e],n&&e in n?n[e]:!0)})}),e}function srn(e,t){return crn(t8(e,t))}function crn(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=lrn(e.observing_).map(crn)),t}function lrn(e){return Array.from(new Set(e))}var urn=0;function drn(){this.message=`FLOW_CANCELLED`}drn.prototype=Object.create(Error.prototype);var frn=wtn(`flow`),prn=wtn(`flow.bound`,{bound:!0}),N6=Object.assign(function(e,t){if(Q3(t))return frn.decorate_20223_(e,t);if(F3(t))return Z3(e,t,frn);var n=e,r=n.name||`<unnamed flow>`,i=function(){var e=this,t=arguments,i=++urn,a=k6(r+` - runid: `+i+` - init`,n).apply(e,t),o,s=void 0,c=new Promise(function(e,t){var n=0;o=t;function c(e){s=void 0;var o;try{o=k6(r+` - runid: `+i+` - yield `+ n++,a.next).call(a,e)}catch(e){return t(e)}u(o)}function l(e){s=void 0;var o;try{o=k6(r+` - runid: `+i+` - yield `+ n++,a.throw).call(a,e)}catch(e){return t(e)}u(o)}function u(n){if(P3(n?.then)){n.then(u,t);return}return n.done?e(n.value):(s=Promise.resolve(n.value),s.then(c,l))}c(void 0)});return c.cancel=k6(r+` - runid: `+i+` - cancel`,function(){try{s&&mrn(s);var e=a.return(void 0),t=Promise.resolve(e.value);t.then(N3,N3),mrn(t),o(new drn)}catch(e){o(e)}}),c};return i.isMobXFlow=!0,i},frn);N6.bound=X3(prn);function mrn(e){P3(e.cancel)&&e.cancel()}function P6(e){return e?.isMobXFlow===!0}function hrn(e,t){return e?t===void 0?e8(e)||!!e[$3]||ltn(e)||D6(e)||m6(e):e8(e)?e[$3].values_.has(t):!1:!1}function grn(e){return hrn(e)}function F6(e,t){t===void 0&&(t=void 0),w6();try{return e.apply(t)}finally{T6()}}function I6(e){return e[$3]}var _rn={has:function(e,t){return I6(e).has_(t)},get:function(e,t){return I6(e).get_(t)},set:function(e,t,n){return F3(t)?I6(e).set_(t,n,!0)??!0:!1},deleteProperty:function(e,t){return F3(t)?I6(e).delete_(t,!0)??!0:!1},defineProperty:function(e,t,n){return I6(e).defineProperty_(t,n)??!0},ownKeys:function(e){return I6(e).ownKeys_()},preventExtensions:function(e){O3(13)}};function vrn(e,t){var n;return Ken(),e=$6(e,t),(n=e[$3]).proxy_??(n.proxy_=new Proxy(e,_rn))}function L6(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function R6(e,t){var n=e.interceptors_||=[];return n.push(t),qen(function(){var e=n.indexOf(t);e!==-1&&n.splice(e,1)})}function z6(e,t){var n=v6();try{for(var r=[].concat(e.interceptors_||[]),i=0,a=r.length;i<a&&(t=r[i](t),t&&!t.type&&O3(14),t);i++);return t}finally{y6(n)}}function B6(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function V6(e,t){var n=e.changeListeners_||=[];return n.push(t),qen(function(){var e=n.indexOf(t);e!==-1&&n.splice(e,1)})}function H6(e,t){var n=v6(),r=e.changeListeners_;if(r){r=r.slice();for(var i=0,a=r.length;i<a;i++)r[i](t);y6(n)}}function yrn(e,t,n){return n8(function(){var r=$6(e,n)[$3];t??=ctn(e),H3(t).forEach(function(e){return r.make_(e,t[e])})}),e}var brn=`splice`,U6=`update`,xrn=1e4,Srn={get:function(e,t){var n=e[$3];return t===$3?n:t===`length`?n.getArrayLength_():typeof t==`string`&&!isNaN(t)?n.get_(parseInt(t)):U3(W6,t)?W6[t]:e[t]},set:function(e,t,n){var r=e[$3];return t===`length`&&r.setArrayLength_(n),typeof t==`symbol`||isNaN(t)?e[t]=n:r.set_(parseInt(t),n),!0},preventExtensions:function(){O3(15)}},Crn=function(){function e(e,t,n,r){e===void 0&&(e=`ObservableArray`),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=n,this.legacyMode_=r,this.atom_=new e6(e),this.enhancer_=function(e,n){return t(e,n,`ObservableArray[..]`)}}var t=e.prototype;return t.dehanceValue_=function(e){return this.dehancer===void 0?e:this.dehancer(e)},t.dehanceValues_=function(e){return this.dehancer!==void 0&&e.length>0?e.map(this.dehancer):e},t.intercept_=function(e){return R6(this,e)},t.observe_=function(e,t){return t===void 0&&(t=!1),t&&e({observableKind:`array`,object:this.proxy_,debugObjectName:this.atom_.name_,type:`splice`,index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),V6(this,e)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(e){(typeof e!=`number`||isNaN(e)||e<0)&&O3(`Out of range: `+e);var t=this.values_.length;if(e!==t)if(e>t){for(var n=Array(e-t),r=0;r<e-t;r++)n[r]=void 0;this.spliceWithArray_(t,0,n)}else this.spliceWithArray_(e,t-e)},t.updateArrayLength_=function(e,t){e!==this.lastKnownLength_&&O3(16),this.lastKnownLength_+=t,this.legacyMode_&&t>0&&Jrn(e+t+1)},t.spliceWithArray_=function(e,t,n){var r=this;this.atom_;var i=this.values_.length;if(e===void 0?e=0:e>i?e=i:e<0&&(e=Math.max(0,i+e)),t=arguments.length===1?i-e:t==null?0:Math.max(0,Math.min(t,i-e)),n===void 0&&(n=Hen),L6(this)){var a=z6(this,{object:this.proxy_,type:brn,index:e,removedCount:t,added:n});if(!a)return Hen;t=a.removedCount,n=a.added}if(n=n.length===0?n:n.map(function(e){return r.enhancer_(e,void 0)}),this.legacyMode_){var o=n.length-t;this.updateArrayLength_(i,o)}var s=this.spliceItemsIntoValues_(e,t,n);return(t!==0||n.length!==0)&&this.notifyArraySplice_(e,n,s),this.dehanceValues_(s)},t.spliceItemsIntoValues_=function(e,t,n){if(n.length<xrn){var r;return(r=this.values_).splice.apply(r,[e,t].concat(n))}else{var i=this.values_.slice(e,e+t),a=this.values_.slice(e+t);this.values_.length+=n.length-t;for(var o=0;o<n.length;o++)this.values_[e+o]=n[o];for(var s=0;s<a.length;s++)this.values_[e+n.length+s]=a[s];return i}},t.notifyArrayChildUpdate_=function(e,t,n){var r=!this.owned_&&O6(),i=B6(this),a=i||r?{observableKind:`array`,object:this.proxy_,type:U6,debugObjectName:this.atom_.name_,index:e,newValue:t,oldValue:n}:null;this.atom_.reportChanged(),i&&H6(this,a)},t.notifyArraySplice_=function(e,t,n){var r=!this.owned_&&O6(),i=B6(this),a=i||r?{observableKind:`array`,object:this.proxy_,debugObjectName:this.atom_.name_,type:brn,index:e,removed:n,added:t,removedCount:n.length,addedCount:t.length}:null;this.atom_.reportChanged(),i&&H6(this,a)},t.get_=function(e){if(this.legacyMode_&&e>=this.values_.length){console.warn(`[mobx] Out of bounds read: `+e);return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[e])},t.set_=function(e,t){var n=this.values_;if(this.legacyMode_&&e>n.length&&O3(17,e,n.length),e<n.length){this.atom_;var r=n[e];if(L6(this)){var i=z6(this,{type:U6,object:this.proxy_,index:e,newValue:t});if(!i)return;t=i.newValue}t=this.enhancer_(t,r),t!==r&&(n[e]=t,this.notifyArrayChildUpdate_(e,t,r))}else{for(var a=Array(e+1-n.length),o=0;o<a.length-1;o++)a[o]=void 0;a[a.length-1]=t,this.spliceWithArray_(n.length,0,a)}},e}();function wrn(e,t,n,r){return n===void 0&&(n=`ObservableArray`),r===void 0&&(r=!1),Ken(),n8(function(){var i=new Crn(n,t,r,!1);Yen(i.values_,$3,i);var a=new Proxy(i.values_,Srn);return i.proxy_=a,e&&e.length&&i.spliceWithArray_(0,0,e),a})}var W6={clear:function(){return this.splice(0)},replace:function(e){var t=this[$3];return t.spliceWithArray_(0,t.values_.length,e)},toJSON:function(){return this.slice()},splice:function(e,t){var n=[...arguments].slice(2),r=this[$3];switch(arguments.length){case 0:return[];case 1:return r.spliceWithArray_(e);case 2:return r.spliceWithArray_(e,t)}return r.spliceWithArray_(e,t,n)},spliceWithArray:function(e,t,n){return this[$3].spliceWithArray_(e,t,n)},push:function(){var e=this[$3],t=[...arguments];return e.spliceWithArray_(e.values_.length,0,t),e.values_.length},pop:function(){return this.splice(Math.max(this[$3].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){var e=this[$3],t=[...arguments];return e.spliceWithArray_(0,0,t),e.values_.length},reverse:function(){return C6.trackingDerivation&&O3(37,`reverse`),this.replace(this.slice().reverse()),this},sort:function(){C6.trackingDerivation&&O3(37,`sort`);var e=this.slice();return e.sort.apply(e,arguments),this.replace(e),this},remove:function(e){var t=this[$3],n=t.dehanceValues_(t.values_).indexOf(e);return n>-1?(this.splice(n,1),!0):!1}};G6(`at`,K6),G6(`concat`,K6),G6(`flat`,K6),G6(`includes`,K6),G6(`indexOf`,K6),G6(`join`,K6),G6(`lastIndexOf`,K6),G6(`slice`,K6),G6(`toString`,K6),G6(`toLocaleString`,K6),G6(`toSorted`,K6),G6(`toSpliced`,K6),G6(`with`,K6),G6(`every`,q6),G6(`filter`,q6),G6(`find`,q6),G6(`findIndex`,q6),G6(`findLast`,q6),G6(`findLastIndex`,q6),G6(`flatMap`,q6),G6(`forEach`,q6),G6(`map`,q6),G6(`some`,q6),G6(`toReversed`,q6),G6(`reduce`,Trn),G6(`reduceRight`,Trn);function G6(e,t){typeof Array.prototype[e]==`function`&&(W6[e]=t(e))}function K6(e){return function(){var t=this[$3];t.atom_.reportObserved();var n=t.dehanceValues_(t.values_);return n[e].apply(n,arguments)}}function q6(e){return function(t,n){var r=this,i=this[$3];return i.atom_.reportObserved(),i.dehanceValues_(i.values_)[e](function(e,i){return t.call(n,e,i,r)})}}function Trn(e){return function(){var t=this,n=this[$3];n.atom_.reportObserved();var r=n.dehanceValues_(n.values_),i=arguments[0];return arguments[0]=function(e,n,r){return i(e,n,r,t)},r[e].apply(r,arguments)}}var Ern=z3(`ObservableArrayAdministration`,Crn);function J6(e){return I3(e)&&Ern(e[$3])}var Drn={},Y6=`add`,X6=`delete`,Orn=function(){function e(e,t,n){var r=this;t===void 0&&(t=n6),n===void 0&&(n=`ObservableMap`),this.enhancer_=void 0,this.name_=void 0,this[$3]=Drn,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=t,this.name_=n,P3(Map)||O3(18),n8(function(){r.keysAtom_=utn(`ObservableMap.keys()`),r.data_=new Map,r.hasMap_=new Map,e&&r.merge(e)})}var t=e.prototype;return t.has_=function(e){return this.data_.has(e)},t.has=function(e){var t=this;if(!C6.trackingDerivation)return this.has_(e);var n=this.hasMap_.get(e);if(!n){var r=n=new f6(this.has_(e),r6,`ObservableMap.key?`,!1);this.hasMap_.set(e,r),trn(r,function(){return t.hasMap_.delete(e)})}return n.get()},t.set=function(e,t){var n=this.has_(e);if(L6(this)){var r=z6(this,{type:n?U6:Y6,object:this,newValue:t,name:e});if(!r)return this;t=r.newValue}return n?this.updateValue_(e,t):this.addValue_(e,t),this},t.delete=function(e){var t=this;if(this.keysAtom_,L6(this)&&!z6(this,{type:X6,object:this,name:e}))return!1;if(this.has_(e)){var n=O6(),r=B6(this),i=r||n?{observableKind:`map`,debugObjectName:this.name_,type:X6,object:this,oldValue:this.data_.get(e).value_,name:e}:null;return F6(function(){var n;t.keysAtom_.reportChanged(),(n=t.hasMap_.get(e))==null||n.setNewValue_(!1),t.data_.get(e).setNewValue_(void 0),t.data_.delete(e)}),r&&H6(this,i),!0}return!1},t.updateValue_=function(e,t){var n=this.data_.get(e);if(t=n.prepareNewValue_(t),t!==C6.UNCHANGED){var r=O6(),i=B6(this),a=i||r?{observableKind:`map`,debugObjectName:this.name_,type:U6,object:this,oldValue:n.value_,name:e,newValue:t}:null;n.setNewValue_(t),i&&H6(this,a)}},t.addValue_=function(e,t){var n=this;this.keysAtom_,F6(function(){var r,i=new f6(t,n.enhancer_,`ObservableMap.key`,!1);n.data_.set(e,i),t=i.value_,(r=n.hasMap_.get(e))==null||r.setNewValue_(!0),n.keysAtom_.reportChanged()});var r=O6(),i=B6(this),a=i||r?{observableKind:`map`,debugObjectName:this.name_,type:Y6,object:this,name:e,newValue:t}:null;i&&H6(this,a)},t.get=function(e){return this.has(e)?this.dehanceValue_(this.data_.get(e).get()):this.dehanceValue_(void 0)},t.dehanceValue_=function(e){return this.dehancer===void 0?e:this.dehancer(e)},t.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},t.values=function(){var e=this,t=this.keys();return krn({next:function(){var n=t.next(),r=n.done,i=n.value;return{done:r,value:r?void 0:e.get(i)}}})},t.entries=function(){var e=this,t=this.keys();return krn({next:function(){var n=t.next(),r=n.done,i=n.value;return{done:r,value:r?void 0:[i,e.get(i)]}}})},t[Symbol.iterator]=function(){return this.entries()},t.forEach=function(e,t){for(var n=q3(this),r;!(r=n()).done;){var i=r.value,a=i[0],o=i[1];e.call(t,o,a,this)}},t.merge=function(e){var t=this;return Z6(e)&&(e=new Map(e)),F6(function(){L3(e)?Qen(e).forEach(function(n){return t.set(n,e[n])}):Array.isArray(e)?e.forEach(function(e){var n=e[0],r=e[1];return t.set(n,r)}):B3(e)?(Xen(e)||O3(19,e),e.forEach(function(e,n){return t.set(n,e)})):e!=null&&O3(20,e)}),this},t.clear=function(){var e=this;F6(function(){xnn(function(){for(var t=q3(e.keys()),n;!(n=t()).done;){var r=n.value;e.delete(r)}})})},t.replace=function(e){var t=this;return F6(function(){for(var n=Arn(e),r=new Map,i=!1,a=q3(t.data_.keys()),o;!(o=a()).done;){var s=o.value;if(!n.has(s))if(t.delete(s))i=!0;else{var c=t.data_.get(s);r.set(s,c)}}for(var l=q3(n.entries()),u;!(u=l()).done;){var d=u.value,f=d[0],p=d[1],m=t.data_.has(f);if(t.set(f,p),t.data_.has(f)){var h=t.data_.get(f);r.set(f,h),m||(i=!0)}}if(!i)if(t.data_.size!==r.size)t.keysAtom_.reportChanged();else for(var g=t.data_.keys(),_=r.keys(),v=g.next(),y=_.next();!v.done;){if(v.value!==y.value){t.keysAtom_.reportChanged();break}v=g.next(),y=_.next()}t.data_=r}),this},t.toString=function(){return`[object ObservableMap]`},t.toJSON=function(){return Array.from(this)},t.observe_=function(e,t){return V6(this,e)},t.intercept_=function(e){return R6(this,e)},K3(e,[{key:`size`,get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return`Map`}}])}(),Z6=z3(`ObservableMap`,Orn);function krn(e){return e[Symbol.toStringTag]=`MapIterator`,rin(e)}function Arn(e){if(B3(e)||Z6(e))return e;if(Array.isArray(e))return new Map(e);if(L3(e)){var t=new Map;for(var n in e)t.set(n,e[n]);return t}else return O3(21,e)}var jrn={},Mrn=function(){function e(e,t,n){var r=this;t===void 0&&(t=n6),n===void 0&&(n=`ObservableSet`),this.name_=void 0,this[$3]=jrn,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=n,P3(Set)||O3(22),this.enhancer_=function(e,r){return t(e,r,n)},n8(function(){r.atom_=utn(r.name_),e&&r.replace(e)})}var t=e.prototype;return t.dehanceValue_=function(e){return this.dehancer===void 0?e:this.dehancer(e)},t.clear=function(){var e=this;F6(function(){xnn(function(){for(var t=q3(e.data_.values()),n;!(n=t()).done;){var r=n.value;e.delete(r)}})})},t.forEach=function(e,t){for(var n=q3(this),r;!(r=n()).done;){var i=r.value;e.call(t,i,i,this)}},t.add=function(e){var t=this;if(this.atom_,L6(this)){var n=z6(this,{type:Y6,object:this,newValue:e});if(!n)return this;e=n.newValue}if(!this.has(e)){F6(function(){t.data_.add(t.enhancer_(e,void 0)),t.atom_.reportChanged()});var r=!1,i=B6(this),a=i||r?{observableKind:`set`,debugObjectName:this.name_,type:Y6,object:this,newValue:e}:null;i&&H6(this,a)}return this},t.delete=function(e){var t=this;if(L6(this)&&!z6(this,{type:X6,object:this,oldValue:e}))return!1;if(this.has(e)){var n=!1,r=B6(this),i=r||n?{observableKind:`set`,debugObjectName:this.name_,type:X6,object:this,oldValue:e}:null;return F6(function(){t.atom_.reportChanged(),t.data_.delete(e)}),r&&H6(this,i),!0}return!1},t.has=function(e){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(e))},t.entries=function(){var e=this.values();return Nrn({next:function(){var t=e.next(),n=t.value,r=t.done;return r?{value:void 0,done:r}:{value:[n,n],done:r}}})},t.keys=function(){return this.values()},t.values=function(){this.atom_.reportObserved();var e=this,t=this.data_.values();return Nrn({next:function(){var n=t.next(),r=n.value,i=n.done;return i?{value:void 0,done:i}:{value:e.dehanceValue_(r),done:i}}})},t.intersection=function(e){return V3(e)&&!Q6(e)?e.intersection(this):new Set(this).intersection(e)},t.union=function(e){return V3(e)&&!Q6(e)?e.union(this):new Set(this).union(e)},t.difference=function(e){return new Set(this).difference(e)},t.symmetricDifference=function(e){return V3(e)&&!Q6(e)?e.symmetricDifference(this):new Set(this).symmetricDifference(e)},t.isSubsetOf=function(e){return new Set(this).isSubsetOf(e)},t.isSupersetOf=function(e){return new Set(this).isSupersetOf(e)},t.isDisjointFrom=function(e){return V3(e)&&!Q6(e)?e.isDisjointFrom(this):new Set(this).isDisjointFrom(e)},t.replace=function(e){var t=this;return Q6(e)&&(e=new Set(e)),F6(function(){Array.isArray(e)||V3(e)?(t.clear(),e.forEach(function(e){return t.add(e)})):e!=null&&O3(`Cannot initialize set from `+e)}),this},t.observe_=function(e,t){return V6(this,e)},t.intercept_=function(e){return R6(this,e)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return`[object ObservableSet]`},t[Symbol.iterator]=function(){return this.values()},K3(e,[{key:`size`,get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return`Set`}}])}(),Q6=z3(`ObservableSet`,Mrn);function Nrn(e){return e[Symbol.toStringTag]=`SetIterator`,rin(e)}var Prn=Object.create(null),Frn=`remove`,Irn=function(){function e(e,t,n,r){t===void 0&&(t=new Map),r===void 0&&(r=Btn),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=e,this.values_=t,this.name_=n,this.defaultAnnotation_=r,this.keysAtom_=new e6(`ObservableObject.keys`),this.isPlainObject_=L3(this.target_)}var t=e.prototype;return t.getObservablePropValue_=function(e){return this.values_.get(e).get()},t.setObservablePropValue_=function(e,t){var n=this.values_.get(e);if(n instanceof p6)return n.set(t),!0;if(L6(this)){var r=z6(this,{type:U6,object:this.proxy_||this.target_,name:e,newValue:t});if(!r)return null;t=r.newValue}if(t=n.prepareNewValue_(t),t!==C6.UNCHANGED){var i=B6(this),a=i?{type:U6,observableKind:`object`,debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:n.value_,name:e,newValue:t}:null;n.setNewValue_(t),i&&H6(this,a)}return!0},t.get_=function(e){return C6.trackingDerivation&&!U3(this.target_,e)&&this.has_(e),this.target_[e]},t.set_=function(e,t,n){return n===void 0&&(n=!1),U3(this.target_,e)?this.values_.has(e)?this.setObservablePropValue_(e,t):n?Reflect.set(this.target_,e,t):(this.target_[e]=t,!0):this.extend_(e,{value:t,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,n)},t.has_=function(e){if(!C6.trackingDerivation)return e in this.target_;this.pendingKeys_||=new Map;var t=this.pendingKeys_.get(e);return t||(t=new f6(e in this.target_,r6,`ObservableObject.key?`,!1),this.pendingKeys_.set(e,t)),t.get()},t.make_=function(e,t){if(t===!0&&(t=this.defaultAnnotation_),t!==!1){if(!(e in this.target_)){var n;if((n=this.target_[Y3])!=null&&n[e])return;O3(1,t.annotationType_,this.name_+`.`+e.toString())}for(var r=this.target_;r&&r!==M3;){var i=A3(r,e);if(i){var a=t.make_(this,e,i,r);if(a===0)return;if(a===1)break}r=Object.getPrototypeOf(r)}zrn(this,t,e)}},t.extend_=function(e,t,n,r){if(r===void 0&&(r=!1),n===!0&&(n=this.defaultAnnotation_),n===!1)return this.defineProperty_(e,t,r);var i=n.extend_(this,e,t,r);return i&&zrn(this,n,e),i},t.defineProperty_=function(e,t,n){n===void 0&&(n=!1),this.keysAtom_;try{w6();var r=this.delete_(e);if(!r)return r;if(L6(this)){var i=z6(this,{object:this.proxy_||this.target_,name:e,type:Y6,newValue:t.value});if(!i)return null;var a=i.newValue;t.value!==a&&(t=J3({},t,{value:a}))}if(n){if(!Reflect.defineProperty(this.target_,e,t))return!1}else j3(this.target_,e,t);this.notifyPropertyAddition_(e,t.value)}finally{T6()}return!0},t.defineObservableProperty_=function(e,t,n,r){r===void 0&&(r=!1),this.keysAtom_;try{w6();var i=this.delete_(e);if(!i)return i;if(L6(this)){var a=z6(this,{object:this.proxy_||this.target_,name:e,type:Y6,newValue:t});if(!a)return null;t=a.newValue}var o=Rrn(e),s={configurable:C6.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:o.get,set:o.set};if(r){if(!Reflect.defineProperty(this.target_,e,s))return!1}else j3(this.target_,e,s);var c=new f6(t,n,`ObservableObject.key`,!1);this.values_.set(e,c),this.notifyPropertyAddition_(e,c.value_)}finally{T6()}return!0},t.defineComputedProperty_=function(e,t,n){n===void 0&&(n=!1),this.keysAtom_;try{w6();var r=this.delete_(e);if(!r)return r;if(L6(this)&&!z6(this,{object:this.proxy_||this.target_,name:e,type:Y6,newValue:void 0}))return null;t.name||=`ObservableObject.key`,t.context=this.proxy_||this.target_;var i=Rrn(e),a={configurable:C6.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:i.get,set:i.set};if(n){if(!Reflect.defineProperty(this.target_,e,a))return!1}else j3(this.target_,e,a);this.values_.set(e,new p6(t)),this.notifyPropertyAddition_(e,void 0)}finally{T6()}return!0},t.delete_=function(e,t){if(t===void 0&&(t=!1),this.keysAtom_,!U3(this.target_,e))return!0;if(L6(this)&&!z6(this,{object:this.proxy_||this.target_,name:e,type:Frn}))return null;try{var n;w6();var r=B6(this),i=!1,a=this.values_.get(e),o=void 0;if(!a&&(r||i)&&(o=A3(this.target_,e)?.value),t){if(!Reflect.deleteProperty(this.target_,e))return!1}else delete this.target_[e];if(a&&(this.values_.delete(e),a instanceof f6&&(o=a.value_),Ann(a)),this.keysAtom_.reportChanged(),(n=this.pendingKeys_)==null||(n=n.get(e))==null||n.set(e in this.target_),r||i){var s={type:Frn,observableKind:`object`,object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:o,name:e};r&&H6(this,s)}}finally{T6()}return!0},t.observe_=function(e,t){return V6(this,e)},t.intercept_=function(e){return R6(this,e)},t.notifyPropertyAddition_=function(e,t){var n,r=B6(this),i=!1;if(r||i){var a=r||i?{type:Y6,observableKind:`object`,debugObjectName:this.name_,object:this.proxy_||this.target_,name:e,newValue:t}:null;r&&H6(this,a)}(n=this.pendingKeys_)==null||(n=n.get(e))==null||n.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),H3(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function $6(e,t){if(U3(e,$3))return e;var n=t?.name??`ObservableObject`;return R3(e,$3,new Irn(e,new Map,String(n),tnn(t))),e}var Lrn=z3(`ObservableObjectAdministration`,Irn);function Rrn(e){return Prn[e]||(Prn[e]={get:function(){return this[$3].getObservablePropValue_(e)},set:function(t){return this[$3].setObservablePropValue_(e,t)}})}function e8(e){return I3(e)?Lrn(e[$3]):!1}function zrn(e,t,n){var r;(r=e.target_[Y3])==null||delete r[n]}var Brn=Krn(0),Vrn=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1}(),Hrn=0,Urn=function(){};function Wrn(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__===void 0?e.prototype=t:e.prototype.__proto__=t}Wrn(Urn,Array.prototype);var Grn=function(e){function t(t,n,r,i){var a;return r===void 0&&(r=`ObservableArray`),i===void 0&&(i=!1),a=e.call(this)||this,n8(function(){var e=new Crn(r,n,i,!0);e.proxy_=a,Yen(a,$3,e),t&&t.length&&a.spliceWithArray(0,0,t),Vrn&&Object.defineProperty(a,"0",Brn)}),a}rtn(t,e);var n=t.prototype;return n.concat=function(){this[$3].atom_.reportObserved();var e=[...arguments];return Array.prototype.concat.apply(this.slice(),e.map(function(e){return J6(e)?e.slice():e}))},n[Symbol.iterator]=function(){var e=this,t=0;return rin({next:function(){return t<e.length?{value:e[t++],done:!1}:{done:!0,value:void 0}}})},K3(t,[{key:`length`,get:function(){return this[$3].getArrayLength_()},set:function(e){this[$3].setArrayLength_(e)}},{key:Symbol.toStringTag,get:function(){return`Array`}}])}(Urn);Object.entries(W6).forEach(function(e){var t=e[0],n=e[1];t!==`concat`&&R3(Grn.prototype,t,n)});function Krn(e){return{enumerable:!1,configurable:!0,get:function(){return this[$3].get_(e)},set:function(t){this[$3].set_(e,t)}}}function qrn(e){j3(Grn.prototype,``+e,Krn(e))}function Jrn(e){if(e>Hrn){for(var t=Hrn;t<e+100;t++)qrn(t);Hrn=e}}Jrn(1e3);function Yrn(e,t,n){return new Grn(e,t,n)}function t8(e,t){if(typeof e==`object`&&e){if(J6(e))return t!==void 0&&O3(23),e[$3].atom_;if(Q6(e))return e.atom_;if(Z6(e)){if(t===void 0)return e.keysAtom_;var n=e.data_.get(t)||e.hasMap_.get(t);return n||O3(25,t,Zrn(e)),n}if(e8(e)){if(!t)return O3(26);var r=e[$3].values_.get(t);return r||O3(27,t,Zrn(e)),r}if(ltn(e)||m6(e)||D6(e))return e}else if(P3(e)&&D6(e[$3]))return e[$3];O3(28)}function Xrn(e,t){if(e||O3(29),t!==void 0)return Xrn(t8(e,t));if(ltn(e)||m6(e)||D6(e)||Z6(e)||Q6(e))return e;if(e[$3])return e[$3];O3(24,e)}function Zrn(e,t){var n;if(t!==void 0)n=t8(e,t);else if(j6(e))return e.name;else n=e8(e)||Z6(e)||Q6(e)?Xrn(e):t8(e);return n.name_}function n8(e){var t=v6(),n=mnn(!0);w6();try{return e()}finally{T6(),hnn(n),y6(t)}}var Qrn=M3.toString;function $rn(e,t,n){return n===void 0&&(n=-1),ein(e,t,n)}function ein(e,t,n,r,i){if(e===t)return e!==0||1/e==1/t;if(e==null||t==null)return!1;if(e!==e)return t!==t;var a=typeof e;if(a!==`function`&&a!==`object`&&typeof t!=`object`)return!1;var o=Qrn.call(e);if(o!==Qrn.call(t))return!1;switch(o){case`[object RegExp]`:case`[object String]`:return``+e==``+t;case`[object Number]`:return+e==+e?+e==0?1/e==1/t:+e==+t:+t!=+t;case`[object Date]`:case`[object Boolean]`:return+e==+t;case`[object Symbol]`:return typeof Symbol<`u`&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t);case`[object Map]`:case`[object Set]`:n>=0&&n++;break}e=tin(e),t=tin(t);var s=o===`[object Array]`;if(!s){if(typeof e!=`object`||typeof t!=`object`)return!1;var c=e.constructor,l=t.constructor;if(c!==l&&!(P3(c)&&c instanceof c&&P3(l)&&l instanceof l)&&`constructor`in e&&`constructor`in t)return!1}if(n===0)return!1;n<0&&(n=-1),r||=[],i||=[];for(var u=r.length;u--;)if(r[u]===e)return i[u]===t;if(r.push(e),i.push(t),s){if(u=e.length,u!==t.length)return!1;for(;u--;)if(!ein(e[u],t[u],n-1,r,i))return!1}else{var d=Object.keys(e),f=d.length;if(Object.keys(t).length!==f)return!1;for(var p=0;p<f;p++){var m=d[p];if(!(U3(t,m)&&ein(e[m],t[m],n-1,r,i)))return!1}}return r.pop(),i.pop(),!0}function tin(e){return J6(e)?e.slice():B3(e)||Z6(e)||V3(e)||Q6(e)?Array.from(e.entries()):e}var nin=k3().Iterator?.prototype||{};function rin(e){return e[Symbol.iterator]=iin,Object.assign(Object.create(nin),e)}function iin(){return this}[`Symbol`,`Map`,`Set`].forEach(function(e){k3()[e]===void 0&&O3(`MobX requires global '`+e+`' to be available or polyfilled`)}),typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__==`object`&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:Rnn,extras:{getDebugName:Zrn},$mobx:$3});function r8(e){return Array.isArray(e)||J6(e)}function i8(e,t){let n=r8(e);if(n!==r8(t))throw Error(`PersistenceUtils::typeGuard] ${D3.MalformedDataError}`);if(n)for(let n of e)i8(n,t[0]);return o8(t)&&Object.keys(t).forEach(n=>{let r=e[n],i=t[n];if(r&&r8(i))i8(r,i);else if(r&&o8(r))i8(r,i);else if(o8(e)&&!e.hasOwnProperty(n))throw Error(`[PersistenceUtils::typeGuard] ${D3.MalformedDataError}`)}),!0}var ain=/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/;function a8(e){if(r8(e))for(let t=0;t<e.length;t++)e[t]=a8(e[t]);else if(o8(e))for(let t of Object.keys(e)){let n=e[t];typeof n==`object`?e[t]=a8(n):typeof n==`string`&&ain.exec(n)&&(e[t]=new Date(n))}return e}function o8(e){return typeof e==`object`&&!!e&&!r8(e)}var oin=class{storageName;schema;constructor(e,t){this.storageName=`${e}Storage`,this.schema=JSON.parse(JSON.stringify(t))}get(){let e=xq.getString(this.storageName),t=this.instantiateData(e);return this.isT(t),t}update(e){let t=JSON.parse(JSON.stringify(e)),n=Object.assign(this.get(),t);return this.isT(n),xq.set(this.storageName,JSON.stringify(n)),n}set(e){return this.isT(e),xq.set(this.storageName,JSON.stringify(e)),e}clear(){return xq.delete(this.storageName),this.instantiateData(void 0)}instantiateData(e){let t=e??JSON.stringify(this.schema);return xq.set(this.storageName,t),JSON.parse(t)}isT(e){if(!e||typeof e!=`object`)throw Error(`[PersistenceManager::isT] ${D3.IncorrectDataError}`);return i8(e,this.schema),!0}},sin=class{persistenceManager;schema;data;constructor(e,t){this.schema=JSON.parse(JSON.stringify(t)),this.data=JSON.parse(JSON.stringify(t)),this.persistenceManager=new oin(e,t),this.createDataFromSchema(),this.restore()}get(){return this.data}set(e){return this.data=JSON.parse(JSON.stringify(e)),this.data=a8(this.data),this.data}update(e){if(r8(this.data)){let t=this.data.findIndex(t=>t.uuid===e.uuid);if(t!==-1)this.data[t]={...this.data[t],...e};else try{i8([e],this.schema),this.data.push(e)}catch(e){throw e.message===D3.MalformedDataError?Error(`[DataManager::update] Cannot add an element that does not contain required fields`):e}}else Object.assign(this.data,e);return this.data}save(e=!0){return e?this.persistenceManager.update(this.data):this.persistenceManager.set(this.data)}restore(){if(this.data=this.persistenceManager.get(),this.data=a8(this.data),r8(this.data)){let e=e=>e.filter(e=>!!e.uuid);this.data=e(this.data)}return this.data}clear=()=>(this.persistenceManager.clear(),this.createDataFromSchema(),this.data);createDataFromSchema(){this.data=r8(this.schema)?[]:JSON.parse(JSON.stringify(this.schema))}},s8=new class extends sin{migrateData(){throw Error(`[TrackingManager::migrateData] Method purposefully not implemented.`)}constructor(){super(`trackingEvent`,[])}update(e){return super.update(e)}sync=async()=>{let e=super.get(),t=[];for(let n of e)try{await zen(n)}catch{t.push(n)}super.set(t),super.save(!1)}},c8=`3.9.0`,cin=`2026-11-03`,lin=1237,uin=`05700002209597`;V();var l8=function(e){return e.QuickGuideStartPress=`quickguide.start.press`,e.QuickGuideBackPressStep1=`quickguide.screen1.back.press`,e.QuickGuideNextPressStep1=`quickguide.screen1.next.press`,e.QuickGuideBackPressStep2=`quickguide.screen2.back.press`,e.QuickGuideNextPressStep2=`quickguide.screen2.next.press`,e.QuickGuideBackPressStep3=`quickguide.screen3.back.press`,e.QuickGuideNextPressStep3=`quickguide.screen3.next.press`,e.QuickGuideBackPressStep4=`quickguide.screen4.back.press`,e.QuickGuideNextPressStep4=`quickguide.screen4.next.press`,e.QuickGuideBackPressStep5=`quickguide.screen5.back.press`,e.QuickGuideNextPressStep5=`quickguide.screen5.next.press`,e.QuickGuideBackPressStep6=`quickguide.screen6.back.press`,e.QuickGuideFinishPress=`quickguide.finish.press`,e.SetupIntroStartPress=`setup.intro.start.press`,e.SetupGeneralBackPress=`setup.general.back.press`,e.SetupGeneralNextPress=`setup.general.next.press`,e.SetupTreatmentBackPress=`setup.treatment.back.press`,e.SetupTreatmentNextPress=`setup.treatment.next.press`,e.SetupOptionsNextPress=`setup.options.next.press`,e.SetupOptionsBackPress=`setup.options.back.press`,e.SetupInsulinBackPress=`setup.insulin.back.press`,e.SetupInsulinNextPress=`setup.insulin.next.press`,e.SetupTDDBackPress=`setup.tdd.back.press`,e.SetupTDDNextPress=`setup.tdd.next.press`,e.SetupSummaryBackPress=`setup.summary.back.press`,e.SetupSummaryFinishPress=`setup.summary.finish.press`,e.ForecastOffline=`forecast.offline`,e.ForecastNotificationsOff=`forecast.notifications.off`,e.ForecastNewCalculationPress=`forecast.newcalculation.press`,e.CarbohydrateChart7DaysPress=`carbohydratechart.7days.press`,e.CarbohydrateChart14DaysPress=`carbohydratechart.14days.press`,e.CarbohydrateChart30DaysPress=`carbohydratechart.30days.press`,e.CarbohydrateChart90DaysPress=`carbohydratechart.90days.press`,e.CarbohydrateChartStart=`carbohydratechart.start`,e.CarbohydrateChartEnd=`carbohydratechart.end`,e.RapidInsulinChart7DaysPress=`rapidinsulinchart.7days.press`,e.RapidInsulinChart14DaysPress=`rapidinsulinchart.14days.press`,e.RapidInsulinChart30DaysPress=`rapidinsulinchart.30days.press`,e.RapidInsulinChart90DaysPress=`rapidinsulinchart.90days.press`,e.RapidInsulinChartStart=`rapidinsulinchart.start`,e.RapidInsulinChartEnd=`rapidinsulinchart.end`,e.TimeInRangeChart7DaysPress=`timeinrangechart.7days.press`,e.TimeInRangeChart14DaysPress=`timeinrangechart.14days.press`,e.TimeInRangeChart30DaysPress=`timeinrangechart.30days.press`,e.TimeInRangeChart90DaysPress=`timeinrangechart.90days.press`,e.TimeInRangeChartStart=`timeinrangechart.start`,e.TimeInRangeChartEnd=`timeinrangechart.end`,e.MyDayPreviousPress=`mydaychart.previous.press`,e.MyDayNextPress=`mydaychart.next.press`,e.MyDayChartStart=`mydaychart.start`,e.MyDayChartEnd=`mydaychart.end`,e.ActiveInsulinChartStart=`activeinsulinchart.start`,e.ActiveInsulinChartEnd=`activeinsulinchart.end`,e.GlucoseChart7DaysPressCGM=`glucosechart.cgm.7days.press`,e.GlucoseChart14DaysPressCGM=`glucosechart.cgm.14days.press`,e.GlucoseChart30DaysPressCGM=`glucosechart.cgm.30days.press`,e.GlucoseChart90DaysPressCGM=`glucosechart.cgm.90days.press`,e.GlucoseChartStartCGM=`glucosechart.cgm.start`,e.GlucoseChartEndCGM=`glucosechart.cgm.end`,e.GlucoseChart7DaysPressBGM=`glucosechart.bgm.7days.press`,e.GlucoseChart14DaysPressBGM=`glucosechart.bgm.14days.press`,e.GlucoseChart30DaysPressBGM=`glucosechart.bgm.30days.press`,e.GlucoseChart90DaysPressBGM=`glucosechart.bgm.90days.press`,e.GlucoseChartStartBGM=`glucosechart.bgm.start`,e.GlucoseChartEndBGM=`glucosechart.bgm.end`,e.DashboardCgmButtonPress=`home.dashboard.cgm.press`,e.DashboardTabPress=`home.dashboard.press`,e.LogbookTabPress=`home.logbook.press`,e.NewCalculationTabPress=`home.newcalculation.press`,e.SettingsTabPress=`home.settings.press`,e.FoodLibraryTabPress=`home.foodlibrary.press`,e.CalculationGlucosePress=`calcflow.glucose.press`,e.CalculationCarbsPress=`calcflow.carbs.press`,e.CalculationActivityPress=`calcflow.activity.press`,e.CalculationNotesPress=`calcflow.notes.press`,e.AbortCalculationPress=`calcflow.abort.press`,e.RecentInsulinRegisterPress=`calcflow.recentinsulin.register.press`,e.RecentInsulinContinuePress=`calcflow.recentinsulin.continue.press`,e.CalculationManualInput=`calcflow.carbs.input.manual`,e.CalculationScanFoodPress=`calcflow.carbs.scanfood.press`,e.CalculationFoodLibraryPress=`calcflow.carbs.foodlibrary.press`,e.CalculationFoodLibraryDatabaseInput=`calcflow.carbs.foodlibrary.input.database`,e.CalculationFoodLibraryPersonalInput=`calcflow.carbs.foodlibrary.input.personal`,e.CalculationFoodLibraryPersonalPress=`calcflow.carbs.foodlibrary.personal.press`,e.CalculationFoodLibrarySearch=`calcflow.carbs.foodlibrary.search`,e.CalculationFoodLibraryAbort=`calcflow.carbs.foodlibrary.abort`,e.FoodLibrarySearched=`foodlibrary.searched`,e.FoodLibraryScanFoodPress=`foodlibrary.scanfood.press`,e.FoodLibraryPersonalPress=`foodlibrary.personal.press`,e.FoodLibraryCreatePress=`foodlibrary.create.press`,e.FoodLibraryUpdatePress=`foodlibrary.update.press`,e.ActivityAddPress=`calcflow.activity.add.press`,e.ActivityEditPress=`calcflow.activity.edit.press`,e.TransferDevice=`integration.device.transfer`,e.TransferService=`integration.service.transfer`,e.ExpiredGlucose=`calcflow.glucose.expired`,e.SummaryEmptyGlucose=`calcflow.summary.glucose.empty`,e.VisualSearchClosePress=`visualsearch.close.press`,e.VisualSearchNoMatchSearchLibraryPress=`visualsearch.nomatch.searchlibrary.press`,e.VisualSearchAddToCalculationPress=`visualsearch.addtocalculation.press`,e.RecommendationSuccess=`calcflow.recommendation.success`,e.RecommendationInvalid=`calcflow.recommendation.invalid`,e.RecommendationViewDetailsPress=`calcflow.recommendation.details.press`,e.RecommendationExpired=`calcflow.recommendation.expired`,e.RecommendationToastPress=`calcflow.recommendation.toast.press`,e.LogbookPersonalAddPress=`logbook.personal.add.press`,e.LogbookPersonalEditPress=`logbook.personal.edit.press`,e.LogbookPersonalDeletePress=`logbook.personal.delete.press`,e.LogbookExportPress=`logbook.export.press`,e.LogbookExportDurationFourteenDaysPress=`logbook.export.duration.fourteendays.press`,e.LogbookExportDurationThreeMonthsPress=`logbook.export.duration.threemonths.press`,e.LogbookExportDurationSixMonthsPress=`logbook.export.duration.sixmonths.press`,e.LogbookExportGeneratePress=`logbook.export.generate.press`,e.SettingsProfile=`settings.profile.press`,e.SettingsInsulin=`settings.insulin.press`,e.SettingsGlucose=`settings.glucose.press`,e.SettingsActivity=`settings.activity.press`,e.SettingsNotifications=`settings.notifications.press`,e.SettingsTheme=`settings.theme.press`,e.SettingsSmartPen=`settings.smartpen.press`,e.SettingsCGM=`settings.cgm.press`,e.SettingsBGM=`settings.bgm.press`,e.SettingsIFU=`settings.ifu.press`,e.SettingsSupport=`settings.support.press`,e.SettingsLegal=`settings.legal.press`,e.SettingsForecast=`settings.forecast.press`,e.NotificationsAllowQuickGuide=`quickguide.notifications.allow.press`,e.NotificationsAllowSettings=`settings.notifications.allow.press`,e.NotificationsDenyQuickGuide=`quickguide.notifications.deny.press`,e.NotificationsDenySettings=`settings.notifications.deny.press`,e.AppOpenNotification=`app.open.notification`,e.ErrorOffline=`errors.offline`,e.ErrorForceUpdate=`errors.forceupdate`,e.ErrorLogOut=`errors.logout`,e.WatchAppOpened=`watch.app.opened`,e.PINCodeSetupCreatePress=`pincode.setup.create.press`,e.PINCodeSetupMaybeLaterPress=`pincode.setup.maybelater.press`,e}({}),din=()=>{let{email:e,id:t,country:n=``}=jan.get();return{id:t,isTester:e.includes(`@hedia`),country:n,uuid:i3(),timestamp:new Date().toISOString(),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,platform:z.OS}},u8=(e,t)=>{let{id:n,isTester:r,country:i,uuid:a,timestamp:o,timezone:s,platform:c}=din(),l={uuid:a,type:e,timestamp:t??o,timezone:s,data:{version:c8,platform:c,user:{id:n,isTester:r},geo:{country:i}}};s8.update(l),s8.sync().catch(console.error)},fin=e=>{let{id:t,isTester:n,country:r,uuid:i,timestamp:a,timezone:o,platform:s}=din(),c={uuid:i,timestamp:a,timezone:o,type:`integration.service.transfer`,data:{version:c8,platform:s,source:{sourceID:e.source_id,deviceName:e.device_name,sourceName:e.source_name},reading:{type:e.type,value:e.quantity.value,unit:e.quantity.unit},geo:{country:r},user:{id:t,isTester:n}}};s8.update(c),s8.sync().catch(console.error)},d8=async(e,t,n=ken,r=0)=>{if(Oq)return fetch(e,t);let{accessToken:i}=E3.getState();if(!i)throw new Ren(`[hediaFetch] Missing access token`);let a={...t?.headers,Authorization:`Bearer ${i}`,...Aq},o=await T3(e,{...t,headers:a},n);if([X.StatusCode.UNAUTHORIZED,X.StatusCode.FORBIDDEN].includes(o.status)){if(r<1)return await min(),d8(e,t,n,r+1);throw new w2(`[hediaFetch::hediaFetch] Failed to refresh token after retry`,{statusCode:o.status,url:typeof e==`string`?e:e.url,method:t?.method})}return o},f8=null,pin=async()=>{let{accessToken:e,refreshToken:t,setTokens:n}=E3.getState();if(!t&&!e)throw new Ren(`[hediaFetch::refreshAccessToken] Missing refresh token`);if(!t)throw u8(l8.ErrorLogOut),n({accessToken:void 0,refreshToken:void 0}),Error(`[hediaFetch::refreshAccessToken] Missing refresh token for a signed-in session`);let r=await Pen(t);if(r.status===X.StatusCode.BAD_REQUEST)throw u8(l8.ErrorLogOut),n({accessToken:void 0,refreshToken:void 0}),new Ren(`[hediaFetch::refreshAccessToken] Bad request - cleared storage`);if(!r.ok)throw Error(`[hediaFetch::refreshAccessToken] Failed to refresh access token (status: ${r.status})`);let{access_token:i,refresh_token:a}=await r.json().catch(()=>null)??{};if(!i||!a)throw Error(`[hediaFetch::refreshAccessToken] Invalid token response from server`);n({accessToken:i,refreshToken:a})},min=()=>(f8===null&&(f8=pin().finally(()=>{f8=null})),f8),hin=async()=>{let e={headers:{Accept:`application/json`,"Content-Type":`application/json`},method:X.HTTPRequestMethod.GET},t=`${bq.HEDIA_SERVER_BASE_URL}/api/v3/user`,n=await d8(t,e);return await T2(n,X.StatusCode.OK,t),n.json()},gin={email:``},_in={lessThanXSeconds:{one:`mindre end ét sekund`,other:`mindre end {{count}} sekunder`},xSeconds:{one:`1 sekund`,other:`{{count}} sekunder`},halfAMinute:`ét halvt minut`,lessThanXMinutes:{one:`mindre end ét minut`,other:`mindre end {{count}} minutter`},xMinutes:{one:`1 minut`,other:`{{count}} minutter`},aboutXHours:{one:`cirka 1 time`,other:`cirka {{count}} timer`},xHours:{one:`1 time`,other:`{{count}} timer`},xDays:{one:`1 dag`,other:`{{count}} dage`},aboutXWeeks:{one:`cirka 1 uge`,other:`cirka {{count}} uger`},xWeeks:{one:`1 uge`,other:`{{count}} uger`},aboutXMonths:{one:`cirka 1 måned`,other:`cirka {{count}} måneder`},xMonths:{one:`1 måned`,other:`{{count}} måneder`},aboutXYears:{one:`cirka 1 år`,other:`cirka {{count}} år`},xYears:{one:`1 år`,other:`{{count}} år`},overXYears:{one:`over 1 år`,other:`over {{count}} år`},almostXYears:{one:`næsten 1 år`,other:`næsten {{count}} år`}},vin=(e,t,n)=>{let r,i=_in[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,String(t)),n?.addSuffix?n.comparison&&n.comparison>0?`om `+r:r+` siden`:r};function p8(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var yin={date:p8({formats:{full:`EEEE 'den' d. MMMM y`,long:`d. MMMM y`,medium:`d. MMM y`,short:`dd/MM/y`},defaultWidth:`full`}),time:p8({formats:{full:`HH:mm:ss zzzz`,long:`HH:mm:ss z`,medium:`HH:mm:ss`,short:`HH:mm`},defaultWidth:`full`}),dateTime:p8({formats:{full:`{{date}} 'kl'. {{time}}`,long:`{{date}} 'kl'. {{time}}`,medium:`{{date}} {{time}}`,short:`{{date}} {{time}}`},defaultWidth:`full`})},bin={lastWeek:`'sidste' eeee 'kl.' p`,yesterday:`'i går kl.' p`,today:`'i dag kl.' p`,tomorrow:`'i morgen kl.' p`,nextWeek:`'på' eeee 'kl.' p`,other:`P`},xin=(e,t,n,r)=>bin[e];function m8(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 Sin={ordinalNumber:(e,t)=>Number(e)+`.`,era:m8({values:{narrow:[`fvt`,`vt`],abbreviated:[`f.v.t.`,`v.t.`],wide:[`før vesterlandsk tidsregning`,`vesterlandsk tidsregning`]},defaultWidth:`wide`}),quarter:m8({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`1. kvt.`,`2. kvt.`,`3. kvt.`,`4. kvt.`],wide:[`1. kvartal`,`2. kvartal`,`3. kvartal`,`4. kvartal`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:m8({values:{narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`jan.`,`feb.`,`mar.`,`apr.`,`maj`,`jun.`,`jul.`,`aug.`,`sep.`,`okt.`,`nov.`,`dec.`],wide:[`januar`,`februar`,`marts`,`april`,`maj`,`juni`,`juli`,`august`,`september`,`oktober`,`november`,`december`]},defaultWidth:`wide`}),day:m8({values:{narrow:[`S`,`M`,`T`,`O`,`T`,`F`,`L`],short:[`sø`,`ma`,`ti`,`on`,`to`,`fr`,`lø`],abbreviated:[`søn.`,`man.`,`tir.`,`ons.`,`tor.`,`fre.`,`lør.`],wide:[`søndag`,`mandag`,`tirsdag`,`onsdag`,`torsdag`,`fredag`,`lørdag`]},defaultWidth:`wide`}),dayPeriod:m8({values:{narrow:{am:`a`,pm:`p`,midnight:`midnat`,noon:`middag`,morning:`morgen`,afternoon:`eftermiddag`,evening:`aften`,night:`nat`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnat`,noon:`middag`,morning:`morgen`,afternoon:`eftermiddag`,evening:`aften`,night:`nat`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnat`,noon:`middag`,morning:`morgen`,afternoon:`eftermiddag`,evening:`aften`,night:`nat`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`a`,pm:`p`,midnight:`midnat`,noon:`middag`,morning:`om morgenen`,afternoon:`om eftermiddagen`,evening:`om aftenen`,night:`om natten`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnat`,noon:`middag`,morning:`om morgenen`,afternoon:`om eftermiddagen`,evening:`om aftenen`,night:`om natten`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnat`,noon:`middag`,morning:`om morgenen`,afternoon:`om eftermiddagen`,evening:`om aftenen`,night:`om natten`}},defaultFormattingWidth:`wide`})};function h8(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)?win(s,e=>e.test(o)):Cin(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 Cin(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function win(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function g8(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 Tin={code:`da`,formatDistance:vin,formatLong:yin,formatRelative:xin,localize:Sin,match:{ordinalNumber:g8({matchPattern:/^(\d+)(\.)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:h8({matchPatterns:{narrow:/^(fKr|fvt|eKr|vt)/i,abbreviated:/^(f\.Kr\.?|f\.v\.t\.?|e\.Kr\.?|v\.t\.)/i,wide:/^(f.Kr.|før vesterlandsk tidsregning|e.Kr.|vesterlandsk tidsregning)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^f/i,/^(v|e)/i]},defaultParseWidth:`any`}),quarter:h8({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^[1234]. kvt\./i,wide:/^[1234]\.? kvartal/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:h8({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan.|feb.|mar.|apr.|maj|jun.|jul.|aug.|sep.|okt.|nov.|dec.)/i,wide:/^(januar|februar|marts|april|maj|juni|juli|august|september|oktober|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,/^maj/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:h8({matchPatterns:{narrow:/^[smtofl]/i,short:/^(søn.|man.|tir.|ons.|tor.|fre.|lør.)/i,abbreviated:/^(søn|man|tir|ons|tor|fre|lør)/i,wide:/^(søndag|mandag|tirsdag|onsdag|torsdag|fredag|lørdag)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^o/i,/^t/i,/^f/i,/^l/i],any:[/^s/i,/^m/i,/^ti/i,/^o/i,/^to/i,/^f/i,/^l/i]},defaultParseWidth:`any`}),dayPeriod:h8({matchPatterns:{narrow:/^(a|p|midnat|middag|(om) (morgenen|eftermiddagen|aftenen|natten))/i,any:/^([ap]\.?\s?m\.?|midnat|middag|(om) (morgenen|eftermiddagen|aftenen|natten))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/midnat/i,noon:/middag/i,morning:/morgen/i,afternoon:/eftermiddag/i,evening:/aften/i,night:/nat/i}},defaultParseWidth:`any`})},options:{weekStartsOn:1,firstWeekContainsDate:4}},Ein={lessThanXSeconds:{standalone:{one:`weniger als 1 Sekunde`,other:`weniger als {{count}} Sekunden`},withPreposition:{one:`weniger als 1 Sekunde`,other:`weniger als {{count}} Sekunden`}},xSeconds:{standalone:{one:`1 Sekunde`,other:`{{count}} Sekunden`},withPreposition:{one:`1 Sekunde`,other:`{{count}} Sekunden`}},halfAMinute:{standalone:`eine halbe Minute`,withPreposition:`einer halben Minute`},lessThanXMinutes:{standalone:{one:`weniger als 1 Minute`,other:`weniger als {{count}} Minuten`},withPreposition:{one:`weniger als 1 Minute`,other:`weniger als {{count}} Minuten`}},xMinutes:{standalone:{one:`1 Minute`,other:`{{count}} Minuten`},withPreposition:{one:`1 Minute`,other:`{{count}} Minuten`}},aboutXHours:{standalone:{one:`etwa 1 Stunde`,other:`etwa {{count}} Stunden`},withPreposition:{one:`etwa 1 Stunde`,other:`etwa {{count}} Stunden`}},xHours:{standalone:{one:`1 Stunde`,other:`{{count}} Stunden`},withPreposition:{one:`1 Stunde`,other:`{{count}} Stunden`}},xDays:{standalone:{one:`1 Tag`,other:`{{count}} Tage`},withPreposition:{one:`1 Tag`,other:`{{count}} Tagen`}},aboutXWeeks:{standalone:{one:`etwa 1 Woche`,other:`etwa {{count}} Wochen`},withPreposition:{one:`etwa 1 Woche`,other:`etwa {{count}} Wochen`}},xWeeks:{standalone:{one:`1 Woche`,other:`{{count}} Wochen`},withPreposition:{one:`1 Woche`,other:`{{count}} Wochen`}},aboutXMonths:{standalone:{one:`etwa 1 Monat`,other:`etwa {{count}} Monate`},withPreposition:{one:`etwa 1 Monat`,other:`etwa {{count}} Monaten`}},xMonths:{standalone:{one:`1 Monat`,other:`{{count}} Monate`},withPreposition:{one:`1 Monat`,other:`{{count}} Monaten`}},aboutXYears:{standalone:{one:`etwa 1 Jahr`,other:`etwa {{count}} Jahre`},withPreposition:{one:`etwa 1 Jahr`,other:`etwa {{count}} Jahren`}},xYears:{standalone:{one:`1 Jahr`,other:`{{count}} Jahre`},withPreposition:{one:`1 Jahr`,other:`{{count}} Jahren`}},overXYears:{standalone:{one:`mehr als 1 Jahr`,other:`mehr als {{count}} Jahre`},withPreposition:{one:`mehr als 1 Jahr`,other:`mehr als {{count}} Jahren`}},almostXYears:{standalone:{one:`fast 1 Jahr`,other:`fast {{count}} Jahre`},withPreposition:{one:`fast 1 Jahr`,other:`fast {{count}} Jahren`}}},Din=(e,t,n)=>{let r,i=n?.addSuffix?Ein[e].withPreposition:Ein[e].standalone;return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,String(t)),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:`vor `+r:r},Oin={date:p8({formats:{full:`EEEE, do MMMM y`,long:`do MMMM y`,medium:`do MMM y`,short:`dd.MM.y`},defaultWidth:`full`}),time:p8({formats:{full:`HH:mm:ss zzzz`,long:`HH:mm:ss z`,medium:`HH:mm:ss`,short:`HH:mm`},defaultWidth:`full`}),dateTime:p8({formats:{full:`{{date}} 'um' {{time}}`,long:`{{date}} 'um' {{time}}`,medium:`{{date}} {{time}}`,short:`{{date}} {{time}}`},defaultWidth:`full`})},kin={lastWeek:`'letzten' eeee 'um' p`,yesterday:`'gestern um' p`,today:`'heute um' p`,tomorrow:`'morgen um' p`,nextWeek:`eeee 'um' p`,other:`P`},Ain=(e,t,n,r)=>kin[e],jin={narrow:[`v.Chr.`,`n.Chr.`],abbreviated:[`v.Chr.`,`n.Chr.`],wide:[`vor Christus`,`nach Christus`]},Min={narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1. Quartal`,`2. Quartal`,`3. Quartal`,`4. Quartal`]},Nin={narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mär`,`Apr`,`Mai`,`Jun`,`Jul`,`Aug`,`Sep`,`Okt`,`Nov`,`Dez`],wide:[`Januar`,`Februar`,`März`,`April`,`Mai`,`Juni`,`Juli`,`August`,`September`,`Oktober`,`November`,`Dezember`]},Pin={narrow:Nin.narrow,abbreviated:[`Jan.`,`Feb.`,`März`,`Apr.`,`Mai`,`Juni`,`Juli`,`Aug.`,`Sep.`,`Okt.`,`Nov.`,`Dez.`],wide:Nin.wide},Fin={code:`de`,formatDistance:Din,formatLong:Oin,formatRelative:Ain,localize:{ordinalNumber:e=>Number(e)+`.`,era:m8({values:jin,defaultWidth:`wide`}),quarter:m8({values:Min,defaultWidth:`wide`,argumentCallback:e=>e-1}),month:m8({values:Nin,formattingValues:Pin,defaultWidth:`wide`}),day:m8({values:{narrow:[`S`,`M`,`D`,`M`,`D`,`F`,`S`],short:[`So`,`Mo`,`Di`,`Mi`,`Do`,`Fr`,`Sa`],abbreviated:[`So.`,`Mo.`,`Di.`,`Mi.`,`Do.`,`Fr.`,`Sa.`],wide:[`Sonntag`,`Montag`,`Dienstag`,`Mittwoch`,`Donnerstag`,`Freitag`,`Samstag`]},defaultWidth:`wide`}),dayPeriod:m8({values:{narrow:{am:`vm.`,pm:`nm.`,midnight:`Mitternacht`,noon:`Mittag`,morning:`Morgen`,afternoon:`Nachm.`,evening:`Abend`,night:`Nacht`},abbreviated:{am:`vorm.`,pm:`nachm.`,midnight:`Mitternacht`,noon:`Mittag`,morning:`Morgen`,afternoon:`Nachmittag`,evening:`Abend`,night:`Nacht`},wide:{am:`vormittags`,pm:`nachmittags`,midnight:`Mitternacht`,noon:`Mittag`,morning:`Morgen`,afternoon:`Nachmittag`,evening:`Abend`,night:`Nacht`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`vm.`,pm:`nm.`,midnight:`Mitternacht`,noon:`Mittag`,morning:`morgens`,afternoon:`nachm.`,evening:`abends`,night:`nachts`},abbreviated:{am:`vorm.`,pm:`nachm.`,midnight:`Mitternacht`,noon:`Mittag`,morning:`morgens`,afternoon:`nachmittags`,evening:`abends`,night:`nachts`},wide:{am:`vormittags`,pm:`nachmittags`,midnight:`Mitternacht`,noon:`Mittag`,morning:`morgens`,afternoon:`nachmittags`,evening:`abends`,night:`nachts`}},defaultFormattingWidth:`wide`})},match:{ordinalNumber:g8({matchPattern:/^(\d+)(\.)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e)}),era:h8({matchPatterns:{narrow:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,abbreviated:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,wide:/^(vor Christus|vor unserer Zeitrechnung|nach Christus|unserer Zeitrechnung)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^v/i,/^n/i]},defaultParseWidth:`any`}),quarter:h8({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](\.)? Quartal/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:h8({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(j[aä]n|feb|mär[z]?|apr|mai|jun[i]?|jul[i]?|aug|sep|okt|nov|dez)\.?/i,wide:/^(januar|februar|märz|april|mai|juni|juli|august|september|oktober|november|dezember)/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:[/^j[aä]/i,/^f/i,/^mär/i,/^ap/i,/^mai/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:h8({matchPatterns:{narrow:/^[smdmf]/i,short:/^(so|mo|di|mi|do|fr|sa)/i,abbreviated:/^(son?|mon?|die?|mit?|don?|fre?|sam?)\.?/i,wide:/^(sonntag|montag|dienstag|mittwoch|donnerstag|freitag|samstag)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^so/i,/^mo/i,/^di/i,/^mi/i,/^do/i,/^f/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:h8({matchPatterns:{narrow:/^(vm\.?|nm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,abbreviated:/^(vorm\.?|nachm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,wide:/^(vormittags|nachmittags|Mitternacht|Mittag|morgens|nachmittags|abends|nachts)/i},defaultMatchWidth:`wide`,parsePatterns:{any:{am:/^v/i,pm:/^n/i,midnight:/^Mitte/i,noon:/^Mitta/i,morning:/morgens/i,afternoon:/nachmittags/i,evening:/abends/i,night:/nachts/i}},defaultParseWidth:`any`})},options:{weekStartsOn:1,firstWeekContainsDate:4}},Iin={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`}},Lin=(e,t,n)=>{let r,i=Iin[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},Rin={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},zin=(e,t,n,r)=>Rin[e],Bin={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:m8({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:m8({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:m8({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:m8({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:m8({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`})},Vin={ordinalNumber:g8({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:h8({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:h8({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:h8({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:h8({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:h8({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`})},Hin={code:`en-GB`,formatDistance:Lin,formatLong:{date:p8({formats:{full:`EEEE, d MMMM yyyy`,long:`d MMMM yyyy`,medium:`d MMM yyyy`,short:`dd/MM/yyyy`},defaultWidth:`full`}),time:p8({formats:{full:`HH:mm:ss zzzz`,long:`HH:mm:ss z`,medium:`HH:mm:ss`,short:`HH:mm`},defaultWidth:`full`}),dateTime:p8({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},formatRelative:zin,localize:Bin,match:Vin,options:{weekStartsOn:1,firstWeekContainsDate:4}},Uin={lessThanXSeconds:{one:`menos de un segundo`,other:`menos de {{count}} segundos`},xSeconds:{one:`1 segundo`,other:`{{count}} segundos`},halfAMinute:`medio minuto`,lessThanXMinutes:{one:`menos de un minuto`,other:`menos de {{count}} minutos`},xMinutes:{one:`1 minuto`,other:`{{count}} minutos`},aboutXHours:{one:`alrededor de 1 hora`,other:`alrededor de {{count}} horas`},xHours:{one:`1 hora`,other:`{{count}} horas`},xDays:{one:`1 día`,other:`{{count}} días`},aboutXWeeks:{one:`alrededor de 1 semana`,other:`alrededor de {{count}} semanas`},xWeeks:{one:`1 semana`,other:`{{count}} semanas`},aboutXMonths:{one:`alrededor de 1 mes`,other:`alrededor de {{count}} meses`},xMonths:{one:`1 mes`,other:`{{count}} meses`},aboutXYears:{one:`alrededor de 1 año`,other:`alrededor de {{count}} años`},xYears:{one:`1 año`,other:`{{count}} años`},overXYears:{one:`más de 1 año`,other:`más de {{count}} años`},almostXYears:{one:`casi 1 año`,other:`casi {{count}} años`}},Win=(e,t,n)=>{let r,i=Uin[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`en `+r:`hace `+r:r},Gin={date:p8({formats:{full:`EEEE, d 'de' MMMM 'de' y`,long:`d 'de' MMMM 'de' y`,medium:`d MMM y`,short:`dd/MM/y`},defaultWidth:`full`}),time:p8({formats:{full:`HH:mm:ss zzzz`,long:`HH:mm:ss z`,medium:`HH:mm:ss`,short:`HH:mm`},defaultWidth:`full`}),dateTime:p8({formats:{full:`{{date}} 'a las' {{time}}`,long:`{{date}} 'a las' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},Kin={lastWeek:`'el' eeee 'pasado a la' p`,yesterday:`'ayer a la' p`,today:`'hoy a la' p`,tomorrow:`'mañana a la' p`,nextWeek:`eeee 'a la' p`,other:`P`},qin={lastWeek:`'el' eeee 'pasado a las' p`,yesterday:`'ayer a las' p`,today:`'hoy a las' p`,tomorrow:`'mañana a las' p`,nextWeek:`eeee 'a las' p`,other:`P`},Jin={code:`es`,formatDistance:Win,formatLong:Gin,formatRelative:(e,t,n,r)=>t.getHours()===1?Kin[e]:qin[e],localize:{ordinalNumber:(e,t)=>Number(e)+`º`,era:m8({values:{narrow:[`AC`,`DC`],abbreviated:[`AC`,`DC`],wide:[`antes de cristo`,`después de cristo`]},defaultWidth:`wide`}),quarter:m8({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`T1`,`T2`,`T3`,`T4`],wide:[`1º trimestre`,`2º trimestre`,`3º trimestre`,`4º trimestre`]},defaultWidth:`wide`,argumentCallback:e=>Number(e)-1}),month:m8({values:{narrow:[`e`,`f`,`m`,`a`,`m`,`j`,`j`,`a`,`s`,`o`,`n`,`d`],abbreviated:[`ene`,`feb`,`mar`,`abr`,`may`,`jun`,`jul`,`ago`,`sep`,`oct`,`nov`,`dic`],wide:[`enero`,`febrero`,`marzo`,`abril`,`mayo`,`junio`,`julio`,`agosto`,`septiembre`,`octubre`,`noviembre`,`diciembre`]},defaultWidth:`wide`}),day:m8({values:{narrow:[`d`,`l`,`m`,`m`,`j`,`v`,`s`],short:[`do`,`lu`,`ma`,`mi`,`ju`,`vi`,`sá`],abbreviated:[`dom`,`lun`,`mar`,`mié`,`jue`,`vie`,`sáb`],wide:[`domingo`,`lunes`,`martes`,`miércoles`,`jueves`,`viernes`,`sábado`]},defaultWidth:`wide`}),dayPeriod:m8({values:{narrow:{am:`a`,pm:`p`,midnight:`mn`,noon:`md`,morning:`mañana`,afternoon:`tarde`,evening:`tarde`,night:`noche`},abbreviated:{am:`AM`,pm:`PM`,midnight:`medianoche`,noon:`mediodia`,morning:`mañana`,afternoon:`tarde`,evening:`tarde`,night:`noche`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`medianoche`,noon:`mediodia`,morning:`mañana`,afternoon:`tarde`,evening:`tarde`,night:`noche`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`a`,pm:`p`,midnight:`mn`,noon:`md`,morning:`de la mañana`,afternoon:`de la tarde`,evening:`de la tarde`,night:`de la noche`},abbreviated:{am:`AM`,pm:`PM`,midnight:`medianoche`,noon:`mediodia`,morning:`de la mañana`,afternoon:`de la tarde`,evening:`de la tarde`,night:`de la noche`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`medianoche`,noon:`mediodia`,morning:`de la mañana`,afternoon:`de la tarde`,evening:`de la tarde`,night:`de la noche`}},defaultFormattingWidth:`wide`})},match:{ordinalNumber:g8({matchPattern:/^(\d+)(º)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:h8({matchPatterns:{narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes de la era com[uú]n|despu[eé]s de cristo|era com[uú]n)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes de la era com[uú]n)/i,/^(despu[eé]s de cristo|era com[uú]n)/i]},defaultParseWidth:`any`}),quarter:h8({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:h8({matchPatterns:{narrow:/^[efmajsond]/i,abbreviated:/^(ene|feb|mar|abr|may|jun|jul|ago|sep|oct|nov|dic)/i,wide:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^e/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^en/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i]},defaultParseWidth:`any`}),day:h8({matchPatterns:{narrow:/^[dlmjvs]/i,short:/^(do|lu|ma|mi|ju|vi|s[áa])/i,abbreviated:/^(dom|lun|mar|mi[ée]|jue|vie|s[áa]b)/i,wide:/^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^do/i,/^lu/i,/^ma/i,/^mi/i,/^ju/i,/^vi/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:h8({matchPatterns:{narrow:/^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,any:/^([ap]\.?\s?m\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mn/i,noon:/^md/i,morning:/mañana/i,afternoon:/tarde/i,evening:/tarde/i,night:/noche/i}},defaultParseWidth:`any`})},options:{weekStartsOn:1,firstWeekContainsDate:1}},Yin={lessThanXSeconds:{one:`moins d’une seconde`,other:`moins de {{count}} secondes`},xSeconds:{one:`1 seconde`,other:`{{count}} secondes`},halfAMinute:`30 secondes`,lessThanXMinutes:{one:`moins d’une minute`,other:`moins de {{count}} minutes`},xMinutes:{one:`1 minute`,other:`{{count}} minutes`},aboutXHours:{one:`environ 1 heure`,other:`environ {{count}} heures`},xHours:{one:`1 heure`,other:`{{count}} heures`},xDays:{one:`1 jour`,other:`{{count}} jours`},aboutXWeeks:{one:`environ 1 semaine`,other:`environ {{count}} semaines`},xWeeks:{one:`1 semaine`,other:`{{count}} semaines`},aboutXMonths:{one:`environ 1 mois`,other:`environ {{count}} mois`},xMonths:{one:`1 mois`,other:`{{count}} mois`},aboutXYears:{one:`environ 1 an`,other:`environ {{count}} ans`},xYears:{one:`1 an`,other:`{{count}} ans`},overXYears:{one:`plus d’un an`,other:`plus de {{count}} ans`},almostXYears:{one:`presqu’un an`,other:`presque {{count}} ans`}},Xin=(e,t,n)=>{let r,i=Yin[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,String(t)),n?.addSuffix?n.comparison&&n.comparison>0?`dans `+r:`il y a `+r:r},Zin={date:p8({formats:{full:`EEEE d MMMM y`,long:`d MMMM y`,medium:`d MMM y`,short:`dd/MM/y`},defaultWidth:`full`}),time:p8({formats:{full:`HH:mm:ss zzzz`,long:`HH:mm:ss z`,medium:`HH:mm:ss`,short:`HH:mm`},defaultWidth:`full`}),dateTime:p8({formats:{full:`{{date}} 'à' {{time}}`,long:`{{date}} 'à' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},Qin={lastWeek:`eeee 'dernier à' p`,yesterday:`'hier à' p`,today:`'aujourd’hui à' p`,tomorrow:`'demain à' p'`,nextWeek:`eeee 'prochain à' p`,other:`P`},$in=(e,t,n,r)=>Qin[e],ean={narrow:[`av. J.-C`,`ap. J.-C`],abbreviated:[`av. J.-C`,`ap. J.-C`],wide:[`avant Jésus-Christ`,`après Jésus-Christ`]},tan={narrow:[`T1`,`T2`,`T3`,`T4`],abbreviated:[`1er trim.`,`2ème trim.`,`3ème trim.`,`4ème trim.`],wide:[`1er trimestre`,`2ème trimestre`,`3ème trimestre`,`4ème trimestre`]},nan={narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`janv.`,`févr.`,`mars`,`avr.`,`mai`,`juin`,`juil.`,`août`,`sept.`,`oct.`,`nov.`,`déc.`],wide:[`janvier`,`février`,`mars`,`avril`,`mai`,`juin`,`juillet`,`août`,`septembre`,`octobre`,`novembre`,`décembre`]},ran={narrow:[`D`,`L`,`M`,`M`,`J`,`V`,`S`],short:[`di`,`lu`,`ma`,`me`,`je`,`ve`,`sa`],abbreviated:[`dim.`,`lun.`,`mar.`,`mer.`,`jeu.`,`ven.`,`sam.`],wide:[`dimanche`,`lundi`,`mardi`,`mercredi`,`jeudi`,`vendredi`,`samedi`]},ian={narrow:{am:`AM`,pm:`PM`,midnight:`minuit`,noon:`midi`,morning:`mat.`,afternoon:`ap.m.`,evening:`soir`,night:`mat.`},abbreviated:{am:`AM`,pm:`PM`,midnight:`minuit`,noon:`midi`,morning:`matin`,afternoon:`après-midi`,evening:`soir`,night:`matin`},wide:{am:`AM`,pm:`PM`,midnight:`minuit`,noon:`midi`,morning:`du matin`,afternoon:`de l’après-midi`,evening:`du soir`,night:`du matin`}},aan=(e,t)=>{let n=Number(e),r=t?.unit;if(n===0)return`0`;let i=[`year`,`week`,`hour`,`minute`,`second`],a;return a=n===1?r&&i.includes(r)?`ère`:`er`:`ème`,n+a},oan=[`MMM`,`MMMM`],san={code:`fr`,formatDistance:Xin,formatLong:Zin,formatRelative:$in,localize:{preprocessor:(e,t)=>e.getDate()===1||!t.some(e=>e.isToken&&oan.includes(e.value))?t:t.map(e=>e.isToken&&e.value===`do`?{isToken:!0,value:`d`}:e),ordinalNumber:aan,era:m8({values:ean,defaultWidth:`wide`}),quarter:m8({values:tan,defaultWidth:`wide`,argumentCallback:e=>e-1}),month:m8({values:nan,defaultWidth:`wide`}),day:m8({values:ran,defaultWidth:`wide`}),dayPeriod:m8({values:ian,defaultWidth:`wide`})},match:{ordinalNumber:g8({matchPattern:/^(\d+)(ième|ère|ème|er|e)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e)}),era:h8({matchPatterns:{narrow:/^(av\.J\.C|ap\.J\.C|ap\.J\.-C)/i,abbreviated:/^(av\.J\.-C|av\.J-C|apr\.J\.-C|apr\.J-C|ap\.J-C)/i,wide:/^(avant Jésus-Christ|après Jésus-Christ)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^av/i,/^ap/i]},defaultParseWidth:`any`}),quarter:h8({matchPatterns:{narrow:/^T?[1234]/i,abbreviated:/^[1234](er|ème|e)? trim\.?/i,wide:/^[1234](er|ème|e)? trimestre/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:h8({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(janv|févr|mars|avr|mai|juin|juill|juil|août|sept|oct|nov|déc)\.?/i,wide:/^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/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,/^av/i,/^ma/i,/^juin/i,/^juil/i,/^ao/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:h8({matchPatterns:{narrow:/^[lmjvsd]/i,short:/^(di|lu|ma|me|je|ve|sa)/i,abbreviated:/^(dim|lun|mar|mer|jeu|ven|sam)\.?/i,wide:/^(dimanche|lundi|mardi|mercredi|jeudi|vendredi|samedi)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^di/i,/^lu/i,/^ma/i,/^me/i,/^je/i,/^ve/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:h8({matchPatterns:{narrow:/^(a|p|minuit|midi|mat\.?|ap\.?m\.?|soir|nuit)/i,any:/^([ap]\.?\s?m\.?|du matin|de l'après[-\s]midi|du soir|de la nuit)/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^min/i,noon:/^mid/i,morning:/mat/i,afternoon:/ap/i,evening:/soir/i,night:/nuit/i}},defaultParseWidth:`any`})},options:{weekStartsOn:1,firstWeekContainsDate:4}},can={lessThanXSeconds:{one:`meno di un secondo`,other:`meno di {{count}} secondi`},xSeconds:{one:`un secondo`,other:`{{count}} secondi`},halfAMinute:`alcuni secondi`,lessThanXMinutes:{one:`meno di un minuto`,other:`meno di {{count}} minuti`},xMinutes:{one:`un minuto`,other:`{{count}} minuti`},aboutXHours:{one:`circa un'ora`,other:`circa {{count}} ore`},xHours:{one:`un'ora`,other:`{{count}} ore`},xDays:{one:`un giorno`,other:`{{count}} giorni`},aboutXWeeks:{one:`circa una settimana`,other:`circa {{count}} settimane`},xWeeks:{one:`una settimana`,other:`{{count}} settimane`},aboutXMonths:{one:`circa un mese`,other:`circa {{count}} mesi`},xMonths:{one:`un mese`,other:`{{count}} mesi`},aboutXYears:{one:`circa un anno`,other:`circa {{count}} anni`},xYears:{one:`un anno`,other:`{{count}} anni`},overXYears:{one:`più di un anno`,other:`più di {{count}} anni`},almostXYears:{one:`quasi un anno`,other:`quasi {{count}} anni`}},lan=(e,t,n)=>{let r,i=can[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`tra `+r:r+` fa`:r},uan={date:p8({formats:{full:`EEEE d MMMM y`,long:`d MMMM y`,medium:`d MMM y`,short:`dd/MM/y`},defaultWidth:`full`}),time:p8({formats:{full:`HH:mm:ss zzzz`,long:`HH:mm:ss z`,medium:`HH:mm:ss`,short:`HH:mm`},defaultWidth:`full`}),dateTime:p8({formats:{full:`{{date}} {{time}}`,long:`{{date}} {{time}}`,medium:`{{date}} {{time}}`,short:`{{date}} {{time}}`},defaultWidth:`full`})};function _8(e,...t){let n=$4.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}var dan={};function v8(){return dan}function fan(e){dan=e}function y8(e,t){let n=v8(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=e3(e,t?.in),a=i.getDay(),o=(a<r?7:0)+a-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function pan(e,t,n){let[r,i]=_8(n?.in,e,t);return+y8(r,n)==+y8(i,n)}var man=[`domenica`,`lunedì`,`martedì`,`mercoledì`,`giovedì`,`venerdì`,`sabato`];function han(e){switch(e){case 0:return`'domenica scorsa alle' p`;default:return`'`+man[e]+` scorso alle' p`}}function gan(e){return`'`+man[e]+` alle' p`}function _an(e){switch(e){case 0:return`'domenica prossima alle' p`;default:return`'`+man[e]+` prossimo alle' p`}}var van={lastWeek:(e,t,n)=>{let r=e.getDay();return pan(e,t,n)?gan(r):han(r)},yesterday:`'ieri alle' p`,today:`'oggi alle' p`,tomorrow:`'domani alle' p`,nextWeek:(e,t,n)=>{let r=e.getDay();return pan(e,t,n)?gan(r):_an(r)},other:`P`},yan={code:`it`,formatDistance:lan,formatLong:uan,formatRelative:(e,t,n,r)=>{let i=van[e];return typeof i==`function`?i(t,n,r):i},localize:{ordinalNumber:(e,t)=>{let n=Number(e);return String(n)},era:m8({values:{narrow:[`aC`,`dC`],abbreviated:[`a.C.`,`d.C.`],wide:[`avanti Cristo`,`dopo Cristo`]},defaultWidth:`wide`}),quarter:m8({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`T1`,`T2`,`T3`,`T4`],wide:[`1º trimestre`,`2º trimestre`,`3º trimestre`,`4º trimestre`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:m8({values:{narrow:[`G`,`F`,`M`,`A`,`M`,`G`,`L`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`gen`,`feb`,`mar`,`apr`,`mag`,`giu`,`lug`,`ago`,`set`,`ott`,`nov`,`dic`],wide:[`gennaio`,`febbraio`,`marzo`,`aprile`,`maggio`,`giugno`,`luglio`,`agosto`,`settembre`,`ottobre`,`novembre`,`dicembre`]},defaultWidth:`wide`}),day:m8({values:{narrow:[`D`,`L`,`M`,`M`,`G`,`V`,`S`],short:[`dom`,`lun`,`mar`,`mer`,`gio`,`ven`,`sab`],abbreviated:[`dom`,`lun`,`mar`,`mer`,`gio`,`ven`,`sab`],wide:[`domenica`,`lunedì`,`martedì`,`mercoledì`,`giovedì`,`venerdì`,`sabato`]},defaultWidth:`wide`}),dayPeriod:m8({values:{narrow:{am:`m.`,pm:`p.`,midnight:`mezzanotte`,noon:`mezzogiorno`,morning:`mattina`,afternoon:`pomeriggio`,evening:`sera`,night:`notte`},abbreviated:{am:`AM`,pm:`PM`,midnight:`mezzanotte`,noon:`mezzogiorno`,morning:`mattina`,afternoon:`pomeriggio`,evening:`sera`,night:`notte`},wide:{am:`AM`,pm:`PM`,midnight:`mezzanotte`,noon:`mezzogiorno`,morning:`mattina`,afternoon:`pomeriggio`,evening:`sera`,night:`notte`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`m.`,pm:`p.`,midnight:`mezzanotte`,noon:`mezzogiorno`,morning:`di mattina`,afternoon:`del pomeriggio`,evening:`di sera`,night:`di notte`},abbreviated:{am:`AM`,pm:`PM`,midnight:`mezzanotte`,noon:`mezzogiorno`,morning:`di mattina`,afternoon:`del pomeriggio`,evening:`di sera`,night:`di notte`},wide:{am:`AM`,pm:`PM`,midnight:`mezzanotte`,noon:`mezzogiorno`,morning:`di mattina`,afternoon:`del pomeriggio`,evening:`di sera`,night:`di notte`}},defaultFormattingWidth:`wide`})},match:{ordinalNumber:g8({matchPattern:/^(\d+)(º)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:h8({matchPatterns:{narrow:/^(aC|dC)/i,abbreviated:/^(a\.?\s?C\.?|a\.?\s?e\.?\s?v\.?|d\.?\s?C\.?|e\.?\s?v\.?)/i,wide:/^(avanti Cristo|avanti Era Volgare|dopo Cristo|Era Volgare)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^a/i,/^(d|e)/i]},defaultParseWidth:`any`}),quarter:h8({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^t[1234]/i,wide:/^[1234](º)? trimestre/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:h8({matchPatterns:{narrow:/^[gfmalsond]/i,abbreviated:/^(gen|feb|mar|apr|mag|giu|lug|ago|set|ott|nov|dic)/i,wide:/^(gennaio|febbraio|marzo|aprile|maggio|giugno|luglio|agosto|settembre|ottobre|novembre|dicembre)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^g/i,/^f/i,/^m/i,/^a/i,/^m/i,/^g/i,/^l/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ge/i,/^f/i,/^mar/i,/^ap/i,/^mag/i,/^gi/i,/^l/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:h8({matchPatterns:{narrow:/^[dlmgvs]/i,short:/^(do|lu|ma|me|gi|ve|sa)/i,abbreviated:/^(dom|lun|mar|mer|gio|ven|sab)/i,wide:/^(domenica|luned[i|ì]|marted[i|ì]|mercoled[i|ì]|gioved[i|ì]|venerd[i|ì]|sabato)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^g/i,/^v/i,/^s/i],any:[/^d/i,/^l/i,/^ma/i,/^me/i,/^g/i,/^v/i,/^s/i]},defaultParseWidth:`any`}),dayPeriod:h8({matchPatterns:{narrow:/^(a|m\.|p|mezzanotte|mezzogiorno|(di|del) (mattina|pomeriggio|sera|notte))/i,any:/^([ap]\.?\s?m\.?|mezzanotte|mezzogiorno|(di|del) (mattina|pomeriggio|sera|notte))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mezza/i,noon:/^mezzo/i,morning:/mattina/i,afternoon:/pomeriggio/i,evening:/sera/i,night:/notte/i}},defaultParseWidth:`any`})},options:{weekStartsOn:1,firstWeekContainsDate:4}},ban={lessThanXSeconds:{one:`mindre än en sekund`,other:`mindre än {{count}} sekunder`},xSeconds:{one:`en sekund`,other:`{{count}} sekunder`},halfAMinute:`en halv minut`,lessThanXMinutes:{one:`mindre än en minut`,other:`mindre än {{count}} minuter`},xMinutes:{one:`en minut`,other:`{{count}} minuter`},aboutXHours:{one:`ungefär en timme`,other:`ungefär {{count}} timmar`},xHours:{one:`en timme`,other:`{{count}} timmar`},xDays:{one:`en dag`,other:`{{count}} dagar`},aboutXWeeks:{one:`ungefär en vecka`,other:`ungefär {{count}} veckor`},xWeeks:{one:`en vecka`,other:`{{count}} veckor`},aboutXMonths:{one:`ungefär en månad`,other:`ungefär {{count}} månader`},xMonths:{one:`en månad`,other:`{{count}} månader`},aboutXYears:{one:`ungefär ett år`,other:`ungefär {{count}} år`},xYears:{one:`ett år`,other:`{{count}} år`},overXYears:{one:`över ett år`,other:`över {{count}} år`},almostXYears:{one:`nästan ett år`,other:`nästan {{count}} år`}},xan=[`noll`,`en`,`två`,`tre`,`fyra`,`fem`,`sex`,`sju`,`åtta`,`nio`,`tio`,`elva`,`tolv`],San=(e,t,n)=>{let r,i=ban[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t<13?xan[t]:String(t)),n?.addSuffix?n.comparison&&n.comparison>0?`om `+r:r+` sedan`:r},Can={date:p8({formats:{full:`EEEE d MMMM y`,long:`d MMMM y`,medium:`d MMM y`,short:`y-MM-dd`},defaultWidth:`full`}),time:p8({formats:{full:`'kl'. HH:mm:ss zzzz`,long:`HH:mm:ss z`,medium:`HH:mm:ss`,short:`HH:mm`},defaultWidth:`full`}),dateTime:p8({formats:{full:`{{date}} 'kl.' {{time}}`,long:`{{date}} 'kl.' {{time}}`,medium:`{{date}} {{time}}`,short:`{{date}} {{time}}`},defaultWidth:`full`})},wan={lastWeek:`'i' EEEE's kl.' p`,yesterday:`'igår kl.' p`,today:`'idag kl.' p`,tomorrow:`'imorgon kl.' p`,nextWeek:`EEEE 'kl.' p`,other:`P`},Tan={code:`sv`,formatDistance:San,formatLong:Can,formatRelative:(e,t,n,r)=>wan[e],localize:{ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:case 2:return n+`:a`}return n+`:e`},era:m8({values:{narrow:[`f.Kr.`,`e.Kr.`],abbreviated:[`f.Kr.`,`e.Kr.`],wide:[`före Kristus`,`efter Kristus`]},defaultWidth:`wide`}),quarter:m8({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1:a kvartalet`,`2:a kvartalet`,`3:e kvartalet`,`4:e kvartalet`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:m8({values:{narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`jan.`,`feb.`,`mars`,`apr.`,`maj`,`juni`,`juli`,`aug.`,`sep.`,`okt.`,`nov.`,`dec.`],wide:[`januari`,`februari`,`mars`,`april`,`maj`,`juni`,`juli`,`augusti`,`september`,`oktober`,`november`,`december`]},defaultWidth:`wide`}),day:m8({values:{narrow:[`S`,`M`,`T`,`O`,`T`,`F`,`L`],short:[`sö`,`må`,`ti`,`on`,`to`,`fr`,`lö`],abbreviated:[`sön`,`mån`,`tis`,`ons`,`tors`,`fre`,`lör`],wide:[`söndag`,`måndag`,`tisdag`,`onsdag`,`torsdag`,`fredag`,`lördag`]},defaultWidth:`wide`}),dayPeriod:m8({values:{narrow:{am:`fm`,pm:`em`,midnight:`midnatt`,noon:`middag`,morning:`morg.`,afternoon:`efterm.`,evening:`kväll`,night:`natt`},abbreviated:{am:`f.m.`,pm:`e.m.`,midnight:`midnatt`,noon:`middag`,morning:`morgon`,afternoon:`efterm.`,evening:`kväll`,night:`natt`},wide:{am:`förmiddag`,pm:`eftermiddag`,midnight:`midnatt`,noon:`middag`,morning:`morgon`,afternoon:`eftermiddag`,evening:`kväll`,night:`natt`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`fm`,pm:`em`,midnight:`midnatt`,noon:`middag`,morning:`på morg.`,afternoon:`på efterm.`,evening:`på kvällen`,night:`på natten`},abbreviated:{am:`fm`,pm:`em`,midnight:`midnatt`,noon:`middag`,morning:`på morg.`,afternoon:`på efterm.`,evening:`på kvällen`,night:`på natten`},wide:{am:`fm`,pm:`em`,midnight:`midnatt`,noon:`middag`,morning:`på morgonen`,afternoon:`på eftermiddagen`,evening:`på kvällen`,night:`på natten`}},defaultFormattingWidth:`wide`})},match:{ordinalNumber:g8({matchPattern:/^(\d+)(:a|:e)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:h8({matchPatterns:{narrow:/^(f\.? ?Kr\.?|f\.? ?v\.? ?t\.?|e\.? ?Kr\.?|v\.? ?t\.?)/i,abbreviated:/^(f\.? ?Kr\.?|f\.? ?v\.? ?t\.?|e\.? ?Kr\.?|v\.? ?t\.?)/i,wide:/^(före Kristus|före vår tid|efter Kristus|vår tid)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^f/i,/^[ev]/i]},defaultParseWidth:`any`}),quarter:h8({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](:a|:e)? kvartalet/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:h8({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar[s]?|apr|maj|jun[i]?|jul[i]?|aug|sep|okt|nov|dec)\.?/i,wide:/^(januari|februari|mars|april|maj|juni|juli|augusti|september|oktober|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,/^maj/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:h8({matchPatterns:{narrow:/^[smtofl]/i,short:/^(sö|må|ti|on|to|fr|lö)/i,abbreviated:/^(sön|mån|tis|ons|tors|fre|lör)/i,wide:/^(söndag|måndag|tisdag|onsdag|torsdag|fredag|lördag)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^s/i,/^m/i,/^ti/i,/^o/i,/^to/i,/^f/i,/^l/i]},defaultParseWidth:`any`}),dayPeriod:h8({matchPatterns:{any:/^([fe]\.?\s?m\.?|midn(att)?|midd(ag)?|(på) (morgonen|eftermiddagen|kvällen|natten))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^f/i,pm:/^e/i,midnight:/^midn/i,noon:/^midd/i,morning:/morgon/i,afternoon:/eftermiddag/i,evening:/kväll/i,night:/natt/i}},defaultParseWidth:`any`})},options:{weekStartsOn:1,firstWeekContainsDate:4}};function Ean(e){let t={},n=v8();for(let e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e]);for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]===void 0?delete t[n]:t[n]=e[n]);fan(t)}var Dan=K9t(X.Languages,X.Languages.en);function Oan(e){let t={da:Tin,de:Fin,es:Jin,fr:san,it:yan,enGB:Hin,sv:Tan};Ean({locale:e===`en`?t.enGB:t[e]})}function kan(e){return e??Dan}function Aan(e){let{language:t,set:n}=Cq.getState();n(e),Oan(e),e!==t&&B4t.invalidateQueries({queryKey:[`foods`]})}var jan=new class extends sin{constructor(){super(`userDetails`,gin)}get(){let{id:e,country:t,language:n,email:r,name:i}=super.get();return{id:e,name:i,country:t,language:n,email:r}}async fetch(){let e=await hin();Aan(kan(e.language)),super.set(e),super.save()}migrateData(){throw Error(`[UserDetailsManager::migrateData] Purposefully not implemented.`)}},Man=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.adjustedInsulinCorrection=a,e.calculateActiveInsulin=c,e.calculateRecommendation=n,e.convertBGL=r,e.foodBolus=u,e.foodRecommendation=s,e.fractionOfInsulinStillActive=o,e.getInterval=p,e.getRecentBolusIds=l,e.getReduction=f,e.insulinStillActive=d,e.rawInsulinCorrection=i,e.roundInsulinValue=void 0;var t=E2();function n(e){let{carbohydrateRatio:n,carbohydrates:i,glucoseReading:o,insulinSensitivity:c,targetBGL:l,recentBoluses:d,activity:p}=e;if(o==null)throw Error(t.GlucoseErrors.MissingGlucoseReading);if(o.unit!==t.BloodGlucoseUnit.MMOL_L&&o.unit!==t.BloodGlucoseUnit.MG_DL)throw Error(t.GlucoseErrors.InvalidGlucoseUnit);let m=r(o.value,o.unit);if(m<t.CONSTANTS.GLUCOSE_INPUT_MIN_MMOLL||m>t.CONSTANTS.GLUCOSE_INPUT_MAX_MMOLL)throw Error(t.GlucoseErrors.OutOfRangeCurrentBGL);let h=new Date,g=p?.activitySettings?.target,_=u(i,n),{activeInsulin:v,adjustedInsulin:y,recentBolusesIds:b}=a(m,g===void 0?l:Math.max(g,l),c,d),x=_+y,S=x>t.CONSTANTS.INSULIN_DOSE_MAX;x=Math.min(x,t.CONSTANTS.INSULIN_DOSE_MAX);let C=0;if(m<3.9){let e=u(15,n);x-=e,x<0&&(C=Math.max(15,s(x+e,n)))}else{let e=s(x,n);C=Math.max(0,e)}x=Math.max(0,x);let w=p?f(p.activityDuration,p.activitySettings,p.activityIntensity,p.activityDate):null;return w&&(x*=1-w),{activeInsulin:v,activityReduction:w,bolus:x,carbRecommendation:C,recentBolusesIds:b,recommendationDate:h,wasLimited:S}}function r(e,n){if(e==null||isNaN(e))throw Error(t.GlucoseErrors.InvalidGlucoseValue);return n===t.BloodGlucoseUnit.MMOL_L?e:e*t.CONSTANTS.MMOLL_PER_MGDL_BGL}function i(e,t,n){return(e-t)/n}function a(e,t,n,r){let a=c(r),o=l(r),s=i(e,t,n);return{activeInsulin:a,adjustedInsulin:Math.max(s-a,Math.min(s,0)),recentBolusesIds:o}}function o(e){if(e<0)throw RangeError(`Parameter secondsPassed can't be negative. Found ${e}.`);return e===0?1:e<5e3?Math.cos((e+500)/5900):e<7e3?-120127e-9*e+1.197151:e<14400?.96-Math.tanh((e-2800)/6e3):0}function s(e,t){return-e*t}function c(e){return e.reduce((e,t)=>e+d(t),0)}function l(e){return e.map(e=>e.id)}function u(e,t){return e/t}function d(e){return e.insulinDose*o(e.secondsPassed)}e.roundInsulinValue=(e,n)=>{let r={[t.InjectionMethod.PenWhole]:1,[t.InjectionMethod.PenHalf]:2,[t.InjectionMethod.Pump]:10}[n];return Math.round(e*r)/r};function f(e,n,r,i){if(e<t.CONSTANTS.ACTIVITY_DURATION_MIN||e>t.CONSTANTS.ACTIVITY_DURATION_MAX)throw Error(t.ActivityErrors.OutOfRangeDuration);let a=i.getTime()+e*t.Milliseconds.Minute,o=new Date().getTime()>=a,s=p(e,(()=>{if(o)return n.post;if(r===null)throw Error(t.ActivityErrors.MissingIntensity);return n[r]})());if(s==null)throw Error(t.ActivityErrors.InvalidInterval);let c=1-s;if(c<t.CONSTANTS.ACTIVITY_REDUCTION_MIN||c>t.CONSTANTS.ACTIVITY_REDUCTION_MAX)throw Error(t.ActivityErrors.InvalidReduction);return c}function p(e,t){let{fromZero:n,fromThirty:r,fromFortysix:i,fromSixtyone:a}=t;return e<=29?n:e<=45?r:e<=60?i:a}})),Nan=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"calculateActiveInsulin",{enumerable:!0,get:function(){return t.calculateActiveInsulin}}),Object.defineProperty(e,"calculateRecommendation",{enumerable:!0,get:function(){return t.calculateRecommendation}}),Object.defineProperty(e,"getReduction",{enumerable:!0,get:function(){return t.getReduction}}),Object.defineProperty(e,"roundInsulinValue",{enumerable:!0,get:function(){return t.roundInsulinValue}});var t=Man()})),b8=Nan(),Pan=class{create=async(e,t)=>{try{e.overwrittenByUUID=void 0;let n=Ian();n.eventUpdates.push({...e,uuidOld:t}),xq.set(`event/pendingChanges`,JSON.stringify(n));let r=(e,t)=>{if(this.saveLocally(e),t!==void 0){let n=this.getByUUID(t);n.overwrittenByUUID=e.uuid,this.saveLocally(n)}};return Oq?(await this.sync(),r(e,t)):(r(e,t),q8.syncAll().catch(console.error)),!0}catch(e){return console.error(e),!1}};getActiveEvents=()=>{let e=x8(),t=[];for(let n of e){let[e,r]=n,i=this.getByUUID(e);r>Date.now()-X.Milliseconds.Minute*90-i.durationSeconds*X.Milliseconds.Second&&t.push(i)}return t};getEvents=(e,t)=>{let n=x8();if(e!==void 0){let t=e.getTime();n=n.filter(e=>e[1]>=t)}if(t!==void 0){let e=t.getTime();n=n.filter(t=>t[1]<e)}let r=[];for(let e of n)try{let t=this.getByUUID(e[0]);r.push(t)}catch(e){console.error(e)}return r};sync=async()=>{let e=Ian(),t={method:X.HTTPRequestMethod.POST,body:JSON.stringify(e),headers:{"Content-Type":`application/json`}},n=`${bq.HEDIA_SERVER_BASE_URL}/api/v2/events`,r=await d8(n,t);await T2(r,X.StatusCode.OK,n,X.HTTPRequestMethod.POST);let{lastSyncTimestamp:i,eventUpdates:a}=await r.json();for(let e of a)this.saveLocally(e);let o=Ian(),s={lastSyncTimestamp:i,eventUpdates:o.eventUpdates.filter(t=>!e.eventUpdates.map(e=>e.uuid).includes(t.uuid)),deletedEvents:o.deletedEvents.filter(t=>!e.deletedEvents.includes(t))};xq.set(`event/pendingChanges`,JSON.stringify(s))};getEventWithHighestReduction=e=>{if(!e)throw Error(`[EventManager::getEventWithHighestReduction] Cannot retrieve highest reduction without a provided setting!`);let t=this.getActiveEvents();if(!t.length)return;let n=({durationSeconds:t,activityIntensity:n,startTimestamp:r})=>{if(r===null)throw Error(`[EventManager::calculateReduction] Cannot calculate reduction without startTimestamp!`);return(0,b8.getReduction)(t/60,e,n,new Date(r))},r=t.sort((e,t)=>n(e)-n(t));return r[r.length-1]};getByUUID=e=>{let t=xq.getString(`event/${e}`);if(t===void 0)throw Error(`[EventManager::getByUUID] The requested event with UUID ${e} does not exist!`);return JSON.parse(t)};saveLocally=e=>{if(Fan(e.uuid),xq.set(`event/${e.uuid}`,JSON.stringify(e)),!e.deleted&&!e.overwrittenByUUID){let t=x8();if(e.startTimestamp===null)throw Error(`[EventManager::saveLocally] event.startTimestamp must be non-null.`);let n=new Date(e.startTimestamp).getTime();t.push([e.uuid,n]),t=t.sort((e,t)=>t[1]-e[1]),xq.set(`event/index`,JSON.stringify(t))}}},Fan=e=>{let t=x8();t=t.filter(t=>t[0]!==e),xq.set(`event/index`,JSON.stringify(t))},x8=()=>{let e=xq.getString(`event/index`);return e===void 0?[]:JSON.parse(e)},Ian=()=>{let e=xq.getString(`event/pendingChanges`);return e===void 0?{lastSyncTimestamp:new Date(0).toJSON(),eventUpdates:[],deletedEvents:[]}:JSON.parse(e)},S8=new Pan,C8=(e,t,n)=>Math.round(e*t*n/100),Lan=e=>e.source!==`packaged`,Ran=async()=>{let e=new URLSearchParams({source:`personal`,limit:`100`,sort:`title`}),t=await d8(`${bq.FOOD_BASE_URL}/api/v1/foods?${e.toString()}`,{headers:{Accept:`application/json`}});return t.ok?await t.json():(console.warn(`[listPersonalFoods] server error`),[])},zan=async e=>{let t=new URLSearchParams({source:`curated`,limit:`100`,sort:`title`});e!==void 0&&t.set(`categoryId`,e);let n=`${bq.FOOD_BASE_URL}/api/v1/foods?${t.toString()}`,r=await d8(n,{headers:{Accept:`application/json`}});return await T2(r,X.StatusCode.OK,n,X.HTTPRequestMethod.GET),r.json()},Ban=async()=>{let e=new URLSearchParams({usedWithinDays:`30`}),t=`${bq.FOOD_BASE_URL}/api/v1/foods?${e.toString()}`,n=await d8(t,{headers:{Accept:`application/json`}});return await T2(n,X.StatusCode.OK,t,X.HTTPRequestMethod.GET),(await n.json()).filter(Lan)},Van=async e=>{let t=new URLSearchParams({search:e,limit:`100`}),n=`${bq.FOOD_BASE_URL}/api/v1/foods?${t.toString()}`,r=await d8(n,{headers:{Accept:`application/json`}});return await T2(r,X.StatusCode.OK,n,X.HTTPRequestMethod.GET),(await r.json()).filter(Lan)},Han=async e=>{let t=`${bq.FOOD_BASE_URL}/api/v1/foods/${e}`,n=await d8(t,{headers:{Accept:`application/json`}});if(n.status===X.StatusCode.NOT_FOUND)return null;await T2(n,X.StatusCode.OK,t,X.HTTPRequestMethod.GET);let r=await n.json();return!Lan(r)||r.deleted?null:r},Uan=async(e,t)=>{let n=`${bq.FOOD_BASE_URL}/api/v1/foods/personal/${e}`,r=await d8(n,{method:X.HTTPRequestMethod.PATCH,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:JSON.stringify(t)});return await T2(r,X.StatusCode.OK,n,X.HTTPRequestMethod.PATCH),r.json()},Wan=async e=>{let t=`${bq.FOOD_BASE_URL}/api/v1/foods/personal/${e}`;await T2(await d8(t,{method:X.HTTPRequestMethod.DELETE}),X.StatusCode.NO_CONTENT,t,X.HTTPRequestMethod.DELETE)},Gan=async e=>{let t=`${bq.FOOD_BASE_URL}/api/v1/foods/personal`,n=await d8(t,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:JSON.stringify(e)});return await T2(n,X.StatusCode.CREATED,t,X.HTTPRequestMethod.POST),await n.json()},Kan=async e=>{let t=new URLSearchParams({language:e}),n=`${bq.FOOD_BASE_URL}/api/v1/categories?${t.toString()}`,r=await d8(n,{headers:{Accept:`application/json`}});return await T2(r,X.StatusCode.OK,n,X.HTTPRequestMethod.GET),r.json()},qan=async e=>{let t=`${bq.FOOD_BASE_URL}/api/v1/food-intakes`,n=await d8(t,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:JSON.stringify(e)});return await T2(n,X.StatusCode.CREATED,t,X.HTTPRequestMethod.POST),await n.json()},Jan=async e=>{let t=`${bq.FOOD_BASE_URL}/api/v1/food-intakes/${e}`;await T2(await d8(t,{method:X.HTTPRequestMethod.DELETE}),X.StatusCode.NO_CONTENT,t,X.HTTPRequestMethod.DELETE)},Yan=o3(X.CONSTANTS.ACTIVITY_TARGET_GLUCOSE_MIN,X.CONSTANTS.ACTIVITY_TARGET_GLUCOSE_MAX),Xan=a3(90,250),Zan=8,Qan={fromZero:1,fromThirty:.75,fromFortysix:.5,fromSixtyone:null},$an={fromZero:1,fromThirty:.5,fromFortysix:.25,fromSixtyone:null},eon={fromZero:1,fromThirty:.25,fromFortysix:null,fromSixtyone:null},ton={fromZero:1,fromThirty:.5,fromFortysix:.5,fromSixtyone:null};function w8(){return{target:Zan,light:Qan,moderate:$an,hard:eon,post:ton}}function non(){return[{startTime:`00:00`,target:8},{startTime:`05:00`,target:6},{startTime:`09:00`,target:7},{startTime:`11:00`,target:6},{startTime:`13:00`,target:7},{startTime:`18:00`,target:6},{startTime:`22:00`,target:8}]}function ron(){return{startTime:`00:00`,target:6}}function ion(){return{targetBGLIntervals:non(),overallTargetBGL:ron(),use:X.Usage.Intervals}}var aon=()=>({min:X.CONSTANTS.TARGET_GLUCOSE_MIN,max:X.CONSTANTS.TARGET_GLUCOSE_MAX}),oon=()=>({min:79,max:180}),son=`19:00`,con=1.5;function lon(){return{medicineNotification:{toggle:!1,dailyReminderTime:son},remeasurementNotification:{toggle:!0,remeasurement:con}}}var T8=new class{get=()=>{let e=xq.getString(`userSettings`),t=this.safeParse(e);return this.migrateAndClean(t)??{}};write=e=>{let t=this.migrateAndClean(e)??{};xq.set(`userSettings`,JSON.stringify(t))};getPending=()=>{let e=xq.getString(`pendingSettingsChanges`);return(this.safeParse(e)??[]).map(e=>this.migrateAndClean(e)??{})};addPending=e=>{let t=this.getPending();t.push(this.migrateAndClean(e)??{}),xq.set(`pendingSettingsChanges`,JSON.stringify(t))};removePending=e=>{let t=e.map(e=>e.uuid),n=this.getPending().filter(e=>!t.includes(e.uuid));xq.set(`pendingSettingsChanges`,JSON.stringify(n))};safeParse=e=>{if(e)try{return JSON.parse(e)}catch{return}};migrateActivitySettings=e=>{if(e.activity)for(let t of[`hard`,`moderate`,`light`,`post`])e.activity[t].fromSixtyone===void 0&&(e.activity[t].fromSixtyone=null)};migrateGenderToBiologicalSex=e=>{e.gender&&!e.biologicalSex&&(e.biologicalSex=e.gender),delete e.gender};removeEmailField=e=>{delete e.email};removeInsulinDependentField=e=>{delete e.insulinDependent};migrateBGLFields=e=>{if(!e.glucoseLevelTargets)return;let t={...e.glucoseLevelTargets};if(t.overallTargetBGL){let e={...t.overallTargetBGL};delete e.low,delete e.high,t.overallTargetBGL=e}Array.isArray(t.targetBGLIntervals)&&(t.targetBGLIntervals=t.targetBGLIntervals.map(e=>{let t={...e};return delete t.low,delete t.high,t})),e.glucoseLevelTargets=t};migrateNotificationsSettings=e=>{if(!e.notifications)return;let t={...e.notifications};t.deviceIdentifiers!==void 0&&delete t.deviceIdentifiers,e.notifications=t};migrateAndClean=e=>{if(!e)return;let t={...e};return this.migrateActivitySettings(t),this.migrateGenderToBiologicalSex(t),this.migrateBGLFields(t),this.migrateNotificationsSettings(t),this.removeEmailField(t),this.removeInsulinDependentField(t),t}};function E8(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var D8=class{_diabetesType;_biologicalSex;_heightCm;_weightKg;_birthDate;_injectionMethod;_glucoseUnit;_treatmentParameters;_glucoseLevelTargets;_fastActingInsulin;_longActingInsulin;_uuid;_activity;_notifications;_created;constructor(){let e=this.getLocalUserSettings();this.updateUserSettings(e),yrn(this)}get diabetesType(){return this._diabetesType}get biologicalSex(){return this._biologicalSex}get heightCm(){return this._heightCm}get weightKg(){return this._weightKg}get birthDate(){return this._birthDate}get injectionMethod(){return this._injectionMethod}get glucoseUnit(){return this._glucoseUnit}get treatmentParameters(){return this._treatmentParameters}get glucoseLevelTargets(){return this._glucoseLevelTargets}get fastActingInsulin(){return this._fastActingInsulin}get longActingInsulin(){return this._longActingInsulin}get uuid(){return this._uuid}get activity(){return this._activity}get notifications(){return this._notifications}get created(){return this._created}async postUserSettings(e){try{e.uuidOld=this.getLocalUserSettings().uuid,e.uuid=i3(),e.created=new Date().toJSON();let t=await this.makeSyncRequest([e]);return T8.write(t),this.updateUserSettings(t),!0}catch(e){return console.error(e),!1}}async getUserSettings(){try{let e=T8.getPending();if(e.length>0){let t=await this.makeSyncRequest(e);return T8.write(t),this.updateUserSettings(t),T8.removePending(e),t}let t=await this.makeSyncRequest();return T8.write(t),this.updateUserSettings(t),t}catch(e){return Oq&&bq.IS_PRODUCTION!==`true`&&e instanceof w2&&[X.StatusCode.UNAVAILABLE_FOR_LEGAL_REASONS,X.StatusCode.UNAUTHORIZED].includes(e.statusCode)?(console.error(`❌❌❌ [dev] Not authenticated — Login at http://localhost:7265 (hda-app) to get the token ❌❌❌`),null):(console.error(e),null)}}getLocalUserSettings(){return T8.get()}reset(){this.updateUserSettings({activity:void 0,biologicalSex:void 0,birthday:void 0,bloodGlucoseUnits:void 0,bloodKetonesUnit:void 0,created:void 0,diabetesType:void 0,fastActingInsulin:void 0,glucoseLevelTargets:void 0,height:void 0,longActingInsulin:void 0,notifications:void 0,parameters:void 0,treatmentType:void 0,uuid:void 0,uuidOld:void 0,weight:void 0})}makeSyncRequest=async e=>{let t=e?X.HTTPRequestMethod.POST:X.HTTPRequestMethod.GET,n={headers:{"Content-Type":`application/json`},body:e?JSON.stringify(e):void 0,method:t},r=`${bq.HEDIA_SERVER_BASE_URL}/api/v2/settings`,i=await d8(r,n);return await T2(i,X.StatusCode.OK,r,t),i.json()};updateUserSettings(e){this._activity=e.activity,this._biologicalSex=e.biologicalSex,this._birthDate=e.birthday,this._created=e.created,this._diabetesType=e.diabetesType,this._fastActingInsulin=e.fastActingInsulin,this._glucoseLevelTargets=e.glucoseLevelTargets,this._glucoseUnit=e.bloodGlucoseUnits,this._heightCm=e.height,this._injectionMethod=e.treatmentType,this._longActingInsulin=e.longActingInsulin,this._notifications=e.notifications,this._treatmentParameters=e.parameters,this._uuid=e.uuid,this._weightKg=e.weight}updateMockUserSettings(){if(bq.IS_PRODUCTION===`true`)throw Error(`[UserSettingsManager::updateMockUserSettings] - This method should only be used outside production environments`);this._uuid=i3(),this._treatmentParameters=O8(2,10,X.Usage.Overall),this._activity=w8(),this._notifications=lon(),this._glucoseLevelTargets=ion(),this._glucoseUnit=X.BloodGlucoseUnit.MMOL_L,this._fastActingInsulin=X.FastActingInsulin.Apidra,this._longActingInsulin=X.LongActingInsulin.Lantus,this._injectionMethod=X.InjectionMethod.Pump,this._diabetesType=X.DiabetesType.Type1,this._birthDate=`1975-12-31T23:00:00.000Z`,this._biologicalSex=X.BiologicalSex.Female,this._heightCm=170,this._weightKg=70}};E8([c6],D8.prototype,`_diabetesType`,void 0),E8([c6],D8.prototype,`_biologicalSex`,void 0),E8([c6],D8.prototype,`_heightCm`,void 0),E8([c6],D8.prototype,`_weightKg`,void 0),E8([c6],D8.prototype,`_birthDate`,void 0),E8([c6],D8.prototype,`_injectionMethod`,void 0),E8([c6],D8.prototype,`_glucoseUnit`,void 0),E8([c6],D8.prototype,`_treatmentParameters`,void 0),E8([c6],D8.prototype,`_glucoseLevelTargets`,void 0),E8([c6],D8.prototype,`_fastActingInsulin`,void 0),E8([c6],D8.prototype,`_longActingInsulin`,void 0),E8([c6],D8.prototype,`_uuid`,void 0),E8([c6],D8.prototype,`_activity`,void 0),E8([c6],D8.prototype,`_notifications`,void 0),E8([c6],D8.prototype,`_created`,void 0),E8([k6],D8.prototype,`updateUserSettings`,null),E8([k6],D8.prototype,`updateMockUserSettings`,null);function O8(e,t,n){let r={carbohydrateRatio:t,insulinSensitivity:e,startTime:`00:00`};return{overallParameters:r,parameterIntervals:[`00:00`,`05:00`,`09:00`,`11:00`,`13:00`,`18:00`,`22:00`].map(e=>({insulinSensitivity:r.insulinSensitivity,carbohydrateRatio:r.carbohydrateRatio,startTime:e})),use:n}}var k8=new D8,uon={code:`en-US`,formatDistance:Lin,formatLong:{date:p8({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:p8({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:p8({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},formatRelative:zin,localize:Bin,match:Vin,options:{weekStartsOn:0,firstWeekContainsDate:1}};function A8(e){let t=e3(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 don(e,t){let n=e3(e,t?.in);return n.setHours(0,0,0,0),n}function fon(e,t,n){let[r,i]=_8(n?.in,e,t),a=don(r),o=don(i),s=+a-A8(a),c=+o-A8(o);return Math.round((s-c)/M9t)}function pon(e,t){let n=e3(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function mon(e,t){let n=e3(e,t?.in);return fon(n,pon(n))+1}function j8(e,t){return y8(e,{...t,weekStartsOn:1})}function hon(e,t){let n=e3(e,t?.in),r=n.getFullYear(),i=$4(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);let a=j8(i),o=$4(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);let s=j8(o);return n.getTime()>=a.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function gon(e,t){let n=hon(e,t),r=$4(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),j8(r)}function _on(e,t){let n=e3(e,t?.in),r=j8(n)-+gon(n);return Math.round(r/j9t)+1}function von(e,t){let n=e3(e,t?.in),r=n.getFullYear(),i=v8(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=$4(t?.in||e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);let s=y8(o,t),c=$4(t?.in||e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);let l=y8(c,t);return+n>=+s?r+1:+n>=+l?r:r-1}function yon(e,t){let n=v8(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=von(e,t),a=$4(t?.in||e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),y8(a,t)}function bon(e,t){let n=e3(e,t?.in),r=y8(n,t)-+yon(n,t);return Math.round(r/j9t)+1}function M8(e,t){return(e<0?`-`:``)+Math.abs(e).toString().padStart(t,`0`)}var N8={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return M8(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):M8(n+1,2)},d(e,t){return M8(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 M8(e.getHours()%12||12,t.length)},H(e,t){return M8(e.getHours(),t.length)},m(e,t){return M8(e.getMinutes(),t.length)},s(e,t){return M8(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds();return M8(Math.trunc(r*10**(n-3)),t.length)}},P8={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},xon={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 N8.y(e,t)},Y:function(e,t,n,r){let i=von(e,r),a=i>0?i:1-i;return t===`YY`?M8(a%100,2):t===`Yo`?n.ordinalNumber(a,{unit:`year`}):M8(a,t.length)},R:function(e,t){return M8(hon(e),t.length)},u:function(e,t){return M8(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 M8(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 M8(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 N8.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 M8(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=bon(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):M8(i,t.length)},I:function(e,t,n){let r=_on(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):M8(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):N8.d(e,t)},D:function(e,t,n){let r=mon(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):M8(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 M8(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 M8(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 M8(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?P8.noon:r===0?P8.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?P8.evening:r>=12?P8.afternoon:r>=4?P8.morning:P8.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 N8.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):N8.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):M8(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):M8(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):N8.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):N8.s(e,t)},S:function(e,t){return N8.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return Con(r);case`XXXX`:case`XX`:return F8(r);default:return F8(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return Con(r);case`xxxx`:case`xx`:return F8(r);default:return F8(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+Son(r,`:`);default:return`GMT`+F8(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+Son(r,`:`);default:return`GMT`+F8(r,`:`)}},t:function(e,t,n){return M8(Math.trunc(e/1e3),t.length)},T:function(e,t,n){return M8(+e,t.length)}};function Son(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+M8(a,2)}function Con(e,t){return e%60==0?(e>0?`-`:`+`)+M8(Math.abs(e)/60,2):F8(e,t)}function F8(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=M8(Math.trunc(r/60),2),a=M8(r%60,2);return n+i+t+a}var won=(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`})}},Ton=(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`})}},Eon={p:Ton,P:(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return won(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}}`,won(r,t)).replace(`{{time}}`,Ton(i,t))}},Don=/^D+$/,Oon=/^Y+$/,kon=[`D`,`DD`,`YY`,`YYYY`];function Aon(e){return Don.test(e)}function jon(e){return Oon.test(e)}function Mon(e,t,n){let r=Non(e,t,n);if(console.warn(r),kon.includes(e))throw RangeError(r)}function Non(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`}function Pon(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function Fon(e){return!(!Pon(e)&&typeof e!=`number`||isNaN(+e3(e)))}var Ion=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Lon=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ron=/^'([^]*?)'?$/,zon=/''/g,Bon=/[a-zA-Z]/;function I8(e,t,n){let r=v8(),i=n?.locale??r.locale??uon,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=e3(e,n?.in);if(!Fon(s))throw RangeError(`Invalid time value`);let c=t.match(Lon).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=Eon[t];return n(e,i.formatLong)}return e}).join(``).match(Ion).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:Von(e)};if(xon[t])return{isToken:!0,value:e};if(t.match(Bon))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&&jon(a)||!n?.useAdditionalDayOfYearTokens&&Aon(a))&&Mon(a,t,String(e));let o=xon[a[0]];return o(s,a,i.localize,l)}).join(``)}function Von(e){let t=e.match(Ron);return t?t[1].replace(zon,`'`):e}var Hon=`mmol/L`,Uon=`mg/dL`,Won=[0,30],Gon=[0,540],Kon={low:3.9,high:10},qon={low:70,high:180},L8=e=>{if(e===X.BloodGlucoseUnit.MMOL_L)return{text:Hon,graphLimits:Won,inputMin:X.CONSTANTS.GLUCOSE_INPUT_MIN_MMOLL,inputMax:X.CONSTANTS.GLUCOSE_INPUT_MAX_MMOLL,decimalPlaces:1,placeholder:`-.-`,targetInterval:{low:Kon.low,high:Kon.high}};if(e===X.BloodGlucoseUnit.MG_DL)return{text:Uon,graphLimits:Gon,inputMin:20,inputMax:600,decimalPlaces:0,placeholder:`-`,targetInterval:{low:qon.low,high:qon.high}};throw Error(`[glucose::getBGConstants] Unsupported glucose unit! ${e}`)};function Jon(e,t,n){return $4(n?.in||e,+e3(e)+t)}function Yon(e,t,n){return Jon(e,t*P9t,n)}function Xon(e){return t=>{let n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function Zon(e,t){return e3(e)-+e3(t)}function Qon(e,t,n){let r=Zon(e,t)/N9t;return Xon(n?.roundingMethod)(r)}function $on(e){return e<=29?`0-29`:e<=45?`30-45`:e<=60?`46-60`:`61-120`}function esn(e,t){let n=new Date,r=Qon(t3(Yon(new Date(e),1.5),t),n),i=Math.floor(r/60),a=r%60;return i>0?`${i}${wq(`activity_card__active_hour`)} ${a}${wq(`activity_card__active_min`)}`:`${a} ${wq(`activity_card__active_min`)}`}var R8={light:()=>wq(`activity_intensity_1`),moderate:()=>wq(`activity_intensity_2`),hard:()=>wq(`activity_intensity_3`)},tsn=Hon,nsn=0,rsn=8,isn=1,asn=()=>({displayUnit:tsn,inputMin:nsn,inputMax:rsn,decimalPlaces:isn});R3t.base900,y2.noRisk,y2.lowRisk,y2.moderateRisk,y2.highRisk;function z8(e,t,n){if(t===n)return e;switch(n){case X.BloodGlucoseUnit.MG_DL:return e*X.CONSTANTS.MGDL_PER_MMOLL_BGL;case X.BloodGlucoseUnit.MMOL_L:return e*X.CONSTANTS.MMOLL_PER_MGDL_BGL;default:throw Error(`[conversionGlucose::convertBGL] Unsupported glucose unit! ${n}`)}}function osn(e,t){let{decimalPlaces:n}=L8(t);return(Math.round(e*10)/10).toFixed(n)}function B8(e,t,n){return osn(z8(e,t,n),n)}var ssn=r8t({entry_timestamp:g4([t8t(),p4()]),settings_uuid:p4(),insulin_entered_units:g4([m4(),h4()]),carbohydrates_entered_grams:g4([m4(),h4()]),blood_glucose_millimolar:g4([m4(),h4()]),blood_ketones_millimolar:g4([m4(),h4(),n8t()]),event_uuid:g4([p4(),h4(),n8t()])}),V8=V3t;`${V8.textPdf}${V8.textPdf}${V8.textPdf}${V8.textPdf}`;var csn=e=>{ssn.parse(e);let{blood_glucose_millimolar:t,carbohydrates_entered_grams:n,insulin_entered_units:r,blood_ketones_millimolar:i}=e,{inputMax:a,inputMin:o}=L8(X.BloodGlucoseUnit.MMOL_L),{inputMax:s}=asn();if(t!==null&&t>a)throw Error(`[LogbookUtils::validateLogbook] blood_glucose_millimolar is greater than ${a}`);if(t!==null&&t<o)throw Error(`[LogbookUtils::validateLogbook] blood_glucose_millimolar is less than ${o}`);if(i!==null&&i>s)throw Error(`[LogbookUtils::validateLogbook] blood_ketones_millimolar is greater than ${s}`);let c={blood_glucose_millimolar:t,carbohydrates_entered_grams:n,insulin_entered_units:r,blood_ketones_millimolar:i};function l(e){return e!==null&&e<0}if(Object.entries(c).forEach(([e,t])=>{if(l(t))throw Error(`[LogbookUtils::validateLogbook] ${e} is less than 0`)}),e.event_uuid)try{S8.getByUUID(e.event_uuid)}catch{e.event_uuid=null}return!0},lsn=e=>({...e,client_timestamp:e.client_timestamp.toISOString(),entry_timestamp:e.entry_timestamp.toISOString(),server_timestamp:e.server_timestamp?.toISOString()??null,is_deleted:e.is_deleted?.toISOString()??null}),usn=e=>({...e,client_timestamp:new Date(e.client_timestamp),entry_timestamp:new Date(e.entry_timestamp),server_timestamp:e.server_timestamp?new Date(e.server_timestamp):null,is_deleted:e.is_deleted?new Date(e.is_deleted):null}),dsn=e=>({active_insulin_source_logbook_ids:[],active_insulin:null,activity_reduction:null,blood_glucose_millimolar_sample_id:null,blood_glucose_millimolar:null,glucose_sample_source_id:null,blood_ketones_millimolar:null,carbohydrates_entered_grams:null,carbohydrates_sample_id:null,carbohydrates_input_grams:null,carbohydrates_manual_grams:null,carbohydrates_food_grams:null,food_intake_id:null,carbohydrates_overwritten_suggested_grams:null,carbohydrates_suggested_grams:null,client_timestamp:new Date,client_version:``,device_and_os:``,entry_timestamp:new Date,event_uuid:null,insulin_entered_units:null,insulin_suggested_units:null,is_bolus_calculation:!1,is_deleted:null,overwritten_by_id:null,server_timestamp:null,server_version:null,settings_uuid:``,timezone:``,utc_timezone_offset:null,uuid:``,note_id:null,...e}),fsn=new Set,psn=e=>{fsn.forEach(t=>{try{t(e)}catch(e){console.error(`[logbookEvents] listener failed`,e)}})},msn=e=>{psn({type:`created`,entry:e})},hsn=(e,t)=>{psn({type:`updated`,oldEntry:e,newEntry:t})},gsn=e=>{psn({type:`deleted`,entry:e})};V();var _sn=e=>{let t={...e};return delete t.carbohydrates_modified_suggested_grams,delete t.mood,delete t.smart_pen_sync_timestamp,t},vsn=class{constructor(){xq.delete(`logbook/unsuccessful`)}async addLogbook(e,t){let n=t?this.getLogbookByUUID(t):null;try{e.uuid=i3(),e.client_timestamp=new Date,e.client_version=c8,e.device_and_os=`${z.OS} ${z.Version}`;let r=W8();if(t)e.settings_uuid=this.getLogbookByUUID(t).settings_uuid,r.edited.push({oldUUID:t,newUUID:e.uuid}),U8(t);else{let{uuid:t}=k8;if(!t)throw Error(`[LogbookManager::addLogbook] settingsUUID must be defined`);e.settings_uuid=t}return e.utc_timezone_offset=G9t(),e.timezone=Intl.DateTimeFormat().resolvedOptions().timeZone,r.created.push(e),xq.set(`logbook/pendingChanges`,JSON.stringify(r)),H8(e),n===null?msn(e):hsn(n,e),Oq?await this.syncWeb():q8.syncAll().catch(console.error),e}catch(r){return console.error(r),Oq&&(t?(U8(e.uuid),n!==null&&H8(n),G8(e.uuid,t)):(U8(e.uuid),G8(e.uuid))),null}}deleteLogbook=async e=>{let t=this.getLogbookByUUID(e);try{t.food_intake_id&&await Jan(t.food_intake_id).catch(console.error);let n=W8();return n.deleted.push(e),xq.set(`logbook/pendingChanges`,JSON.stringify(n)),U8(e),gsn(t),Oq?await this.syncWeb():q8.syncAll().catch(console.error),!0}catch(n){return console.error(n),Oq&&(H8(t),G8(e)),!1}};syncWeb=async()=>{let e=W8(),t=e=>({method:X.HTTPRequestMethod.POST,body:JSON.stringify(e),headers:{"Content-Type":`application/json`}}),n=`${bq.HEDIA_SERVER_BASE_URL}/api/v2/logbooks`,r=await d8(n,t(e));await T2(r,X.StatusCode.OK,n,X.HTTPRequestMethod.POST);let{created:i,last_sync_timestamp:a}=await r.json();for(let e of i)H8(e);let o={last_sync_timestamp:a,created:[],deleted:[],edited:[]};xq.set(`logbook/pendingChanges`,JSON.stringify(o))};sync=async()=>{let e=W8(),{created:t,deleted:n,edited:r,last_sync_timestamp:i}=e,a=[],o=[],s=[],c=[],l=[],u=e.last_sync_timestamp,d=async e=>{let t=`${bq.HEDIA_SERVER_BASE_URL}/api/v2/logbooks`,n=await d8(t,{method:X.HTTPRequestMethod.POST,body:JSON.stringify(e),headers:{"Content-Type":`application/json`}});await T2(n,X.StatusCode.OK,t,X.HTTPRequestMethod.POST);let{created:r,deleted:i,last_sync_timestamp:a}=await n.json();c=c.concat(r),l=l.concat(i),u=a},f={created:[],deleted:[],edited:[]};!t.length&&!r.length&&!n.length&&await d({...f,last_sync_timestamp:i}).catch();for(let e of t)await d({...f,last_sync_timestamp:i,created:[e]}).catch(()=>a.push(e));for(let e of r)await d({...f,last_sync_timestamp:i,edited:[e]}).catch(()=>s.push(e));for(let e of n)await d({...f,last_sync_timestamp:i,deleted:[e]}).catch(()=>o.push(e));let p=W8(),m=t.filter(e=>!a.includes(e)).map(e=>e.uuid),h=r.filter(e=>!s.includes(e)).map(e=>e.oldUUID),g=n.filter(e=>!o.includes(e)),_={last_sync_timestamp:u,created:p.created.filter(e=>!m.includes(e.uuid)),deleted:p.deleted.filter(e=>!g.includes(e)),edited:p.edited.filter(e=>!h.includes(e.oldUUID))};xq.set(`logbook/pendingChanges`,JSON.stringify(_));for(let e of c)H8(e);for(let e of l)U8(e)};getRecentBoluses=(e=new Date(Date.now()-X.Milliseconds.Hour*4),t=new Date)=>{let n=this.getLogbooks(e,t);return n.length===0?[]:n.filter(e=>e.insulin_entered_units!==null&&e.insulin_entered_units>0).map(({insulin_entered_units:e,entry_timestamp:t,uuid:n})=>({insulinDose:e,secondsPassed:(Date.now()-new Date(t).getTime())/1e3,id:n}))};getLogbooks=(e,t)=>{let n=ysn();if(e!==void 0){let t=e.getTime();n=n.filter(e=>e[1]>=t)}if(t!==void 0){let e=t.getTime();n=n.filter(t=>t[1]<e)}let r=[];for(let[e]of n)try{let t=this.getLogbookByUUID(e);try{csn(t),r.push(t)}catch(t){console.error(t),G8(e),U8(e)}}catch(e){console.error(e)}return r};getLogbookByUUID=e=>{let t=xq.getString(`logbook/${e}`);if(!t)throw Error(`LogbookManager::getLogbookByUUID - could not find logbook in local storage`);let n=_sn(JSON.parse(t));return{...n,entry_timestamp:new Date(n.entry_timestamp),server_timestamp:n.server_timestamp?new Date(n.server_timestamp):null,client_timestamp:new Date(n.client_timestamp)}}},H8=e=>{let{uuid:t}=e;if(!t)throw Error(`[LogbookManager::saveLocally] uuid must be defined`);U8(t);let n=ysn();n.push([t,new Date(e.entry_timestamp).getTime()]),n.sort((e,t)=>t[1]-e[1]),xq.set(`logbook/index`,JSON.stringify(n)),xq.set(`logbook/${e.uuid}`,JSON.stringify(e))},U8=e=>{let t=ysn().filter(([t])=>t!==e);xq.set(`logbook/index`,JSON.stringify(t)),xq.delete(`logbook/${e}`)},W8=()=>{let e=xq.getString(`logbook/pendingChanges`);if(!e)return{last_sync_timestamp:new Date(0).toISOString(),created:[],edited:[],deleted:[]};let t=JSON.parse(e);return{...t,created:t.created.map(e=>_sn(e))}},G8=(e,t)=>{let{created:n,deleted:r,edited:i,last_sync_timestamp:a}=W8(),o={last_sync_timestamp:a,created:[...n].filter(({uuid:t})=>t!==e),edited:[...i].filter(({oldUUID:n,newUUID:r})=>n!==t&&r!==e),deleted:[...r].filter(t=>t!==e)};xq.set(`logbook/pendingChanges`,JSON.stringify(o))},ysn=()=>{let e=xq.getString(`logbook/index`);return e===void 0?[]:JSON.parse(e)},K8=new vsn,q8=new class{currentIsConnected=null;isSynchronizing=!1;isListenerAttached=!1;constructor(){this.setListener()}syncAll=async()=>{let e=!Oq&&!E3.getState().accessToken;if(!(this.isSynchronizing||e))try{this.isSynchronizing=!0,await k8.getUserSettings().catch(console.error),await S8.sync().catch(console.error),await K8.sync().catch(console.error),await jan.fetch().catch(console.error)}finally{this.isSynchronizing=!1}};handleConnectivity=async({isConnected:e,isInternetReachable:t})=>{this.currentIsConnected!==(e&&t)&&(this.currentIsConnected=e&&t,this.currentIsConnected&&await this.syncAll())};setListener=()=>{!this.isListenerAttached&&!Oq&&(Oen.addEventListener(this.handleConnectivity),this.isListenerAttached=!0)}};V();var{add:bsn,multiply:xsn}=lf;function J8(e,t,n){return bsn(xsn(e,t),xsn(e.interpolate({inputRange:[0,1],outputRange:[1,0]}),n))}V();var{add:Ssn,multiply:Y8}=lf;function Csn({current:e,next:t,inverted:n,layouts:{screen:r}}){let i=Y8(e.progress.interpolate({inputRange:[0,1],outputRange:[r.width,0],extrapolate:`clamp`}),n),a=t?Y8(t.progress.interpolate({inputRange:[0,1],outputRange:[0,r.width*-.3],extrapolate:`clamp`}),n):0,o=e.progress.interpolate({inputRange:[0,1],outputRange:[0,.07],extrapolate:`clamp`}),s=e.progress.interpolate({inputRange:[0,1],outputRange:[0,.3],extrapolate:`clamp`});return{cardStyle:{transform:[{translateX:i},{translateX:a}]},overlayStyle:{opacity:o},shadowStyle:{shadowOpacity:s}}}function wsn({inverted:e,...t}){return Csn({...t,inverted:lf.multiply(e,-1)})}function Tsn({current:e,inverted:t,layouts:{screen:n}}){return{cardStyle:{transform:[{translateY:Y8(e.progress.interpolate({inputRange:[0,1],outputRange:[n.height,0],extrapolate:`clamp`}),t)}]}}}function Esn({index:e,current:t,next:n,inverted:r,layouts:{screen:i},insets:a}){let o=z.OS===`ios`&&!z.isPad&&!z.isTV&&a.top>20,s=i.width>i.height,c=s?0:10,l=a.top,u=i.height/i.width,d=Ssn(t.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:`clamp`}),n?n.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:`clamp`}):0),f=e===0,p=Y8(d.interpolate({inputRange:[0,1,2],outputRange:[i.height,f?0:c,(f?l:0)-c*u]}),r),m=d.interpolate({inputRange:[0,1,1.0001,2],outputRange:[0,.3,1,1]}),h=s?1:d.interpolate({inputRange:[0,1,2],outputRange:[1,1,i.width?1-c*2/i.width:1]}),g=s?0:f?d.interpolate({inputRange:[0,1,1.0001,2],outputRange:[0,0,o?38:0,10]}):10;return{cardStyle:{overflow:`hidden`,borderCurve:`continuous`,borderTopLeftRadius:g,borderTopRightRadius:g,borderBottomLeftRadius:o?g:0,borderBottomRightRadius:o?g:0,marginTop:f?0:l,marginBottom:f?0:c,transform:[{translateY:p},{scale:h}]},overlayStyle:{opacity:m}}}function Dsn({current:e,inverted:t,layouts:{screen:n},closing:r}){let i=Y8(e.progress.interpolate({inputRange:[0,1],outputRange:[n.height*.08,0],extrapolate:`clamp`}),t);return{cardStyle:{opacity:J8(r,e.progress,e.progress.interpolate({inputRange:[0,.5,.9,1],outputRange:[0,.25,.7,1],extrapolate:`clamp`})),transform:[{translateY:i}]}}}function Osn({current:e,next:t,inverted:n,layouts:{screen:r}}){let i=Y8(e.progress.interpolate({inputRange:[0,1],outputRange:[r.height,0],extrapolate:`clamp`}),n),a=Y8(e.progress.interpolate({inputRange:[0,1],outputRange:[r.height*(95.9/100)*-1,0],extrapolate:`clamp`}),n),o=t?Y8(t.progress.interpolate({inputRange:[0,1],outputRange:[0,r.height*(2/100)*-1],extrapolate:`clamp`}),n):0,s=e.progress.interpolate({inputRange:[0,.36,1],outputRange:[0,.1,.1],extrapolate:`clamp`});return{containerStyle:{overflow:`hidden`,transform:[{translateY:i}]},cardStyle:{transform:[{translateY:a},{translateY:o}]},overlayStyle:{opacity:s}}}function ksn({current:e,next:t,closing:n}){let r=Ssn(e.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:`clamp`}),t?t.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:`clamp`}):0);return{cardStyle:{opacity:r.interpolate({inputRange:[0,.75,.875,1,1.0825,1.2075,2],outputRange:[0,0,1,1,1,1,0]}),transform:[{scale:J8(n,e.progress.interpolate({inputRange:[0,1],outputRange:[.925,1],extrapolate:`clamp`}),r.interpolate({inputRange:[0,1,2],outputRange:[.85,1,1.075]}))}]}}}function Asn({current:e,next:t,inverted:n,closing:r}){let i=Y8(e.progress.interpolate({inputRange:[0,1],outputRange:[96,0],extrapolate:`clamp`}),n),a=t?Y8(t.progress.interpolate({inputRange:[0,1],outputRange:[0,-96],extrapolate:`clamp`}),n):0;return{cardStyle:{opacity:J8(r,e.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:`clamp`}),e.progress),transform:[{translateX:i},{translateX:a}]}}}function jsn({current:e,inverted:t,layouts:{screen:n},closing:r}){let i=Y8(e.progress.interpolate({inputRange:[0,1],outputRange:[n.height*.8,0],extrapolate:`clamp`}),t),a=J8(r,e.progress,e.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:`clamp`})),o=e.progress.interpolate({inputRange:[0,1],outputRange:[0,.3],extrapolate:`clamp`});return{cardStyle:{opacity:a,transform:[{translateY:i}]},overlayStyle:{opacity:o}}}function Msn({current:{progress:e}}){return{cardStyle:{opacity:e.interpolate({inputRange:[0,.5,.9,1],outputRange:[0,.25,.7,1]})},overlayStyle:{opacity:e.interpolate({inputRange:[0,1],outputRange:[0,.5],extrapolate:`clamp`})}}}function Nsn(){return{}}V();var{add:X8,multiply:Psn}=lf;function Z8({current:e,next:t}){let n=X8(e.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:`clamp`}),t?t.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:`clamp`}):0),r=n.interpolate({inputRange:[0,1,2],outputRange:[0,1,0]});return{leftButtonStyle:{opacity:r},rightButtonStyle:{opacity:r},titleStyle:{opacity:r},backgroundStyle:{opacity:n.interpolate({inputRange:[0,1,1.9,2],outputRange:[0,1,1,0]})}}}function Fsn({current:e,next:t,direction:n,layouts:{screen:r}}){let i=n===`rtl`,a=[{translateX:X8(e.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:`clamp`}),t?t.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:`clamp`}):0).interpolate({inputRange:[0,1,2],outputRange:i?[-r.width,0,r.width]:[r.width,0,-r.width]})}];return{leftButtonStyle:{transform:a},rightButtonStyle:{transform:a},titleStyle:{transform:a},backgroundStyle:{transform:a}}}function Isn({current:e,next:t,direction:n,layouts:{screen:r}}){let i=n===`rtl`,a=[{translateX:X8(e.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:`clamp`}),t?t.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:`clamp`}):0).interpolate({inputRange:[0,1,2],outputRange:i?[r.width,0,-r.width]:[-r.width,0,r.width]})}];return{leftButtonStyle:{transform:a},rightButtonStyle:{transform:a},titleStyle:{transform:a},backgroundStyle:{transform:a}}}function Lsn({current:e,next:t,layouts:{header:n}}){let r=[{translateY:X8(e.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:`clamp`}),t?t.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:`clamp`}):0).interpolate({inputRange:[0,1,2],outputRange:[-n.height,0,-n.height]})}];return{leftButtonStyle:{transform:r},rightButtonStyle:{transform:r},titleStyle:{transform:r},backgroundStyle:{transform:r}}}function Rsn(){return{}}V();var Q8={animation:`spring`,config:{stiffness:1e3,damping:500,mass:3,overshootClamping:!0,restDisplacementThreshold:10,restSpeedThreshold:10}},zsn={animation:`timing`,config:{duration:350,easing:ef.out(ef.poly(5))}},Bsn={animation:`timing`,config:{duration:150,easing:ef.in(ef.linear)}},Vsn={animation:`timing`,config:{duration:425,easing:ef.bezier(.20833,.82,.25,1)}},Hsn={animation:`timing`,config:{duration:400,easing:ef.bezier(.20833,.82,.25,1)}};ef.bezier(.20833,.82,.25,1),ef.bezier(.20833,.82,.25,1);var Usn={animation:`timing`,config:{duration:250,easing:e=>Math.cos((e+1)*Math.PI)/2+.5}},Wsn={animation:`timing`,config:{duration:200,easing:e=>e===1?1:e**2}};V();var Gsn=28,Ksn=29,qsn=34,$8={gestureDirection:`horizontal`,transitionSpec:{open:Q8,close:Q8},cardStyleInterpolator:Csn,headerStyleInterpolator:Z8},Jsn={gestureDirection:`vertical`,transitionSpec:{open:Q8,close:Q8},cardStyleInterpolator:Tsn,headerStyleInterpolator:Z8},Ysn={gestureDirection:`vertical`,transitionSpec:{open:Q8,close:Q8},cardStyleInterpolator:Esn,headerStyleInterpolator:Z8},Xsn={gestureDirection:`vertical`,transitionSpec:{open:zsn,close:Bsn},cardStyleInterpolator:Dsn,headerStyleInterpolator:Z8},Zsn={gestureDirection:`vertical`,transitionSpec:{open:Vsn,close:Vsn},cardStyleInterpolator:Osn,headerStyleInterpolator:Z8},Qsn={gestureDirection:`horizontal`,transitionSpec:{open:Hsn,close:Hsn},cardStyleInterpolator:ksn,headerStyleInterpolator:Z8},$sn={gestureDirection:`horizontal`,transitionSpec:{open:zsn,close:Bsn},cardStyleInterpolator:Asn,headerStyleInterpolator:Z8},ecn={gestureDirection:`vertical`,transitionSpec:{open:Usn,close:Wsn},cardStyleInterpolator:jsn,headerStyleInterpolator:Z8},tcn={gestureDirection:`vertical`,transitionSpec:{open:Usn,close:Wsn},cardStyleInterpolator:Msn,headerStyleInterpolator:Z8},e5=z.select({ios:$8,android:Number(z.Version)>=qsn?$sn:Number(z.Version)>=Ksn?Qsn:Number(z.Version)>=Gsn?Zsn:Xsn,default:Qsn}),ncn=z.select({ios:Ysn,default:ecn}),rcn={...$8,cardStyleInterpolator:wsn},icn=`/assets/png/back-icon.png`,acn=`/assets/png/back-icon-mask.png`,ocn=`/assets/png/clear-icon.png`,scn=`/assets/png/close-icon.png`,ccn=`/assets/png/search-icon.png`,lcn=s(((e,t)=>{t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}})),ucn=s(((e,t)=>{t.exports=function(e){return!e||typeof e==`string`?!1:e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&e.constructor.name!==`String`)}})),dcn=s(((e,t)=>{var n=ucn(),r=Array.prototype.concat,i=Array.prototype.slice,a=t.exports=function(e){for(var t=[],a=0,o=e.length;a<o;a++){var s=e[a];n(s)?t=r.call(t,i.call(s)):t.push(s)}return t};a.wrap=function(e){return function(){return e(a(arguments))}}})),fcn=s(((e,t)=>{var n=lcn(),r=dcn(),i=Object.hasOwnProperty,a=Object.create(null);for(var o in n)i.call(n,o)&&(a[n[o]]=o);var s=t.exports={to:{},get:{}};s.get=function(e){var t=e.substring(0,3).toLowerCase(),n,r;switch(t){case`hsl`:n=s.get.hsl(e),r=`hsl`;break;case`hwb`:n=s.get.hwb(e),r=`hwb`;break;default:n=s.get.rgb(e),r=`rgb`;break}return n?{model:r,value:n}:null},s.get.rgb=function(e){if(!e)return null;var t=/^#([a-f0-9]{3,4})$/i,r=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,a=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,o=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,s=/^(\w+)$/,l=[0,0,0,1],u,d,f;if(u=e.match(r)){for(f=u[2],u=u[1],d=0;d<3;d++){var p=d*2;l[d]=parseInt(u.slice(p,p+2),16)}f&&(l[3]=parseInt(f,16)/255)}else if(u=e.match(t)){for(u=u[1],f=u[3],d=0;d<3;d++)l[d]=parseInt(u[d]+u[d],16);f&&(l[3]=parseInt(f+f,16)/255)}else if(u=e.match(a)){for(d=0;d<3;d++)l[d]=parseInt(u[d+1],0);u[4]&&(u[5]?l[3]=parseFloat(u[4])*.01:l[3]=parseFloat(u[4]))}else if(u=e.match(o)){for(d=0;d<3;d++)l[d]=Math.round(parseFloat(u[d+1])*2.55);u[4]&&(u[5]?l[3]=parseFloat(u[4])*.01:l[3]=parseFloat(u[4]))}else if(u=e.match(s))return u[1]===`transparent`?[0,0,0,0]:i.call(n,u[1])?(l=n[u[1]],l[3]=1,l):null;else return null;for(d=0;d<3;d++)l[d]=c(l[d],0,255);return l[3]=c(l[3],0,1),l},s.get.hsl=function(e){if(!e)return null;var t=e.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){var n=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,c(parseFloat(t[2]),0,100),c(parseFloat(t[3]),0,100),c(isNaN(n)?1:n,0,1)]}return null},s.get.hwb=function(e){if(!e)return null;var t=e.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){var n=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,c(parseFloat(t[2]),0,100),c(parseFloat(t[3]),0,100),c(isNaN(n)?1:n,0,1)]}return null},s.to.hex=function(){var e=r(arguments);return`#`+l(e[0])+l(e[1])+l(e[2])+(e[3]<1?l(Math.round(e[3]*255)):``)},s.to.rgb=function(){var e=r(arguments);return e.length<4||e[3]===1?`rgb(`+Math.round(e[0])+`, `+Math.round(e[1])+`, `+Math.round(e[2])+`)`:`rgba(`+Math.round(e[0])+`, `+Math.round(e[1])+`, `+Math.round(e[2])+`, `+e[3]+`)`},s.to.rgb.percent=function(){var e=r(arguments),t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),i=Math.round(e[2]/255*100);return e.length<4||e[3]===1?`rgb(`+t+`%, `+n+`%, `+i+`%)`:`rgba(`+t+`%, `+n+`%, `+i+`%, `+e[3]+`)`},s.to.hsl=function(){var e=r(arguments);return e.length<4||e[3]===1?`hsl(`+e[0]+`, `+e[1]+`%, `+e[2]+`%)`:`hsla(`+e[0]+`, `+e[1]+`%, `+e[2]+`%, `+e[3]+`)`},s.to.hwb=function(){var e=r(arguments),t=``;return e.length>=4&&e[3]!==1&&(t=`, `+e[3]),`hwb(`+e[0]+`, `+e[1]+`%, `+e[2]+`%`+t+`)`},s.to.keyword=function(e){return a[e.slice(0,3)]};function c(e,t,n){return Math.min(Math.max(t,e),n)}function l(e){var t=Math.round(e).toString(16).toUpperCase();return t.length<2?`0`+t:t}})),pcn=s(((e,t)=>{var n=lcn(),r={};for(let e of Object.keys(n))r[n[e]]=e;var i={rgb:{channels:3,labels:`rgb`},hsl:{channels:3,labels:`hsl`},hsv:{channels:3,labels:`hsv`},hwb:{channels:3,labels:`hwb`},cmyk:{channels:4,labels:`cmyk`},xyz:{channels:3,labels:`xyz`},lab:{channels:3,labels:`lab`},lch:{channels:3,labels:`lch`},hex:{channels:1,labels:[`hex`]},keyword:{channels:1,labels:[`keyword`]},ansi16:{channels:1,labels:[`ansi16`]},ansi256:{channels:1,labels:[`ansi256`]},hcg:{channels:3,labels:[`h`,`c`,`g`]},apple:{channels:3,labels:[`r16`,`g16`,`b16`]},gray:{channels:1,labels:[`gray`]}};t.exports=i;for(let e of Object.keys(i)){if(!(`channels`in i[e]))throw Error(`missing channels property: `+e);if(!(`labels`in i[e]))throw Error(`missing channel labels property: `+e);if(i[e].labels.length!==i[e].channels)throw Error(`channel and label counts mismatch: `+e);let{channels:t,labels:n}=i[e];delete i[e].channels,delete i[e].labels,Object.defineProperty(i[e],"channels",{value:t}),Object.defineProperty(i[e],"labels",{value:n})}i.rgb.hsl=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=a-i,s,c;a===i?s=0:t===a?s=(n-r)/o:n===a?s=2+(r-t)/o:r===a&&(s=4+(t-n)/o),s=Math.min(s*60,360),s<0&&(s+=360);let l=(i+a)/2;return c=a===i?0:l<=.5?o/(a+i):o/(2-a-i),[s,c*100,l*100]},i.rgb.hsv=function(e){let t,n,r,i,a,o=e[0]/255,s=e[1]/255,c=e[2]/255,l=Math.max(o,s,c),u=l-Math.min(o,s,c),d=function(e){return(l-e)/6/u+1/2};return u===0?(i=0,a=0):(a=u/l,t=d(o),n=d(s),r=d(c),o===l?i=r-n:s===l?i=1/3+t-r:c===l&&(i=2/3+n-t),i<0?i+=1:i>1&&--i),[i*360,a*100,l*100]},i.rgb.hwb=function(e){let t=e[0],n=e[1],r=e[2],a=i.rgb.hsl(e)[0],o=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[a,o*100,r*100]},i.rgb.cmyk=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(1-t,1-n,1-r),a=(1-t-i)/(1-i)||0,o=(1-n-i)/(1-i)||0,s=(1-r-i)/(1-i)||0;return[a*100,o*100,s*100,i*100]};function a(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}i.rgb.keyword=function(e){let t=r[e];if(t)return t;let i=1/0,o;for(let t of Object.keys(n)){let r=n[t],s=a(e,r);s<i&&(i=s,o=t)}return o},i.keyword.rgb=function(e){return n[e]},i.rgb.xyz=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;let i=t*.4124+n*.3576+r*.1805,a=t*.2126+n*.7152+r*.0722,o=t*.0193+n*.1192+r*.9505;return[i*100,a*100,o*100]},i.rgb.lab=function(e){let t=i.rgb.xyz(e),n=t[0],r=t[1],a=t[2];return n/=95.047,r/=100,a/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,a=a>.008856?a**(1/3):7.787*a+16/116,[116*r-16,500*(n-r),200*(r-a)]},i.hsl.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100,i,a,o;if(n===0)return o=r*255,[o,o,o];i=r<.5?r*(1+n):r+n-r*n;let s=2*r-i,c=[0,0,0];for(let e=0;e<3;e++)a=t+1/3*-(e-1),a<0&&a++,a>1&&a--,o=6*a<1?s+(i-s)*6*a:2*a<1?i:3*a<2?s+(i-s)*(2/3-a)*6:s,c[e]=o*255;return c},i.hsl.hsv=function(e){let t=e[0],n=e[1]/100,r=e[2]/100,i=n,a=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,i*=a<=1?a:2-a;let o=(r+n)/2;return[t,(r===0?2*i/(a+i):2*n/(r+n))*100,o*100]},i.hsv.rgb=function(e){let t=e[0]/60,n=e[1]/100,r=e[2]/100,i=Math.floor(t)%6,a=t-Math.floor(t),o=255*r*(1-n),s=255*r*(1-n*a),c=255*r*(1-n*(1-a));switch(r*=255,i){case 0:return[r,c,o];case 1:return[s,r,o];case 2:return[o,r,c];case 3:return[o,s,r];case 4:return[c,o,r];case 5:return[r,o,s]}},i.hsv.hsl=function(e){let t=e[0],n=e[1]/100,r=e[2]/100,i=Math.max(r,.01),a,o;o=(2-n)*r;let s=(2-n)*i;return a=n*i,a/=s<=1?s:2-s,a||=0,o/=2,[t,a*100,o*100]},i.hwb.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100,i=n+r,a;i>1&&(n/=i,r/=i);let o=Math.floor(6*t),s=1-r;a=6*t-o,o&1&&(a=1-a);let c=n+a*(s-n),l,u,d;switch(o){default:case 6:case 0:l=s,u=c,d=n;break;case 1:l=c,u=s,d=n;break;case 2:l=n,u=s,d=c;break;case 3:l=n,u=c,d=s;break;case 4:l=c,u=n,d=s;break;case 5:l=s,u=n,d=c;break}return[l*255,u*255,d*255]},i.cmyk.rgb=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i=e[3]/100,a=1-Math.min(1,t*(1-i)+i),o=1-Math.min(1,n*(1-i)+i),s=1-Math.min(1,r*(1-i)+i);return[a*255,o*255,s*255]},i.xyz.rgb=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i,a,o;return i=t*3.2406+n*-1.5372+r*-.4986,a=t*-.9689+n*1.8758+r*.0415,o=t*.0557+n*-.204+r*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,i=Math.min(Math.max(0,i),1),a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),[i*255,a*255,o*255]},i.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];return t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,[116*n-16,500*(t-n),200*(n-r)]},i.lab.xyz=function(e){let t=e[0],n=e[1],r=e[2],i,a,o;a=(t+16)/116,i=n/500+a,o=a-r/200;let s=a**3,c=i**3,l=o**3;return a=s>.008856?s:(a-16/116)/7.787,i=c>.008856?c:(i-16/116)/7.787,o=l>.008856?l:(o-16/116)/7.787,i*=95.047,a*=100,o*=108.883,[i,a,o]},i.lab.lch=function(e){let t=e[0],n=e[1],r=e[2],i;return i=Math.atan2(r,n)*360/2/Math.PI,i<0&&(i+=360),[t,Math.sqrt(n*n+r*r),i]},i.lch.lab=function(e){let t=e[0],n=e[1],r=e[2]/360*2*Math.PI;return[t,n*Math.cos(r),n*Math.sin(r)]},i.rgb.ansi16=function(e,t=null){let[n,r,a]=e,o=t===null?i.rgb.hsv(e)[2]:t;if(o=Math.round(o/50),o===0)return 30;let s=30+(Math.round(a/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return o===2&&(s+=60),s},i.hsv.ansi16=function(e){return i.rgb.ansi16(i.hsv.rgb(e),e[2])},i.rgb.ansi256=function(e){let t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},i.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];let n=(~~(e>50)+1)*.5;return[(t&1)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},i.ansi256.rgb=function(e){if(e>=232){let t=(e-232)*10+8;return[t,t,t]}e-=16;let t;return[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},i.rgb.hex=function(e){let t=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return`000000`.substring(t.length)+t},i.hex.rgb=function(e){let t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];t[0].length===3&&(n=n.split(``).map(e=>e+e).join(``));let r=parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},i.rgb.hcg=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.max(Math.max(t,n),r),a=Math.min(Math.min(t,n),r),o=i-a,s,c;return s=o<1?a/(1-o):0,c=o<=0?0:i===t?(n-r)/o%6:i===n?2+(r-t)/o:4+(t-n)/o,c/=6,c%=1,[c*360,o*100,s*100]},i.hsl.hcg=function(e){let t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n),i=0;return r<1&&(i=(n-.5*r)/(1-r)),[e[0],r*100,i*100]},i.hsv.hcg=function(e){let t=e[1]/100,n=e[2]/100,r=t*n,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],r*100,i*100]},i.hcg.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100;if(n===0)return[r*255,r*255,r*255];let i=[0,0,0],a=t%1*6,o=a%1,s=1-o,c=0;switch(Math.floor(a)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=s,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=s,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=s}return c=(1-n)*r,[(n*i[0]+c)*255,(n*i[1]+c)*255,(n*i[2]+c)*255]},i.hcg.hsv=function(e){let t=e[1]/100,n=t+e[2]/100*(1-t),r=0;return n>0&&(r=t/n),[e[0],r*100,n*100]},i.hcg.hsl=function(e){let t=e[1]/100,n=e[2]/100*(1-t)+.5*t,r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],r*100,n*100]},i.hcg.hwb=function(e){let t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],(n-t)*100,(1-n)*100]},i.hwb.hcg=function(e){let t=e[1]/100,n=1-e[2]/100,r=n-t,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],r*100,i*100]},i.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},i.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},i.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},i.gray.hsl=function(e){return[0,0,e[0]]},i.gray.hsv=i.gray.hsl,i.gray.hwb=function(e){return[0,100,e[0]]},i.gray.cmyk=function(e){return[0,0,0,e[0]]},i.gray.lab=function(e){return[e[0],0,0]},i.gray.hex=function(e){let t=Math.round(e[0]/100*255)&255,n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return`000000`.substring(n.length)+n},i.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}})),mcn=s(((e,t)=>{var n=pcn();function r(){let e={},t=Object.keys(n);for(let n=t.length,r=0;r<n;r++)e[t[r]]={distance:-1,parent:null};return e}function i(e){let t=r(),i=[e];for(t[e].distance=0;i.length;){let e=i.pop(),r=Object.keys(n[e]);for(let n=r.length,a=0;a<n;a++){let n=r[a],o=t[n];o.distance===-1&&(o.distance=t[e].distance+1,o.parent=e,i.unshift(n))}}return t}function a(e,t){return function(n){return t(e(n))}}function o(e,t){let r=[t[e].parent,e],i=n[t[e].parent][e],o=t[e].parent;for(;t[o].parent;)r.unshift(t[o].parent),i=a(n[t[o].parent][o],i),o=t[o].parent;return i.conversion=r,i}t.exports=function(e){let t=i(e),n={},r=Object.keys(t);for(let e=r.length,i=0;i<e;i++){let e=r[i];t[e].parent!==null&&(n[e]=o(e,t))}return n}})),hcn=s(((e,t)=>{var n=pcn(),r=mcn(),i={},a=Object.keys(n);function o(e){let t=function(...t){let n=t[0];return n==null?n:(n.length>1&&(t=n),e(t))};return`conversion`in e&&(t.conversion=e.conversion),t}function s(e){let t=function(...t){let n=t[0];if(n==null)return n;n.length>1&&(t=n);let r=e(t);if(typeof r==`object`)for(let e=r.length,t=0;t<e;t++)r[t]=Math.round(r[t]);return r};return`conversion`in e&&(t.conversion=e.conversion),t}a.forEach(e=>{i[e]={},Object.defineProperty(i[e],"channels",{value:n[e].channels}),Object.defineProperty(i[e],"labels",{value:n[e].labels});let t=r(e);Object.keys(t).forEach(n=>{let r=t[n];i[e][n]=s(r),i[e][n].raw=o(r)})}),t.exports=i})),gcn=s(((e,t)=>{var n=fcn(),r=hcn(),i=[`keyword`,`gray`,`hex`],a={};for(let e of Object.keys(r))a[[...r[e].labels].sort().join(``)]=e;var o={};function s(e,t){if(!(this instanceof s))return new s(e,t);if(t&&t in i&&(t=null),t&&!(t in r))throw Error(`Unknown model: `+t);let c,l;if(e==null)this.model=`rgb`,this.color=[0,0,0],this.valpha=1;else if(e instanceof s)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if(typeof e==`string`){let t=n.get(e);if(t===null)throw Error(`Unable to parse color from string: `+e);this.model=t.model,l=r[this.model].channels,this.color=t.value.slice(0,l),this.valpha=typeof t.value[l]==`number`?t.value[l]:1}else if(e.length>0){this.model=t||`rgb`,l=r[this.model].channels;let n=Array.prototype.slice.call(e,0,l);this.color=p(n,l),this.valpha=typeof e[l]==`number`?e[l]:1}else if(typeof e==`number`)this.model=`rgb`,this.color=[e>>16&255,e>>8&255,e&255],this.valpha=1;else{this.valpha=1;let t=Object.keys(e);`alpha`in e&&(t.splice(t.indexOf(`alpha`),1),this.valpha=typeof e.alpha==`number`?e.alpha:0);let n=t.sort().join(``);if(!(n in a))throw Error(`Unable to parse color from object: `+JSON.stringify(e));this.model=a[n];let{labels:i}=r[this.model],o=[];for(c=0;c<i.length;c++)o.push(e[i[c]]);this.color=p(o)}if(o[this.model])for(l=r[this.model].channels,c=0;c<l;c++){let e=o[this.model][c];e&&(this.color[c]=e(this.color[c]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}s.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let t=this.model in n.to?this:this.rgb();t=t.round(typeof e==`number`?e:1);let r=t.valpha===1?t.color:[...t.color,this.valpha];return n.to[t.model](r)},percentString(e){let t=this.rgb().round(typeof e==`number`?e:1),r=t.valpha===1?t.color:[...t.color,this.valpha];return n.to.rgb.percent(r)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let e={},{channels:t}=r[this.model],{labels:n}=r[this.model];for(let r=0;r<t;r++)e[n[r]]=this.color[r];return this.valpha!==1&&(e.alpha=this.valpha),e},unitArray(){let e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,this.valpha!==1&&e.push(this.valpha),e},unitObject(){let e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,this.valpha!==1&&(e.alpha=this.valpha),e},round(e){return e=Math.max(e||0,0),new s([...this.color.map(l(e)),this.valpha],this.model)},alpha(e){return e===void 0?this.valpha:new s([...this.color,Math.max(0,Math.min(1,e))],this.model)},red:u(`rgb`,0,d(255)),green:u(`rgb`,1,d(255)),blue:u(`rgb`,2,d(255)),hue:u([`hsl`,`hsv`,`hsl`,`hwb`,`hcg`],0,e=>(e%360+360)%360),saturationl:u(`hsl`,1,d(100)),lightness:u(`hsl`,2,d(100)),saturationv:u(`hsv`,1,d(100)),value:u(`hsv`,2,d(100)),chroma:u(`hcg`,1,d(100)),gray:u(`hcg`,2,d(100)),white:u(`hwb`,1,d(100)),wblack:u(`hwb`,2,d(100)),cyan:u(`cmyk`,0,d(100)),magenta:u(`cmyk`,1,d(100)),yellow:u(`cmyk`,2,d(100)),black:u(`cmyk`,3,d(100)),x:u(`xyz`,0,d(95.047)),y:u(`xyz`,1,d(100)),z:u(`xyz`,2,d(108.833)),l:u(`lab`,0,d(100)),a:u(`lab`,1),b:u(`lab`,2),keyword(e){return e===void 0?r[this.model].keyword(this.color):new s(e)},hex(e){return e===void 0?n.to.hex(this.rgb().round().color):new s(e)},hexa(e){if(e!==void 0)return new s(e);let t=this.rgb().round().color,r=Math.round(this.valpha*255).toString(16).toUpperCase();return r.length===1&&(r=`0`+r),n.to.hex(t)+r},rgbNumber(){let e=this.rgb().color;return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255},luminosity(){let e=this.rgb().color,t=[];for(let[n,r]of e.entries()){let e=r/255;t[n]=e<=.04045?e/12.92:((e+.055)/1.055)**2.4}return .2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(e){let t=this.luminosity(),n=e.luminosity();return t>n?(t+.05)/(n+.05):(n+.05)/(t+.05)},level(e){let t=this.contrast(e);return t>=7?`AAA`:t>=4.5?`AA`:``},isDark(){let e=this.rgb().color;return(e[0]*2126+e[1]*7152+e[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){let t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){let t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){let t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){let t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){let t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){let t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){let e=this.rgb().color,t=e[0]*.3+e[1]*.59+e[2]*.11;return s.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){let t=this.hsl(),n=t.color[0];return n=(n+e)%360,n=n<0?360+n:n,t.color[0]=n,t},mix(e,t){if(!e||!e.rgb)throw Error(`Argument to "mix" was not a Color instance, but rather an instance of `+typeof e);let n=e.rgb(),r=this.rgb(),i=t===void 0?.5:t,a=2*i-1,o=n.alpha()-r.alpha(),c=((a*o===-1?a:(a+o)/(1+a*o))+1)/2,l=1-c;return s.rgb(c*n.red()+l*r.red(),c*n.green()+l*r.green(),c*n.blue()+l*r.blue(),n.alpha()*i+r.alpha()*(1-i))}};for(let e of Object.keys(r)){if(i.includes(e))continue;let{channels:t}=r[e];s.prototype[e]=function(...t){return this.model===e?new s(this):t.length>0?new s(t,e):new s([...f(r[this.model][e].raw(this.color)),this.valpha],e)},s[e]=function(...n){let r=n[0];return typeof r==`number`&&(r=p(n,t)),new s(r,e)}}function c(e,t){return Number(e.toFixed(t))}function l(e){return function(t){return c(t,e)}}function u(e,t,n){e=Array.isArray(e)?e:[e];for(let r of e)(o[r]||(o[r]=[]))[t]=n;return e=e[0],function(r){let i;return r===void 0?(i=this[e]().color[t],n&&(i=n(i)),i):(n&&(r=n(r)),i=this[e](),i.color[t]=r,i)}}function d(e){return function(t){return Math.max(0,Math.min(e,t))}}function f(e){return Array.isArray(e)?e:[e]}function p(e,t){for(let n=0;n<t;n++)typeof e[n]!=`number`&&(e[n]=0);return e}t.exports=s}));V();var _cn=lf.createAnimatedComponent(wp),vcn=z.OS===`android`&&z.Version>=21,ycn=z.OS!==`web`;function bcn({disabled:e,onPress:t,onPressIn:n,onPressOut:r,android_ripple:i,pressColor:a,pressOpacity:o=.3,hoverEffect:s,style:c,children:l,...u},d){let{dark:f}=B$(),[p]=H.useState(()=>new lf.Value(1)),m=(e,t)=>{vcn||lf.timing(p,{toValue:e,duration:t,easing:ef.inOut(ef.quad),useNativeDriver:ycn}).start()};return(0,W.jsxs)(_cn,{ref:d,accessible:!0,role:z.OS===`web`&&u.href!=null?`link`:`button`,onPress:e?void 0:e=>{if(z.OS===`web`&&u.href!==null){let n=`metaKey`in e&&e.metaKey||`altKey`in e&&e.altKey||`ctrlKey`in e&&e.ctrlKey||`shiftKey`in e&&e.shiftKey,r=`button`in e?e.button==null||e.button===0:!0,i=e.currentTarget&&`target`in e.currentTarget?[void 0,null,``,`self`].includes(e.currentTarget.target):!0;!n&&r&&i&&(e.preventDefault(),t?.(e))}else t?.(e)},onPressIn:e?void 0:e=>{m(o,0),n?.(e)},onPressOut:e?void 0:e=>{m(1,200),r?.(e)},android_ripple:vcn&&!e?{color:a===void 0?f?`rgba(255, 255, 255, .32)`:`rgba(0, 0, 0, .32)`:a,...i}:void 0,style:[{cursor:(z.OS===`web`||z.OS===`ios`)&&!e?`pointer`:`auto`,opacity:!vcn&&!e?p:1},c],...u,children:[e?null:(0,W.jsx)(Ccn,{...s}),l]})}var t5=H.forwardRef(bcn);t5.displayName=`PlatformPressable`;var xcn=String.raw,n5=`__react-navigation_elements_Pressable_hover`,Scn=xcn`
|
|
880
|
+
'`+a.annotationType_+`' can only be used on properties with a function value.`))}function Stn(e,t,n,r){t.annotationType_,r.value}function Ctn(e,t,n,r,i){var a,o;i===void 0&&(i=C6.safeDescriptors),Stn(e,t,n,r);var s=r.value;return(a=t.options_)!=null&&a.bound&&(s=s.bind(e.proxy_??e.target_)),{value:d6(t.options_?.name??n.toString(),s,t.options_?.autoAction??!1,(o=t.options_)!=null&&o.bound?e.proxy_??e.target_:void 0),configurable:i?e.isPlainObject_:!0,enumerable:!1,writable:!i}}function wtn(e,t){return{annotationType_:e,options_:t,make_:Ttn,extend_:Etn,decorate_20223_:Dtn}}function Ttn(e,t,n,r){var i;return r===e.target_?this.extend_(e,t,n,!1)===null?0:2:(i=this.options_)!=null&&i.bound&&(!U3(e.target_,t)||!P6(e.target_[t]))&&this.extend_(e,t,n,!1)===null?0:P6(n.value)?1:(j3(r,t,ktn(e,this,t,n,!1,!1)),2)}function Etn(e,t,n,r){var i=ktn(e,this,t,n,this.options_?.bound);return e.defineProperty_(t,i,r)}function Dtn(e,t){var n,r=t.name,i=t.addInitializer;return P6(e)||(e=N6(e)),(n=this.options_)!=null&&n.bound&&i(function(){var e=this,t=e[r].bind(e);t.isMobXFlow=!0,e[r]=t}),e}function Otn(e,t,n,r){t.annotationType_,r.value}function ktn(e,t,n,r,i,a){a===void 0&&(a=C6.safeDescriptors),Otn(e,t,n,r);var o=r.value;return P6(o)||(o=N6(o)),i&&(o=o.bind(e.proxy_??e.target_),o.isMobXFlow=!0),{value:o,configurable:a?e.isPlainObject_:!0,enumerable:!1,writable:!a}}function Atn(e,t){return{annotationType_:e,options_:t,make_:jtn,extend_:Mtn,decorate_20223_:Ntn}}function jtn(e,t,n){return this.extend_(e,t,n,!1)===null?0:1}function Mtn(e,t,n,r){return Ptn(e,this,t,n),e.defineComputedProperty_(t,J3({},this.options_,{get:n.get,set:n.set}),r)}function Ntn(e,t){var n=this,r=t.name,i=t.addInitializer;return i(function(){var t=$6(this)[$3],i=J3({},n.options_,{get:e,context:this});i.name||=`ObservableObject.`+r.toString(),t.values_.set(r,new p6(i))}),function(){return this[$3].getObservablePropValue_(r)}}function Ptn(e,t,n,r){t.annotationType_,r.get}function a6(e,t){return{annotationType_:e,options_:t,make_:Ftn,extend_:Itn,decorate_20223_:Ltn}}function Ftn(e,t,n){return this.extend_(e,t,n,!1)===null?0:1}function Itn(e,t,n,r){return Rtn(e,this,t,n),e.defineObservableProperty_(t,n.value,this.options_?.enhancer??n6,r)}function Ltn(e,t){var n=this,r=t.kind,i=t.name,a=new WeakSet;function o(e,t){var r=$6(e)[$3],o=new f6(t,n.options_?.enhancer??n6,`ObservableObject.`+i.toString(),!1);r.values_.set(i,o),a.add(e)}if(r==`accessor`)return{get:function(){return a.has(this)||o(this,e.get.call(this)),this[$3].getObservablePropValue_(i)},set:function(e){return a.has(this)||o(this,e),this[$3].setObservablePropValue_(i,e)},init:function(e){return a.has(this)||o(this,e),e}}}function Rtn(e,t,n,r){t.annotationType_}var ztn=`true`,Btn=Vtn();function Vtn(e){return{annotationType_:ztn,options_:e,make_:Htn,extend_:Utn,decorate_20223_:Wtn}}function Htn(e,t,n,r){var i;if(n.get)return l6.make_(e,t,n,r);if(n.set){var a=d6(t.toString(),n.set);return r===e.target_?e.defineProperty_(t,{configurable:C6.safeDescriptors?e.isPlainObject_:!0,set:a})===null?0:2:(j3(r,t,{configurable:!0,set:a}),2)}if(r!==e.target_&&typeof n.value==`function`){var o;if(Jen(n.value)){var s;return((s=this.options_)!=null&&s.autoBind?N6.bound:N6).make_(e,t,n,r)}return((o=this.options_)!=null&&o.autoBind?A6.bound:A6).make_(e,t,n,r)}var c=this.options_?.deep===!1?c6.ref:c6;return typeof n.value==`function`&&(i=this.options_)!=null&&i.autoBind&&(n.value=n.value.bind(e.proxy_??e.target_)),c.make_(e,t,n,r)}function Utn(e,t,n,r){var i;return n.get?l6.extend_(e,t,n,r):n.set?e.defineProperty_(t,{configurable:C6.safeDescriptors?e.isPlainObject_:!0,set:d6(t.toString(),n.set)},r):(typeof n.value==`function`&&(i=this.options_)!=null&&i.autoBind&&(n.value=n.value.bind(e.proxy_??e.target_)),(this.options_?.deep===!1?c6.ref:c6).extend_(e,t,n,r))}function Wtn(e,t){O3(`'`+this.annotationType_+`' cannot be used as a decorator`)}var Gtn=`observable`,Ktn=`observable.ref`,qtn=`observable.shallow`,Jtn=`observable.struct`,Ytn={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(Ytn);function o6(e){return e||Ytn}var Xtn=a6(Gtn),Ztn=a6(Ktn,{enhancer:r6}),Qtn=a6(qtn,{enhancer:htn}),$tn=a6(Jtn,{enhancer:gtn}),enn=X3(Xtn);function s6(e){return e.deep===!0?n6:e.deep===!1?r6:nnn(e.defaultDecorator)}function tnn(e){return e?e.defaultDecorator??Vtn(e):void 0}function nnn(e){return e?e.options_?.enhancer??n6:n6}function rnn(e,t,n){if(Q3(t))return Xtn.decorate_20223_(e,t);if(F3(t)){Z3(e,t,Xtn);return}return grn(e)?e:L3(e)?c6.object(e,t,n):Array.isArray(e)?c6.array(e,t):B3(e)?c6.map(e,t):V3(e)?c6.set(e,t):typeof e==`object`&&e?e:c6.box(e,t)}Ven(rnn,enn);var c6=Ven(rnn,{box:function(e,t){var n=o6(t);return new f6(e,s6(n),n.name,!0,n.equals)},array:function(e,t){var n=o6(t);return(C6.useProxies===!1||n.proxy===!1?Yrn:wrn)(e,s6(n),n.name)},map:function(e,t){var n=o6(t);return new Orn(e,s6(n),n.name)},set:function(e,t){var n=o6(t);return new Mrn(e,s6(n),n.name)},object:function(e,t,n){return n8(function(){return orn(C6.useProxies===!1||n?.proxy===!1?$6({},n):vrn({},n),e,t)})},ref:X3(Ztn),shallow:X3(Qtn),deep:enn,struct:X3($tn)}),inn=`computed`,ann=`computed.struct`,onn=Atn(inn),snn=Atn(ann,{equals:t6.structural}),l6=function(e,t){if(Q3(t))return onn.decorate_20223_(e,t);if(F3(t))return Z3(e,t,onn);if(L3(e))return X3(Atn(inn,e));var n=L3(t)?t:{};return n.get=e,n.name||=e.name||``,new p6(n)};Object.assign(l6,onn),l6.struct=X3(snn);var u6=0,cnn=1,lnn=A3(function(){},`name`)?.configurable??!1,unn={value:`action`,configurable:!0,writable:!1,enumerable:!1};function d6(e,t,n,r){n===void 0&&(n=!1);function i(){return dnn(e,n,t,r||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},lnn&&(unn.value=e,j3(i,`name`,unn)),i}function dnn(e,t,n,r,i){var a=fnn(e,t,r,i);try{return n.apply(r,i)}catch(e){throw a.error_=e,e}finally{pnn(a)}}function fnn(e,t,n,r){var i=!1,a=0,o=C6.trackingDerivation,s=!t||!o;w6();var c=C6.allowStateChanges;s&&(v6(),c=mnn(!0));var l=Snn(!0),u={runAsAction_:s,prevDerivation_:o,prevAllowStateChanges_:c,prevAllowStateReads_:l,notifySpy_:i,startTime_:a,actionId_:cnn++,parentActionId_:u6};return u6=u.actionId_,u}function pnn(e){u6!==e.actionId_&&O3(30),u6=e.parentActionId_,e.error_!==void 0&&(C6.suppressReactionErrors=!0),hnn(e.prevAllowStateChanges_),b6(e.prevAllowStateReads_),T6(),e.runAsAction_&&y6(e.prevDerivation_),C6.suppressReactionErrors=!1}function mnn(e){var t=C6.allowStateChanges;return C6.allowStateChanges=e,t}function hnn(e){C6.allowStateChanges=e}var f6=function(e){function t(t,n,r,i,a){var o;return r===void 0&&(r=`ObservableValue`),i===void 0&&(i=!0),a===void 0&&(a=t6.default),o=e.call(this,r)||this,o.enhancer=void 0,o.name_=void 0,o.equals=void 0,o.hasUnreportedChange_=!1,o.interceptors_=void 0,o.changeListeners_=void 0,o.value_=void 0,o.dehancer=void 0,o.enhancer=n,o.name_=r,o.equals=a,o.value_=n(t,void 0,r),o}rtn(t,e);var n=t.prototype;return n.dehanceValue=function(e){return this.dehancer===void 0?e:this.dehancer(e)},n.set=function(e){this.value_,e=this.prepareNewValue_(e),e!==C6.UNCHANGED&&this.setNewValue_(e)},n.prepareNewValue_=function(e){if(L6(this)){var t=z6(this,{object:this,type:U6,newValue:e});if(!t)return C6.UNCHANGED;e=t.newValue}return e=this.enhancer(e,this.value_,this.name_),this.equals(this.value_,e)?C6.UNCHANGED:e},n.setNewValue_=function(e){var t=this.value_;this.value_=e,this.reportChanged(),B6(this)&&H6(this,{type:U6,object:this,newValue:e,oldValue:t})},n.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},n.intercept_=function(e){return R6(this,e)},n.observe_=function(e,t){return t&&e({observableKind:`value`,debugObjectName:this.name_,object:this,type:U6,newValue:this.value_,oldValue:void 0}),V6(this,e)},n.raw=function(){return this.value_},n.toJSON=function(){return this.get()},n.toString=function(){return this.name_+`[`+this.value_+`]`},n.valueOf=function(){return $en(this.get())},n[Symbol.toPrimitive]=function(){return this.valueOf()},t}(e6),p6=function(){function e(e){this.dependenciesState_=h6.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=h6.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new g6(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=gnn.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,e.get||O3(31),this.derivation=e.get,this.name_=e.name||`ComputedValue`,e.set&&(this.setter_=d6(`ComputedValue-setter`,e.set)),this.equals_=e.equals||(e.compareStructural||e.struct?t6.structural:t6.default),this.scope_=e.context,this.requiresReaction_=e.requiresReaction,this.keepAlive_=!!e.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){Mnn(this)},t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(e){return e()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(e){return e()})},t.get=function(){if(this.isComputing&&O3(32,this.name_,this.derivation),C6.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)_nn(this)&&(this.warnAboutUntrackedRead_(),w6(),this.value_=this.computeValue_(!1),T6());else if(knn(this),_nn(this)){var e=C6.trackingContext;this.keepAlive_&&!e&&(C6.trackingContext=this),this.trackAndCompute()&&jnn(this),C6.trackingContext=e}var t=this.value_;if(_6(t))throw t.cause;return t},t.set=function(e){if(this.setter_){this.isRunningSetter&&O3(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,e)}finally{this.isRunningSetter=!1}}else O3(34,this.name_)},t.trackAndCompute=function(){var e=this.value_,t=this.dependenciesState_===h6.NOT_TRACKING_,n=this.computeValue_(!0),r=t||_6(e)||_6(n)||!this.equals_(e,n);return r&&(this.value_=n),r},t.computeValue_=function(e){this.isComputing=!0;var t=mnn(!1),n;if(e)n=vnn(this,this.derivation,this.scope_);else if(C6.disableErrorBoundaries===!0)n=this.derivation.call(this.scope_);else try{n=this.derivation.call(this.scope_)}catch(e){n=new g6(e)}return hnn(t),this.isComputing=!1,n},t.suspend_=function(){this.keepAlive_||(bnn(this),this.value_=void 0)},t.observe_=function(e,t){var n=this,r=!0,i=void 0;return Ynn(function(){var a=n.get();if(!r||t){var o=v6();e({observableKind:`computed`,debugObjectName:n.name_,type:U6,object:n,newValue:a,oldValue:i}),y6(o)}r=!1,i=a})},t.warnAboutUntrackedRead_=function(){},t.toString=function(){return this.name_+`[`+this.derivation.toString()+`]`},t.valueOf=function(){return $en(this.get())},t[Symbol.toPrimitive]=function(){return this.valueOf()},K3(e,[{key:`isComputing`,get:function(){return W3(this.flags_,e.isComputingMask_)},set:function(t){this.flags_=G3(this.flags_,e.isComputingMask_,t)}},{key:`isRunningSetter`,get:function(){return W3(this.flags_,e.isRunningSetterMask_)},set:function(t){this.flags_=G3(this.flags_,e.isRunningSetterMask_,t)}},{key:`isBeingObserved`,get:function(){return W3(this.flags_,e.isBeingObservedMask_)},set:function(t){this.flags_=G3(this.flags_,e.isBeingObservedMask_,t)}},{key:`isPendingUnobservation`,get:function(){return W3(this.flags_,e.isPendingUnobservationMask_)},set:function(t){this.flags_=G3(this.flags_,e.isPendingUnobservationMask_,t)}},{key:`diffValue`,get:function(){return+!!W3(this.flags_,e.diffValueMask_)},set:function(t){this.flags_=G3(this.flags_,e.diffValueMask_,t===1)}}])}();p6.isComputingMask_=1,p6.isRunningSetterMask_=2,p6.isBeingObservedMask_=4,p6.isPendingUnobservationMask_=8,p6.diffValueMask_=16;var m6=z3(`ComputedValue`,p6),h6;(function(e){e[e.NOT_TRACKING_=-1]=`NOT_TRACKING_`,e[e.UP_TO_DATE_=0]=`UP_TO_DATE_`,e[e.POSSIBLY_STALE_=1]=`POSSIBLY_STALE_`,e[e.STALE_=2]=`STALE_`})(h6||={});var gnn;(function(e){e[e.NONE=0]=`NONE`,e[e.LOG=1]=`LOG`,e[e.BREAK=2]=`BREAK`})(gnn||={});var g6=function(e){this.cause=void 0,this.cause=e};function _6(e){return e instanceof g6}function _nn(e){switch(e.dependenciesState_){case h6.UP_TO_DATE_:return!1;case h6.NOT_TRACKING_:case h6.STALE_:return!0;case h6.POSSIBLY_STALE_:for(var t=Snn(!0),n=v6(),r=e.observing_,i=r.length,a=0;a<i;a++){var o=r[a];if(m6(o)){if(C6.disableErrorBoundaries)o.get();else try{o.get()}catch{return y6(n),b6(t),!0}if(e.dependenciesState_===h6.STALE_)return y6(n),b6(t),!0}}return Cnn(e),y6(n),b6(t),!1}}function vnn(e,t,n){var r=Snn(!0);Cnn(e),e.newObserving_=Array(e.runId_===0?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++C6.runId;var i=C6.trackingDerivation;C6.trackingDerivation=e,C6.inBatch++;var a;if(C6.disableErrorBoundaries===!0)a=t.call(n);else try{a=t.call(n)}catch(e){a=new g6(e)}return C6.inBatch--,C6.trackingDerivation=i,ynn(e),b6(r),a}function ynn(e){for(var t=e.observing_,n=e.observing_=e.newObserving_,r=h6.UP_TO_DATE_,i=0,a=e.unboundDepsCount_,o=0;o<a;o++){var s=n[o];s.diffValue===0&&(s.diffValue=1,i!==o&&(n[i]=s),i++),s.dependenciesState_>r&&(r=s.dependenciesState_)}for(n.length=i,e.newObserving_=null,a=t.length;a--;){var c=t[a];c.diffValue===0&&Dnn(c,e),c.diffValue=0}for(;i--;){var l=n[i];l.diffValue===1&&(l.diffValue=0,Enn(l,e))}r!==h6.UP_TO_DATE_&&(e.dependenciesState_=r,e.onBecomeStale_())}function bnn(e){var t=e.observing_;e.observing_=[];for(var n=t.length;n--;)Dnn(t[n],e);e.dependenciesState_=h6.NOT_TRACKING_}function xnn(e){var t=v6();try{return e()}finally{y6(t)}}function v6(){var e=C6.trackingDerivation;return C6.trackingDerivation=null,e}function y6(e){C6.trackingDerivation=e}function Snn(e){var t=C6.allowStateReads;return C6.allowStateReads=e,t}function b6(e){C6.allowStateReads=e}function Cnn(e){if(e.dependenciesState_!==h6.UP_TO_DATE_){e.dependenciesState_=h6.UP_TO_DATE_;for(var t=e.observing_,n=t.length;n--;)t[n].lowestObserverState_=h6.UP_TO_DATE_}}var x6=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},S6=!0,wnn=!1,C6=function(){var e=k3();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(S6=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new x6().version&&(S6=!1),S6?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new x6):(setTimeout(function(){wnn||O3(35)},1),new x6)}();function Tnn(){if((C6.pendingReactions.length||C6.inBatch||C6.isRunningReactions)&&O3(36),wnn=!0,S6){var e=k3();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),C6=new x6}}function Enn(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function Dnn(e,t){e.observers_.delete(t),e.observers_.size===0&&Onn(e)}function Onn(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,C6.pendingUnobservations.push(e))}function w6(){C6.inBatch++}function T6(){if(--C6.inBatch===0){Fnn();for(var e=C6.pendingUnobservations,t=0;t<e.length;t++){var n=e[t];n.isPendingUnobservation=!1,n.observers_.size===0&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBUO()),n instanceof p6&&n.suspend_())}C6.pendingUnobservations=[]}}function knn(e){var t=C6.trackingDerivation;return t===null?(e.observers_.size===0&&C6.inBatch>0&&Onn(e),!1):(t.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=t.runId_,t.newObserving_[t.unboundDepsCount_++]=e,!e.isBeingObserved&&C6.trackingContext&&(e.isBeingObserved=!0,e.onBO())),e.isBeingObserved)}function Ann(e){e.lowestObserverState_!==h6.STALE_&&(e.lowestObserverState_=h6.STALE_,e.observers_.forEach(function(e){e.dependenciesState_===h6.UP_TO_DATE_&&e.onBecomeStale_(),e.dependenciesState_=h6.STALE_}))}function jnn(e){e.lowestObserverState_!==h6.STALE_&&(e.lowestObserverState_=h6.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===h6.POSSIBLY_STALE_?t.dependenciesState_=h6.STALE_:t.dependenciesState_===h6.UP_TO_DATE_&&(e.lowestObserverState_=h6.UP_TO_DATE_)}))}function Mnn(e){e.lowestObserverState_===h6.UP_TO_DATE_&&(e.lowestObserverState_=h6.POSSIBLY_STALE_,e.observers_.forEach(function(e){e.dependenciesState_===h6.UP_TO_DATE_&&(e.dependenciesState_=h6.POSSIBLY_STALE_,e.onBecomeStale_())}))}var E6=function(){function e(e,t,n,r){e===void 0&&(e=`Reaction`),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=h6.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=gnn.NONE,this.name_=e,this.onInvalidate_=t,this.errorHandler_=n,this.requiresObservable_=r}var t=e.prototype;return t.onBecomeStale_=function(){this.schedule_()},t.schedule_=function(){this.isScheduled||(this.isScheduled=!0,C6.pendingReactions.push(this),Fnn())},t.runReaction_=function(){if(!this.isDisposed){w6(),this.isScheduled=!1;var e=C6.trackingContext;if(C6.trackingContext=this,_nn(this)){this.isTrackPending=!0;try{this.onInvalidate_()}catch(e){this.reportExceptionInDerivation_(e)}}C6.trackingContext=e,T6()}},t.track=function(e){if(!this.isDisposed){w6(),this.isRunning=!0;var t=C6.trackingContext;C6.trackingContext=this;var n=vnn(this,e,void 0);C6.trackingContext=t,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&bnn(this),_6(n)&&this.reportExceptionInDerivation_(n.cause),T6()}},t.reportExceptionInDerivation_=function(e){var t=this;if(this.errorHandler_){this.errorHandler_(e,this);return}if(C6.disableErrorBoundaries)throw e;var n=`[mobx] uncaught error in '`+this+`'`;C6.suppressReactionErrors||console.error(n,e),C6.globalReactionErrorHandlers.forEach(function(n){return n(e,t)})},t.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(w6(),bnn(this),T6()))},t.getDisposer_=function(e){var t=this,n=function n(){t.dispose(),e==null||e.removeEventListener==null||e.removeEventListener(`abort`,n)};return e==null||e.addEventListener==null||e.addEventListener(`abort`,n),n[$3]=this,n},t.toString=function(){return`Reaction[`+this.name_+`]`},t.trace=function(e){e===void 0&&(e=!1)},K3(e,[{key:`isDisposed`,get:function(){return W3(this.flags_,e.isDisposedMask_)},set:function(t){this.flags_=G3(this.flags_,e.isDisposedMask_,t)}},{key:`isScheduled`,get:function(){return W3(this.flags_,e.isScheduledMask_)},set:function(t){this.flags_=G3(this.flags_,e.isScheduledMask_,t)}},{key:`isTrackPending`,get:function(){return W3(this.flags_,e.isTrackPendingMask_)},set:function(t){this.flags_=G3(this.flags_,e.isTrackPendingMask_,t)}},{key:`isRunning`,get:function(){return W3(this.flags_,e.isRunningMask_)},set:function(t){this.flags_=G3(this.flags_,e.isRunningMask_,t)}},{key:`diffValue`,get:function(){return+!!W3(this.flags_,e.diffValueMask_)},set:function(t){this.flags_=G3(this.flags_,e.diffValueMask_,t===1)}}])}();E6.isDisposedMask_=1,E6.isScheduledMask_=2,E6.isTrackPendingMask_=4,E6.isRunningMask_=8,E6.diffValueMask_=16;var Nnn=100,Pnn=function(e){return e()};function Fnn(){C6.inBatch>0||C6.isRunningReactions||Pnn(Inn)}function Inn(){C6.isRunningReactions=!0;for(var e=C6.pendingReactions,t=0;e.length>0;){++t===Nnn&&(console.error(`[mobx] cycle in reaction: `+e[0]),e.splice(0));for(var n=e.splice(0),r=0,i=n.length;r<i;r++)n[r].runReaction_()}C6.isRunningReactions=!1}var D6=z3(`Reaction`,E6);function Lnn(e){var t=Pnn;Pnn=function(n){return e(function(){return t(n)})}}function O6(){return!1}function Rnn(e){return console.warn(`[mobx.spy] Is a no-op in production builds`),function(){}}var znn=`action`,Bnn=`action.bound`,Vnn=`autoAction`,Hnn=`autoAction.bound`,Unn=`<unnamed action>`,Wnn=i6(znn),Gnn=i6(Bnn,{bound:!0}),Knn=i6(Vnn,{autoAction:!0}),qnn=i6(Hnn,{autoAction:!0,bound:!0});function Jnn(e){return function(t,n){if(P3(t))return d6(t.name||Unn,t,e);if(P3(n))return d6(t,n,e);if(Q3(n))return(e?Knn:Wnn).decorate_20223_(t,n);if(F3(n))return Z3(t,n,e?Knn:Wnn);if(F3(t))return X3(i6(e?Vnn:znn,{name:t,autoAction:e}))}}var k6=Jnn(!1);Object.assign(k6,Wnn);var A6=Jnn(!0);Object.assign(A6,Knn),k6.bound=X3(Gnn),A6.bound=X3(qnn);function j6(e){return P3(e)&&e.isMobxAction===!0}function Ynn(e,t){var n;t===void 0&&(t=Uen);var r=t?.name??`Autorun`,i=!t.scheduler&&!t.delay,a;if(i)a=new E6(r,function(){this.track(c)},t.onError,t.requiresObservable);else{var o=Znn(t),s=!1;a=new E6(r,function(){s||(s=!0,o(function(){s=!1,a.isDisposed||a.track(c)}))},t.onError,t.requiresObservable)}function c(){e(a)}return(n=t)!=null&&(n=n.signal)!=null&&n.aborted||a.schedule_(),a.getDisposer_(t?.signal)}var Xnn=function(e){return e()};function Znn(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:Xnn}var Qnn=`onBO`,$nn=`onBUO`;function ern(e,t,n){return nrn(Qnn,e,t,n)}function trn(e,t,n){return nrn($nn,e,t,n)}function nrn(e,t,n,r){var i=typeof r==`function`?t8(t,n):t8(t),a=P3(r)?r:n,o=e+`L`;return i[o]?i[o].add(a):i[o]=new Set([a]),function(){var e=i[o];e&&(e.delete(a),e.size===0&&delete i[o])}}var rrn=`never`,M6=`always`,irn=`observed`;function arn(e){e.isolateGlobalState===!0&&Tnn();var t=e.useProxies,n=e.enforceActions;if(t!==void 0&&(C6.useProxies=t===M6?!0:t===rrn?!1:typeof Proxy<`u`),t===`ifavailable`&&(C6.verifyProxies=!0),n!==void 0){var r=n===M6?M6:n===irn;C6.enforceActions=r,C6.allowStateChanges=!(r===!0||r===M6)}[`computedRequiresReaction`,`reactionRequiresObservable`,`observableRequiresReaction`,`disableErrorBoundaries`,`safeDescriptors`].forEach(function(t){t in e&&(C6[t]=!!e[t])}),C6.allowStateReads=!C6.observableRequiresReaction,e.reactionScheduler&&Lnn(e.reactionScheduler)}function orn(e,t,n,r){var i=etn(t);return n8(function(){var t=$6(e,r)[$3];H3(i).forEach(function(e){t.extend_(e,i[e],n&&e in n?n[e]:!0)})}),e}function srn(e,t){return crn(t8(e,t))}function crn(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=lrn(e.observing_).map(crn)),t}function lrn(e){return Array.from(new Set(e))}var urn=0;function drn(){this.message=`FLOW_CANCELLED`}drn.prototype=Object.create(Error.prototype);var frn=wtn(`flow`),prn=wtn(`flow.bound`,{bound:!0}),N6=Object.assign(function(e,t){if(Q3(t))return frn.decorate_20223_(e,t);if(F3(t))return Z3(e,t,frn);var n=e,r=n.name||`<unnamed flow>`,i=function(){var e=this,t=arguments,i=++urn,a=k6(r+` - runid: `+i+` - init`,n).apply(e,t),o,s=void 0,c=new Promise(function(e,t){var n=0;o=t;function c(e){s=void 0;var o;try{o=k6(r+` - runid: `+i+` - yield `+ n++,a.next).call(a,e)}catch(e){return t(e)}u(o)}function l(e){s=void 0;var o;try{o=k6(r+` - runid: `+i+` - yield `+ n++,a.throw).call(a,e)}catch(e){return t(e)}u(o)}function u(n){if(P3(n?.then)){n.then(u,t);return}return n.done?e(n.value):(s=Promise.resolve(n.value),s.then(c,l))}c(void 0)});return c.cancel=k6(r+` - runid: `+i+` - cancel`,function(){try{s&&mrn(s);var e=a.return(void 0),t=Promise.resolve(e.value);t.then(N3,N3),mrn(t),o(new drn)}catch(e){o(e)}}),c};return i.isMobXFlow=!0,i},frn);N6.bound=X3(prn);function mrn(e){P3(e.cancel)&&e.cancel()}function P6(e){return e?.isMobXFlow===!0}function hrn(e,t){return e?t===void 0?e8(e)||!!e[$3]||ltn(e)||D6(e)||m6(e):e8(e)?e[$3].values_.has(t):!1:!1}function grn(e){return hrn(e)}function F6(e,t){t===void 0&&(t=void 0),w6();try{return e.apply(t)}finally{T6()}}function I6(e){return e[$3]}var _rn={has:function(e,t){return I6(e).has_(t)},get:function(e,t){return I6(e).get_(t)},set:function(e,t,n){return F3(t)?I6(e).set_(t,n,!0)??!0:!1},deleteProperty:function(e,t){return F3(t)?I6(e).delete_(t,!0)??!0:!1},defineProperty:function(e,t,n){return I6(e).defineProperty_(t,n)??!0},ownKeys:function(e){return I6(e).ownKeys_()},preventExtensions:function(e){O3(13)}};function vrn(e,t){var n;return Ken(),e=$6(e,t),(n=e[$3]).proxy_??(n.proxy_=new Proxy(e,_rn))}function L6(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function R6(e,t){var n=e.interceptors_||=[];return n.push(t),qen(function(){var e=n.indexOf(t);e!==-1&&n.splice(e,1)})}function z6(e,t){var n=v6();try{for(var r=[].concat(e.interceptors_||[]),i=0,a=r.length;i<a&&(t=r[i](t),t&&!t.type&&O3(14),t);i++);return t}finally{y6(n)}}function B6(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function V6(e,t){var n=e.changeListeners_||=[];return n.push(t),qen(function(){var e=n.indexOf(t);e!==-1&&n.splice(e,1)})}function H6(e,t){var n=v6(),r=e.changeListeners_;if(r){r=r.slice();for(var i=0,a=r.length;i<a;i++)r[i](t);y6(n)}}function yrn(e,t,n){return n8(function(){var r=$6(e,n)[$3];t??=ctn(e),H3(t).forEach(function(e){return r.make_(e,t[e])})}),e}var brn=`splice`,U6=`update`,xrn=1e4,Srn={get:function(e,t){var n=e[$3];return t===$3?n:t===`length`?n.getArrayLength_():typeof t==`string`&&!isNaN(t)?n.get_(parseInt(t)):U3(W6,t)?W6[t]:e[t]},set:function(e,t,n){var r=e[$3];return t===`length`&&r.setArrayLength_(n),typeof t==`symbol`||isNaN(t)?e[t]=n:r.set_(parseInt(t),n),!0},preventExtensions:function(){O3(15)}},Crn=function(){function e(e,t,n,r){e===void 0&&(e=`ObservableArray`),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=n,this.legacyMode_=r,this.atom_=new e6(e),this.enhancer_=function(e,n){return t(e,n,`ObservableArray[..]`)}}var t=e.prototype;return t.dehanceValue_=function(e){return this.dehancer===void 0?e:this.dehancer(e)},t.dehanceValues_=function(e){return this.dehancer!==void 0&&e.length>0?e.map(this.dehancer):e},t.intercept_=function(e){return R6(this,e)},t.observe_=function(e,t){return t===void 0&&(t=!1),t&&e({observableKind:`array`,object:this.proxy_,debugObjectName:this.atom_.name_,type:`splice`,index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),V6(this,e)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(e){(typeof e!=`number`||isNaN(e)||e<0)&&O3(`Out of range: `+e);var t=this.values_.length;if(e!==t)if(e>t){for(var n=Array(e-t),r=0;r<e-t;r++)n[r]=void 0;this.spliceWithArray_(t,0,n)}else this.spliceWithArray_(e,t-e)},t.updateArrayLength_=function(e,t){e!==this.lastKnownLength_&&O3(16),this.lastKnownLength_+=t,this.legacyMode_&&t>0&&Jrn(e+t+1)},t.spliceWithArray_=function(e,t,n){var r=this;this.atom_;var i=this.values_.length;if(e===void 0?e=0:e>i?e=i:e<0&&(e=Math.max(0,i+e)),t=arguments.length===1?i-e:t==null?0:Math.max(0,Math.min(t,i-e)),n===void 0&&(n=Hen),L6(this)){var a=z6(this,{object:this.proxy_,type:brn,index:e,removedCount:t,added:n});if(!a)return Hen;t=a.removedCount,n=a.added}if(n=n.length===0?n:n.map(function(e){return r.enhancer_(e,void 0)}),this.legacyMode_){var o=n.length-t;this.updateArrayLength_(i,o)}var s=this.spliceItemsIntoValues_(e,t,n);return(t!==0||n.length!==0)&&this.notifyArraySplice_(e,n,s),this.dehanceValues_(s)},t.spliceItemsIntoValues_=function(e,t,n){if(n.length<xrn){var r;return(r=this.values_).splice.apply(r,[e,t].concat(n))}else{var i=this.values_.slice(e,e+t),a=this.values_.slice(e+t);this.values_.length+=n.length-t;for(var o=0;o<n.length;o++)this.values_[e+o]=n[o];for(var s=0;s<a.length;s++)this.values_[e+n.length+s]=a[s];return i}},t.notifyArrayChildUpdate_=function(e,t,n){var r=!this.owned_&&O6(),i=B6(this),a=i||r?{observableKind:`array`,object:this.proxy_,type:U6,debugObjectName:this.atom_.name_,index:e,newValue:t,oldValue:n}:null;this.atom_.reportChanged(),i&&H6(this,a)},t.notifyArraySplice_=function(e,t,n){var r=!this.owned_&&O6(),i=B6(this),a=i||r?{observableKind:`array`,object:this.proxy_,debugObjectName:this.atom_.name_,type:brn,index:e,removed:n,added:t,removedCount:n.length,addedCount:t.length}:null;this.atom_.reportChanged(),i&&H6(this,a)},t.get_=function(e){if(this.legacyMode_&&e>=this.values_.length){console.warn(`[mobx] Out of bounds read: `+e);return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[e])},t.set_=function(e,t){var n=this.values_;if(this.legacyMode_&&e>n.length&&O3(17,e,n.length),e<n.length){this.atom_;var r=n[e];if(L6(this)){var i=z6(this,{type:U6,object:this.proxy_,index:e,newValue:t});if(!i)return;t=i.newValue}t=this.enhancer_(t,r),t!==r&&(n[e]=t,this.notifyArrayChildUpdate_(e,t,r))}else{for(var a=Array(e+1-n.length),o=0;o<a.length-1;o++)a[o]=void 0;a[a.length-1]=t,this.spliceWithArray_(n.length,0,a)}},e}();function wrn(e,t,n,r){return n===void 0&&(n=`ObservableArray`),r===void 0&&(r=!1),Ken(),n8(function(){var i=new Crn(n,t,r,!1);Yen(i.values_,$3,i);var a=new Proxy(i.values_,Srn);return i.proxy_=a,e&&e.length&&i.spliceWithArray_(0,0,e),a})}var W6={clear:function(){return this.splice(0)},replace:function(e){var t=this[$3];return t.spliceWithArray_(0,t.values_.length,e)},toJSON:function(){return this.slice()},splice:function(e,t){var n=[...arguments].slice(2),r=this[$3];switch(arguments.length){case 0:return[];case 1:return r.spliceWithArray_(e);case 2:return r.spliceWithArray_(e,t)}return r.spliceWithArray_(e,t,n)},spliceWithArray:function(e,t,n){return this[$3].spliceWithArray_(e,t,n)},push:function(){var e=this[$3],t=[...arguments];return e.spliceWithArray_(e.values_.length,0,t),e.values_.length},pop:function(){return this.splice(Math.max(this[$3].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){var e=this[$3],t=[...arguments];return e.spliceWithArray_(0,0,t),e.values_.length},reverse:function(){return C6.trackingDerivation&&O3(37,`reverse`),this.replace(this.slice().reverse()),this},sort:function(){C6.trackingDerivation&&O3(37,`sort`);var e=this.slice();return e.sort.apply(e,arguments),this.replace(e),this},remove:function(e){var t=this[$3],n=t.dehanceValues_(t.values_).indexOf(e);return n>-1?(this.splice(n,1),!0):!1}};G6(`at`,K6),G6(`concat`,K6),G6(`flat`,K6),G6(`includes`,K6),G6(`indexOf`,K6),G6(`join`,K6),G6(`lastIndexOf`,K6),G6(`slice`,K6),G6(`toString`,K6),G6(`toLocaleString`,K6),G6(`toSorted`,K6),G6(`toSpliced`,K6),G6(`with`,K6),G6(`every`,q6),G6(`filter`,q6),G6(`find`,q6),G6(`findIndex`,q6),G6(`findLast`,q6),G6(`findLastIndex`,q6),G6(`flatMap`,q6),G6(`forEach`,q6),G6(`map`,q6),G6(`some`,q6),G6(`toReversed`,q6),G6(`reduce`,Trn),G6(`reduceRight`,Trn);function G6(e,t){typeof Array.prototype[e]==`function`&&(W6[e]=t(e))}function K6(e){return function(){var t=this[$3];t.atom_.reportObserved();var n=t.dehanceValues_(t.values_);return n[e].apply(n,arguments)}}function q6(e){return function(t,n){var r=this,i=this[$3];return i.atom_.reportObserved(),i.dehanceValues_(i.values_)[e](function(e,i){return t.call(n,e,i,r)})}}function Trn(e){return function(){var t=this,n=this[$3];n.atom_.reportObserved();var r=n.dehanceValues_(n.values_),i=arguments[0];return arguments[0]=function(e,n,r){return i(e,n,r,t)},r[e].apply(r,arguments)}}var Ern=z3(`ObservableArrayAdministration`,Crn);function J6(e){return I3(e)&&Ern(e[$3])}var Drn={},Y6=`add`,X6=`delete`,Orn=function(){function e(e,t,n){var r=this;t===void 0&&(t=n6),n===void 0&&(n=`ObservableMap`),this.enhancer_=void 0,this.name_=void 0,this[$3]=Drn,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=t,this.name_=n,P3(Map)||O3(18),n8(function(){r.keysAtom_=utn(`ObservableMap.keys()`),r.data_=new Map,r.hasMap_=new Map,e&&r.merge(e)})}var t=e.prototype;return t.has_=function(e){return this.data_.has(e)},t.has=function(e){var t=this;if(!C6.trackingDerivation)return this.has_(e);var n=this.hasMap_.get(e);if(!n){var r=n=new f6(this.has_(e),r6,`ObservableMap.key?`,!1);this.hasMap_.set(e,r),trn(r,function(){return t.hasMap_.delete(e)})}return n.get()},t.set=function(e,t){var n=this.has_(e);if(L6(this)){var r=z6(this,{type:n?U6:Y6,object:this,newValue:t,name:e});if(!r)return this;t=r.newValue}return n?this.updateValue_(e,t):this.addValue_(e,t),this},t.delete=function(e){var t=this;if(this.keysAtom_,L6(this)&&!z6(this,{type:X6,object:this,name:e}))return!1;if(this.has_(e)){var n=O6(),r=B6(this),i=r||n?{observableKind:`map`,debugObjectName:this.name_,type:X6,object:this,oldValue:this.data_.get(e).value_,name:e}:null;return F6(function(){var n;t.keysAtom_.reportChanged(),(n=t.hasMap_.get(e))==null||n.setNewValue_(!1),t.data_.get(e).setNewValue_(void 0),t.data_.delete(e)}),r&&H6(this,i),!0}return!1},t.updateValue_=function(e,t){var n=this.data_.get(e);if(t=n.prepareNewValue_(t),t!==C6.UNCHANGED){var r=O6(),i=B6(this),a=i||r?{observableKind:`map`,debugObjectName:this.name_,type:U6,object:this,oldValue:n.value_,name:e,newValue:t}:null;n.setNewValue_(t),i&&H6(this,a)}},t.addValue_=function(e,t){var n=this;this.keysAtom_,F6(function(){var r,i=new f6(t,n.enhancer_,`ObservableMap.key`,!1);n.data_.set(e,i),t=i.value_,(r=n.hasMap_.get(e))==null||r.setNewValue_(!0),n.keysAtom_.reportChanged()});var r=O6(),i=B6(this),a=i||r?{observableKind:`map`,debugObjectName:this.name_,type:Y6,object:this,name:e,newValue:t}:null;i&&H6(this,a)},t.get=function(e){return this.has(e)?this.dehanceValue_(this.data_.get(e).get()):this.dehanceValue_(void 0)},t.dehanceValue_=function(e){return this.dehancer===void 0?e:this.dehancer(e)},t.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},t.values=function(){var e=this,t=this.keys();return krn({next:function(){var n=t.next(),r=n.done,i=n.value;return{done:r,value:r?void 0:e.get(i)}}})},t.entries=function(){var e=this,t=this.keys();return krn({next:function(){var n=t.next(),r=n.done,i=n.value;return{done:r,value:r?void 0:[i,e.get(i)]}}})},t[Symbol.iterator]=function(){return this.entries()},t.forEach=function(e,t){for(var n=q3(this),r;!(r=n()).done;){var i=r.value,a=i[0],o=i[1];e.call(t,o,a,this)}},t.merge=function(e){var t=this;return Z6(e)&&(e=new Map(e)),F6(function(){L3(e)?Qen(e).forEach(function(n){return t.set(n,e[n])}):Array.isArray(e)?e.forEach(function(e){var n=e[0],r=e[1];return t.set(n,r)}):B3(e)?(Xen(e)||O3(19,e),e.forEach(function(e,n){return t.set(n,e)})):e!=null&&O3(20,e)}),this},t.clear=function(){var e=this;F6(function(){xnn(function(){for(var t=q3(e.keys()),n;!(n=t()).done;){var r=n.value;e.delete(r)}})})},t.replace=function(e){var t=this;return F6(function(){for(var n=Arn(e),r=new Map,i=!1,a=q3(t.data_.keys()),o;!(o=a()).done;){var s=o.value;if(!n.has(s))if(t.delete(s))i=!0;else{var c=t.data_.get(s);r.set(s,c)}}for(var l=q3(n.entries()),u;!(u=l()).done;){var d=u.value,f=d[0],p=d[1],m=t.data_.has(f);if(t.set(f,p),t.data_.has(f)){var h=t.data_.get(f);r.set(f,h),m||(i=!0)}}if(!i)if(t.data_.size!==r.size)t.keysAtom_.reportChanged();else for(var g=t.data_.keys(),_=r.keys(),v=g.next(),y=_.next();!v.done;){if(v.value!==y.value){t.keysAtom_.reportChanged();break}v=g.next(),y=_.next()}t.data_=r}),this},t.toString=function(){return`[object ObservableMap]`},t.toJSON=function(){return Array.from(this)},t.observe_=function(e,t){return V6(this,e)},t.intercept_=function(e){return R6(this,e)},K3(e,[{key:`size`,get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return`Map`}}])}(),Z6=z3(`ObservableMap`,Orn);function krn(e){return e[Symbol.toStringTag]=`MapIterator`,rin(e)}function Arn(e){if(B3(e)||Z6(e))return e;if(Array.isArray(e))return new Map(e);if(L3(e)){var t=new Map;for(var n in e)t.set(n,e[n]);return t}else return O3(21,e)}var jrn={},Mrn=function(){function e(e,t,n){var r=this;t===void 0&&(t=n6),n===void 0&&(n=`ObservableSet`),this.name_=void 0,this[$3]=jrn,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=n,P3(Set)||O3(22),this.enhancer_=function(e,r){return t(e,r,n)},n8(function(){r.atom_=utn(r.name_),e&&r.replace(e)})}var t=e.prototype;return t.dehanceValue_=function(e){return this.dehancer===void 0?e:this.dehancer(e)},t.clear=function(){var e=this;F6(function(){xnn(function(){for(var t=q3(e.data_.values()),n;!(n=t()).done;){var r=n.value;e.delete(r)}})})},t.forEach=function(e,t){for(var n=q3(this),r;!(r=n()).done;){var i=r.value;e.call(t,i,i,this)}},t.add=function(e){var t=this;if(this.atom_,L6(this)){var n=z6(this,{type:Y6,object:this,newValue:e});if(!n)return this;e=n.newValue}if(!this.has(e)){F6(function(){t.data_.add(t.enhancer_(e,void 0)),t.atom_.reportChanged()});var r=!1,i=B6(this),a=i||r?{observableKind:`set`,debugObjectName:this.name_,type:Y6,object:this,newValue:e}:null;i&&H6(this,a)}return this},t.delete=function(e){var t=this;if(L6(this)&&!z6(this,{type:X6,object:this,oldValue:e}))return!1;if(this.has(e)){var n=!1,r=B6(this),i=r||n?{observableKind:`set`,debugObjectName:this.name_,type:X6,object:this,oldValue:e}:null;return F6(function(){t.atom_.reportChanged(),t.data_.delete(e)}),r&&H6(this,i),!0}return!1},t.has=function(e){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(e))},t.entries=function(){var e=this.values();return Nrn({next:function(){var t=e.next(),n=t.value,r=t.done;return r?{value:void 0,done:r}:{value:[n,n],done:r}}})},t.keys=function(){return this.values()},t.values=function(){this.atom_.reportObserved();var e=this,t=this.data_.values();return Nrn({next:function(){var n=t.next(),r=n.value,i=n.done;return i?{value:void 0,done:i}:{value:e.dehanceValue_(r),done:i}}})},t.intersection=function(e){return V3(e)&&!Q6(e)?e.intersection(this):new Set(this).intersection(e)},t.union=function(e){return V3(e)&&!Q6(e)?e.union(this):new Set(this).union(e)},t.difference=function(e){return new Set(this).difference(e)},t.symmetricDifference=function(e){return V3(e)&&!Q6(e)?e.symmetricDifference(this):new Set(this).symmetricDifference(e)},t.isSubsetOf=function(e){return new Set(this).isSubsetOf(e)},t.isSupersetOf=function(e){return new Set(this).isSupersetOf(e)},t.isDisjointFrom=function(e){return V3(e)&&!Q6(e)?e.isDisjointFrom(this):new Set(this).isDisjointFrom(e)},t.replace=function(e){var t=this;return Q6(e)&&(e=new Set(e)),F6(function(){Array.isArray(e)||V3(e)?(t.clear(),e.forEach(function(e){return t.add(e)})):e!=null&&O3(`Cannot initialize set from `+e)}),this},t.observe_=function(e,t){return V6(this,e)},t.intercept_=function(e){return R6(this,e)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return`[object ObservableSet]`},t[Symbol.iterator]=function(){return this.values()},K3(e,[{key:`size`,get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return`Set`}}])}(),Q6=z3(`ObservableSet`,Mrn);function Nrn(e){return e[Symbol.toStringTag]=`SetIterator`,rin(e)}var Prn=Object.create(null),Frn=`remove`,Irn=function(){function e(e,t,n,r){t===void 0&&(t=new Map),r===void 0&&(r=Btn),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=e,this.values_=t,this.name_=n,this.defaultAnnotation_=r,this.keysAtom_=new e6(`ObservableObject.keys`),this.isPlainObject_=L3(this.target_)}var t=e.prototype;return t.getObservablePropValue_=function(e){return this.values_.get(e).get()},t.setObservablePropValue_=function(e,t){var n=this.values_.get(e);if(n instanceof p6)return n.set(t),!0;if(L6(this)){var r=z6(this,{type:U6,object:this.proxy_||this.target_,name:e,newValue:t});if(!r)return null;t=r.newValue}if(t=n.prepareNewValue_(t),t!==C6.UNCHANGED){var i=B6(this),a=i?{type:U6,observableKind:`object`,debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:n.value_,name:e,newValue:t}:null;n.setNewValue_(t),i&&H6(this,a)}return!0},t.get_=function(e){return C6.trackingDerivation&&!U3(this.target_,e)&&this.has_(e),this.target_[e]},t.set_=function(e,t,n){return n===void 0&&(n=!1),U3(this.target_,e)?this.values_.has(e)?this.setObservablePropValue_(e,t):n?Reflect.set(this.target_,e,t):(this.target_[e]=t,!0):this.extend_(e,{value:t,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,n)},t.has_=function(e){if(!C6.trackingDerivation)return e in this.target_;this.pendingKeys_||=new Map;var t=this.pendingKeys_.get(e);return t||(t=new f6(e in this.target_,r6,`ObservableObject.key?`,!1),this.pendingKeys_.set(e,t)),t.get()},t.make_=function(e,t){if(t===!0&&(t=this.defaultAnnotation_),t!==!1){if(!(e in this.target_)){var n;if((n=this.target_[Y3])!=null&&n[e])return;O3(1,t.annotationType_,this.name_+`.`+e.toString())}for(var r=this.target_;r&&r!==M3;){var i=A3(r,e);if(i){var a=t.make_(this,e,i,r);if(a===0)return;if(a===1)break}r=Object.getPrototypeOf(r)}zrn(this,t,e)}},t.extend_=function(e,t,n,r){if(r===void 0&&(r=!1),n===!0&&(n=this.defaultAnnotation_),n===!1)return this.defineProperty_(e,t,r);var i=n.extend_(this,e,t,r);return i&&zrn(this,n,e),i},t.defineProperty_=function(e,t,n){n===void 0&&(n=!1),this.keysAtom_;try{w6();var r=this.delete_(e);if(!r)return r;if(L6(this)){var i=z6(this,{object:this.proxy_||this.target_,name:e,type:Y6,newValue:t.value});if(!i)return null;var a=i.newValue;t.value!==a&&(t=J3({},t,{value:a}))}if(n){if(!Reflect.defineProperty(this.target_,e,t))return!1}else j3(this.target_,e,t);this.notifyPropertyAddition_(e,t.value)}finally{T6()}return!0},t.defineObservableProperty_=function(e,t,n,r){r===void 0&&(r=!1),this.keysAtom_;try{w6();var i=this.delete_(e);if(!i)return i;if(L6(this)){var a=z6(this,{object:this.proxy_||this.target_,name:e,type:Y6,newValue:t});if(!a)return null;t=a.newValue}var o=Rrn(e),s={configurable:C6.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:o.get,set:o.set};if(r){if(!Reflect.defineProperty(this.target_,e,s))return!1}else j3(this.target_,e,s);var c=new f6(t,n,`ObservableObject.key`,!1);this.values_.set(e,c),this.notifyPropertyAddition_(e,c.value_)}finally{T6()}return!0},t.defineComputedProperty_=function(e,t,n){n===void 0&&(n=!1),this.keysAtom_;try{w6();var r=this.delete_(e);if(!r)return r;if(L6(this)&&!z6(this,{object:this.proxy_||this.target_,name:e,type:Y6,newValue:void 0}))return null;t.name||=`ObservableObject.key`,t.context=this.proxy_||this.target_;var i=Rrn(e),a={configurable:C6.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:i.get,set:i.set};if(n){if(!Reflect.defineProperty(this.target_,e,a))return!1}else j3(this.target_,e,a);this.values_.set(e,new p6(t)),this.notifyPropertyAddition_(e,void 0)}finally{T6()}return!0},t.delete_=function(e,t){if(t===void 0&&(t=!1),this.keysAtom_,!U3(this.target_,e))return!0;if(L6(this)&&!z6(this,{object:this.proxy_||this.target_,name:e,type:Frn}))return null;try{var n;w6();var r=B6(this),i=!1,a=this.values_.get(e),o=void 0;if(!a&&(r||i)&&(o=A3(this.target_,e)?.value),t){if(!Reflect.deleteProperty(this.target_,e))return!1}else delete this.target_[e];if(a&&(this.values_.delete(e),a instanceof f6&&(o=a.value_),Ann(a)),this.keysAtom_.reportChanged(),(n=this.pendingKeys_)==null||(n=n.get(e))==null||n.set(e in this.target_),r||i){var s={type:Frn,observableKind:`object`,object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:o,name:e};r&&H6(this,s)}}finally{T6()}return!0},t.observe_=function(e,t){return V6(this,e)},t.intercept_=function(e){return R6(this,e)},t.notifyPropertyAddition_=function(e,t){var n,r=B6(this),i=!1;if(r||i){var a=r||i?{type:Y6,observableKind:`object`,debugObjectName:this.name_,object:this.proxy_||this.target_,name:e,newValue:t}:null;r&&H6(this,a)}(n=this.pendingKeys_)==null||(n=n.get(e))==null||n.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),H3(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function $6(e,t){if(U3(e,$3))return e;var n=t?.name??`ObservableObject`;return R3(e,$3,new Irn(e,new Map,String(n),tnn(t))),e}var Lrn=z3(`ObservableObjectAdministration`,Irn);function Rrn(e){return Prn[e]||(Prn[e]={get:function(){return this[$3].getObservablePropValue_(e)},set:function(t){return this[$3].setObservablePropValue_(e,t)}})}function e8(e){return I3(e)?Lrn(e[$3]):!1}function zrn(e,t,n){var r;(r=e.target_[Y3])==null||delete r[n]}var Brn=Krn(0),Vrn=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1}(),Hrn=0,Urn=function(){};function Wrn(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__===void 0?e.prototype=t:e.prototype.__proto__=t}Wrn(Urn,Array.prototype);var Grn=function(e){function t(t,n,r,i){var a;return r===void 0&&(r=`ObservableArray`),i===void 0&&(i=!1),a=e.call(this)||this,n8(function(){var e=new Crn(r,n,i,!0);e.proxy_=a,Yen(a,$3,e),t&&t.length&&a.spliceWithArray(0,0,t),Vrn&&Object.defineProperty(a,"0",Brn)}),a}rtn(t,e);var n=t.prototype;return n.concat=function(){this[$3].atom_.reportObserved();var e=[...arguments];return Array.prototype.concat.apply(this.slice(),e.map(function(e){return J6(e)?e.slice():e}))},n[Symbol.iterator]=function(){var e=this,t=0;return rin({next:function(){return t<e.length?{value:e[t++],done:!1}:{done:!0,value:void 0}}})},K3(t,[{key:`length`,get:function(){return this[$3].getArrayLength_()},set:function(e){this[$3].setArrayLength_(e)}},{key:Symbol.toStringTag,get:function(){return`Array`}}])}(Urn);Object.entries(W6).forEach(function(e){var t=e[0],n=e[1];t!==`concat`&&R3(Grn.prototype,t,n)});function Krn(e){return{enumerable:!1,configurable:!0,get:function(){return this[$3].get_(e)},set:function(t){this[$3].set_(e,t)}}}function qrn(e){j3(Grn.prototype,``+e,Krn(e))}function Jrn(e){if(e>Hrn){for(var t=Hrn;t<e+100;t++)qrn(t);Hrn=e}}Jrn(1e3);function Yrn(e,t,n){return new Grn(e,t,n)}function t8(e,t){if(typeof e==`object`&&e){if(J6(e))return t!==void 0&&O3(23),e[$3].atom_;if(Q6(e))return e.atom_;if(Z6(e)){if(t===void 0)return e.keysAtom_;var n=e.data_.get(t)||e.hasMap_.get(t);return n||O3(25,t,Zrn(e)),n}if(e8(e)){if(!t)return O3(26);var r=e[$3].values_.get(t);return r||O3(27,t,Zrn(e)),r}if(ltn(e)||m6(e)||D6(e))return e}else if(P3(e)&&D6(e[$3]))return e[$3];O3(28)}function Xrn(e,t){if(e||O3(29),t!==void 0)return Xrn(t8(e,t));if(ltn(e)||m6(e)||D6(e)||Z6(e)||Q6(e))return e;if(e[$3])return e[$3];O3(24,e)}function Zrn(e,t){var n;if(t!==void 0)n=t8(e,t);else if(j6(e))return e.name;else n=e8(e)||Z6(e)||Q6(e)?Xrn(e):t8(e);return n.name_}function n8(e){var t=v6(),n=mnn(!0);w6();try{return e()}finally{T6(),hnn(n),y6(t)}}var Qrn=M3.toString;function $rn(e,t,n){return n===void 0&&(n=-1),ein(e,t,n)}function ein(e,t,n,r,i){if(e===t)return e!==0||1/e==1/t;if(e==null||t==null)return!1;if(e!==e)return t!==t;var a=typeof e;if(a!==`function`&&a!==`object`&&typeof t!=`object`)return!1;var o=Qrn.call(e);if(o!==Qrn.call(t))return!1;switch(o){case`[object RegExp]`:case`[object String]`:return``+e==``+t;case`[object Number]`:return+e==+e?+e==0?1/e==1/t:+e==+t:+t!=+t;case`[object Date]`:case`[object Boolean]`:return+e==+t;case`[object Symbol]`:return typeof Symbol<`u`&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t);case`[object Map]`:case`[object Set]`:n>=0&&n++;break}e=tin(e),t=tin(t);var s=o===`[object Array]`;if(!s){if(typeof e!=`object`||typeof t!=`object`)return!1;var c=e.constructor,l=t.constructor;if(c!==l&&!(P3(c)&&c instanceof c&&P3(l)&&l instanceof l)&&`constructor`in e&&`constructor`in t)return!1}if(n===0)return!1;n<0&&(n=-1),r||=[],i||=[];for(var u=r.length;u--;)if(r[u]===e)return i[u]===t;if(r.push(e),i.push(t),s){if(u=e.length,u!==t.length)return!1;for(;u--;)if(!ein(e[u],t[u],n-1,r,i))return!1}else{var d=Object.keys(e),f=d.length;if(Object.keys(t).length!==f)return!1;for(var p=0;p<f;p++){var m=d[p];if(!(U3(t,m)&&ein(e[m],t[m],n-1,r,i)))return!1}}return r.pop(),i.pop(),!0}function tin(e){return J6(e)?e.slice():B3(e)||Z6(e)||V3(e)||Q6(e)?Array.from(e.entries()):e}var nin=k3().Iterator?.prototype||{};function rin(e){return e[Symbol.iterator]=iin,Object.assign(Object.create(nin),e)}function iin(){return this}[`Symbol`,`Map`,`Set`].forEach(function(e){k3()[e]===void 0&&O3(`MobX requires global '`+e+`' to be available or polyfilled`)}),typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__==`object`&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:Rnn,extras:{getDebugName:Zrn},$mobx:$3});function r8(e){return Array.isArray(e)||J6(e)}function i8(e,t){let n=r8(e);if(n!==r8(t))throw Error(`PersistenceUtils::typeGuard] ${D3.MalformedDataError}`);if(n)for(let n of e)i8(n,t[0]);return o8(t)&&Object.keys(t).forEach(n=>{let r=e[n],i=t[n];if(r&&r8(i))i8(r,i);else if(r&&o8(r))i8(r,i);else if(o8(e)&&!e.hasOwnProperty(n))throw Error(`[PersistenceUtils::typeGuard] ${D3.MalformedDataError}`)}),!0}var ain=/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/;function a8(e){if(r8(e))for(let t=0;t<e.length;t++)e[t]=a8(e[t]);else if(o8(e))for(let t of Object.keys(e)){let n=e[t];typeof n==`object`?e[t]=a8(n):typeof n==`string`&&ain.exec(n)&&(e[t]=new Date(n))}return e}function o8(e){return typeof e==`object`&&!!e&&!r8(e)}var oin=class{storageName;schema;constructor(e,t){this.storageName=`${e}Storage`,this.schema=JSON.parse(JSON.stringify(t))}get(){let e=xq.getString(this.storageName),t=this.instantiateData(e);return this.isT(t),t}update(e){let t=JSON.parse(JSON.stringify(e)),n=Object.assign(this.get(),t);return this.isT(n),xq.set(this.storageName,JSON.stringify(n)),n}set(e){return this.isT(e),xq.set(this.storageName,JSON.stringify(e)),e}clear(){return xq.delete(this.storageName),this.instantiateData(void 0)}instantiateData(e){let t=e??JSON.stringify(this.schema);return xq.set(this.storageName,t),JSON.parse(t)}isT(e){if(!e||typeof e!=`object`)throw Error(`[PersistenceManager::isT] ${D3.IncorrectDataError}`);return i8(e,this.schema),!0}},sin=class{persistenceManager;schema;data;constructor(e,t){this.schema=JSON.parse(JSON.stringify(t)),this.data=JSON.parse(JSON.stringify(t)),this.persistenceManager=new oin(e,t),this.createDataFromSchema(),this.restore()}get(){return this.data}set(e){return this.data=JSON.parse(JSON.stringify(e)),this.data=a8(this.data),this.data}update(e){if(r8(this.data)){let t=this.data.findIndex(t=>t.uuid===e.uuid);if(t!==-1)this.data[t]={...this.data[t],...e};else try{i8([e],this.schema),this.data.push(e)}catch(e){throw e.message===D3.MalformedDataError?Error(`[DataManager::update] Cannot add an element that does not contain required fields`):e}}else Object.assign(this.data,e);return this.data}save(e=!0){return e?this.persistenceManager.update(this.data):this.persistenceManager.set(this.data)}restore(){if(this.data=this.persistenceManager.get(),this.data=a8(this.data),r8(this.data)){let e=e=>e.filter(e=>!!e.uuid);this.data=e(this.data)}return this.data}clear=()=>(this.persistenceManager.clear(),this.createDataFromSchema(),this.data);createDataFromSchema(){this.data=r8(this.schema)?[]:JSON.parse(JSON.stringify(this.schema))}},s8=new class extends sin{migrateData(){throw Error(`[TrackingManager::migrateData] Method purposefully not implemented.`)}constructor(){super(`trackingEvent`,[])}update(e){return super.update(e)}sync=async()=>{let e=super.get(),t=[];for(let n of e)try{await zen(n)}catch{t.push(n)}super.set(t),super.save(!1)}},c8=`3.9.0`,cin=`2026-11-03`,lin=1238,uin=`05700002209597`;V();var l8=function(e){return e.QuickGuideStartPress=`quickguide.start.press`,e.QuickGuideBackPressStep1=`quickguide.screen1.back.press`,e.QuickGuideNextPressStep1=`quickguide.screen1.next.press`,e.QuickGuideBackPressStep2=`quickguide.screen2.back.press`,e.QuickGuideNextPressStep2=`quickguide.screen2.next.press`,e.QuickGuideBackPressStep3=`quickguide.screen3.back.press`,e.QuickGuideNextPressStep3=`quickguide.screen3.next.press`,e.QuickGuideBackPressStep4=`quickguide.screen4.back.press`,e.QuickGuideNextPressStep4=`quickguide.screen4.next.press`,e.QuickGuideBackPressStep5=`quickguide.screen5.back.press`,e.QuickGuideNextPressStep5=`quickguide.screen5.next.press`,e.QuickGuideBackPressStep6=`quickguide.screen6.back.press`,e.QuickGuideFinishPress=`quickguide.finish.press`,e.SetupIntroStartPress=`setup.intro.start.press`,e.SetupGeneralBackPress=`setup.general.back.press`,e.SetupGeneralNextPress=`setup.general.next.press`,e.SetupTreatmentBackPress=`setup.treatment.back.press`,e.SetupTreatmentNextPress=`setup.treatment.next.press`,e.SetupOptionsNextPress=`setup.options.next.press`,e.SetupOptionsBackPress=`setup.options.back.press`,e.SetupInsulinBackPress=`setup.insulin.back.press`,e.SetupInsulinNextPress=`setup.insulin.next.press`,e.SetupTDDBackPress=`setup.tdd.back.press`,e.SetupTDDNextPress=`setup.tdd.next.press`,e.SetupSummaryBackPress=`setup.summary.back.press`,e.SetupSummaryFinishPress=`setup.summary.finish.press`,e.ForecastOffline=`forecast.offline`,e.ForecastNotificationsOff=`forecast.notifications.off`,e.ForecastNewCalculationPress=`forecast.newcalculation.press`,e.CarbohydrateChart7DaysPress=`carbohydratechart.7days.press`,e.CarbohydrateChart14DaysPress=`carbohydratechart.14days.press`,e.CarbohydrateChart30DaysPress=`carbohydratechart.30days.press`,e.CarbohydrateChart90DaysPress=`carbohydratechart.90days.press`,e.CarbohydrateChartStart=`carbohydratechart.start`,e.CarbohydrateChartEnd=`carbohydratechart.end`,e.RapidInsulinChart7DaysPress=`rapidinsulinchart.7days.press`,e.RapidInsulinChart14DaysPress=`rapidinsulinchart.14days.press`,e.RapidInsulinChart30DaysPress=`rapidinsulinchart.30days.press`,e.RapidInsulinChart90DaysPress=`rapidinsulinchart.90days.press`,e.RapidInsulinChartStart=`rapidinsulinchart.start`,e.RapidInsulinChartEnd=`rapidinsulinchart.end`,e.TimeInRangeChart7DaysPress=`timeinrangechart.7days.press`,e.TimeInRangeChart14DaysPress=`timeinrangechart.14days.press`,e.TimeInRangeChart30DaysPress=`timeinrangechart.30days.press`,e.TimeInRangeChart90DaysPress=`timeinrangechart.90days.press`,e.TimeInRangeChartStart=`timeinrangechart.start`,e.TimeInRangeChartEnd=`timeinrangechart.end`,e.MyDayPreviousPress=`mydaychart.previous.press`,e.MyDayNextPress=`mydaychart.next.press`,e.MyDayChartStart=`mydaychart.start`,e.MyDayChartEnd=`mydaychart.end`,e.ActiveInsulinChartStart=`activeinsulinchart.start`,e.ActiveInsulinChartEnd=`activeinsulinchart.end`,e.GlucoseChart7DaysPressCGM=`glucosechart.cgm.7days.press`,e.GlucoseChart14DaysPressCGM=`glucosechart.cgm.14days.press`,e.GlucoseChart30DaysPressCGM=`glucosechart.cgm.30days.press`,e.GlucoseChart90DaysPressCGM=`glucosechart.cgm.90days.press`,e.GlucoseChartStartCGM=`glucosechart.cgm.start`,e.GlucoseChartEndCGM=`glucosechart.cgm.end`,e.GlucoseChart7DaysPressBGM=`glucosechart.bgm.7days.press`,e.GlucoseChart14DaysPressBGM=`glucosechart.bgm.14days.press`,e.GlucoseChart30DaysPressBGM=`glucosechart.bgm.30days.press`,e.GlucoseChart90DaysPressBGM=`glucosechart.bgm.90days.press`,e.GlucoseChartStartBGM=`glucosechart.bgm.start`,e.GlucoseChartEndBGM=`glucosechart.bgm.end`,e.DashboardCgmButtonPress=`home.dashboard.cgm.press`,e.DashboardTabPress=`home.dashboard.press`,e.LogbookTabPress=`home.logbook.press`,e.NewCalculationTabPress=`home.newcalculation.press`,e.SettingsTabPress=`home.settings.press`,e.FoodLibraryTabPress=`home.foodlibrary.press`,e.CalculationGlucosePress=`calcflow.glucose.press`,e.CalculationCarbsPress=`calcflow.carbs.press`,e.CalculationActivityPress=`calcflow.activity.press`,e.CalculationNotesPress=`calcflow.notes.press`,e.AbortCalculationPress=`calcflow.abort.press`,e.RecentInsulinRegisterPress=`calcflow.recentinsulin.register.press`,e.RecentInsulinContinuePress=`calcflow.recentinsulin.continue.press`,e.CalculationManualInput=`calcflow.carbs.input.manual`,e.CalculationScanFoodPress=`calcflow.carbs.scanfood.press`,e.CalculationFoodLibraryPress=`calcflow.carbs.foodlibrary.press`,e.CalculationFoodLibraryDatabaseInput=`calcflow.carbs.foodlibrary.input.database`,e.CalculationFoodLibraryPersonalInput=`calcflow.carbs.foodlibrary.input.personal`,e.CalculationFoodLibraryPersonalPress=`calcflow.carbs.foodlibrary.personal.press`,e.CalculationFoodLibrarySearch=`calcflow.carbs.foodlibrary.search`,e.CalculationFoodLibraryAbort=`calcflow.carbs.foodlibrary.abort`,e.FoodLibrarySearched=`foodlibrary.searched`,e.FoodLibraryScanFoodPress=`foodlibrary.scanfood.press`,e.FoodLibraryPersonalPress=`foodlibrary.personal.press`,e.FoodLibraryCreatePress=`foodlibrary.create.press`,e.FoodLibraryUpdatePress=`foodlibrary.update.press`,e.ActivityAddPress=`calcflow.activity.add.press`,e.ActivityEditPress=`calcflow.activity.edit.press`,e.TransferDevice=`integration.device.transfer`,e.TransferService=`integration.service.transfer`,e.ExpiredGlucose=`calcflow.glucose.expired`,e.SummaryEmptyGlucose=`calcflow.summary.glucose.empty`,e.VisualSearchClosePress=`visualsearch.close.press`,e.VisualSearchNoMatchSearchLibraryPress=`visualsearch.nomatch.searchlibrary.press`,e.VisualSearchAddToCalculationPress=`visualsearch.addtocalculation.press`,e.RecommendationSuccess=`calcflow.recommendation.success`,e.RecommendationInvalid=`calcflow.recommendation.invalid`,e.RecommendationViewDetailsPress=`calcflow.recommendation.details.press`,e.RecommendationExpired=`calcflow.recommendation.expired`,e.RecommendationToastPress=`calcflow.recommendation.toast.press`,e.LogbookPersonalAddPress=`logbook.personal.add.press`,e.LogbookPersonalEditPress=`logbook.personal.edit.press`,e.LogbookPersonalDeletePress=`logbook.personal.delete.press`,e.LogbookExportPress=`logbook.export.press`,e.LogbookExportDurationFourteenDaysPress=`logbook.export.duration.fourteendays.press`,e.LogbookExportDurationThreeMonthsPress=`logbook.export.duration.threemonths.press`,e.LogbookExportDurationSixMonthsPress=`logbook.export.duration.sixmonths.press`,e.LogbookExportGeneratePress=`logbook.export.generate.press`,e.SettingsProfile=`settings.profile.press`,e.SettingsInsulin=`settings.insulin.press`,e.SettingsGlucose=`settings.glucose.press`,e.SettingsActivity=`settings.activity.press`,e.SettingsNotifications=`settings.notifications.press`,e.SettingsTheme=`settings.theme.press`,e.SettingsSmartPen=`settings.smartpen.press`,e.SettingsCGM=`settings.cgm.press`,e.SettingsBGM=`settings.bgm.press`,e.SettingsIFU=`settings.ifu.press`,e.SettingsSupport=`settings.support.press`,e.SettingsLegal=`settings.legal.press`,e.SettingsForecast=`settings.forecast.press`,e.NotificationsAllowQuickGuide=`quickguide.notifications.allow.press`,e.NotificationsAllowSettings=`settings.notifications.allow.press`,e.NotificationsDenyQuickGuide=`quickguide.notifications.deny.press`,e.NotificationsDenySettings=`settings.notifications.deny.press`,e.AppOpenNotification=`app.open.notification`,e.ErrorOffline=`errors.offline`,e.ErrorForceUpdate=`errors.forceupdate`,e.ErrorLogOut=`errors.logout`,e.WatchAppOpened=`watch.app.opened`,e.PINCodeSetupCreatePress=`pincode.setup.create.press`,e.PINCodeSetupMaybeLaterPress=`pincode.setup.maybelater.press`,e}({}),din=()=>{let{email:e,id:t,country:n=``}=jan.get();return{id:t,isTester:e.includes(`@hedia`),country:n,uuid:i3(),timestamp:new Date().toISOString(),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,platform:z.OS}},u8=(e,t)=>{let{id:n,isTester:r,country:i,uuid:a,timestamp:o,timezone:s,platform:c}=din(),l={uuid:a,type:e,timestamp:t??o,timezone:s,data:{version:c8,platform:c,user:{id:n,isTester:r},geo:{country:i}}};s8.update(l),s8.sync().catch(console.error)},fin=e=>{let{id:t,isTester:n,country:r,uuid:i,timestamp:a,timezone:o,platform:s}=din(),c={uuid:i,timestamp:a,timezone:o,type:`integration.service.transfer`,data:{version:c8,platform:s,source:{sourceID:e.source_id,deviceName:e.device_name,sourceName:e.source_name},reading:{type:e.type,value:e.quantity.value,unit:e.quantity.unit},geo:{country:r},user:{id:t,isTester:n}}};s8.update(c),s8.sync().catch(console.error)},d8=async(e,t,n=ken,r=0)=>{if(Oq)return fetch(e,t);let{accessToken:i}=E3.getState();if(!i)throw new Ren(`[hediaFetch] Missing access token`);let a={...t?.headers,Authorization:`Bearer ${i}`,...Aq},o=await T3(e,{...t,headers:a},n);if([X.StatusCode.UNAUTHORIZED,X.StatusCode.FORBIDDEN].includes(o.status)){if(r<1)return await min(),d8(e,t,n,r+1);throw new w2(`[hediaFetch::hediaFetch] Failed to refresh token after retry`,{statusCode:o.status,url:typeof e==`string`?e:e.url,method:t?.method})}return o},f8=null,pin=async()=>{let{accessToken:e,refreshToken:t,setTokens:n}=E3.getState();if(!t&&!e)throw new Ren(`[hediaFetch::refreshAccessToken] Missing refresh token`);if(!t)throw u8(l8.ErrorLogOut),n({accessToken:void 0,refreshToken:void 0}),Error(`[hediaFetch::refreshAccessToken] Missing refresh token for a signed-in session`);let r=await Pen(t);if(r.status===X.StatusCode.BAD_REQUEST)throw u8(l8.ErrorLogOut),n({accessToken:void 0,refreshToken:void 0}),new Ren(`[hediaFetch::refreshAccessToken] Bad request - cleared storage`);if(!r.ok)throw Error(`[hediaFetch::refreshAccessToken] Failed to refresh access token (status: ${r.status})`);let{access_token:i,refresh_token:a}=await r.json().catch(()=>null)??{};if(!i||!a)throw Error(`[hediaFetch::refreshAccessToken] Invalid token response from server`);n({accessToken:i,refreshToken:a})},min=()=>(f8===null&&(f8=pin().finally(()=>{f8=null})),f8),hin=async()=>{let e={headers:{Accept:`application/json`,"Content-Type":`application/json`},method:X.HTTPRequestMethod.GET},t=`${bq.HEDIA_SERVER_BASE_URL}/api/v3/user`,n=await d8(t,e);return await T2(n,X.StatusCode.OK,t),n.json()},gin={email:``},_in={lessThanXSeconds:{one:`mindre end ét sekund`,other:`mindre end {{count}} sekunder`},xSeconds:{one:`1 sekund`,other:`{{count}} sekunder`},halfAMinute:`ét halvt minut`,lessThanXMinutes:{one:`mindre end ét minut`,other:`mindre end {{count}} minutter`},xMinutes:{one:`1 minut`,other:`{{count}} minutter`},aboutXHours:{one:`cirka 1 time`,other:`cirka {{count}} timer`},xHours:{one:`1 time`,other:`{{count}} timer`},xDays:{one:`1 dag`,other:`{{count}} dage`},aboutXWeeks:{one:`cirka 1 uge`,other:`cirka {{count}} uger`},xWeeks:{one:`1 uge`,other:`{{count}} uger`},aboutXMonths:{one:`cirka 1 måned`,other:`cirka {{count}} måneder`},xMonths:{one:`1 måned`,other:`{{count}} måneder`},aboutXYears:{one:`cirka 1 år`,other:`cirka {{count}} år`},xYears:{one:`1 år`,other:`{{count}} år`},overXYears:{one:`over 1 år`,other:`over {{count}} år`},almostXYears:{one:`næsten 1 år`,other:`næsten {{count}} år`}},vin=(e,t,n)=>{let r,i=_in[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,String(t)),n?.addSuffix?n.comparison&&n.comparison>0?`om `+r:r+` siden`:r};function p8(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var yin={date:p8({formats:{full:`EEEE 'den' d. MMMM y`,long:`d. MMMM y`,medium:`d. MMM y`,short:`dd/MM/y`},defaultWidth:`full`}),time:p8({formats:{full:`HH:mm:ss zzzz`,long:`HH:mm:ss z`,medium:`HH:mm:ss`,short:`HH:mm`},defaultWidth:`full`}),dateTime:p8({formats:{full:`{{date}} 'kl'. {{time}}`,long:`{{date}} 'kl'. {{time}}`,medium:`{{date}} {{time}}`,short:`{{date}} {{time}}`},defaultWidth:`full`})},bin={lastWeek:`'sidste' eeee 'kl.' p`,yesterday:`'i går kl.' p`,today:`'i dag kl.' p`,tomorrow:`'i morgen kl.' p`,nextWeek:`'på' eeee 'kl.' p`,other:`P`},xin=(e,t,n,r)=>bin[e];function m8(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 Sin={ordinalNumber:(e,t)=>Number(e)+`.`,era:m8({values:{narrow:[`fvt`,`vt`],abbreviated:[`f.v.t.`,`v.t.`],wide:[`før vesterlandsk tidsregning`,`vesterlandsk tidsregning`]},defaultWidth:`wide`}),quarter:m8({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`1. kvt.`,`2. kvt.`,`3. kvt.`,`4. kvt.`],wide:[`1. kvartal`,`2. kvartal`,`3. kvartal`,`4. kvartal`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:m8({values:{narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`jan.`,`feb.`,`mar.`,`apr.`,`maj`,`jun.`,`jul.`,`aug.`,`sep.`,`okt.`,`nov.`,`dec.`],wide:[`januar`,`februar`,`marts`,`april`,`maj`,`juni`,`juli`,`august`,`september`,`oktober`,`november`,`december`]},defaultWidth:`wide`}),day:m8({values:{narrow:[`S`,`M`,`T`,`O`,`T`,`F`,`L`],short:[`sø`,`ma`,`ti`,`on`,`to`,`fr`,`lø`],abbreviated:[`søn.`,`man.`,`tir.`,`ons.`,`tor.`,`fre.`,`lør.`],wide:[`søndag`,`mandag`,`tirsdag`,`onsdag`,`torsdag`,`fredag`,`lørdag`]},defaultWidth:`wide`}),dayPeriod:m8({values:{narrow:{am:`a`,pm:`p`,midnight:`midnat`,noon:`middag`,morning:`morgen`,afternoon:`eftermiddag`,evening:`aften`,night:`nat`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnat`,noon:`middag`,morning:`morgen`,afternoon:`eftermiddag`,evening:`aften`,night:`nat`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnat`,noon:`middag`,morning:`morgen`,afternoon:`eftermiddag`,evening:`aften`,night:`nat`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`a`,pm:`p`,midnight:`midnat`,noon:`middag`,morning:`om morgenen`,afternoon:`om eftermiddagen`,evening:`om aftenen`,night:`om natten`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnat`,noon:`middag`,morning:`om morgenen`,afternoon:`om eftermiddagen`,evening:`om aftenen`,night:`om natten`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnat`,noon:`middag`,morning:`om morgenen`,afternoon:`om eftermiddagen`,evening:`om aftenen`,night:`om natten`}},defaultFormattingWidth:`wide`})};function h8(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)?win(s,e=>e.test(o)):Cin(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 Cin(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function win(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function g8(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 Tin={code:`da`,formatDistance:vin,formatLong:yin,formatRelative:xin,localize:Sin,match:{ordinalNumber:g8({matchPattern:/^(\d+)(\.)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:h8({matchPatterns:{narrow:/^(fKr|fvt|eKr|vt)/i,abbreviated:/^(f\.Kr\.?|f\.v\.t\.?|e\.Kr\.?|v\.t\.)/i,wide:/^(f.Kr.|før vesterlandsk tidsregning|e.Kr.|vesterlandsk tidsregning)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^f/i,/^(v|e)/i]},defaultParseWidth:`any`}),quarter:h8({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^[1234]. kvt\./i,wide:/^[1234]\.? kvartal/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:h8({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan.|feb.|mar.|apr.|maj|jun.|jul.|aug.|sep.|okt.|nov.|dec.)/i,wide:/^(januar|februar|marts|april|maj|juni|juli|august|september|oktober|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,/^maj/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:h8({matchPatterns:{narrow:/^[smtofl]/i,short:/^(søn.|man.|tir.|ons.|tor.|fre.|lør.)/i,abbreviated:/^(søn|man|tir|ons|tor|fre|lør)/i,wide:/^(søndag|mandag|tirsdag|onsdag|torsdag|fredag|lørdag)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^o/i,/^t/i,/^f/i,/^l/i],any:[/^s/i,/^m/i,/^ti/i,/^o/i,/^to/i,/^f/i,/^l/i]},defaultParseWidth:`any`}),dayPeriod:h8({matchPatterns:{narrow:/^(a|p|midnat|middag|(om) (morgenen|eftermiddagen|aftenen|natten))/i,any:/^([ap]\.?\s?m\.?|midnat|middag|(om) (morgenen|eftermiddagen|aftenen|natten))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/midnat/i,noon:/middag/i,morning:/morgen/i,afternoon:/eftermiddag/i,evening:/aften/i,night:/nat/i}},defaultParseWidth:`any`})},options:{weekStartsOn:1,firstWeekContainsDate:4}},Ein={lessThanXSeconds:{standalone:{one:`weniger als 1 Sekunde`,other:`weniger als {{count}} Sekunden`},withPreposition:{one:`weniger als 1 Sekunde`,other:`weniger als {{count}} Sekunden`}},xSeconds:{standalone:{one:`1 Sekunde`,other:`{{count}} Sekunden`},withPreposition:{one:`1 Sekunde`,other:`{{count}} Sekunden`}},halfAMinute:{standalone:`eine halbe Minute`,withPreposition:`einer halben Minute`},lessThanXMinutes:{standalone:{one:`weniger als 1 Minute`,other:`weniger als {{count}} Minuten`},withPreposition:{one:`weniger als 1 Minute`,other:`weniger als {{count}} Minuten`}},xMinutes:{standalone:{one:`1 Minute`,other:`{{count}} Minuten`},withPreposition:{one:`1 Minute`,other:`{{count}} Minuten`}},aboutXHours:{standalone:{one:`etwa 1 Stunde`,other:`etwa {{count}} Stunden`},withPreposition:{one:`etwa 1 Stunde`,other:`etwa {{count}} Stunden`}},xHours:{standalone:{one:`1 Stunde`,other:`{{count}} Stunden`},withPreposition:{one:`1 Stunde`,other:`{{count}} Stunden`}},xDays:{standalone:{one:`1 Tag`,other:`{{count}} Tage`},withPreposition:{one:`1 Tag`,other:`{{count}} Tagen`}},aboutXWeeks:{standalone:{one:`etwa 1 Woche`,other:`etwa {{count}} Wochen`},withPreposition:{one:`etwa 1 Woche`,other:`etwa {{count}} Wochen`}},xWeeks:{standalone:{one:`1 Woche`,other:`{{count}} Wochen`},withPreposition:{one:`1 Woche`,other:`{{count}} Wochen`}},aboutXMonths:{standalone:{one:`etwa 1 Monat`,other:`etwa {{count}} Monate`},withPreposition:{one:`etwa 1 Monat`,other:`etwa {{count}} Monaten`}},xMonths:{standalone:{one:`1 Monat`,other:`{{count}} Monate`},withPreposition:{one:`1 Monat`,other:`{{count}} Monaten`}},aboutXYears:{standalone:{one:`etwa 1 Jahr`,other:`etwa {{count}} Jahre`},withPreposition:{one:`etwa 1 Jahr`,other:`etwa {{count}} Jahren`}},xYears:{standalone:{one:`1 Jahr`,other:`{{count}} Jahre`},withPreposition:{one:`1 Jahr`,other:`{{count}} Jahren`}},overXYears:{standalone:{one:`mehr als 1 Jahr`,other:`mehr als {{count}} Jahre`},withPreposition:{one:`mehr als 1 Jahr`,other:`mehr als {{count}} Jahren`}},almostXYears:{standalone:{one:`fast 1 Jahr`,other:`fast {{count}} Jahre`},withPreposition:{one:`fast 1 Jahr`,other:`fast {{count}} Jahren`}}},Din=(e,t,n)=>{let r,i=n?.addSuffix?Ein[e].withPreposition:Ein[e].standalone;return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,String(t)),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:`vor `+r:r},Oin={date:p8({formats:{full:`EEEE, do MMMM y`,long:`do MMMM y`,medium:`do MMM y`,short:`dd.MM.y`},defaultWidth:`full`}),time:p8({formats:{full:`HH:mm:ss zzzz`,long:`HH:mm:ss z`,medium:`HH:mm:ss`,short:`HH:mm`},defaultWidth:`full`}),dateTime:p8({formats:{full:`{{date}} 'um' {{time}}`,long:`{{date}} 'um' {{time}}`,medium:`{{date}} {{time}}`,short:`{{date}} {{time}}`},defaultWidth:`full`})},kin={lastWeek:`'letzten' eeee 'um' p`,yesterday:`'gestern um' p`,today:`'heute um' p`,tomorrow:`'morgen um' p`,nextWeek:`eeee 'um' p`,other:`P`},Ain=(e,t,n,r)=>kin[e],jin={narrow:[`v.Chr.`,`n.Chr.`],abbreviated:[`v.Chr.`,`n.Chr.`],wide:[`vor Christus`,`nach Christus`]},Min={narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1. Quartal`,`2. Quartal`,`3. Quartal`,`4. Quartal`]},Nin={narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mär`,`Apr`,`Mai`,`Jun`,`Jul`,`Aug`,`Sep`,`Okt`,`Nov`,`Dez`],wide:[`Januar`,`Februar`,`März`,`April`,`Mai`,`Juni`,`Juli`,`August`,`September`,`Oktober`,`November`,`Dezember`]},Pin={narrow:Nin.narrow,abbreviated:[`Jan.`,`Feb.`,`März`,`Apr.`,`Mai`,`Juni`,`Juli`,`Aug.`,`Sep.`,`Okt.`,`Nov.`,`Dez.`],wide:Nin.wide},Fin={code:`de`,formatDistance:Din,formatLong:Oin,formatRelative:Ain,localize:{ordinalNumber:e=>Number(e)+`.`,era:m8({values:jin,defaultWidth:`wide`}),quarter:m8({values:Min,defaultWidth:`wide`,argumentCallback:e=>e-1}),month:m8({values:Nin,formattingValues:Pin,defaultWidth:`wide`}),day:m8({values:{narrow:[`S`,`M`,`D`,`M`,`D`,`F`,`S`],short:[`So`,`Mo`,`Di`,`Mi`,`Do`,`Fr`,`Sa`],abbreviated:[`So.`,`Mo.`,`Di.`,`Mi.`,`Do.`,`Fr.`,`Sa.`],wide:[`Sonntag`,`Montag`,`Dienstag`,`Mittwoch`,`Donnerstag`,`Freitag`,`Samstag`]},defaultWidth:`wide`}),dayPeriod:m8({values:{narrow:{am:`vm.`,pm:`nm.`,midnight:`Mitternacht`,noon:`Mittag`,morning:`Morgen`,afternoon:`Nachm.`,evening:`Abend`,night:`Nacht`},abbreviated:{am:`vorm.`,pm:`nachm.`,midnight:`Mitternacht`,noon:`Mittag`,morning:`Morgen`,afternoon:`Nachmittag`,evening:`Abend`,night:`Nacht`},wide:{am:`vormittags`,pm:`nachmittags`,midnight:`Mitternacht`,noon:`Mittag`,morning:`Morgen`,afternoon:`Nachmittag`,evening:`Abend`,night:`Nacht`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`vm.`,pm:`nm.`,midnight:`Mitternacht`,noon:`Mittag`,morning:`morgens`,afternoon:`nachm.`,evening:`abends`,night:`nachts`},abbreviated:{am:`vorm.`,pm:`nachm.`,midnight:`Mitternacht`,noon:`Mittag`,morning:`morgens`,afternoon:`nachmittags`,evening:`abends`,night:`nachts`},wide:{am:`vormittags`,pm:`nachmittags`,midnight:`Mitternacht`,noon:`Mittag`,morning:`morgens`,afternoon:`nachmittags`,evening:`abends`,night:`nachts`}},defaultFormattingWidth:`wide`})},match:{ordinalNumber:g8({matchPattern:/^(\d+)(\.)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e)}),era:h8({matchPatterns:{narrow:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,abbreviated:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,wide:/^(vor Christus|vor unserer Zeitrechnung|nach Christus|unserer Zeitrechnung)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^v/i,/^n/i]},defaultParseWidth:`any`}),quarter:h8({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](\.)? Quartal/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:h8({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(j[aä]n|feb|mär[z]?|apr|mai|jun[i]?|jul[i]?|aug|sep|okt|nov|dez)\.?/i,wide:/^(januar|februar|märz|april|mai|juni|juli|august|september|oktober|november|dezember)/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:[/^j[aä]/i,/^f/i,/^mär/i,/^ap/i,/^mai/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:h8({matchPatterns:{narrow:/^[smdmf]/i,short:/^(so|mo|di|mi|do|fr|sa)/i,abbreviated:/^(son?|mon?|die?|mit?|don?|fre?|sam?)\.?/i,wide:/^(sonntag|montag|dienstag|mittwoch|donnerstag|freitag|samstag)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^so/i,/^mo/i,/^di/i,/^mi/i,/^do/i,/^f/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:h8({matchPatterns:{narrow:/^(vm\.?|nm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,abbreviated:/^(vorm\.?|nachm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,wide:/^(vormittags|nachmittags|Mitternacht|Mittag|morgens|nachmittags|abends|nachts)/i},defaultMatchWidth:`wide`,parsePatterns:{any:{am:/^v/i,pm:/^n/i,midnight:/^Mitte/i,noon:/^Mitta/i,morning:/morgens/i,afternoon:/nachmittags/i,evening:/abends/i,night:/nachts/i}},defaultParseWidth:`any`})},options:{weekStartsOn:1,firstWeekContainsDate:4}},Iin={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`}},Lin=(e,t,n)=>{let r,i=Iin[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},Rin={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},zin=(e,t,n,r)=>Rin[e],Bin={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:m8({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:m8({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:m8({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:m8({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:m8({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`})},Vin={ordinalNumber:g8({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:h8({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:h8({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:h8({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:h8({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:h8({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`})},Hin={code:`en-GB`,formatDistance:Lin,formatLong:{date:p8({formats:{full:`EEEE, d MMMM yyyy`,long:`d MMMM yyyy`,medium:`d MMM yyyy`,short:`dd/MM/yyyy`},defaultWidth:`full`}),time:p8({formats:{full:`HH:mm:ss zzzz`,long:`HH:mm:ss z`,medium:`HH:mm:ss`,short:`HH:mm`},defaultWidth:`full`}),dateTime:p8({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},formatRelative:zin,localize:Bin,match:Vin,options:{weekStartsOn:1,firstWeekContainsDate:4}},Uin={lessThanXSeconds:{one:`menos de un segundo`,other:`menos de {{count}} segundos`},xSeconds:{one:`1 segundo`,other:`{{count}} segundos`},halfAMinute:`medio minuto`,lessThanXMinutes:{one:`menos de un minuto`,other:`menos de {{count}} minutos`},xMinutes:{one:`1 minuto`,other:`{{count}} minutos`},aboutXHours:{one:`alrededor de 1 hora`,other:`alrededor de {{count}} horas`},xHours:{one:`1 hora`,other:`{{count}} horas`},xDays:{one:`1 día`,other:`{{count}} días`},aboutXWeeks:{one:`alrededor de 1 semana`,other:`alrededor de {{count}} semanas`},xWeeks:{one:`1 semana`,other:`{{count}} semanas`},aboutXMonths:{one:`alrededor de 1 mes`,other:`alrededor de {{count}} meses`},xMonths:{one:`1 mes`,other:`{{count}} meses`},aboutXYears:{one:`alrededor de 1 año`,other:`alrededor de {{count}} años`},xYears:{one:`1 año`,other:`{{count}} años`},overXYears:{one:`más de 1 año`,other:`más de {{count}} años`},almostXYears:{one:`casi 1 año`,other:`casi {{count}} años`}},Win=(e,t,n)=>{let r,i=Uin[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`en `+r:`hace `+r:r},Gin={date:p8({formats:{full:`EEEE, d 'de' MMMM 'de' y`,long:`d 'de' MMMM 'de' y`,medium:`d MMM y`,short:`dd/MM/y`},defaultWidth:`full`}),time:p8({formats:{full:`HH:mm:ss zzzz`,long:`HH:mm:ss z`,medium:`HH:mm:ss`,short:`HH:mm`},defaultWidth:`full`}),dateTime:p8({formats:{full:`{{date}} 'a las' {{time}}`,long:`{{date}} 'a las' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},Kin={lastWeek:`'el' eeee 'pasado a la' p`,yesterday:`'ayer a la' p`,today:`'hoy a la' p`,tomorrow:`'mañana a la' p`,nextWeek:`eeee 'a la' p`,other:`P`},qin={lastWeek:`'el' eeee 'pasado a las' p`,yesterday:`'ayer a las' p`,today:`'hoy a las' p`,tomorrow:`'mañana a las' p`,nextWeek:`eeee 'a las' p`,other:`P`},Jin={code:`es`,formatDistance:Win,formatLong:Gin,formatRelative:(e,t,n,r)=>t.getHours()===1?Kin[e]:qin[e],localize:{ordinalNumber:(e,t)=>Number(e)+`º`,era:m8({values:{narrow:[`AC`,`DC`],abbreviated:[`AC`,`DC`],wide:[`antes de cristo`,`después de cristo`]},defaultWidth:`wide`}),quarter:m8({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`T1`,`T2`,`T3`,`T4`],wide:[`1º trimestre`,`2º trimestre`,`3º trimestre`,`4º trimestre`]},defaultWidth:`wide`,argumentCallback:e=>Number(e)-1}),month:m8({values:{narrow:[`e`,`f`,`m`,`a`,`m`,`j`,`j`,`a`,`s`,`o`,`n`,`d`],abbreviated:[`ene`,`feb`,`mar`,`abr`,`may`,`jun`,`jul`,`ago`,`sep`,`oct`,`nov`,`dic`],wide:[`enero`,`febrero`,`marzo`,`abril`,`mayo`,`junio`,`julio`,`agosto`,`septiembre`,`octubre`,`noviembre`,`diciembre`]},defaultWidth:`wide`}),day:m8({values:{narrow:[`d`,`l`,`m`,`m`,`j`,`v`,`s`],short:[`do`,`lu`,`ma`,`mi`,`ju`,`vi`,`sá`],abbreviated:[`dom`,`lun`,`mar`,`mié`,`jue`,`vie`,`sáb`],wide:[`domingo`,`lunes`,`martes`,`miércoles`,`jueves`,`viernes`,`sábado`]},defaultWidth:`wide`}),dayPeriod:m8({values:{narrow:{am:`a`,pm:`p`,midnight:`mn`,noon:`md`,morning:`mañana`,afternoon:`tarde`,evening:`tarde`,night:`noche`},abbreviated:{am:`AM`,pm:`PM`,midnight:`medianoche`,noon:`mediodia`,morning:`mañana`,afternoon:`tarde`,evening:`tarde`,night:`noche`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`medianoche`,noon:`mediodia`,morning:`mañana`,afternoon:`tarde`,evening:`tarde`,night:`noche`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`a`,pm:`p`,midnight:`mn`,noon:`md`,morning:`de la mañana`,afternoon:`de la tarde`,evening:`de la tarde`,night:`de la noche`},abbreviated:{am:`AM`,pm:`PM`,midnight:`medianoche`,noon:`mediodia`,morning:`de la mañana`,afternoon:`de la tarde`,evening:`de la tarde`,night:`de la noche`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`medianoche`,noon:`mediodia`,morning:`de la mañana`,afternoon:`de la tarde`,evening:`de la tarde`,night:`de la noche`}},defaultFormattingWidth:`wide`})},match:{ordinalNumber:g8({matchPattern:/^(\d+)(º)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:h8({matchPatterns:{narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes de la era com[uú]n|despu[eé]s de cristo|era com[uú]n)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes de la era com[uú]n)/i,/^(despu[eé]s de cristo|era com[uú]n)/i]},defaultParseWidth:`any`}),quarter:h8({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:h8({matchPatterns:{narrow:/^[efmajsond]/i,abbreviated:/^(ene|feb|mar|abr|may|jun|jul|ago|sep|oct|nov|dic)/i,wide:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^e/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^en/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i]},defaultParseWidth:`any`}),day:h8({matchPatterns:{narrow:/^[dlmjvs]/i,short:/^(do|lu|ma|mi|ju|vi|s[áa])/i,abbreviated:/^(dom|lun|mar|mi[ée]|jue|vie|s[áa]b)/i,wide:/^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^do/i,/^lu/i,/^ma/i,/^mi/i,/^ju/i,/^vi/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:h8({matchPatterns:{narrow:/^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,any:/^([ap]\.?\s?m\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mn/i,noon:/^md/i,morning:/mañana/i,afternoon:/tarde/i,evening:/tarde/i,night:/noche/i}},defaultParseWidth:`any`})},options:{weekStartsOn:1,firstWeekContainsDate:1}},Yin={lessThanXSeconds:{one:`moins d’une seconde`,other:`moins de {{count}} secondes`},xSeconds:{one:`1 seconde`,other:`{{count}} secondes`},halfAMinute:`30 secondes`,lessThanXMinutes:{one:`moins d’une minute`,other:`moins de {{count}} minutes`},xMinutes:{one:`1 minute`,other:`{{count}} minutes`},aboutXHours:{one:`environ 1 heure`,other:`environ {{count}} heures`},xHours:{one:`1 heure`,other:`{{count}} heures`},xDays:{one:`1 jour`,other:`{{count}} jours`},aboutXWeeks:{one:`environ 1 semaine`,other:`environ {{count}} semaines`},xWeeks:{one:`1 semaine`,other:`{{count}} semaines`},aboutXMonths:{one:`environ 1 mois`,other:`environ {{count}} mois`},xMonths:{one:`1 mois`,other:`{{count}} mois`},aboutXYears:{one:`environ 1 an`,other:`environ {{count}} ans`},xYears:{one:`1 an`,other:`{{count}} ans`},overXYears:{one:`plus d’un an`,other:`plus de {{count}} ans`},almostXYears:{one:`presqu’un an`,other:`presque {{count}} ans`}},Xin=(e,t,n)=>{let r,i=Yin[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,String(t)),n?.addSuffix?n.comparison&&n.comparison>0?`dans `+r:`il y a `+r:r},Zin={date:p8({formats:{full:`EEEE d MMMM y`,long:`d MMMM y`,medium:`d MMM y`,short:`dd/MM/y`},defaultWidth:`full`}),time:p8({formats:{full:`HH:mm:ss zzzz`,long:`HH:mm:ss z`,medium:`HH:mm:ss`,short:`HH:mm`},defaultWidth:`full`}),dateTime:p8({formats:{full:`{{date}} 'à' {{time}}`,long:`{{date}} 'à' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},Qin={lastWeek:`eeee 'dernier à' p`,yesterday:`'hier à' p`,today:`'aujourd’hui à' p`,tomorrow:`'demain à' p'`,nextWeek:`eeee 'prochain à' p`,other:`P`},$in=(e,t,n,r)=>Qin[e],ean={narrow:[`av. J.-C`,`ap. J.-C`],abbreviated:[`av. J.-C`,`ap. J.-C`],wide:[`avant Jésus-Christ`,`après Jésus-Christ`]},tan={narrow:[`T1`,`T2`,`T3`,`T4`],abbreviated:[`1er trim.`,`2ème trim.`,`3ème trim.`,`4ème trim.`],wide:[`1er trimestre`,`2ème trimestre`,`3ème trimestre`,`4ème trimestre`]},nan={narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`janv.`,`févr.`,`mars`,`avr.`,`mai`,`juin`,`juil.`,`août`,`sept.`,`oct.`,`nov.`,`déc.`],wide:[`janvier`,`février`,`mars`,`avril`,`mai`,`juin`,`juillet`,`août`,`septembre`,`octobre`,`novembre`,`décembre`]},ran={narrow:[`D`,`L`,`M`,`M`,`J`,`V`,`S`],short:[`di`,`lu`,`ma`,`me`,`je`,`ve`,`sa`],abbreviated:[`dim.`,`lun.`,`mar.`,`mer.`,`jeu.`,`ven.`,`sam.`],wide:[`dimanche`,`lundi`,`mardi`,`mercredi`,`jeudi`,`vendredi`,`samedi`]},ian={narrow:{am:`AM`,pm:`PM`,midnight:`minuit`,noon:`midi`,morning:`mat.`,afternoon:`ap.m.`,evening:`soir`,night:`mat.`},abbreviated:{am:`AM`,pm:`PM`,midnight:`minuit`,noon:`midi`,morning:`matin`,afternoon:`après-midi`,evening:`soir`,night:`matin`},wide:{am:`AM`,pm:`PM`,midnight:`minuit`,noon:`midi`,morning:`du matin`,afternoon:`de l’après-midi`,evening:`du soir`,night:`du matin`}},aan=(e,t)=>{let n=Number(e),r=t?.unit;if(n===0)return`0`;let i=[`year`,`week`,`hour`,`minute`,`second`],a;return a=n===1?r&&i.includes(r)?`ère`:`er`:`ème`,n+a},oan=[`MMM`,`MMMM`],san={code:`fr`,formatDistance:Xin,formatLong:Zin,formatRelative:$in,localize:{preprocessor:(e,t)=>e.getDate()===1||!t.some(e=>e.isToken&&oan.includes(e.value))?t:t.map(e=>e.isToken&&e.value===`do`?{isToken:!0,value:`d`}:e),ordinalNumber:aan,era:m8({values:ean,defaultWidth:`wide`}),quarter:m8({values:tan,defaultWidth:`wide`,argumentCallback:e=>e-1}),month:m8({values:nan,defaultWidth:`wide`}),day:m8({values:ran,defaultWidth:`wide`}),dayPeriod:m8({values:ian,defaultWidth:`wide`})},match:{ordinalNumber:g8({matchPattern:/^(\d+)(ième|ère|ème|er|e)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e)}),era:h8({matchPatterns:{narrow:/^(av\.J\.C|ap\.J\.C|ap\.J\.-C)/i,abbreviated:/^(av\.J\.-C|av\.J-C|apr\.J\.-C|apr\.J-C|ap\.J-C)/i,wide:/^(avant Jésus-Christ|après Jésus-Christ)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^av/i,/^ap/i]},defaultParseWidth:`any`}),quarter:h8({matchPatterns:{narrow:/^T?[1234]/i,abbreviated:/^[1234](er|ème|e)? trim\.?/i,wide:/^[1234](er|ème|e)? trimestre/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:h8({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(janv|févr|mars|avr|mai|juin|juill|juil|août|sept|oct|nov|déc)\.?/i,wide:/^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/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,/^av/i,/^ma/i,/^juin/i,/^juil/i,/^ao/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:h8({matchPatterns:{narrow:/^[lmjvsd]/i,short:/^(di|lu|ma|me|je|ve|sa)/i,abbreviated:/^(dim|lun|mar|mer|jeu|ven|sam)\.?/i,wide:/^(dimanche|lundi|mardi|mercredi|jeudi|vendredi|samedi)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^di/i,/^lu/i,/^ma/i,/^me/i,/^je/i,/^ve/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:h8({matchPatterns:{narrow:/^(a|p|minuit|midi|mat\.?|ap\.?m\.?|soir|nuit)/i,any:/^([ap]\.?\s?m\.?|du matin|de l'après[-\s]midi|du soir|de la nuit)/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^min/i,noon:/^mid/i,morning:/mat/i,afternoon:/ap/i,evening:/soir/i,night:/nuit/i}},defaultParseWidth:`any`})},options:{weekStartsOn:1,firstWeekContainsDate:4}},can={lessThanXSeconds:{one:`meno di un secondo`,other:`meno di {{count}} secondi`},xSeconds:{one:`un secondo`,other:`{{count}} secondi`},halfAMinute:`alcuni secondi`,lessThanXMinutes:{one:`meno di un minuto`,other:`meno di {{count}} minuti`},xMinutes:{one:`un minuto`,other:`{{count}} minuti`},aboutXHours:{one:`circa un'ora`,other:`circa {{count}} ore`},xHours:{one:`un'ora`,other:`{{count}} ore`},xDays:{one:`un giorno`,other:`{{count}} giorni`},aboutXWeeks:{one:`circa una settimana`,other:`circa {{count}} settimane`},xWeeks:{one:`una settimana`,other:`{{count}} settimane`},aboutXMonths:{one:`circa un mese`,other:`circa {{count}} mesi`},xMonths:{one:`un mese`,other:`{{count}} mesi`},aboutXYears:{one:`circa un anno`,other:`circa {{count}} anni`},xYears:{one:`un anno`,other:`{{count}} anni`},overXYears:{one:`più di un anno`,other:`più di {{count}} anni`},almostXYears:{one:`quasi un anno`,other:`quasi {{count}} anni`}},lan=(e,t,n)=>{let r,i=can[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`tra `+r:r+` fa`:r},uan={date:p8({formats:{full:`EEEE d MMMM y`,long:`d MMMM y`,medium:`d MMM y`,short:`dd/MM/y`},defaultWidth:`full`}),time:p8({formats:{full:`HH:mm:ss zzzz`,long:`HH:mm:ss z`,medium:`HH:mm:ss`,short:`HH:mm`},defaultWidth:`full`}),dateTime:p8({formats:{full:`{{date}} {{time}}`,long:`{{date}} {{time}}`,medium:`{{date}} {{time}}`,short:`{{date}} {{time}}`},defaultWidth:`full`})};function _8(e,...t){let n=$4.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}var dan={};function v8(){return dan}function fan(e){dan=e}function y8(e,t){let n=v8(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=e3(e,t?.in),a=i.getDay(),o=(a<r?7:0)+a-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function pan(e,t,n){let[r,i]=_8(n?.in,e,t);return+y8(r,n)==+y8(i,n)}var man=[`domenica`,`lunedì`,`martedì`,`mercoledì`,`giovedì`,`venerdì`,`sabato`];function han(e){switch(e){case 0:return`'domenica scorsa alle' p`;default:return`'`+man[e]+` scorso alle' p`}}function gan(e){return`'`+man[e]+` alle' p`}function _an(e){switch(e){case 0:return`'domenica prossima alle' p`;default:return`'`+man[e]+` prossimo alle' p`}}var van={lastWeek:(e,t,n)=>{let r=e.getDay();return pan(e,t,n)?gan(r):han(r)},yesterday:`'ieri alle' p`,today:`'oggi alle' p`,tomorrow:`'domani alle' p`,nextWeek:(e,t,n)=>{let r=e.getDay();return pan(e,t,n)?gan(r):_an(r)},other:`P`},yan={code:`it`,formatDistance:lan,formatLong:uan,formatRelative:(e,t,n,r)=>{let i=van[e];return typeof i==`function`?i(t,n,r):i},localize:{ordinalNumber:(e,t)=>{let n=Number(e);return String(n)},era:m8({values:{narrow:[`aC`,`dC`],abbreviated:[`a.C.`,`d.C.`],wide:[`avanti Cristo`,`dopo Cristo`]},defaultWidth:`wide`}),quarter:m8({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`T1`,`T2`,`T3`,`T4`],wide:[`1º trimestre`,`2º trimestre`,`3º trimestre`,`4º trimestre`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:m8({values:{narrow:[`G`,`F`,`M`,`A`,`M`,`G`,`L`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`gen`,`feb`,`mar`,`apr`,`mag`,`giu`,`lug`,`ago`,`set`,`ott`,`nov`,`dic`],wide:[`gennaio`,`febbraio`,`marzo`,`aprile`,`maggio`,`giugno`,`luglio`,`agosto`,`settembre`,`ottobre`,`novembre`,`dicembre`]},defaultWidth:`wide`}),day:m8({values:{narrow:[`D`,`L`,`M`,`M`,`G`,`V`,`S`],short:[`dom`,`lun`,`mar`,`mer`,`gio`,`ven`,`sab`],abbreviated:[`dom`,`lun`,`mar`,`mer`,`gio`,`ven`,`sab`],wide:[`domenica`,`lunedì`,`martedì`,`mercoledì`,`giovedì`,`venerdì`,`sabato`]},defaultWidth:`wide`}),dayPeriod:m8({values:{narrow:{am:`m.`,pm:`p.`,midnight:`mezzanotte`,noon:`mezzogiorno`,morning:`mattina`,afternoon:`pomeriggio`,evening:`sera`,night:`notte`},abbreviated:{am:`AM`,pm:`PM`,midnight:`mezzanotte`,noon:`mezzogiorno`,morning:`mattina`,afternoon:`pomeriggio`,evening:`sera`,night:`notte`},wide:{am:`AM`,pm:`PM`,midnight:`mezzanotte`,noon:`mezzogiorno`,morning:`mattina`,afternoon:`pomeriggio`,evening:`sera`,night:`notte`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`m.`,pm:`p.`,midnight:`mezzanotte`,noon:`mezzogiorno`,morning:`di mattina`,afternoon:`del pomeriggio`,evening:`di sera`,night:`di notte`},abbreviated:{am:`AM`,pm:`PM`,midnight:`mezzanotte`,noon:`mezzogiorno`,morning:`di mattina`,afternoon:`del pomeriggio`,evening:`di sera`,night:`di notte`},wide:{am:`AM`,pm:`PM`,midnight:`mezzanotte`,noon:`mezzogiorno`,morning:`di mattina`,afternoon:`del pomeriggio`,evening:`di sera`,night:`di notte`}},defaultFormattingWidth:`wide`})},match:{ordinalNumber:g8({matchPattern:/^(\d+)(º)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:h8({matchPatterns:{narrow:/^(aC|dC)/i,abbreviated:/^(a\.?\s?C\.?|a\.?\s?e\.?\s?v\.?|d\.?\s?C\.?|e\.?\s?v\.?)/i,wide:/^(avanti Cristo|avanti Era Volgare|dopo Cristo|Era Volgare)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^a/i,/^(d|e)/i]},defaultParseWidth:`any`}),quarter:h8({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^t[1234]/i,wide:/^[1234](º)? trimestre/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:h8({matchPatterns:{narrow:/^[gfmalsond]/i,abbreviated:/^(gen|feb|mar|apr|mag|giu|lug|ago|set|ott|nov|dic)/i,wide:/^(gennaio|febbraio|marzo|aprile|maggio|giugno|luglio|agosto|settembre|ottobre|novembre|dicembre)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^g/i,/^f/i,/^m/i,/^a/i,/^m/i,/^g/i,/^l/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ge/i,/^f/i,/^mar/i,/^ap/i,/^mag/i,/^gi/i,/^l/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:h8({matchPatterns:{narrow:/^[dlmgvs]/i,short:/^(do|lu|ma|me|gi|ve|sa)/i,abbreviated:/^(dom|lun|mar|mer|gio|ven|sab)/i,wide:/^(domenica|luned[i|ì]|marted[i|ì]|mercoled[i|ì]|gioved[i|ì]|venerd[i|ì]|sabato)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^g/i,/^v/i,/^s/i],any:[/^d/i,/^l/i,/^ma/i,/^me/i,/^g/i,/^v/i,/^s/i]},defaultParseWidth:`any`}),dayPeriod:h8({matchPatterns:{narrow:/^(a|m\.|p|mezzanotte|mezzogiorno|(di|del) (mattina|pomeriggio|sera|notte))/i,any:/^([ap]\.?\s?m\.?|mezzanotte|mezzogiorno|(di|del) (mattina|pomeriggio|sera|notte))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mezza/i,noon:/^mezzo/i,morning:/mattina/i,afternoon:/pomeriggio/i,evening:/sera/i,night:/notte/i}},defaultParseWidth:`any`})},options:{weekStartsOn:1,firstWeekContainsDate:4}},ban={lessThanXSeconds:{one:`mindre än en sekund`,other:`mindre än {{count}} sekunder`},xSeconds:{one:`en sekund`,other:`{{count}} sekunder`},halfAMinute:`en halv minut`,lessThanXMinutes:{one:`mindre än en minut`,other:`mindre än {{count}} minuter`},xMinutes:{one:`en minut`,other:`{{count}} minuter`},aboutXHours:{one:`ungefär en timme`,other:`ungefär {{count}} timmar`},xHours:{one:`en timme`,other:`{{count}} timmar`},xDays:{one:`en dag`,other:`{{count}} dagar`},aboutXWeeks:{one:`ungefär en vecka`,other:`ungefär {{count}} veckor`},xWeeks:{one:`en vecka`,other:`{{count}} veckor`},aboutXMonths:{one:`ungefär en månad`,other:`ungefär {{count}} månader`},xMonths:{one:`en månad`,other:`{{count}} månader`},aboutXYears:{one:`ungefär ett år`,other:`ungefär {{count}} år`},xYears:{one:`ett år`,other:`{{count}} år`},overXYears:{one:`över ett år`,other:`över {{count}} år`},almostXYears:{one:`nästan ett år`,other:`nästan {{count}} år`}},xan=[`noll`,`en`,`två`,`tre`,`fyra`,`fem`,`sex`,`sju`,`åtta`,`nio`,`tio`,`elva`,`tolv`],San=(e,t,n)=>{let r,i=ban[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t<13?xan[t]:String(t)),n?.addSuffix?n.comparison&&n.comparison>0?`om `+r:r+` sedan`:r},Can={date:p8({formats:{full:`EEEE d MMMM y`,long:`d MMMM y`,medium:`d MMM y`,short:`y-MM-dd`},defaultWidth:`full`}),time:p8({formats:{full:`'kl'. HH:mm:ss zzzz`,long:`HH:mm:ss z`,medium:`HH:mm:ss`,short:`HH:mm`},defaultWidth:`full`}),dateTime:p8({formats:{full:`{{date}} 'kl.' {{time}}`,long:`{{date}} 'kl.' {{time}}`,medium:`{{date}} {{time}}`,short:`{{date}} {{time}}`},defaultWidth:`full`})},wan={lastWeek:`'i' EEEE's kl.' p`,yesterday:`'igår kl.' p`,today:`'idag kl.' p`,tomorrow:`'imorgon kl.' p`,nextWeek:`EEEE 'kl.' p`,other:`P`},Tan={code:`sv`,formatDistance:San,formatLong:Can,formatRelative:(e,t,n,r)=>wan[e],localize:{ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:case 2:return n+`:a`}return n+`:e`},era:m8({values:{narrow:[`f.Kr.`,`e.Kr.`],abbreviated:[`f.Kr.`,`e.Kr.`],wide:[`före Kristus`,`efter Kristus`]},defaultWidth:`wide`}),quarter:m8({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1:a kvartalet`,`2:a kvartalet`,`3:e kvartalet`,`4:e kvartalet`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:m8({values:{narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`jan.`,`feb.`,`mars`,`apr.`,`maj`,`juni`,`juli`,`aug.`,`sep.`,`okt.`,`nov.`,`dec.`],wide:[`januari`,`februari`,`mars`,`april`,`maj`,`juni`,`juli`,`augusti`,`september`,`oktober`,`november`,`december`]},defaultWidth:`wide`}),day:m8({values:{narrow:[`S`,`M`,`T`,`O`,`T`,`F`,`L`],short:[`sö`,`må`,`ti`,`on`,`to`,`fr`,`lö`],abbreviated:[`sön`,`mån`,`tis`,`ons`,`tors`,`fre`,`lör`],wide:[`söndag`,`måndag`,`tisdag`,`onsdag`,`torsdag`,`fredag`,`lördag`]},defaultWidth:`wide`}),dayPeriod:m8({values:{narrow:{am:`fm`,pm:`em`,midnight:`midnatt`,noon:`middag`,morning:`morg.`,afternoon:`efterm.`,evening:`kväll`,night:`natt`},abbreviated:{am:`f.m.`,pm:`e.m.`,midnight:`midnatt`,noon:`middag`,morning:`morgon`,afternoon:`efterm.`,evening:`kväll`,night:`natt`},wide:{am:`förmiddag`,pm:`eftermiddag`,midnight:`midnatt`,noon:`middag`,morning:`morgon`,afternoon:`eftermiddag`,evening:`kväll`,night:`natt`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`fm`,pm:`em`,midnight:`midnatt`,noon:`middag`,morning:`på morg.`,afternoon:`på efterm.`,evening:`på kvällen`,night:`på natten`},abbreviated:{am:`fm`,pm:`em`,midnight:`midnatt`,noon:`middag`,morning:`på morg.`,afternoon:`på efterm.`,evening:`på kvällen`,night:`på natten`},wide:{am:`fm`,pm:`em`,midnight:`midnatt`,noon:`middag`,morning:`på morgonen`,afternoon:`på eftermiddagen`,evening:`på kvällen`,night:`på natten`}},defaultFormattingWidth:`wide`})},match:{ordinalNumber:g8({matchPattern:/^(\d+)(:a|:e)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:h8({matchPatterns:{narrow:/^(f\.? ?Kr\.?|f\.? ?v\.? ?t\.?|e\.? ?Kr\.?|v\.? ?t\.?)/i,abbreviated:/^(f\.? ?Kr\.?|f\.? ?v\.? ?t\.?|e\.? ?Kr\.?|v\.? ?t\.?)/i,wide:/^(före Kristus|före vår tid|efter Kristus|vår tid)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^f/i,/^[ev]/i]},defaultParseWidth:`any`}),quarter:h8({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](:a|:e)? kvartalet/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:h8({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar[s]?|apr|maj|jun[i]?|jul[i]?|aug|sep|okt|nov|dec)\.?/i,wide:/^(januari|februari|mars|april|maj|juni|juli|augusti|september|oktober|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,/^maj/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:h8({matchPatterns:{narrow:/^[smtofl]/i,short:/^(sö|må|ti|on|to|fr|lö)/i,abbreviated:/^(sön|mån|tis|ons|tors|fre|lör)/i,wide:/^(söndag|måndag|tisdag|onsdag|torsdag|fredag|lördag)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^s/i,/^m/i,/^ti/i,/^o/i,/^to/i,/^f/i,/^l/i]},defaultParseWidth:`any`}),dayPeriod:h8({matchPatterns:{any:/^([fe]\.?\s?m\.?|midn(att)?|midd(ag)?|(på) (morgonen|eftermiddagen|kvällen|natten))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^f/i,pm:/^e/i,midnight:/^midn/i,noon:/^midd/i,morning:/morgon/i,afternoon:/eftermiddag/i,evening:/kväll/i,night:/natt/i}},defaultParseWidth:`any`})},options:{weekStartsOn:1,firstWeekContainsDate:4}};function Ean(e){let t={},n=v8();for(let e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e]);for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]===void 0?delete t[n]:t[n]=e[n]);fan(t)}var Dan=K9t(X.Languages,X.Languages.en);function Oan(e){let t={da:Tin,de:Fin,es:Jin,fr:san,it:yan,enGB:Hin,sv:Tan};Ean({locale:e===`en`?t.enGB:t[e]})}function kan(e){return e??Dan}function Aan(e){let{language:t,set:n}=Cq.getState();n(e),Oan(e),e!==t&&B4t.invalidateQueries({queryKey:[`foods`]})}var jan=new class extends sin{constructor(){super(`userDetails`,gin)}get(){let{id:e,country:t,language:n,email:r,name:i}=super.get();return{id:e,name:i,country:t,language:n,email:r}}async fetch(){let e=await hin();Aan(kan(e.language)),super.set(e),super.save()}migrateData(){throw Error(`[UserDetailsManager::migrateData] Purposefully not implemented.`)}},Man=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.adjustedInsulinCorrection=a,e.calculateActiveInsulin=c,e.calculateRecommendation=n,e.convertBGL=r,e.foodBolus=u,e.foodRecommendation=s,e.fractionOfInsulinStillActive=o,e.getInterval=p,e.getRecentBolusIds=l,e.getReduction=f,e.insulinStillActive=d,e.rawInsulinCorrection=i,e.roundInsulinValue=void 0;var t=E2();function n(e){let{carbohydrateRatio:n,carbohydrates:i,glucoseReading:o,insulinSensitivity:c,targetBGL:l,recentBoluses:d,activity:p}=e;if(o==null)throw Error(t.GlucoseErrors.MissingGlucoseReading);if(o.unit!==t.BloodGlucoseUnit.MMOL_L&&o.unit!==t.BloodGlucoseUnit.MG_DL)throw Error(t.GlucoseErrors.InvalidGlucoseUnit);let m=r(o.value,o.unit);if(m<t.CONSTANTS.GLUCOSE_INPUT_MIN_MMOLL||m>t.CONSTANTS.GLUCOSE_INPUT_MAX_MMOLL)throw Error(t.GlucoseErrors.OutOfRangeCurrentBGL);let h=new Date,g=p?.activitySettings?.target,_=u(i,n),{activeInsulin:v,adjustedInsulin:y,recentBolusesIds:b}=a(m,g===void 0?l:Math.max(g,l),c,d),x=_+y,S=x>t.CONSTANTS.INSULIN_DOSE_MAX;x=Math.min(x,t.CONSTANTS.INSULIN_DOSE_MAX);let C=0;if(m<3.9){let e=u(15,n);x-=e,x<0&&(C=Math.max(15,s(x+e,n)))}else{let e=s(x,n);C=Math.max(0,e)}x=Math.max(0,x);let w=p?f(p.activityDuration,p.activitySettings,p.activityIntensity,p.activityDate):null;return w&&(x*=1-w),{activeInsulin:v,activityReduction:w,bolus:x,carbRecommendation:C,recentBolusesIds:b,recommendationDate:h,wasLimited:S}}function r(e,n){if(e==null||isNaN(e))throw Error(t.GlucoseErrors.InvalidGlucoseValue);return n===t.BloodGlucoseUnit.MMOL_L?e:e*t.CONSTANTS.MMOLL_PER_MGDL_BGL}function i(e,t,n){return(e-t)/n}function a(e,t,n,r){let a=c(r),o=l(r),s=i(e,t,n);return{activeInsulin:a,adjustedInsulin:Math.max(s-a,Math.min(s,0)),recentBolusesIds:o}}function o(e){if(e<0)throw RangeError(`Parameter secondsPassed can't be negative. Found ${e}.`);return e===0?1:e<5e3?Math.cos((e+500)/5900):e<7e3?-120127e-9*e+1.197151:e<14400?.96-Math.tanh((e-2800)/6e3):0}function s(e,t){return-e*t}function c(e){return e.reduce((e,t)=>e+d(t),0)}function l(e){return e.map(e=>e.id)}function u(e,t){return e/t}function d(e){return e.insulinDose*o(e.secondsPassed)}e.roundInsulinValue=(e,n)=>{let r={[t.InjectionMethod.PenWhole]:1,[t.InjectionMethod.PenHalf]:2,[t.InjectionMethod.Pump]:10}[n];return Math.round(e*r)/r};function f(e,n,r,i){if(e<t.CONSTANTS.ACTIVITY_DURATION_MIN||e>t.CONSTANTS.ACTIVITY_DURATION_MAX)throw Error(t.ActivityErrors.OutOfRangeDuration);let a=i.getTime()+e*t.Milliseconds.Minute,o=new Date().getTime()>=a,s=p(e,(()=>{if(o)return n.post;if(r===null)throw Error(t.ActivityErrors.MissingIntensity);return n[r]})());if(s==null)throw Error(t.ActivityErrors.InvalidInterval);let c=1-s;if(c<t.CONSTANTS.ACTIVITY_REDUCTION_MIN||c>t.CONSTANTS.ACTIVITY_REDUCTION_MAX)throw Error(t.ActivityErrors.InvalidReduction);return c}function p(e,t){let{fromZero:n,fromThirty:r,fromFortysix:i,fromSixtyone:a}=t;return e<=29?n:e<=45?r:e<=60?i:a}})),Nan=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"calculateActiveInsulin",{enumerable:!0,get:function(){return t.calculateActiveInsulin}}),Object.defineProperty(e,"calculateRecommendation",{enumerable:!0,get:function(){return t.calculateRecommendation}}),Object.defineProperty(e,"getReduction",{enumerable:!0,get:function(){return t.getReduction}}),Object.defineProperty(e,"roundInsulinValue",{enumerable:!0,get:function(){return t.roundInsulinValue}});var t=Man()})),b8=Nan(),Pan=class{create=async(e,t)=>{try{e.overwrittenByUUID=void 0;let n=Ian();n.eventUpdates.push({...e,uuidOld:t}),xq.set(`event/pendingChanges`,JSON.stringify(n));let r=(e,t)=>{if(this.saveLocally(e),t!==void 0){let n=this.getByUUID(t);n.overwrittenByUUID=e.uuid,this.saveLocally(n)}};return Oq?(await this.sync(),r(e,t)):(r(e,t),q8.syncAll().catch(console.error)),!0}catch(e){return console.error(e),!1}};getActiveEvents=()=>{let e=x8(),t=[];for(let n of e){let[e,r]=n,i=this.getByUUID(e);r>Date.now()-X.Milliseconds.Minute*90-i.durationSeconds*X.Milliseconds.Second&&t.push(i)}return t};getEvents=(e,t)=>{let n=x8();if(e!==void 0){let t=e.getTime();n=n.filter(e=>e[1]>=t)}if(t!==void 0){let e=t.getTime();n=n.filter(t=>t[1]<e)}let r=[];for(let e of n)try{let t=this.getByUUID(e[0]);r.push(t)}catch(e){console.error(e)}return r};sync=async()=>{let e=Ian(),t={method:X.HTTPRequestMethod.POST,body:JSON.stringify(e),headers:{"Content-Type":`application/json`}},n=`${bq.HEDIA_SERVER_BASE_URL}/api/v2/events`,r=await d8(n,t);await T2(r,X.StatusCode.OK,n,X.HTTPRequestMethod.POST);let{lastSyncTimestamp:i,eventUpdates:a}=await r.json();for(let e of a)this.saveLocally(e);let o=Ian(),s={lastSyncTimestamp:i,eventUpdates:o.eventUpdates.filter(t=>!e.eventUpdates.map(e=>e.uuid).includes(t.uuid)),deletedEvents:o.deletedEvents.filter(t=>!e.deletedEvents.includes(t))};xq.set(`event/pendingChanges`,JSON.stringify(s))};getEventWithHighestReduction=e=>{if(!e)throw Error(`[EventManager::getEventWithHighestReduction] Cannot retrieve highest reduction without a provided setting!`);let t=this.getActiveEvents();if(!t.length)return;let n=({durationSeconds:t,activityIntensity:n,startTimestamp:r})=>{if(r===null)throw Error(`[EventManager::calculateReduction] Cannot calculate reduction without startTimestamp!`);return(0,b8.getReduction)(t/60,e,n,new Date(r))},r=t.sort((e,t)=>n(e)-n(t));return r[r.length-1]};getByUUID=e=>{let t=xq.getString(`event/${e}`);if(t===void 0)throw Error(`[EventManager::getByUUID] The requested event with UUID ${e} does not exist!`);return JSON.parse(t)};saveLocally=e=>{if(Fan(e.uuid),xq.set(`event/${e.uuid}`,JSON.stringify(e)),!e.deleted&&!e.overwrittenByUUID){let t=x8();if(e.startTimestamp===null)throw Error(`[EventManager::saveLocally] event.startTimestamp must be non-null.`);let n=new Date(e.startTimestamp).getTime();t.push([e.uuid,n]),t=t.sort((e,t)=>t[1]-e[1]),xq.set(`event/index`,JSON.stringify(t))}}},Fan=e=>{let t=x8();t=t.filter(t=>t[0]!==e),xq.set(`event/index`,JSON.stringify(t))},x8=()=>{let e=xq.getString(`event/index`);return e===void 0?[]:JSON.parse(e)},Ian=()=>{let e=xq.getString(`event/pendingChanges`);return e===void 0?{lastSyncTimestamp:new Date(0).toJSON(),eventUpdates:[],deletedEvents:[]}:JSON.parse(e)},S8=new Pan,C8=(e,t,n)=>Math.round(e*t*n/100),Lan=e=>e.source!==`packaged`,Ran=async()=>{let e=new URLSearchParams({source:`personal`,limit:`100`,sort:`title`}),t=await d8(`${bq.FOOD_BASE_URL}/api/v1/foods?${e.toString()}`,{headers:{Accept:`application/json`}});return t.ok?await t.json():(console.warn(`[listPersonalFoods] server error`),[])},zan=async e=>{let t=new URLSearchParams({source:`curated`,limit:`100`,sort:`title`});e!==void 0&&t.set(`categoryId`,e);let n=`${bq.FOOD_BASE_URL}/api/v1/foods?${t.toString()}`,r=await d8(n,{headers:{Accept:`application/json`}});return await T2(r,X.StatusCode.OK,n,X.HTTPRequestMethod.GET),r.json()},Ban=async()=>{let e=new URLSearchParams({usedWithinDays:`30`}),t=`${bq.FOOD_BASE_URL}/api/v1/foods?${e.toString()}`,n=await d8(t,{headers:{Accept:`application/json`}});return await T2(n,X.StatusCode.OK,t,X.HTTPRequestMethod.GET),(await n.json()).filter(Lan)},Van=async e=>{let t=new URLSearchParams({search:e,limit:`100`}),n=`${bq.FOOD_BASE_URL}/api/v1/foods?${t.toString()}`,r=await d8(n,{headers:{Accept:`application/json`}});return await T2(r,X.StatusCode.OK,n,X.HTTPRequestMethod.GET),(await r.json()).filter(Lan)},Han=async e=>{let t=`${bq.FOOD_BASE_URL}/api/v1/foods/${e}`,n=await d8(t,{headers:{Accept:`application/json`}});if(n.status===X.StatusCode.NOT_FOUND)return null;await T2(n,X.StatusCode.OK,t,X.HTTPRequestMethod.GET);let r=await n.json();return!Lan(r)||r.deleted?null:r},Uan=async(e,t)=>{let n=`${bq.FOOD_BASE_URL}/api/v1/foods/personal/${e}`,r=await d8(n,{method:X.HTTPRequestMethod.PATCH,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:JSON.stringify(t)});return await T2(r,X.StatusCode.OK,n,X.HTTPRequestMethod.PATCH),r.json()},Wan=async e=>{let t=`${bq.FOOD_BASE_URL}/api/v1/foods/personal/${e}`;await T2(await d8(t,{method:X.HTTPRequestMethod.DELETE}),X.StatusCode.NO_CONTENT,t,X.HTTPRequestMethod.DELETE)},Gan=async e=>{let t=`${bq.FOOD_BASE_URL}/api/v1/foods/personal`,n=await d8(t,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:JSON.stringify(e)});return await T2(n,X.StatusCode.CREATED,t,X.HTTPRequestMethod.POST),await n.json()},Kan=async e=>{let t=new URLSearchParams({language:e}),n=`${bq.FOOD_BASE_URL}/api/v1/categories?${t.toString()}`,r=await d8(n,{headers:{Accept:`application/json`}});return await T2(r,X.StatusCode.OK,n,X.HTTPRequestMethod.GET),r.json()},qan=async e=>{let t=`${bq.FOOD_BASE_URL}/api/v1/food-intakes`,n=await d8(t,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:JSON.stringify(e)});return await T2(n,X.StatusCode.CREATED,t,X.HTTPRequestMethod.POST),await n.json()},Jan=async e=>{let t=`${bq.FOOD_BASE_URL}/api/v1/food-intakes/${e}`;await T2(await d8(t,{method:X.HTTPRequestMethod.DELETE}),X.StatusCode.NO_CONTENT,t,X.HTTPRequestMethod.DELETE)},Yan=o3(X.CONSTANTS.ACTIVITY_TARGET_GLUCOSE_MIN,X.CONSTANTS.ACTIVITY_TARGET_GLUCOSE_MAX),Xan=a3(90,250),Zan=8,Qan={fromZero:1,fromThirty:.75,fromFortysix:.5,fromSixtyone:null},$an={fromZero:1,fromThirty:.5,fromFortysix:.25,fromSixtyone:null},eon={fromZero:1,fromThirty:.25,fromFortysix:null,fromSixtyone:null},ton={fromZero:1,fromThirty:.5,fromFortysix:.5,fromSixtyone:null};function w8(){return{target:Zan,light:Qan,moderate:$an,hard:eon,post:ton}}function non(){return[{startTime:`00:00`,target:8},{startTime:`05:00`,target:6},{startTime:`09:00`,target:7},{startTime:`11:00`,target:6},{startTime:`13:00`,target:7},{startTime:`18:00`,target:6},{startTime:`22:00`,target:8}]}function ron(){return{startTime:`00:00`,target:6}}function ion(){return{targetBGLIntervals:non(),overallTargetBGL:ron(),use:X.Usage.Intervals}}var aon=()=>({min:X.CONSTANTS.TARGET_GLUCOSE_MIN,max:X.CONSTANTS.TARGET_GLUCOSE_MAX}),oon=()=>({min:79,max:180}),son=`19:00`,con=1.5;function lon(){return{medicineNotification:{toggle:!1,dailyReminderTime:son},remeasurementNotification:{toggle:!0,remeasurement:con}}}var T8=new class{get=()=>{let e=xq.getString(`userSettings`),t=this.safeParse(e);return this.migrateAndClean(t)??{}};write=e=>{let t=this.migrateAndClean(e)??{};xq.set(`userSettings`,JSON.stringify(t))};getPending=()=>{let e=xq.getString(`pendingSettingsChanges`);return(this.safeParse(e)??[]).map(e=>this.migrateAndClean(e)??{})};addPending=e=>{let t=this.getPending();t.push(this.migrateAndClean(e)??{}),xq.set(`pendingSettingsChanges`,JSON.stringify(t))};removePending=e=>{let t=e.map(e=>e.uuid),n=this.getPending().filter(e=>!t.includes(e.uuid));xq.set(`pendingSettingsChanges`,JSON.stringify(n))};safeParse=e=>{if(e)try{return JSON.parse(e)}catch{return}};migrateActivitySettings=e=>{if(e.activity)for(let t of[`hard`,`moderate`,`light`,`post`])e.activity[t].fromSixtyone===void 0&&(e.activity[t].fromSixtyone=null)};migrateGenderToBiologicalSex=e=>{e.gender&&!e.biologicalSex&&(e.biologicalSex=e.gender),delete e.gender};removeEmailField=e=>{delete e.email};removeInsulinDependentField=e=>{delete e.insulinDependent};migrateBGLFields=e=>{if(!e.glucoseLevelTargets)return;let t={...e.glucoseLevelTargets};if(t.overallTargetBGL){let e={...t.overallTargetBGL};delete e.low,delete e.high,t.overallTargetBGL=e}Array.isArray(t.targetBGLIntervals)&&(t.targetBGLIntervals=t.targetBGLIntervals.map(e=>{let t={...e};return delete t.low,delete t.high,t})),e.glucoseLevelTargets=t};migrateNotificationsSettings=e=>{if(!e.notifications)return;let t={...e.notifications};t.deviceIdentifiers!==void 0&&delete t.deviceIdentifiers,e.notifications=t};migrateAndClean=e=>{if(!e)return;let t={...e};return this.migrateActivitySettings(t),this.migrateGenderToBiologicalSex(t),this.migrateBGLFields(t),this.migrateNotificationsSettings(t),this.removeEmailField(t),this.removeInsulinDependentField(t),t}};function E8(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var D8=class{_diabetesType;_biologicalSex;_heightCm;_weightKg;_birthDate;_injectionMethod;_glucoseUnit;_treatmentParameters;_glucoseLevelTargets;_fastActingInsulin;_longActingInsulin;_uuid;_activity;_notifications;_created;constructor(){let e=this.getLocalUserSettings();this.updateUserSettings(e),yrn(this)}get diabetesType(){return this._diabetesType}get biologicalSex(){return this._biologicalSex}get heightCm(){return this._heightCm}get weightKg(){return this._weightKg}get birthDate(){return this._birthDate}get injectionMethod(){return this._injectionMethod}get glucoseUnit(){return this._glucoseUnit}get treatmentParameters(){return this._treatmentParameters}get glucoseLevelTargets(){return this._glucoseLevelTargets}get fastActingInsulin(){return this._fastActingInsulin}get longActingInsulin(){return this._longActingInsulin}get uuid(){return this._uuid}get activity(){return this._activity}get notifications(){return this._notifications}get created(){return this._created}async postUserSettings(e){try{e.uuidOld=this.getLocalUserSettings().uuid,e.uuid=i3(),e.created=new Date().toJSON();let t=await this.makeSyncRequest([e]);return T8.write(t),this.updateUserSettings(t),!0}catch(e){return console.error(e),!1}}async getUserSettings(){try{let e=T8.getPending();if(e.length>0){let t=await this.makeSyncRequest(e);return T8.write(t),this.updateUserSettings(t),T8.removePending(e),t}let t=await this.makeSyncRequest();return T8.write(t),this.updateUserSettings(t),t}catch(e){return Oq&&bq.IS_PRODUCTION!==`true`&&e instanceof w2&&[X.StatusCode.UNAVAILABLE_FOR_LEGAL_REASONS,X.StatusCode.UNAUTHORIZED].includes(e.statusCode)?(console.error(`❌❌❌ [dev] Not authenticated — Login at http://localhost:7265 (hda-app) to get the token ❌❌❌`),null):(console.error(e),null)}}getLocalUserSettings(){return T8.get()}reset(){this.updateUserSettings({activity:void 0,biologicalSex:void 0,birthday:void 0,bloodGlucoseUnits:void 0,bloodKetonesUnit:void 0,created:void 0,diabetesType:void 0,fastActingInsulin:void 0,glucoseLevelTargets:void 0,height:void 0,longActingInsulin:void 0,notifications:void 0,parameters:void 0,treatmentType:void 0,uuid:void 0,uuidOld:void 0,weight:void 0})}makeSyncRequest=async e=>{let t=e?X.HTTPRequestMethod.POST:X.HTTPRequestMethod.GET,n={headers:{"Content-Type":`application/json`},body:e?JSON.stringify(e):void 0,method:t},r=`${bq.HEDIA_SERVER_BASE_URL}/api/v2/settings`,i=await d8(r,n);return await T2(i,X.StatusCode.OK,r,t),i.json()};updateUserSettings(e){this._activity=e.activity,this._biologicalSex=e.biologicalSex,this._birthDate=e.birthday,this._created=e.created,this._diabetesType=e.diabetesType,this._fastActingInsulin=e.fastActingInsulin,this._glucoseLevelTargets=e.glucoseLevelTargets,this._glucoseUnit=e.bloodGlucoseUnits,this._heightCm=e.height,this._injectionMethod=e.treatmentType,this._longActingInsulin=e.longActingInsulin,this._notifications=e.notifications,this._treatmentParameters=e.parameters,this._uuid=e.uuid,this._weightKg=e.weight}updateMockUserSettings(){if(bq.IS_PRODUCTION===`true`)throw Error(`[UserSettingsManager::updateMockUserSettings] - This method should only be used outside production environments`);this._uuid=i3(),this._treatmentParameters=O8(2,10,X.Usage.Overall),this._activity=w8(),this._notifications=lon(),this._glucoseLevelTargets=ion(),this._glucoseUnit=X.BloodGlucoseUnit.MMOL_L,this._fastActingInsulin=X.FastActingInsulin.Apidra,this._longActingInsulin=X.LongActingInsulin.Lantus,this._injectionMethod=X.InjectionMethod.Pump,this._diabetesType=X.DiabetesType.Type1,this._birthDate=`1975-12-31T23:00:00.000Z`,this._biologicalSex=X.BiologicalSex.Female,this._heightCm=170,this._weightKg=70}};E8([c6],D8.prototype,`_diabetesType`,void 0),E8([c6],D8.prototype,`_biologicalSex`,void 0),E8([c6],D8.prototype,`_heightCm`,void 0),E8([c6],D8.prototype,`_weightKg`,void 0),E8([c6],D8.prototype,`_birthDate`,void 0),E8([c6],D8.prototype,`_injectionMethod`,void 0),E8([c6],D8.prototype,`_glucoseUnit`,void 0),E8([c6],D8.prototype,`_treatmentParameters`,void 0),E8([c6],D8.prototype,`_glucoseLevelTargets`,void 0),E8([c6],D8.prototype,`_fastActingInsulin`,void 0),E8([c6],D8.prototype,`_longActingInsulin`,void 0),E8([c6],D8.prototype,`_uuid`,void 0),E8([c6],D8.prototype,`_activity`,void 0),E8([c6],D8.prototype,`_notifications`,void 0),E8([c6],D8.prototype,`_created`,void 0),E8([k6],D8.prototype,`updateUserSettings`,null),E8([k6],D8.prototype,`updateMockUserSettings`,null);function O8(e,t,n){let r={carbohydrateRatio:t,insulinSensitivity:e,startTime:`00:00`};return{overallParameters:r,parameterIntervals:[`00:00`,`05:00`,`09:00`,`11:00`,`13:00`,`18:00`,`22:00`].map(e=>({insulinSensitivity:r.insulinSensitivity,carbohydrateRatio:r.carbohydrateRatio,startTime:e})),use:n}}var k8=new D8,uon={code:`en-US`,formatDistance:Lin,formatLong:{date:p8({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:p8({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:p8({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},formatRelative:zin,localize:Bin,match:Vin,options:{weekStartsOn:0,firstWeekContainsDate:1}};function A8(e){let t=e3(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 don(e,t){let n=e3(e,t?.in);return n.setHours(0,0,0,0),n}function fon(e,t,n){let[r,i]=_8(n?.in,e,t),a=don(r),o=don(i),s=+a-A8(a),c=+o-A8(o);return Math.round((s-c)/M9t)}function pon(e,t){let n=e3(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function mon(e,t){let n=e3(e,t?.in);return fon(n,pon(n))+1}function j8(e,t){return y8(e,{...t,weekStartsOn:1})}function hon(e,t){let n=e3(e,t?.in),r=n.getFullYear(),i=$4(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);let a=j8(i),o=$4(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);let s=j8(o);return n.getTime()>=a.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function gon(e,t){let n=hon(e,t),r=$4(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),j8(r)}function _on(e,t){let n=e3(e,t?.in),r=j8(n)-+gon(n);return Math.round(r/j9t)+1}function von(e,t){let n=e3(e,t?.in),r=n.getFullYear(),i=v8(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=$4(t?.in||e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);let s=y8(o,t),c=$4(t?.in||e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);let l=y8(c,t);return+n>=+s?r+1:+n>=+l?r:r-1}function yon(e,t){let n=v8(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=von(e,t),a=$4(t?.in||e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),y8(a,t)}function bon(e,t){let n=e3(e,t?.in),r=y8(n,t)-+yon(n,t);return Math.round(r/j9t)+1}function M8(e,t){return(e<0?`-`:``)+Math.abs(e).toString().padStart(t,`0`)}var N8={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return M8(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):M8(n+1,2)},d(e,t){return M8(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 M8(e.getHours()%12||12,t.length)},H(e,t){return M8(e.getHours(),t.length)},m(e,t){return M8(e.getMinutes(),t.length)},s(e,t){return M8(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds();return M8(Math.trunc(r*10**(n-3)),t.length)}},P8={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},xon={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 N8.y(e,t)},Y:function(e,t,n,r){let i=von(e,r),a=i>0?i:1-i;return t===`YY`?M8(a%100,2):t===`Yo`?n.ordinalNumber(a,{unit:`year`}):M8(a,t.length)},R:function(e,t){return M8(hon(e),t.length)},u:function(e,t){return M8(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 M8(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 M8(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 N8.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 M8(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=bon(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):M8(i,t.length)},I:function(e,t,n){let r=_on(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):M8(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):N8.d(e,t)},D:function(e,t,n){let r=mon(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):M8(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 M8(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 M8(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 M8(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?P8.noon:r===0?P8.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?P8.evening:r>=12?P8.afternoon:r>=4?P8.morning:P8.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 N8.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):N8.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):M8(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):M8(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):N8.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):N8.s(e,t)},S:function(e,t){return N8.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return Con(r);case`XXXX`:case`XX`:return F8(r);default:return F8(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return Con(r);case`xxxx`:case`xx`:return F8(r);default:return F8(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+Son(r,`:`);default:return`GMT`+F8(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+Son(r,`:`);default:return`GMT`+F8(r,`:`)}},t:function(e,t,n){return M8(Math.trunc(e/1e3),t.length)},T:function(e,t,n){return M8(+e,t.length)}};function Son(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+M8(a,2)}function Con(e,t){return e%60==0?(e>0?`-`:`+`)+M8(Math.abs(e)/60,2):F8(e,t)}function F8(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=M8(Math.trunc(r/60),2),a=M8(r%60,2);return n+i+t+a}var won=(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`})}},Ton=(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`})}},Eon={p:Ton,P:(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return won(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}}`,won(r,t)).replace(`{{time}}`,Ton(i,t))}},Don=/^D+$/,Oon=/^Y+$/,kon=[`D`,`DD`,`YY`,`YYYY`];function Aon(e){return Don.test(e)}function jon(e){return Oon.test(e)}function Mon(e,t,n){let r=Non(e,t,n);if(console.warn(r),kon.includes(e))throw RangeError(r)}function Non(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`}function Pon(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function Fon(e){return!(!Pon(e)&&typeof e!=`number`||isNaN(+e3(e)))}var Ion=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Lon=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ron=/^'([^]*?)'?$/,zon=/''/g,Bon=/[a-zA-Z]/;function I8(e,t,n){let r=v8(),i=n?.locale??r.locale??uon,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=e3(e,n?.in);if(!Fon(s))throw RangeError(`Invalid time value`);let c=t.match(Lon).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=Eon[t];return n(e,i.formatLong)}return e}).join(``).match(Ion).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:Von(e)};if(xon[t])return{isToken:!0,value:e};if(t.match(Bon))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&&jon(a)||!n?.useAdditionalDayOfYearTokens&&Aon(a))&&Mon(a,t,String(e));let o=xon[a[0]];return o(s,a,i.localize,l)}).join(``)}function Von(e){let t=e.match(Ron);return t?t[1].replace(zon,`'`):e}var Hon=`mmol/L`,Uon=`mg/dL`,Won=[0,30],Gon=[0,540],Kon={low:3.9,high:10},qon={low:70,high:180},L8=e=>{if(e===X.BloodGlucoseUnit.MMOL_L)return{text:Hon,graphLimits:Won,inputMin:X.CONSTANTS.GLUCOSE_INPUT_MIN_MMOLL,inputMax:X.CONSTANTS.GLUCOSE_INPUT_MAX_MMOLL,decimalPlaces:1,placeholder:`-.-`,targetInterval:{low:Kon.low,high:Kon.high}};if(e===X.BloodGlucoseUnit.MG_DL)return{text:Uon,graphLimits:Gon,inputMin:20,inputMax:600,decimalPlaces:0,placeholder:`-`,targetInterval:{low:qon.low,high:qon.high}};throw Error(`[glucose::getBGConstants] Unsupported glucose unit! ${e}`)};function Jon(e,t,n){return $4(n?.in||e,+e3(e)+t)}function Yon(e,t,n){return Jon(e,t*P9t,n)}function Xon(e){return t=>{let n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function Zon(e,t){return e3(e)-+e3(t)}function Qon(e,t,n){let r=Zon(e,t)/N9t;return Xon(n?.roundingMethod)(r)}function $on(e){return e<=29?`0-29`:e<=45?`30-45`:e<=60?`46-60`:`61-120`}function esn(e,t){let n=new Date,r=Qon(t3(Yon(new Date(e),1.5),t),n),i=Math.floor(r/60),a=r%60;return i>0?`${i}${wq(`activity_card__active_hour`)} ${a}${wq(`activity_card__active_min`)}`:`${a} ${wq(`activity_card__active_min`)}`}var R8={light:()=>wq(`activity_intensity_1`),moderate:()=>wq(`activity_intensity_2`),hard:()=>wq(`activity_intensity_3`)},tsn=Hon,nsn=0,rsn=8,isn=1,asn=()=>({displayUnit:tsn,inputMin:nsn,inputMax:rsn,decimalPlaces:isn});R3t.base900,y2.noRisk,y2.lowRisk,y2.moderateRisk,y2.highRisk;function z8(e,t,n){if(t===n)return e;switch(n){case X.BloodGlucoseUnit.MG_DL:return e*X.CONSTANTS.MGDL_PER_MMOLL_BGL;case X.BloodGlucoseUnit.MMOL_L:return e*X.CONSTANTS.MMOLL_PER_MGDL_BGL;default:throw Error(`[conversionGlucose::convertBGL] Unsupported glucose unit! ${n}`)}}function osn(e,t){let{decimalPlaces:n}=L8(t);return(Math.round(e*10)/10).toFixed(n)}function B8(e,t,n){return osn(z8(e,t,n),n)}var ssn=r8t({entry_timestamp:g4([t8t(),p4()]),settings_uuid:p4(),insulin_entered_units:g4([m4(),h4()]),carbohydrates_entered_grams:g4([m4(),h4()]),blood_glucose_millimolar:g4([m4(),h4()]),blood_ketones_millimolar:g4([m4(),h4(),n8t()]),event_uuid:g4([p4(),h4(),n8t()])}),V8=V3t;`${V8.textPdf}${V8.textPdf}${V8.textPdf}${V8.textPdf}`;var csn=e=>{ssn.parse(e);let{blood_glucose_millimolar:t,carbohydrates_entered_grams:n,insulin_entered_units:r,blood_ketones_millimolar:i}=e,{inputMax:a,inputMin:o}=L8(X.BloodGlucoseUnit.MMOL_L),{inputMax:s}=asn();if(t!==null&&t>a)throw Error(`[LogbookUtils::validateLogbook] blood_glucose_millimolar is greater than ${a}`);if(t!==null&&t<o)throw Error(`[LogbookUtils::validateLogbook] blood_glucose_millimolar is less than ${o}`);if(i!==null&&i>s)throw Error(`[LogbookUtils::validateLogbook] blood_ketones_millimolar is greater than ${s}`);let c={blood_glucose_millimolar:t,carbohydrates_entered_grams:n,insulin_entered_units:r,blood_ketones_millimolar:i};function l(e){return e!==null&&e<0}if(Object.entries(c).forEach(([e,t])=>{if(l(t))throw Error(`[LogbookUtils::validateLogbook] ${e} is less than 0`)}),e.event_uuid)try{S8.getByUUID(e.event_uuid)}catch{e.event_uuid=null}return!0},lsn=e=>({...e,client_timestamp:e.client_timestamp.toISOString(),entry_timestamp:e.entry_timestamp.toISOString(),server_timestamp:e.server_timestamp?.toISOString()??null,is_deleted:e.is_deleted?.toISOString()??null}),usn=e=>({...e,client_timestamp:new Date(e.client_timestamp),entry_timestamp:new Date(e.entry_timestamp),server_timestamp:e.server_timestamp?new Date(e.server_timestamp):null,is_deleted:e.is_deleted?new Date(e.is_deleted):null}),dsn=e=>({active_insulin_source_logbook_ids:[],active_insulin:null,activity_reduction:null,blood_glucose_millimolar_sample_id:null,blood_glucose_millimolar:null,glucose_sample_source_id:null,blood_ketones_millimolar:null,carbohydrates_entered_grams:null,carbohydrates_sample_id:null,carbohydrates_input_grams:null,carbohydrates_manual_grams:null,carbohydrates_food_grams:null,food_intake_id:null,carbohydrates_overwritten_suggested_grams:null,carbohydrates_suggested_grams:null,client_timestamp:new Date,client_version:``,device_and_os:``,entry_timestamp:new Date,event_uuid:null,insulin_entered_units:null,insulin_suggested_units:null,is_bolus_calculation:!1,is_deleted:null,overwritten_by_id:null,server_timestamp:null,server_version:null,settings_uuid:``,timezone:``,utc_timezone_offset:null,uuid:``,note_id:null,...e}),fsn=new Set,psn=e=>{fsn.forEach(t=>{try{t(e)}catch(e){console.error(`[logbookEvents] listener failed`,e)}})},msn=e=>{psn({type:`created`,entry:e})},hsn=(e,t)=>{psn({type:`updated`,oldEntry:e,newEntry:t})},gsn=e=>{psn({type:`deleted`,entry:e})};V();var _sn=e=>{let t={...e};return delete t.carbohydrates_modified_suggested_grams,delete t.mood,delete t.smart_pen_sync_timestamp,t},vsn=class{constructor(){xq.delete(`logbook/unsuccessful`)}async addLogbook(e,t){let n=t?this.getLogbookByUUID(t):null;try{e.uuid=i3(),e.client_timestamp=new Date,e.client_version=c8,e.device_and_os=`${z.OS} ${z.Version}`;let r=W8();if(t)e.settings_uuid=this.getLogbookByUUID(t).settings_uuid,r.edited.push({oldUUID:t,newUUID:e.uuid}),U8(t);else{let{uuid:t}=k8;if(!t)throw Error(`[LogbookManager::addLogbook] settingsUUID must be defined`);e.settings_uuid=t}return e.utc_timezone_offset=G9t(),e.timezone=Intl.DateTimeFormat().resolvedOptions().timeZone,r.created.push(e),xq.set(`logbook/pendingChanges`,JSON.stringify(r)),H8(e),n===null?msn(e):hsn(n,e),Oq?await this.syncWeb():q8.syncAll().catch(console.error),e}catch(r){return console.error(r),Oq&&(t?(U8(e.uuid),n!==null&&H8(n),G8(e.uuid,t)):(U8(e.uuid),G8(e.uuid))),null}}deleteLogbook=async e=>{let t=this.getLogbookByUUID(e);try{t.food_intake_id&&await Jan(t.food_intake_id).catch(console.error);let n=W8();return n.deleted.push(e),xq.set(`logbook/pendingChanges`,JSON.stringify(n)),U8(e),gsn(t),Oq?await this.syncWeb():q8.syncAll().catch(console.error),!0}catch(n){return console.error(n),Oq&&(H8(t),G8(e)),!1}};syncWeb=async()=>{let e=W8(),t=e=>({method:X.HTTPRequestMethod.POST,body:JSON.stringify(e),headers:{"Content-Type":`application/json`}}),n=`${bq.HEDIA_SERVER_BASE_URL}/api/v2/logbooks`,r=await d8(n,t(e));await T2(r,X.StatusCode.OK,n,X.HTTPRequestMethod.POST);let{created:i,last_sync_timestamp:a}=await r.json();for(let e of i)H8(e);let o={last_sync_timestamp:a,created:[],deleted:[],edited:[]};xq.set(`logbook/pendingChanges`,JSON.stringify(o))};sync=async()=>{let e=W8(),{created:t,deleted:n,edited:r,last_sync_timestamp:i}=e,a=[],o=[],s=[],c=[],l=[],u=e.last_sync_timestamp,d=async e=>{let t=`${bq.HEDIA_SERVER_BASE_URL}/api/v2/logbooks`,n=await d8(t,{method:X.HTTPRequestMethod.POST,body:JSON.stringify(e),headers:{"Content-Type":`application/json`}});await T2(n,X.StatusCode.OK,t,X.HTTPRequestMethod.POST);let{created:r,deleted:i,last_sync_timestamp:a}=await n.json();c=c.concat(r),l=l.concat(i),u=a},f={created:[],deleted:[],edited:[]};!t.length&&!r.length&&!n.length&&await d({...f,last_sync_timestamp:i}).catch();for(let e of t)await d({...f,last_sync_timestamp:i,created:[e]}).catch(()=>a.push(e));for(let e of r)await d({...f,last_sync_timestamp:i,edited:[e]}).catch(()=>s.push(e));for(let e of n)await d({...f,last_sync_timestamp:i,deleted:[e]}).catch(()=>o.push(e));let p=W8(),m=t.filter(e=>!a.includes(e)).map(e=>e.uuid),h=r.filter(e=>!s.includes(e)).map(e=>e.oldUUID),g=n.filter(e=>!o.includes(e)),_={last_sync_timestamp:u,created:p.created.filter(e=>!m.includes(e.uuid)),deleted:p.deleted.filter(e=>!g.includes(e)),edited:p.edited.filter(e=>!h.includes(e.oldUUID))};xq.set(`logbook/pendingChanges`,JSON.stringify(_));for(let e of c)H8(e);for(let e of l)U8(e)};getRecentBoluses=(e=new Date(Date.now()-X.Milliseconds.Hour*4),t=new Date)=>{let n=this.getLogbooks(e,t);return n.length===0?[]:n.filter(e=>e.insulin_entered_units!==null&&e.insulin_entered_units>0).map(({insulin_entered_units:e,entry_timestamp:t,uuid:n})=>({insulinDose:e,secondsPassed:(Date.now()-new Date(t).getTime())/1e3,id:n}))};getLogbooks=(e,t)=>{let n=ysn();if(e!==void 0){let t=e.getTime();n=n.filter(e=>e[1]>=t)}if(t!==void 0){let e=t.getTime();n=n.filter(t=>t[1]<e)}let r=[];for(let[e]of n)try{let t=this.getLogbookByUUID(e);try{csn(t),r.push(t)}catch(t){console.error(t),G8(e),U8(e)}}catch(e){console.error(e)}return r};getLogbookByUUID=e=>{let t=xq.getString(`logbook/${e}`);if(!t)throw Error(`LogbookManager::getLogbookByUUID - could not find logbook in local storage`);let n=_sn(JSON.parse(t));return{...n,entry_timestamp:new Date(n.entry_timestamp),server_timestamp:n.server_timestamp?new Date(n.server_timestamp):null,client_timestamp:new Date(n.client_timestamp)}}},H8=e=>{let{uuid:t}=e;if(!t)throw Error(`[LogbookManager::saveLocally] uuid must be defined`);U8(t);let n=ysn();n.push([t,new Date(e.entry_timestamp).getTime()]),n.sort((e,t)=>t[1]-e[1]),xq.set(`logbook/index`,JSON.stringify(n)),xq.set(`logbook/${e.uuid}`,JSON.stringify(e))},U8=e=>{let t=ysn().filter(([t])=>t!==e);xq.set(`logbook/index`,JSON.stringify(t)),xq.delete(`logbook/${e}`)},W8=()=>{let e=xq.getString(`logbook/pendingChanges`);if(!e)return{last_sync_timestamp:new Date(0).toISOString(),created:[],edited:[],deleted:[]};let t=JSON.parse(e);return{...t,created:t.created.map(e=>_sn(e))}},G8=(e,t)=>{let{created:n,deleted:r,edited:i,last_sync_timestamp:a}=W8(),o={last_sync_timestamp:a,created:[...n].filter(({uuid:t})=>t!==e),edited:[...i].filter(({oldUUID:n,newUUID:r})=>n!==t&&r!==e),deleted:[...r].filter(t=>t!==e)};xq.set(`logbook/pendingChanges`,JSON.stringify(o))},ysn=()=>{let e=xq.getString(`logbook/index`);return e===void 0?[]:JSON.parse(e)},K8=new vsn,q8=new class{currentIsConnected=null;isSynchronizing=!1;isListenerAttached=!1;constructor(){this.setListener()}syncAll=async()=>{let e=!Oq&&!E3.getState().accessToken;if(!(this.isSynchronizing||e))try{this.isSynchronizing=!0,await k8.getUserSettings().catch(console.error),await S8.sync().catch(console.error),await K8.sync().catch(console.error),await jan.fetch().catch(console.error)}finally{this.isSynchronizing=!1}};handleConnectivity=async({isConnected:e,isInternetReachable:t})=>{this.currentIsConnected!==(e&&t)&&(this.currentIsConnected=e&&t,this.currentIsConnected&&await this.syncAll())};setListener=()=>{!this.isListenerAttached&&!Oq&&(Oen.addEventListener(this.handleConnectivity),this.isListenerAttached=!0)}};V();var{add:bsn,multiply:xsn}=lf;function J8(e,t,n){return bsn(xsn(e,t),xsn(e.interpolate({inputRange:[0,1],outputRange:[1,0]}),n))}V();var{add:Ssn,multiply:Y8}=lf;function Csn({current:e,next:t,inverted:n,layouts:{screen:r}}){let i=Y8(e.progress.interpolate({inputRange:[0,1],outputRange:[r.width,0],extrapolate:`clamp`}),n),a=t?Y8(t.progress.interpolate({inputRange:[0,1],outputRange:[0,r.width*-.3],extrapolate:`clamp`}),n):0,o=e.progress.interpolate({inputRange:[0,1],outputRange:[0,.07],extrapolate:`clamp`}),s=e.progress.interpolate({inputRange:[0,1],outputRange:[0,.3],extrapolate:`clamp`});return{cardStyle:{transform:[{translateX:i},{translateX:a}]},overlayStyle:{opacity:o},shadowStyle:{shadowOpacity:s}}}function wsn({inverted:e,...t}){return Csn({...t,inverted:lf.multiply(e,-1)})}function Tsn({current:e,inverted:t,layouts:{screen:n}}){return{cardStyle:{transform:[{translateY:Y8(e.progress.interpolate({inputRange:[0,1],outputRange:[n.height,0],extrapolate:`clamp`}),t)}]}}}function Esn({index:e,current:t,next:n,inverted:r,layouts:{screen:i},insets:a}){let o=z.OS===`ios`&&!z.isPad&&!z.isTV&&a.top>20,s=i.width>i.height,c=s?0:10,l=a.top,u=i.height/i.width,d=Ssn(t.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:`clamp`}),n?n.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:`clamp`}):0),f=e===0,p=Y8(d.interpolate({inputRange:[0,1,2],outputRange:[i.height,f?0:c,(f?l:0)-c*u]}),r),m=d.interpolate({inputRange:[0,1,1.0001,2],outputRange:[0,.3,1,1]}),h=s?1:d.interpolate({inputRange:[0,1,2],outputRange:[1,1,i.width?1-c*2/i.width:1]}),g=s?0:f?d.interpolate({inputRange:[0,1,1.0001,2],outputRange:[0,0,o?38:0,10]}):10;return{cardStyle:{overflow:`hidden`,borderCurve:`continuous`,borderTopLeftRadius:g,borderTopRightRadius:g,borderBottomLeftRadius:o?g:0,borderBottomRightRadius:o?g:0,marginTop:f?0:l,marginBottom:f?0:c,transform:[{translateY:p},{scale:h}]},overlayStyle:{opacity:m}}}function Dsn({current:e,inverted:t,layouts:{screen:n},closing:r}){let i=Y8(e.progress.interpolate({inputRange:[0,1],outputRange:[n.height*.08,0],extrapolate:`clamp`}),t);return{cardStyle:{opacity:J8(r,e.progress,e.progress.interpolate({inputRange:[0,.5,.9,1],outputRange:[0,.25,.7,1],extrapolate:`clamp`})),transform:[{translateY:i}]}}}function Osn({current:e,next:t,inverted:n,layouts:{screen:r}}){let i=Y8(e.progress.interpolate({inputRange:[0,1],outputRange:[r.height,0],extrapolate:`clamp`}),n),a=Y8(e.progress.interpolate({inputRange:[0,1],outputRange:[r.height*(95.9/100)*-1,0],extrapolate:`clamp`}),n),o=t?Y8(t.progress.interpolate({inputRange:[0,1],outputRange:[0,r.height*(2/100)*-1],extrapolate:`clamp`}),n):0,s=e.progress.interpolate({inputRange:[0,.36,1],outputRange:[0,.1,.1],extrapolate:`clamp`});return{containerStyle:{overflow:`hidden`,transform:[{translateY:i}]},cardStyle:{transform:[{translateY:a},{translateY:o}]},overlayStyle:{opacity:s}}}function ksn({current:e,next:t,closing:n}){let r=Ssn(e.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:`clamp`}),t?t.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:`clamp`}):0);return{cardStyle:{opacity:r.interpolate({inputRange:[0,.75,.875,1,1.0825,1.2075,2],outputRange:[0,0,1,1,1,1,0]}),transform:[{scale:J8(n,e.progress.interpolate({inputRange:[0,1],outputRange:[.925,1],extrapolate:`clamp`}),r.interpolate({inputRange:[0,1,2],outputRange:[.85,1,1.075]}))}]}}}function Asn({current:e,next:t,inverted:n,closing:r}){let i=Y8(e.progress.interpolate({inputRange:[0,1],outputRange:[96,0],extrapolate:`clamp`}),n),a=t?Y8(t.progress.interpolate({inputRange:[0,1],outputRange:[0,-96],extrapolate:`clamp`}),n):0;return{cardStyle:{opacity:J8(r,e.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:`clamp`}),e.progress),transform:[{translateX:i},{translateX:a}]}}}function jsn({current:e,inverted:t,layouts:{screen:n},closing:r}){let i=Y8(e.progress.interpolate({inputRange:[0,1],outputRange:[n.height*.8,0],extrapolate:`clamp`}),t),a=J8(r,e.progress,e.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:`clamp`})),o=e.progress.interpolate({inputRange:[0,1],outputRange:[0,.3],extrapolate:`clamp`});return{cardStyle:{opacity:a,transform:[{translateY:i}]},overlayStyle:{opacity:o}}}function Msn({current:{progress:e}}){return{cardStyle:{opacity:e.interpolate({inputRange:[0,.5,.9,1],outputRange:[0,.25,.7,1]})},overlayStyle:{opacity:e.interpolate({inputRange:[0,1],outputRange:[0,.5],extrapolate:`clamp`})}}}function Nsn(){return{}}V();var{add:X8,multiply:Psn}=lf;function Z8({current:e,next:t}){let n=X8(e.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:`clamp`}),t?t.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:`clamp`}):0),r=n.interpolate({inputRange:[0,1,2],outputRange:[0,1,0]});return{leftButtonStyle:{opacity:r},rightButtonStyle:{opacity:r},titleStyle:{opacity:r},backgroundStyle:{opacity:n.interpolate({inputRange:[0,1,1.9,2],outputRange:[0,1,1,0]})}}}function Fsn({current:e,next:t,direction:n,layouts:{screen:r}}){let i=n===`rtl`,a=[{translateX:X8(e.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:`clamp`}),t?t.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:`clamp`}):0).interpolate({inputRange:[0,1,2],outputRange:i?[-r.width,0,r.width]:[r.width,0,-r.width]})}];return{leftButtonStyle:{transform:a},rightButtonStyle:{transform:a},titleStyle:{transform:a},backgroundStyle:{transform:a}}}function Isn({current:e,next:t,direction:n,layouts:{screen:r}}){let i=n===`rtl`,a=[{translateX:X8(e.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:`clamp`}),t?t.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:`clamp`}):0).interpolate({inputRange:[0,1,2],outputRange:i?[r.width,0,-r.width]:[-r.width,0,r.width]})}];return{leftButtonStyle:{transform:a},rightButtonStyle:{transform:a},titleStyle:{transform:a},backgroundStyle:{transform:a}}}function Lsn({current:e,next:t,layouts:{header:n}}){let r=[{translateY:X8(e.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:`clamp`}),t?t.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:`clamp`}):0).interpolate({inputRange:[0,1,2],outputRange:[-n.height,0,-n.height]})}];return{leftButtonStyle:{transform:r},rightButtonStyle:{transform:r},titleStyle:{transform:r},backgroundStyle:{transform:r}}}function Rsn(){return{}}V();var Q8={animation:`spring`,config:{stiffness:1e3,damping:500,mass:3,overshootClamping:!0,restDisplacementThreshold:10,restSpeedThreshold:10}},zsn={animation:`timing`,config:{duration:350,easing:ef.out(ef.poly(5))}},Bsn={animation:`timing`,config:{duration:150,easing:ef.in(ef.linear)}},Vsn={animation:`timing`,config:{duration:425,easing:ef.bezier(.20833,.82,.25,1)}},Hsn={animation:`timing`,config:{duration:400,easing:ef.bezier(.20833,.82,.25,1)}};ef.bezier(.20833,.82,.25,1),ef.bezier(.20833,.82,.25,1);var Usn={animation:`timing`,config:{duration:250,easing:e=>Math.cos((e+1)*Math.PI)/2+.5}},Wsn={animation:`timing`,config:{duration:200,easing:e=>e===1?1:e**2}};V();var Gsn=28,Ksn=29,qsn=34,$8={gestureDirection:`horizontal`,transitionSpec:{open:Q8,close:Q8},cardStyleInterpolator:Csn,headerStyleInterpolator:Z8},Jsn={gestureDirection:`vertical`,transitionSpec:{open:Q8,close:Q8},cardStyleInterpolator:Tsn,headerStyleInterpolator:Z8},Ysn={gestureDirection:`vertical`,transitionSpec:{open:Q8,close:Q8},cardStyleInterpolator:Esn,headerStyleInterpolator:Z8},Xsn={gestureDirection:`vertical`,transitionSpec:{open:zsn,close:Bsn},cardStyleInterpolator:Dsn,headerStyleInterpolator:Z8},Zsn={gestureDirection:`vertical`,transitionSpec:{open:Vsn,close:Vsn},cardStyleInterpolator:Osn,headerStyleInterpolator:Z8},Qsn={gestureDirection:`horizontal`,transitionSpec:{open:Hsn,close:Hsn},cardStyleInterpolator:ksn,headerStyleInterpolator:Z8},$sn={gestureDirection:`horizontal`,transitionSpec:{open:zsn,close:Bsn},cardStyleInterpolator:Asn,headerStyleInterpolator:Z8},ecn={gestureDirection:`vertical`,transitionSpec:{open:Usn,close:Wsn},cardStyleInterpolator:jsn,headerStyleInterpolator:Z8},tcn={gestureDirection:`vertical`,transitionSpec:{open:Usn,close:Wsn},cardStyleInterpolator:Msn,headerStyleInterpolator:Z8},e5=z.select({ios:$8,android:Number(z.Version)>=qsn?$sn:Number(z.Version)>=Ksn?Qsn:Number(z.Version)>=Gsn?Zsn:Xsn,default:Qsn}),ncn=z.select({ios:Ysn,default:ecn}),rcn={...$8,cardStyleInterpolator:wsn},icn=`/assets/png/back-icon.png`,acn=`/assets/png/back-icon-mask.png`,ocn=`/assets/png/clear-icon.png`,scn=`/assets/png/close-icon.png`,ccn=`/assets/png/search-icon.png`,lcn=s(((e,t)=>{t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}})),ucn=s(((e,t)=>{t.exports=function(e){return!e||typeof e==`string`?!1:e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&e.constructor.name!==`String`)}})),dcn=s(((e,t)=>{var n=ucn(),r=Array.prototype.concat,i=Array.prototype.slice,a=t.exports=function(e){for(var t=[],a=0,o=e.length;a<o;a++){var s=e[a];n(s)?t=r.call(t,i.call(s)):t.push(s)}return t};a.wrap=function(e){return function(){return e(a(arguments))}}})),fcn=s(((e,t)=>{var n=lcn(),r=dcn(),i=Object.hasOwnProperty,a=Object.create(null);for(var o in n)i.call(n,o)&&(a[n[o]]=o);var s=t.exports={to:{},get:{}};s.get=function(e){var t=e.substring(0,3).toLowerCase(),n,r;switch(t){case`hsl`:n=s.get.hsl(e),r=`hsl`;break;case`hwb`:n=s.get.hwb(e),r=`hwb`;break;default:n=s.get.rgb(e),r=`rgb`;break}return n?{model:r,value:n}:null},s.get.rgb=function(e){if(!e)return null;var t=/^#([a-f0-9]{3,4})$/i,r=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,a=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,o=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,s=/^(\w+)$/,l=[0,0,0,1],u,d,f;if(u=e.match(r)){for(f=u[2],u=u[1],d=0;d<3;d++){var p=d*2;l[d]=parseInt(u.slice(p,p+2),16)}f&&(l[3]=parseInt(f,16)/255)}else if(u=e.match(t)){for(u=u[1],f=u[3],d=0;d<3;d++)l[d]=parseInt(u[d]+u[d],16);f&&(l[3]=parseInt(f+f,16)/255)}else if(u=e.match(a)){for(d=0;d<3;d++)l[d]=parseInt(u[d+1],0);u[4]&&(u[5]?l[3]=parseFloat(u[4])*.01:l[3]=parseFloat(u[4]))}else if(u=e.match(o)){for(d=0;d<3;d++)l[d]=Math.round(parseFloat(u[d+1])*2.55);u[4]&&(u[5]?l[3]=parseFloat(u[4])*.01:l[3]=parseFloat(u[4]))}else if(u=e.match(s))return u[1]===`transparent`?[0,0,0,0]:i.call(n,u[1])?(l=n[u[1]],l[3]=1,l):null;else return null;for(d=0;d<3;d++)l[d]=c(l[d],0,255);return l[3]=c(l[3],0,1),l},s.get.hsl=function(e){if(!e)return null;var t=e.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){var n=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,c(parseFloat(t[2]),0,100),c(parseFloat(t[3]),0,100),c(isNaN(n)?1:n,0,1)]}return null},s.get.hwb=function(e){if(!e)return null;var t=e.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){var n=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,c(parseFloat(t[2]),0,100),c(parseFloat(t[3]),0,100),c(isNaN(n)?1:n,0,1)]}return null},s.to.hex=function(){var e=r(arguments);return`#`+l(e[0])+l(e[1])+l(e[2])+(e[3]<1?l(Math.round(e[3]*255)):``)},s.to.rgb=function(){var e=r(arguments);return e.length<4||e[3]===1?`rgb(`+Math.round(e[0])+`, `+Math.round(e[1])+`, `+Math.round(e[2])+`)`:`rgba(`+Math.round(e[0])+`, `+Math.round(e[1])+`, `+Math.round(e[2])+`, `+e[3]+`)`},s.to.rgb.percent=function(){var e=r(arguments),t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),i=Math.round(e[2]/255*100);return e.length<4||e[3]===1?`rgb(`+t+`%, `+n+`%, `+i+`%)`:`rgba(`+t+`%, `+n+`%, `+i+`%, `+e[3]+`)`},s.to.hsl=function(){var e=r(arguments);return e.length<4||e[3]===1?`hsl(`+e[0]+`, `+e[1]+`%, `+e[2]+`%)`:`hsla(`+e[0]+`, `+e[1]+`%, `+e[2]+`%, `+e[3]+`)`},s.to.hwb=function(){var e=r(arguments),t=``;return e.length>=4&&e[3]!==1&&(t=`, `+e[3]),`hwb(`+e[0]+`, `+e[1]+`%, `+e[2]+`%`+t+`)`},s.to.keyword=function(e){return a[e.slice(0,3)]};function c(e,t,n){return Math.min(Math.max(t,e),n)}function l(e){var t=Math.round(e).toString(16).toUpperCase();return t.length<2?`0`+t:t}})),pcn=s(((e,t)=>{var n=lcn(),r={};for(let e of Object.keys(n))r[n[e]]=e;var i={rgb:{channels:3,labels:`rgb`},hsl:{channels:3,labels:`hsl`},hsv:{channels:3,labels:`hsv`},hwb:{channels:3,labels:`hwb`},cmyk:{channels:4,labels:`cmyk`},xyz:{channels:3,labels:`xyz`},lab:{channels:3,labels:`lab`},lch:{channels:3,labels:`lch`},hex:{channels:1,labels:[`hex`]},keyword:{channels:1,labels:[`keyword`]},ansi16:{channels:1,labels:[`ansi16`]},ansi256:{channels:1,labels:[`ansi256`]},hcg:{channels:3,labels:[`h`,`c`,`g`]},apple:{channels:3,labels:[`r16`,`g16`,`b16`]},gray:{channels:1,labels:[`gray`]}};t.exports=i;for(let e of Object.keys(i)){if(!(`channels`in i[e]))throw Error(`missing channels property: `+e);if(!(`labels`in i[e]))throw Error(`missing channel labels property: `+e);if(i[e].labels.length!==i[e].channels)throw Error(`channel and label counts mismatch: `+e);let{channels:t,labels:n}=i[e];delete i[e].channels,delete i[e].labels,Object.defineProperty(i[e],"channels",{value:t}),Object.defineProperty(i[e],"labels",{value:n})}i.rgb.hsl=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=a-i,s,c;a===i?s=0:t===a?s=(n-r)/o:n===a?s=2+(r-t)/o:r===a&&(s=4+(t-n)/o),s=Math.min(s*60,360),s<0&&(s+=360);let l=(i+a)/2;return c=a===i?0:l<=.5?o/(a+i):o/(2-a-i),[s,c*100,l*100]},i.rgb.hsv=function(e){let t,n,r,i,a,o=e[0]/255,s=e[1]/255,c=e[2]/255,l=Math.max(o,s,c),u=l-Math.min(o,s,c),d=function(e){return(l-e)/6/u+1/2};return u===0?(i=0,a=0):(a=u/l,t=d(o),n=d(s),r=d(c),o===l?i=r-n:s===l?i=1/3+t-r:c===l&&(i=2/3+n-t),i<0?i+=1:i>1&&--i),[i*360,a*100,l*100]},i.rgb.hwb=function(e){let t=e[0],n=e[1],r=e[2],a=i.rgb.hsl(e)[0],o=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[a,o*100,r*100]},i.rgb.cmyk=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(1-t,1-n,1-r),a=(1-t-i)/(1-i)||0,o=(1-n-i)/(1-i)||0,s=(1-r-i)/(1-i)||0;return[a*100,o*100,s*100,i*100]};function a(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}i.rgb.keyword=function(e){let t=r[e];if(t)return t;let i=1/0,o;for(let t of Object.keys(n)){let r=n[t],s=a(e,r);s<i&&(i=s,o=t)}return o},i.keyword.rgb=function(e){return n[e]},i.rgb.xyz=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;let i=t*.4124+n*.3576+r*.1805,a=t*.2126+n*.7152+r*.0722,o=t*.0193+n*.1192+r*.9505;return[i*100,a*100,o*100]},i.rgb.lab=function(e){let t=i.rgb.xyz(e),n=t[0],r=t[1],a=t[2];return n/=95.047,r/=100,a/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,a=a>.008856?a**(1/3):7.787*a+16/116,[116*r-16,500*(n-r),200*(r-a)]},i.hsl.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100,i,a,o;if(n===0)return o=r*255,[o,o,o];i=r<.5?r*(1+n):r+n-r*n;let s=2*r-i,c=[0,0,0];for(let e=0;e<3;e++)a=t+1/3*-(e-1),a<0&&a++,a>1&&a--,o=6*a<1?s+(i-s)*6*a:2*a<1?i:3*a<2?s+(i-s)*(2/3-a)*6:s,c[e]=o*255;return c},i.hsl.hsv=function(e){let t=e[0],n=e[1]/100,r=e[2]/100,i=n,a=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,i*=a<=1?a:2-a;let o=(r+n)/2;return[t,(r===0?2*i/(a+i):2*n/(r+n))*100,o*100]},i.hsv.rgb=function(e){let t=e[0]/60,n=e[1]/100,r=e[2]/100,i=Math.floor(t)%6,a=t-Math.floor(t),o=255*r*(1-n),s=255*r*(1-n*a),c=255*r*(1-n*(1-a));switch(r*=255,i){case 0:return[r,c,o];case 1:return[s,r,o];case 2:return[o,r,c];case 3:return[o,s,r];case 4:return[c,o,r];case 5:return[r,o,s]}},i.hsv.hsl=function(e){let t=e[0],n=e[1]/100,r=e[2]/100,i=Math.max(r,.01),a,o;o=(2-n)*r;let s=(2-n)*i;return a=n*i,a/=s<=1?s:2-s,a||=0,o/=2,[t,a*100,o*100]},i.hwb.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100,i=n+r,a;i>1&&(n/=i,r/=i);let o=Math.floor(6*t),s=1-r;a=6*t-o,o&1&&(a=1-a);let c=n+a*(s-n),l,u,d;switch(o){default:case 6:case 0:l=s,u=c,d=n;break;case 1:l=c,u=s,d=n;break;case 2:l=n,u=s,d=c;break;case 3:l=n,u=c,d=s;break;case 4:l=c,u=n,d=s;break;case 5:l=s,u=n,d=c;break}return[l*255,u*255,d*255]},i.cmyk.rgb=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i=e[3]/100,a=1-Math.min(1,t*(1-i)+i),o=1-Math.min(1,n*(1-i)+i),s=1-Math.min(1,r*(1-i)+i);return[a*255,o*255,s*255]},i.xyz.rgb=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i,a,o;return i=t*3.2406+n*-1.5372+r*-.4986,a=t*-.9689+n*1.8758+r*.0415,o=t*.0557+n*-.204+r*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,i=Math.min(Math.max(0,i),1),a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),[i*255,a*255,o*255]},i.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];return t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,[116*n-16,500*(t-n),200*(n-r)]},i.lab.xyz=function(e){let t=e[0],n=e[1],r=e[2],i,a,o;a=(t+16)/116,i=n/500+a,o=a-r/200;let s=a**3,c=i**3,l=o**3;return a=s>.008856?s:(a-16/116)/7.787,i=c>.008856?c:(i-16/116)/7.787,o=l>.008856?l:(o-16/116)/7.787,i*=95.047,a*=100,o*=108.883,[i,a,o]},i.lab.lch=function(e){let t=e[0],n=e[1],r=e[2],i;return i=Math.atan2(r,n)*360/2/Math.PI,i<0&&(i+=360),[t,Math.sqrt(n*n+r*r),i]},i.lch.lab=function(e){let t=e[0],n=e[1],r=e[2]/360*2*Math.PI;return[t,n*Math.cos(r),n*Math.sin(r)]},i.rgb.ansi16=function(e,t=null){let[n,r,a]=e,o=t===null?i.rgb.hsv(e)[2]:t;if(o=Math.round(o/50),o===0)return 30;let s=30+(Math.round(a/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return o===2&&(s+=60),s},i.hsv.ansi16=function(e){return i.rgb.ansi16(i.hsv.rgb(e),e[2])},i.rgb.ansi256=function(e){let t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},i.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];let n=(~~(e>50)+1)*.5;return[(t&1)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},i.ansi256.rgb=function(e){if(e>=232){let t=(e-232)*10+8;return[t,t,t]}e-=16;let t;return[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},i.rgb.hex=function(e){let t=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return`000000`.substring(t.length)+t},i.hex.rgb=function(e){let t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];t[0].length===3&&(n=n.split(``).map(e=>e+e).join(``));let r=parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},i.rgb.hcg=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.max(Math.max(t,n),r),a=Math.min(Math.min(t,n),r),o=i-a,s,c;return s=o<1?a/(1-o):0,c=o<=0?0:i===t?(n-r)/o%6:i===n?2+(r-t)/o:4+(t-n)/o,c/=6,c%=1,[c*360,o*100,s*100]},i.hsl.hcg=function(e){let t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n),i=0;return r<1&&(i=(n-.5*r)/(1-r)),[e[0],r*100,i*100]},i.hsv.hcg=function(e){let t=e[1]/100,n=e[2]/100,r=t*n,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],r*100,i*100]},i.hcg.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100;if(n===0)return[r*255,r*255,r*255];let i=[0,0,0],a=t%1*6,o=a%1,s=1-o,c=0;switch(Math.floor(a)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=s,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=s,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=s}return c=(1-n)*r,[(n*i[0]+c)*255,(n*i[1]+c)*255,(n*i[2]+c)*255]},i.hcg.hsv=function(e){let t=e[1]/100,n=t+e[2]/100*(1-t),r=0;return n>0&&(r=t/n),[e[0],r*100,n*100]},i.hcg.hsl=function(e){let t=e[1]/100,n=e[2]/100*(1-t)+.5*t,r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],r*100,n*100]},i.hcg.hwb=function(e){let t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],(n-t)*100,(1-n)*100]},i.hwb.hcg=function(e){let t=e[1]/100,n=1-e[2]/100,r=n-t,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],r*100,i*100]},i.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},i.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},i.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},i.gray.hsl=function(e){return[0,0,e[0]]},i.gray.hsv=i.gray.hsl,i.gray.hwb=function(e){return[0,100,e[0]]},i.gray.cmyk=function(e){return[0,0,0,e[0]]},i.gray.lab=function(e){return[e[0],0,0]},i.gray.hex=function(e){let t=Math.round(e[0]/100*255)&255,n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return`000000`.substring(n.length)+n},i.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}})),mcn=s(((e,t)=>{var n=pcn();function r(){let e={},t=Object.keys(n);for(let n=t.length,r=0;r<n;r++)e[t[r]]={distance:-1,parent:null};return e}function i(e){let t=r(),i=[e];for(t[e].distance=0;i.length;){let e=i.pop(),r=Object.keys(n[e]);for(let n=r.length,a=0;a<n;a++){let n=r[a],o=t[n];o.distance===-1&&(o.distance=t[e].distance+1,o.parent=e,i.unshift(n))}}return t}function a(e,t){return function(n){return t(e(n))}}function o(e,t){let r=[t[e].parent,e],i=n[t[e].parent][e],o=t[e].parent;for(;t[o].parent;)r.unshift(t[o].parent),i=a(n[t[o].parent][o],i),o=t[o].parent;return i.conversion=r,i}t.exports=function(e){let t=i(e),n={},r=Object.keys(t);for(let e=r.length,i=0;i<e;i++){let e=r[i];t[e].parent!==null&&(n[e]=o(e,t))}return n}})),hcn=s(((e,t)=>{var n=pcn(),r=mcn(),i={},a=Object.keys(n);function o(e){let t=function(...t){let n=t[0];return n==null?n:(n.length>1&&(t=n),e(t))};return`conversion`in e&&(t.conversion=e.conversion),t}function s(e){let t=function(...t){let n=t[0];if(n==null)return n;n.length>1&&(t=n);let r=e(t);if(typeof r==`object`)for(let e=r.length,t=0;t<e;t++)r[t]=Math.round(r[t]);return r};return`conversion`in e&&(t.conversion=e.conversion),t}a.forEach(e=>{i[e]={},Object.defineProperty(i[e],"channels",{value:n[e].channels}),Object.defineProperty(i[e],"labels",{value:n[e].labels});let t=r(e);Object.keys(t).forEach(n=>{let r=t[n];i[e][n]=s(r),i[e][n].raw=o(r)})}),t.exports=i})),gcn=s(((e,t)=>{var n=fcn(),r=hcn(),i=[`keyword`,`gray`,`hex`],a={};for(let e of Object.keys(r))a[[...r[e].labels].sort().join(``)]=e;var o={};function s(e,t){if(!(this instanceof s))return new s(e,t);if(t&&t in i&&(t=null),t&&!(t in r))throw Error(`Unknown model: `+t);let c,l;if(e==null)this.model=`rgb`,this.color=[0,0,0],this.valpha=1;else if(e instanceof s)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if(typeof e==`string`){let t=n.get(e);if(t===null)throw Error(`Unable to parse color from string: `+e);this.model=t.model,l=r[this.model].channels,this.color=t.value.slice(0,l),this.valpha=typeof t.value[l]==`number`?t.value[l]:1}else if(e.length>0){this.model=t||`rgb`,l=r[this.model].channels;let n=Array.prototype.slice.call(e,0,l);this.color=p(n,l),this.valpha=typeof e[l]==`number`?e[l]:1}else if(typeof e==`number`)this.model=`rgb`,this.color=[e>>16&255,e>>8&255,e&255],this.valpha=1;else{this.valpha=1;let t=Object.keys(e);`alpha`in e&&(t.splice(t.indexOf(`alpha`),1),this.valpha=typeof e.alpha==`number`?e.alpha:0);let n=t.sort().join(``);if(!(n in a))throw Error(`Unable to parse color from object: `+JSON.stringify(e));this.model=a[n];let{labels:i}=r[this.model],o=[];for(c=0;c<i.length;c++)o.push(e[i[c]]);this.color=p(o)}if(o[this.model])for(l=r[this.model].channels,c=0;c<l;c++){let e=o[this.model][c];e&&(this.color[c]=e(this.color[c]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}s.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let t=this.model in n.to?this:this.rgb();t=t.round(typeof e==`number`?e:1);let r=t.valpha===1?t.color:[...t.color,this.valpha];return n.to[t.model](r)},percentString(e){let t=this.rgb().round(typeof e==`number`?e:1),r=t.valpha===1?t.color:[...t.color,this.valpha];return n.to.rgb.percent(r)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let e={},{channels:t}=r[this.model],{labels:n}=r[this.model];for(let r=0;r<t;r++)e[n[r]]=this.color[r];return this.valpha!==1&&(e.alpha=this.valpha),e},unitArray(){let e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,this.valpha!==1&&e.push(this.valpha),e},unitObject(){let e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,this.valpha!==1&&(e.alpha=this.valpha),e},round(e){return e=Math.max(e||0,0),new s([...this.color.map(l(e)),this.valpha],this.model)},alpha(e){return e===void 0?this.valpha:new s([...this.color,Math.max(0,Math.min(1,e))],this.model)},red:u(`rgb`,0,d(255)),green:u(`rgb`,1,d(255)),blue:u(`rgb`,2,d(255)),hue:u([`hsl`,`hsv`,`hsl`,`hwb`,`hcg`],0,e=>(e%360+360)%360),saturationl:u(`hsl`,1,d(100)),lightness:u(`hsl`,2,d(100)),saturationv:u(`hsv`,1,d(100)),value:u(`hsv`,2,d(100)),chroma:u(`hcg`,1,d(100)),gray:u(`hcg`,2,d(100)),white:u(`hwb`,1,d(100)),wblack:u(`hwb`,2,d(100)),cyan:u(`cmyk`,0,d(100)),magenta:u(`cmyk`,1,d(100)),yellow:u(`cmyk`,2,d(100)),black:u(`cmyk`,3,d(100)),x:u(`xyz`,0,d(95.047)),y:u(`xyz`,1,d(100)),z:u(`xyz`,2,d(108.833)),l:u(`lab`,0,d(100)),a:u(`lab`,1),b:u(`lab`,2),keyword(e){return e===void 0?r[this.model].keyword(this.color):new s(e)},hex(e){return e===void 0?n.to.hex(this.rgb().round().color):new s(e)},hexa(e){if(e!==void 0)return new s(e);let t=this.rgb().round().color,r=Math.round(this.valpha*255).toString(16).toUpperCase();return r.length===1&&(r=`0`+r),n.to.hex(t)+r},rgbNumber(){let e=this.rgb().color;return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255},luminosity(){let e=this.rgb().color,t=[];for(let[n,r]of e.entries()){let e=r/255;t[n]=e<=.04045?e/12.92:((e+.055)/1.055)**2.4}return .2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(e){let t=this.luminosity(),n=e.luminosity();return t>n?(t+.05)/(n+.05):(n+.05)/(t+.05)},level(e){let t=this.contrast(e);return t>=7?`AAA`:t>=4.5?`AA`:``},isDark(){let e=this.rgb().color;return(e[0]*2126+e[1]*7152+e[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){let t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){let t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){let t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){let t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){let t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){let t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){let e=this.rgb().color,t=e[0]*.3+e[1]*.59+e[2]*.11;return s.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){let t=this.hsl(),n=t.color[0];return n=(n+e)%360,n=n<0?360+n:n,t.color[0]=n,t},mix(e,t){if(!e||!e.rgb)throw Error(`Argument to "mix" was not a Color instance, but rather an instance of `+typeof e);let n=e.rgb(),r=this.rgb(),i=t===void 0?.5:t,a=2*i-1,o=n.alpha()-r.alpha(),c=((a*o===-1?a:(a+o)/(1+a*o))+1)/2,l=1-c;return s.rgb(c*n.red()+l*r.red(),c*n.green()+l*r.green(),c*n.blue()+l*r.blue(),n.alpha()*i+r.alpha()*(1-i))}};for(let e of Object.keys(r)){if(i.includes(e))continue;let{channels:t}=r[e];s.prototype[e]=function(...t){return this.model===e?new s(this):t.length>0?new s(t,e):new s([...f(r[this.model][e].raw(this.color)),this.valpha],e)},s[e]=function(...n){let r=n[0];return typeof r==`number`&&(r=p(n,t)),new s(r,e)}}function c(e,t){return Number(e.toFixed(t))}function l(e){return function(t){return c(t,e)}}function u(e,t,n){e=Array.isArray(e)?e:[e];for(let r of e)(o[r]||(o[r]=[]))[t]=n;return e=e[0],function(r){let i;return r===void 0?(i=this[e]().color[t],n&&(i=n(i)),i):(n&&(r=n(r)),i=this[e](),i.color[t]=r,i)}}function d(e){return function(t){return Math.max(0,Math.min(e,t))}}function f(e){return Array.isArray(e)?e:[e]}function p(e,t){for(let n=0;n<t;n++)typeof e[n]!=`number`&&(e[n]=0);return e}t.exports=s}));V();var _cn=lf.createAnimatedComponent(wp),vcn=z.OS===`android`&&z.Version>=21,ycn=z.OS!==`web`;function bcn({disabled:e,onPress:t,onPressIn:n,onPressOut:r,android_ripple:i,pressColor:a,pressOpacity:o=.3,hoverEffect:s,style:c,children:l,...u},d){let{dark:f}=B$(),[p]=H.useState(()=>new lf.Value(1)),m=(e,t)=>{vcn||lf.timing(p,{toValue:e,duration:t,easing:ef.inOut(ef.quad),useNativeDriver:ycn}).start()};return(0,W.jsxs)(_cn,{ref:d,accessible:!0,role:z.OS===`web`&&u.href!=null?`link`:`button`,onPress:e?void 0:e=>{if(z.OS===`web`&&u.href!==null){let n=`metaKey`in e&&e.metaKey||`altKey`in e&&e.altKey||`ctrlKey`in e&&e.ctrlKey||`shiftKey`in e&&e.shiftKey,r=`button`in e?e.button==null||e.button===0:!0,i=e.currentTarget&&`target`in e.currentTarget?[void 0,null,``,`self`].includes(e.currentTarget.target):!0;!n&&r&&i&&(e.preventDefault(),t?.(e))}else t?.(e)},onPressIn:e?void 0:e=>{m(o,0),n?.(e)},onPressOut:e?void 0:e=>{m(1,200),r?.(e)},android_ripple:vcn&&!e?{color:a===void 0?f?`rgba(255, 255, 255, .32)`:`rgba(0, 0, 0, .32)`:a,...i}:void 0,style:[{cursor:(z.OS===`web`||z.OS===`ios`)&&!e?`pointer`:`auto`,opacity:!vcn&&!e?p:1},c],...u,children:[e?null:(0,W.jsx)(Ccn,{...s}),l]})}var t5=H.forwardRef(bcn);t5.displayName=`PlatformPressable`;var xcn=String.raw,n5=`__react-navigation_elements_Pressable_hover`,Scn=xcn`
|
|
881
881
|
.${n5} {
|
|
882
882
|
position: absolute;
|
|
883
883
|
top: 0;
|
|
@@ -899,4 +899,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
899
899
|
opacity: var(--overlay-active-opacity);
|
|
900
900
|
}
|
|
901
901
|
`,Ccn=({color:e,hoverOpacity:t=.08,activeOpacity:n=.16})=>z.OS!==`web`||e==null?null:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`style`,{href:n5,precedence:`elements`,children:Scn}),(0,W.jsx)(`div`,{className:n5,style:{"--overlay-color":e,"--overlay-hover-opacity":t,"--overlay-active-opacity":n}})]});V();function wcn({style:e,...t}){let{colors:n,fonts:r}=B$();return(0,W.jsx)(_d,{...t,style:[{color:n.text},r.regular,e]})}V();function Tcn(e,t,n){let r,i=z.OS===`ios`&&n>50?n-(5+1/Ru.get()):n,a=e.width>e.height;return r=z.OS===`ios`?z.isPad||z.isTV?t?56:50:a?32:t?56:44:64,r+i}function Ecn(e,t){return typeof e.headerTitle==`string`?e.headerTitle:e.title===void 0?t:e.title}var Dcn=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}})),Ocn=s(((e,t)=>{t.exports=Dcn()}));V();var kcn=Ocn(),Acn=H.createContext(void 0);function jcn(e,t){let n=H.useContext(Acn);if(n==null)throw Error(`useFrameSize must be used within a FrameSizeProvider`);return(0,kcn.useSyncExternalStoreWithSelector)(t?n.subscribeThrottled:n.subscribe,n.getCurrent,n.getCurrent,e)}function Mcn({initialFrame:e,render:t}){let n=H.useRef({width:e.width,height:e.height}),r=H.useRef(new Set),i=T$(()=>n.current),a=T$(e=>(r.current.add(e),()=>{r.current.delete(e)})),o=T$(e=>{let t,n=!1,r=!1,i=a(()=>{clearTimeout(t),n=!0,r?t=setTimeout(()=>{n&&(n=!1,e())},100):(r=!0,setTimeout(function(){r=!1},100),n=!1,e())});return()=>{i(),clearTimeout(t)}}),s=H.useMemo(()=>({getCurrent:i,subscribe:a,subscribeThrottled:o}),[a,o,i]),c=T$(e=>{n.current.height===e.height&&n.current.width===e.width||(n.current={width:e.width,height:e.height},r.current.forEach(e=>e()))}),l=H.useRef(null);return H.useEffect(()=>{z.OS!==`web`&&l.current?.measure((e,t,n,r)=>{c({width:n,height:r})})},[c]),(0,W.jsxs)(Acn.Provider,{value:s,children:[z.OS===`web`?(0,W.jsx)(Ncn,{onChange:c}):null,t({ref:l,onLayout:e=>{let{width:t,height:n}=e.nativeEvent.layout;c({width:t,height:n})}})]})}function Ncn({onChange:e}){let t=H.useRef(null);return H.useEffect(()=>{if(t.current==null)return;let n=t.current.getBoundingClientRect();e({width:n.width,height:n.height});let r=new ResizeObserver(t=>{let n=t[0];if(n){let{width:t,height:r}=n.contentRect;e({width:t,height:r})}});return r.observe(t.current),()=>{r.disconnect()}},[e]),(0,W.jsx)(`div`,{ref:t,style:{position:`absolute`,left:0,right:0,top:0,bottom:0,pointerEvents:`none`,visibility:`hidden`}})}function Pcn({children:e}){return e}V();function Fcn({disabled:e,onPress:t,pressColor:n,pressOpacity:r,accessibilityLabel:i,testID:a,style:o,href:s,children:c},l){return(0,W.jsx)(t5,{ref:l,disabled:e,href:s,"aria-label":i,testID:a,onPress:t,pressColor:n,pressOpacity:r,android_ripple:Icn,style:[Lcn.container,e&&Lcn.disabled,o],hitSlop:z.select({ios:void 0,default:{top:16,right:16,bottom:16,left:16}}),children:c})}var r5=H.forwardRef(Fcn);r5.displayName=`HeaderButton`;var Icn={borderless:!0,foreground:z.OS===`android`&&z.Version>=23,radius:20},Lcn=R.create({container:{flexDirection:`row`,alignItems:`center`,paddingHorizontal:8,borderRadius:10,borderCurve:`continuous`},disabled:{opacity:.5}});V();function i5({source:e,style:t,...n}){let{colors:r}=B$(),{direction:i}=K$();return(0,W.jsx)(Zu,{source:e,resizeMode:`contain`,fadeDuration:0,tintColor:r.text,style:[Bcn.icon,i===`rtl`&&Bcn.flip,t],...n})}var Rcn=z.OS===`ios`?21:24,zcn=z.OS===`ios`?8:3,Bcn=R.create({icon:{width:Rcn,height:Rcn,margin:zcn},flip:{transform:`scaleX(-1)`}});V();function Vcn({disabled:e,allowFontScaling:t,backImage:n,label:r,labelStyle:i,displayMode:a=z.OS===`ios`?`default`:`minimal`,onLabelLayout:o,onPress:s,pressColor:c,pressOpacity:l,screenLayout:u,tintColor:d,titleLayout:f,truncatedLabel:p=`Back`,accessibilityLabel:m=r&&r!==`Back`?`${r}, back`:`Go back`,testID:h,style:g,href:_}){let{colors:v,fonts:y}=B$(),{direction:b}=K$(),[x,S]=H.useState(null),[C,w]=H.useState(null);return(0,W.jsx)(r5,{disabled:e,href:_,accessibilityLabel:m,testID:h,onPress:()=>{s&&requestAnimationFrame(()=>s())},pressColor:c,pressOpacity:l,style:[a5.container,g],children:(0,W.jsxs)(H.Fragment,{children:[n?n({tintColor:d??v.text}):(0,W.jsx)(i5,{source:icn,tintColor:d,style:[a5.icon,a!==`minimal`&&a5.iconWithLabel]}),(()=>{if(a===`minimal`)return null;let e=f&&u?(u.width-f.width)/2-(Hcn+zcn):null,s=a==="default"?r:p,c=e&&x&&C?e>x?s:e>C?p:null:s,l=[y.regular,a5.label,i],m=[l,{position:`absolute`,top:0,left:0,opacity:0}],h=(0,W.jsxs)(B,{style:a5.labelWrapper,children:[r&&a==="default"?(0,W.jsx)(lf.Text,{style:m,numberOfLines:1,onLayout:e=>S(e.nativeEvent.layout.width),children:r}):null,p?(0,W.jsx)(lf.Text,{style:m,numberOfLines:1,onLayout:e=>w(e.nativeEvent.layout.width),children:p}):null,c?(0,W.jsx)(lf.Text,{accessible:!1,onLayout:o,style:[d?{color:d}:null,l],numberOfLines:1,allowFontScaling:!!t,children:c}):null]});return n||z.OS!==`ios`?h:(0,W.jsx)(Pcn,{maskElement:(0,W.jsxs)(B,{style:[a5.iconMaskContainer,u?{minWidth:u.width/2-27}:null],children:[(0,W.jsx)(Zu,{source:acn,resizeMode:`contain`,style:[a5.iconMask,b===`rtl`&&a5.flip]}),(0,W.jsx)(B,{style:a5.iconMaskFillerRect})]}),children:h})})()]})})}var Hcn=z.OS===`ios`?13:24,Ucn=z.OS===`ios`?22:3,a5=R.create({container:{paddingHorizontal:0,minWidth:R.hairlineWidth,...z.select({ios:null,default:{marginVertical:3,marginHorizontal:11}})},label:{fontSize:17,letterSpacing:.35},labelWrapper:{flexDirection:`row`,alignItems:`flex-start`,marginEnd:zcn},icon:{width:Hcn,marginEnd:Ucn},iconWithLabel:z.OS===`ios`?{marginEnd:6}:{},iconMaskContainer:{flex:1,flexDirection:`row`,justifyContent:`center`},iconMaskFillerRect:{flex:1,backgroundColor:`#000`},iconMask:{height:21,width:13,marginStart:-14.5,marginVertical:12,alignSelf:`center`},flip:{transform:`scaleX(-1)`}});V();function Wcn({style:e,...t}){let{colors:n,dark:r}=B$();return(0,W.jsx)(lf.View,{style:[Gcn.container,{backgroundColor:n.card,borderBottomColor:n.border,...z.OS===`ios`&&{shadowColor:r?`rgba(255, 255, 255, 0.45)`:`rgba(0, 0, 0, 1)`}},e],...t})}var Gcn=R.create({container:{flex:1,...z.select({android:{elevation:4},ios:{shadowOpacity:.3,shadowRadius:0,shadowOffset:{width:0,height:R.hairlineWidth}},default:{borderBottomWidth:R.hairlineWidth}})}}),o5=u(gcn());V();var Kcn={text:`text`,number:`numeric`,phone:`tel`,email:`email`},qcn=z.OS!==`web`;function Jcn({visible:e,inputType:t,autoFocus:n=!0,autoCapitalize:r,placeholder:i=`Search`,cancelButtonText:a=`Cancel`,enterKeyHint:o=`search`,onChangeText:s,onClose:c,tintColor:l,style:u,...d},f){let p=N$(),{dark:m,colors:h,fonts:g}=B$(),[_,v]=H.useState(``),[y,b]=H.useState(e),[x]=H.useState(()=>new lf.Value(+!!e)),[S]=H.useState(()=>new lf.Value(0)),C=H.useRef(e),w=H.useRef(!1),T=H.useRef(null);H.useEffect(()=>{if(e!==C.current)return lf.timing(x,{toValue:+!!e,duration:100,useNativeDriver:qcn}).start(({finished:t})=>{t&&(b(e),C.current=e)}),()=>{x.stopAnimation()}},[e,x]);let E=_!==``;H.useEffect(()=>{w.current!==E&&lf.timing(S,{toValue:+!!E,duration:100,useNativeDriver:qcn}).start(({finished:e})=>{e&&(w.current=E)})},[S,E]);let D=H.useCallback(()=>{T.current?.clear(),T.current?.focus(),v(``)},[]),O=H.useCallback(()=>{D(),s?.({nativeEvent:{text:``}})},[D,s]),k=H.useCallback(()=>{O(),c()},[O,c]);if(H.useEffect(()=>p?.addListener(`blur`,k),[k,p]),H.useImperativeHandle(f,()=>({focus:()=>{T.current?.focus()},blur:()=>{T.current?.blur()},setText:e=>{T.current?.setNativeProps({text:e}),v(e)},clearText:D,cancelSearch:k}),[k,D]),!e&&!y)return null;let A=l??h.text;return(0,W.jsxs)(lf.View,{pointerEvents:e?`auto`:`none`,"aria-live":`polite`,"aria-hidden":!e,style:[s5.container,{opacity:x},u],children:[(0,W.jsxs)(B,{style:s5.searchbarContainer,children:[(0,W.jsx)(i5,{source:ccn,tintColor:A,style:s5.inputSearchIcon}),(0,W.jsx)(Lp,{...d,ref:T,onChange:s,onChangeText:v,autoFocus:n,autoCapitalize:r===`systemDefault`?void 0:r,inputMode:Kcn[t??`text`],enterKeyHint:o,placeholder:i,placeholderTextColor:(0,o5.default)(A).alpha(.5).string(),cursorColor:h.primary,selectionHandleColor:h.primary,selectionColor:(0,o5.default)(h.primary).alpha(.3).string(),style:[g.regular,s5.searchbar,{backgroundColor:z.select({ios:m?`rgba(255, 255, 255, 0.1)`:`rgba(0, 0, 0, 0.1)`,default:`transparent`}),color:A,borderBottomColor:(0,o5.default)(A).alpha(.2).string()}]}),z.OS===`ios`?(0,W.jsx)(t5,{onPress:O,style:[{opacity:S,transform:[{scale:S}]},s5.clearButton],children:(0,W.jsx)(Zu,{source:ocn,resizeMode:`contain`,tintColor:A,style:s5.clearIcon})}):null]}),z.OS===`ios`?null:(0,W.jsx)(r5,{onPress:()=>{_?O():c()},style:s5.closeButton,children:(0,W.jsx)(i5,{source:scn,tintColor:A})}),z.OS===`ios`?(0,W.jsx)(t5,{onPress:k,style:s5.cancelButton,children:(0,W.jsx)(wcn,{style:[g.regular,{color:l??h.primary},s5.cancelText],children:a})}):null]})}var s5=R.create({container:{flex:1,flexDirection:`row`,alignItems:`stretch`},inputSearchIcon:{position:`absolute`,opacity:.5,left:z.select({ios:16,default:4}),top:z.select({ios:-1,default:17}),...z.select({ios:{height:18,width:18},default:{}})},closeButton:{position:`absolute`,opacity:.5,right:z.select({ios:0,default:8}),top:z.select({ios:-2,default:17})},clearButton:{position:`absolute`,right:0,top:-7,bottom:0,justifyContent:`center`,padding:8},clearIcon:{height:16,width:16,opacity:.5},cancelButton:{alignSelf:`center`,top:-4},cancelText:{fontSize:17,marginHorizontal:12},searchbarContainer:{flex:1},searchbar:z.select({ios:{flex:1,fontSize:17,paddingHorizontal:32,marginLeft:16,marginTop:-1,marginBottom:4,borderRadius:8,borderCurve:`continuous`},default:{flex:1,fontSize:18,paddingHorizontal:36,marginRight:8,marginTop:8,marginBottom:8,borderBottomWidth:1}})}),Ycn=H.forwardRef(Jcn),c5=`__react_navigation__elements_contexts`;globalThis[c5]=globalThis[c5]??new Map;function Xcn(e,t){let n=globalThis[c5].get(e);return n||(n=H.createContext(t),n.displayName=e,globalThis[c5].set(e,n),n)}var l5=Xcn(`HeaderShownContext`,!1);V();function Zcn({tintColor:e,style:t,...n}){let{colors:r,fonts:i}=B$();return(0,W.jsx)(lf.Text,{role:`heading`,"aria-level":`1`,numberOfLines:1,...n,style:[{color:e===void 0?r.text:e},z.select({ios:i.bold,default:i.medium}),Qcn.title,t]})}var Qcn=R.create({title:z.select({ios:{fontSize:17},android:{fontSize:20},default:{fontSize:18}})});V(),Z0();var $cn=414;function eln(e){let t=W0(),n=jcn(e=>e,!0),{colors:r}=B$(),i=N$(),a=H.useContext(l5),[o,s]=H.useState(!1),[c,l]=H.useState(void 0),u=e=>{let{height:t,width:n}=e.nativeEvent.layout;l(e=>e&&t===e.height&&n===e.width?e:{height:t,width:n})},{layout:d=n,modal:f=!1,back:p,title:m,headerTitle:h,headerTitleAlign:g=z.OS===`ios`?`center`:`left`,headerLeft:_=p?e=>(0,W.jsx)(Vcn,{...e}):void 0,headerSearchBarOptions:v,headerTransparent:y,headerTintColor:b,headerBackground:x,headerRight:S,headerTitleAllowFontScaling:C,headerTitleStyle:w,headerLeftContainerStyle:T,headerRightContainerStyle:E,headerTitleContainerStyle:D,headerBackButtonDisplayMode:O=z.OS===`ios`?`default`:`minimal`,headerBackTitleStyle:k,headerBackgroundContainerStyle:A,headerStyle:ee,headerShadowVisible:te,headerPressColor:ne,headerPressOpacity:re,headerStatusBarHeight:ie=a?0:t.top}=e,j=Tcn(d,f,ie),{height:ae=j,maxHeight:oe,minHeight:se,backfaceVisibility:M,backgroundColor:ce,borderBlockColor:N,borderBlockEndColor:P,borderBlockStartColor:le,borderBottomColor:ue,borderBottomEndRadius:de,borderBottomLeftRadius:fe,borderBottomRightRadius:pe,borderBottomStartRadius:me,borderBottomWidth:he,borderColor:ge,borderCurve:F,borderEndColor:_e,borderEndEndRadius:I,borderEndStartRadius:ve,borderEndWidth:ye,borderLeftColor:be,borderLeftWidth:xe,borderRadius:L,borderRightColor:Se,borderRightWidth:Ce,borderStartColor:we,borderStartEndRadius:Te,borderStartStartRadius:Ee,borderStartWidth:De,borderStyle:Oe,borderTopColor:ke,borderTopEndRadius:Ae,borderTopLeftRadius:je,borderTopRightRadius:Me,borderTopStartRadius:Ne,borderTopWidth:Pe,borderWidth:Fe,boxShadow:Ie,elevation:Le,filter:Re,mixBlendMode:ze,opacity:Be,shadowColor:Ve,shadowOffset:He,shadowOpacity:Ue,shadowRadius:We,transform:Ge,transformOrigin:Ke,...qe}=R.flatten(ee||{}),Je={backfaceVisibility:M,backgroundColor:ce,borderBlockColor:N,borderBlockEndColor:P,borderBlockStartColor:le,borderBottomColor:ue,borderBottomEndRadius:de,borderBottomLeftRadius:fe,borderBottomRightRadius:pe,borderBottomStartRadius:me,borderBottomWidth:he,borderColor:ge,borderCurve:F,borderEndColor:_e,borderEndEndRadius:I,borderEndStartRadius:ve,borderEndWidth:ye,borderLeftColor:be,borderLeftWidth:xe,borderRadius:L,borderRightColor:Se,borderRightWidth:Ce,borderStartColor:we,borderStartEndRadius:Te,borderStartStartRadius:Ee,borderStartWidth:De,borderStyle:Oe,borderTopColor:ke,borderTopEndRadius:Ae,borderTopLeftRadius:je,borderTopRightRadius:Me,borderTopStartRadius:Ne,borderTopWidth:Pe,borderWidth:Fe,boxShadow:Ie,elevation:Le,filter:Re,mixBlendMode:ze,opacity:Be,shadowColor:Ve,shadowOffset:He,shadowOpacity:Ue,shadowRadius:We,transform:Ge,transformOrigin:Ke};for(let e in Je)Je[e]===void 0&&delete Je[e];let Ye={...y&&{backgroundColor:`transparent`},...(y||te===!1)&&{borderBottomWidth:0,...z.select({android:{elevation:0},web:{boxShadow:`none`},default:{shadowOpacity:0}})},...Je},Xe=b??z.select({ios:r.primary,default:r.text}),Ze=_?_({tintColor:Xe,pressColor:ne,pressOpacity:re,displayMode:O,titleLayout:c,screenLayout:d,canGoBack:!!p,onPress:p?i.goBack:void 0,label:p?.title,labelStyle:k,href:p?.href}):null,Qe=S?S({tintColor:Xe,pressColor:ne,pressOpacity:re,canGoBack:!!p}):null,$e=typeof h==`function`?h:e=>(0,W.jsx)(Zcn,{...e});return(0,W.jsxs)(lf.View,{pointerEvents:`box-none`,style:[{height:ae,minHeight:se,maxHeight:oe,opacity:Be,transform:Ge}],children:[(0,W.jsx)(lf.View,{pointerEvents:`box-none`,style:[R.absoluteFill,A],children:x?x({style:Ye}):(0,W.jsx)(Wcn,{pointerEvents:y&&(Ye.backgroundColor===`transparent`||(0,o5.default)(Ye.backgroundColor).alpha()===0)?`none`:`auto`,style:Ye})}),(0,W.jsx)(B,{pointerEvents:`none`,style:{height:ie}}),(0,W.jsxs)(B,{pointerEvents:`box-none`,style:[u5.content,z.OS===`ios`&&n.width>=$cn?u5.large:null],children:[(0,W.jsx)(lf.View,{pointerEvents:`box-none`,style:[u5.start,!o&&g===`center`&&u5.expand,{marginStart:t.left},T],children:Ze}),z.OS===`ios`||!o?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(lf.View,{pointerEvents:`box-none`,style:[u5.title,{maxWidth:g===`center`?d.width-((Ze?O===`minimal`?32:80:16)+(Qe||v?16:0)+Math.max(t.left,t.right))*2:d.width-((Ze?52:16)+(Qe||v?52:16)+t.left-t.right)},g===`left`&&Ze?{marginStart:4}:{marginHorizontal:16},D],children:$e({children:m,allowFontScaling:C,tintColor:b,onLayout:u,style:w})}),(0,W.jsxs)(lf.View,{pointerEvents:`box-none`,style:[u5.end,u5.expand,{marginEnd:t.right},E],children:[Qe,v?(0,W.jsx)(r5,{tintColor:Xe,pressColor:ne,pressOpacity:re,onPress:()=>{s(!0),v?.onOpen?.()},children:(0,W.jsx)(i5,{source:ccn,tintColor:Xe})}):null]})]}):null,z.OS===`ios`||o?(0,W.jsx)(Ycn,{...v,visible:o,onClose:()=>{s(!1),v?.onClose?.()},tintColor:b,style:[z.OS===`ios`?[R.absoluteFill,{paddingTop:ie?0:4},{backgroundColor:ce??r.card}]:!Ze&&{marginStart:8}]}):null]})]})}var u5=R.create({content:{flex:1,flexDirection:`row`,alignItems:`stretch`},large:{marginHorizontal:5},title:{justifyContent:`center`},start:{flexDirection:`row`,alignItems:`center`,justifyContent:`flex-start`},end:{flexDirection:`row`,alignItems:`center`,justifyContent:`flex-end`},expand:{flexGrow:1,flexBasis:0}}),tln=Xcn(`HeaderBackContext`,void 0),nln=Xcn(`HeaderHeightContext`,void 0);function rln(){let e=H.useContext(nln);if(e===void 0)throw Error(`Couldn't find the header height. Are you inside a screen in a navigator with a header?`);return e}V(),Z0();var{width:iln=0,height:aln=0}=Wo.get(`window`),oln=(z.OS,{frame:{x:0,y:0,width:iln,height:aln},insets:{top:0,left:0,right:0,bottom:0}});function sln({children:e,style:t}){let n=H.useContext(K0);return(0,W.jsx)(Mcn,{initialFrame:oln.frame,render:({ref:r,onLayout:i})=>n?(0,W.jsx)(B,{ref:r,onLayout:i,style:[cln.container,t],children:e}):(0,W.jsx)(S4t,{initialMetrics:oln,style:t,onLayout:i,children:e})})}sln.initialMetrics=oln;var cln=R.create({container:{flex:1}}),lln=H.createContext(!1);V();var uln=({children:e})=>(0,W.jsx)(W.Fragment,{children:e}),dln=B,d5={UNDETERMINED:0,FAILED:1,BEGAN:2,CANCELLED:3,ACTIVE:4,END:5};function fln(e,t){let n;return function(...r){n??=(e.apply(this,r),setTimeout(()=>{n=void 0},t))}}V();function pln(e){let{direction:t}=K$(),[n,r]=H.useState(void 0),[i,a]=H.useState(void 0),o=e=>{let{height:t,width:n}=e.nativeEvent.layout;a(e=>e&&t===e.height&&n===e.width?e:{height:t,width:n})},s=e=>{let{height:t,width:i}=e.nativeEvent.layout;n&&t===n.height&&i===n.width||r({height:t,width:i})},{progress:c,layout:l,modal:u,onGoBack:d,backHref:f,headerTitle:p,headerLeft:m=d?e=>(0,W.jsx)(Vcn,{...e}):void 0,headerRight:h,headerBackImage:g,headerBackTitle:_,headerBackButtonDisplayMode:v=z.OS===`ios`?`default`:`minimal`,headerBackTruncatedTitle:y,headerBackAccessibilityLabel:b,headerBackTestID:x,headerBackAllowFontScaling:S,headerBackTitleStyle:C,headerTitleContainerStyle:w,headerLeftContainerStyle:T,headerRightContainerStyle:E,headerBackgroundContainerStyle:D,headerStyle:O,headerStatusBarHeight:k,styleInterpolator:A,...ee}=e,te=Tcn(l,u,k),{height:ne=te}=R.flatten(O||{}),re=typeof ne==`number`?ne:te,{titleStyle:ie,leftButtonStyle:j,leftLabelStyle:ae,rightButtonStyle:oe,backgroundStyle:se}=H.useMemo(()=>A({current:{progress:c.current},next:c.next&&{progress:c.next},direction:t,layouts:{header:{height:re,width:l.width},screen:l,title:i,leftLabel:n}}),[A,c,t,re,l,i,n]);return(0,W.jsx)(eln,{modal:u,layout:l,headerTitle:typeof p==`function`?e=>p({...e,onLayout:o}):e=>(0,W.jsx)(Zcn,{...e,onLayout:o}),headerLeft:m?e=>m({...e,href:f,backImage:g,accessibilityLabel:b,testID:x,allowFontScaling:S,onPress:d,label:_,truncatedLabel:y,labelStyle:[ae,C],onLabelLayout:s,screenLayout:l,titleLayout:i,canGoBack:!!d}):void 0,headerRight:h?e=>h({...e,canGoBack:!!d}):void 0,headerTitleContainerStyle:[ie,w],headerLeftContainerStyle:[j,T],headerRightContainerStyle:[oe,E],headerBackButtonDisplayMode:v,headerBackgroundContainerStyle:[se,D],headerStyle:O,headerStatusBarHeight:k,...ee})}Z0();var mln=H.memo(function({back:e,layout:t,progress:n,options:r,route:i,navigation:a,styleInterpolator:o}){let s=W0(),c;r.headerBackTitle===void 0?e&&(c=e.title):c=r.headerBackTitle;let l=H.useCallback(fln(()=>{a.isFocused()&&a.canGoBack()&&a.dispatch({...w$.pop(),source:i.key})},50),[a,i.key]),u=H.useContext(lln),d=H.useContext(l5),f=r.headerStatusBarHeight===void 0?u||d?0:s.top:r.headerStatusBarHeight;return(0,W.jsx)(pln,{...r,title:Ecn(r,i.name),progress:n,layout:t,modal:u,headerBackTitle:r.headerBackTitle===void 0?c:r.headerBackTitle,headerStatusBarHeight:f,onGoBack:e?l:void 0,backHref:e?e.href:void 0,styleInterpolator:o})});V();function hln({mode:e,scenes:t,layout:n,getPreviousScene:r,getFocusedRoute:i,onContentHeightChange:a,style:o}){let s=i(),c=H.useContext(tln),{buildHref:l}=RKt();return(0,W.jsx)(B,{pointerEvents:`box-none`,style:o,children:t.slice(-2).map((t,i,o)=>{if(e===`screen`&&i!==o.length-1||!t)return null;let{header:u,headerMode:d,headerShown:f=!0,headerTransparent:p,headerStyleInterpolator:m}=t.descriptor.options;if(d!==e||!f)return null;let h=s.key===t.descriptor.route.key,g=r({route:t.descriptor.route}),_=c;if(g){let{options:e,route:t}=g.descriptor;_=g?{title:Ecn(e,t.name),href:l(t.name,t.params)}:c}let v=o[i-1]?.descriptor,y=o[i+1]?.descriptor,{headerShown:b=!0,headerMode:x}=v?.options||{},S=o.slice(i+1).find(e=>{let{headerShown:t=!0,headerMode:n}=e?.descriptor.options||{};return t===!1||n===`screen`}),{gestureDirection:C}=S?.descriptor.options||{},w=(b===!1||x===`screen`)&&!y||S,T={layout:n,back:_,progress:t.progress,options:t.descriptor.options,route:t.descriptor.route,navigation:t.descriptor.navigation,styleInterpolator:e===`float`?w?C===`vertical`||C===`vertical-inverted`?Lsn:C===`horizontal-inverted`?Isn:Fsn:m:Rsn};return(0,W.jsx)(GWt,{route:t.descriptor.route,navigation:t.descriptor.navigation,children:(0,W.jsx)(B,{onLayout:a?e=>{let{height:n}=e.nativeEvent.layout;a({route:t.descriptor.route,height:n})}:void 0,pointerEvents:h?`box-none`:`none`,"aria-hidden":!h,style:e===`float`&&!h||p?gln.header:null,children:u===void 0?(0,W.jsx)(mln,{...T}):u(T)})},t.descriptor.route.key)})})}var gln=R.create({header:{position:`absolute`,top:0,start:0,end:0}});function _ln(e,t){for(let n=e.length-1;n>=0;n--)if(t(e[n]))return n;return-1}function f5(e,t){switch(e){case`vertical`:return 1;case`vertical-inverted`:return-1;case`horizontal`:return t?-1:1;case`horizontal-inverted`:return t?1:-1}}function p5(e,t,n){let r=f5(t,n);switch(t){case`vertical`:case`vertical-inverted`:return e.height*r;case`horizontal`:case`horizontal-inverted`:return e.width*r}}var vln=(e,t)=>e.reduce((e,n)=>{let{presentation:r}=t[n.key]?.options??{};return(e.length&&!r||r===`modal`||r===`transparentModal`)&&e.push(n.key),e},[]);function yln(e=!0){h5=e,m5&&h5&&!_i.getViewManagerConfig(`RNSScreen`)&&console.error(`Screen native module hasn't been linked. Please check the react-native-screens README for more details`)}function bln(e=!0){m5&&(Cln=e)}function xln(){return h5}function Sln(){return Cln}var m5,h5,Cln,wln=o((()=>{V(),m5=z.OS===`ios`||z.OS===`android`||z.OS===`windows`,h5=m5,Cln=!1}));function Tln(){return Tln=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},Tln.apply(null,arguments)}var g5,Eln,Dln,_5,Oln,kln=o((()=>{V(),g5=u(p()),wln(),Eln=B,Dln=class extends g5.Component{render(){let{active:e,activityState:t,style:n,enabled:r=xln(),...i}=this.props;return r?(e!==void 0&&t===void 0&&(t=e===0?0:2),g5.createElement(B,Tln({hidden:t===0,style:[n,{display:t===0?`none`:`flex`}]},i))):g5.createElement(B,i)}},_5=lf.createAnimatedComponent(Dln),Oln=g5.createContext(_5)}));function Aln(){return Aln=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},Aln.apply(null,arguments)}var v5,jln,Mln,Nln,Pln,Fln,Iln,Lln,Rln=o((()=>{V(),v5=u(p()),jln=e=>v5.createElement(B,null,v5.createElement(Zu,Aln({resizeMode:`center`,fadeDuration:0},e))),Mln=e=>v5.createElement(B,e),Nln=e=>v5.createElement(B,e),Pln=e=>v5.createElement(B,e),Fln=e=>v5.createElement(B,e),Iln=e=>v5.createElement(B,e),Lln=B})),zln,Bln=o((()=>{V(),zln=B})),Vln,Hln=o((()=>{V(),Vln=B})),Uln,Wln=o((()=>{V(),Uln=B})),Gln=s(((e,t)=>{function n(e,...t){}t.exports=n})),Kln,qln=o((()=>{V(),Kln=B}));function Jln(e){return Yln.createElement(Kln,e)}var Yln,Xln=o((()=>{Yln=u(p()),qln()})),Zln,Qln,$ln=o((()=>{Zln=u(p()),Qln=Zln.createContext(null)})),eun,tun,nun=o((()=>{V(),eun=B,tun=B})),run,iun=o((()=>{V(),run=B})),aun,oun,sun,cun,lun,uun,dun,fun,y5,b5,pun,mun,hun,gun,_un,vun,yun,bun,x5,xun=o((()=>{aun=!0,oun=!0,sun=!0,cun=!1,lun=!0,uun=!0,dun=!1,fun={isNewBackTitleImplementation:!0,usesHeaderFlexboxImplementation:!0,usesNewAndroidHeaderHeightImplementation:!0,usesStableTabsApi:!0},y5={experiment:{synchronousScreenUpdatesEnabled:aun,synchronousHeaderConfigUpdatesEnabled:oun,synchronousHeaderSubviewUpdatesEnabled:sun,androidLegacyTopInsetBehavior:cun,androidResetScreenShadowStateOnOrientationChangeEnabled:lun,iosOrientationInheritanceFixEnabled:uun},stable:{debugLogging:dun}},b5=(e,t)=>({get(){return y5.experiment[e]},set(n){n!==y5.experiment[e]&&y5.experiment[e]!==t&&console.error(`[RNScreens] ${e} feature flag modified for a second time; this might lead to unexpected effects`),y5.experiment[e]=n}}),pun=(e,t)=>({get(){return y5.stable[e]},set(n){n!==y5.stable[e]&&y5.stable[e]!==t&&console.error(`[RNScreens] ${e} feature flag modified for a second time; this might lead to unexpected effects`),y5.stable[e]=n}}),mun=b5(`synchronousScreenUpdatesEnabled`,aun),hun=b5(`synchronousHeaderConfigUpdatesEnabled`,oun),gun=b5(`synchronousHeaderSubviewUpdatesEnabled`,sun),_un=b5(`androidLegacyTopInsetBehavior`,cun),vun=b5(`androidResetScreenShadowStateOnOrientationChangeEnabled`,lun),yun=b5(`iosOrientationInheritanceFixEnabled`,uun),bun=pun(`debugLogging`,dun),x5={experiment:{get synchronousScreenUpdatesEnabled(){return mun.get()},set synchronousScreenUpdatesEnabled(e){mun.set(e)},get synchronousHeaderConfigUpdatesEnabled(){return hun.get()},set synchronousHeaderConfigUpdatesEnabled(e){hun.set(e)},get synchronousHeaderSubviewUpdatesEnabled(){return gun.get()},set synchronousHeaderSubviewUpdatesEnabled(e){gun.set(e)},get androidLegacyTopInsetBehavior(){return _un.get()},set androidLegacyTopInsetBehavior(e){_un.set(e)},get androidResetScreenShadowStateOnOrientationChangeEnabled(){return vun.get()},set androidResetScreenShadowStateOnOrientationChangeEnabled(e){vun.set(e)},get iosOrientationInheritanceFixEnabled(){return yun.get()},set iosOrientationInheritanceFixEnabled(e){yun.set(e)},get iosPreventReattachmentOfDismissedScreens(){return!0},set iosPreventReattachmentOfDismissedScreens(e){},get iosPreventReattachmentOfDismissedModals(){return!0},set iosPreventReattachmentOfDismissedModals(e){},get ios26AllowInteractionsDuringTransition(){return!0},set ios26AllowInteractionsDuringTransition(e){}},stable:{get debugLogging(){return bun.get()},set debugLogging(e){bun.set(e)}}}})),Sun,Cun=o((()=>{V(),Sun=z.OS===`ios`&&parseInt(z.Version,10)>=26}));function wun(e,t,n,r,i){let{topAlreadyApplied:a,leftDisabled:o,rightDisabled:s,bottomDisabled:c}=S5.useContext(Eun),l=x5.experiment?.androidLegacyTopInsetBehavior??!1,u=l||!a&&e,d=u&&!t,f=o||n,p=s||r,m=c||i,h=S5.useMemo(()=>({topAlreadyApplied:a||u,leftDisabled:f,rightDisabled:p,bottomDisabled:m}),[a,u,f,p,m]);return{appliesTopInset:d,consumeLeftInset:!f,consumeRightInset:!p,consumeBottomInset:!m,useLegacyBehavior:l,nextContextValue:h}}var S5,Tun,Eun,Dun=o((()=>{S5=u(p()),xun(),Tun={topAlreadyApplied:!1,leftDisabled:!1,rightDisabled:!1,bottomDisabled:!1},Eun=S5.createContext(Tun)}));function Oun(){return Oun=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},Oun.apply(null,arguments)}function kun({children:e,headerConfig:t,activityState:n,shouldFreeze:r,stackPresentation:i,sheetAllowedDetents:a,contentStyle:o,style:s,screenId:c,onHeaderHeightChange:l,scrollEdgeEffects:u,unstable_sheetFooter:d,...f},p){let{nextContextValue:m}=wun(!t?.hidden,t?.disableTopInsetApplication??!1,t?.disableLeftInsetApplication??!1,t?.disableRightInsetApplication??!1,t?.disableBottomInsetApplication??!1),h=C5.useRef(null),g=C5.useContext(Qln);C5.useImperativeHandle(p,()=>h.current);let _=i??`push`,v=t?.hidden??!1,y=z.OS===`android`?!1:_!==`push`&&v===!1,b=C5.useRef(v);C5.useEffect(()=>{(0,Nun.default)(z.OS!==`android`&&_!==`push`&&b.current!==v,`Dynamically changing header's visibility in modals will result in remounting the screen and losing all local state.`),b.current=v},[v,_]);let x=u===void 0||Object.values(u).some(e=>e!==`hidden`),S=t?.blurEffect!==void 0&&t.blurEffect!==`none`;(0,Nun.default)(x&&S&&Sun,"[RNScreens] Using both `blurEffect` and `scrollEdgeEffects` simultaneously may cause overlapping effects.");let C=Aun(a,_),w;if(_===`formSheet`&&z.OS===`ios`&&o){let{screenStyles:e,contentWrapperStyles:t}=jun(o);w=e,o=t}let T=Sun,E=C5.createElement(C5.Fragment,null,C5.createElement(Eun.Provider,{value:m},C5.createElement(Jln,{contentStyle:o,style:C,stackPresentation:_},T?C5.createElement(run,{edges:Mun(t)},e):e)),C5.createElement(Iln,t),_===`formSheet`&&d&&C5.createElement(tun,null,d()));return C5.createElement(_5,Oun({ref:e=>{if(h.current=e,g===null){console.warn(`Looks like RNSScreensRefContext is missing. Make sure the ScreenStack component is wrapped in it`);return}let t=g.current;e===null?delete t[c]:t[c]={current:e}},enabled:!0,isNativeStack:!0,activityState:n,shouldFreeze:r,screenId:c,stackPresentation:_,hasLargeHeader:t?.largeTitle??!1,sheetAllowedDetents:a,style:[s,w],scrollEdgeEffects:y?void 0:u,onHeaderHeightChange:y?void 0:l},f),y?C5.createElement(Uln,{style:w5.container},C5.createElement(_5,{enabled:!0,isNativeStack:!0,activityState:n,shouldFreeze:r,hasLargeHeader:t?.largeTitle??!1,scrollEdgeEffects:u,style:R.absoluteFill,onHeaderHeightChange:l},E)):E)}function Aun(e,t){let n=z.OS===`ios`;return t===`formSheet`?n?e!==`fitToContents`&&x5.experiment.synchronousScreenUpdatesEnabled?w5.container:w5.absoluteWithNoBottom:e===`fitToContents`?w5.absoluteWithNoBottom:w5.container:w5.container}function jun(e){let{backgroundColor:t,...n}=R.flatten(e);return{screenStyles:{backgroundColor:t},contentWrapperStyles:n}}function Mun(e){if(z.OS!==`ios`||parseInt(z.Version,10)<26)return{};let t;return t=e?.translucent||e?.hidden?{}:{top:!0},t}var C5,Nun,Pun,w5,Fun=o((()=>{C5=u(p()),V(),Nun=u(Gln()),Xln(),Rln(),kln(),Wln(),$ln(),nun(),iun(),xun(),Cun(),Dun(),Pun=C5.forwardRef(kun),w5=R.create({container:{flex:1},absoluteWithNoBottom:{position:`absolute`,top:0,start:0,end:0}})})),Iun,Lun=o((()=>{V(),Iun=B}));function Run(){return Cf.exitApp(),!0}var zun,Bun=o((()=>{V(),zun=[`ios`,`android`].includes(z.OS),z.OS})),Vun,Hun,Uun=o((()=>{Vun=u(p()),Hun=Vun.createContext(void 0)}));function Wun(){let e=Gun.useContext(Hun);if(e===void 0)throw Error(`Couldn't find values for transition progress. Are you inside a screen in Native Stack?`);return e}var Gun,Kun=o((()=>{Gun=u(p()),Uun()})),qun,Jun=o((()=>{V(),qun=B})),Yun=o((()=>{Jun()})),Xun,Zun=o((()=>{V(),Xun=B})),Qun=o((()=>{Zun()})),$un,edn=o((()=>{Yun(),Qun(),$un={Host:qun,Screen:Xun}})),tdn=c({FullWindowOverlay:()=>Iun,InnerScreen:()=>Eln,Screen:()=>_5,ScreenContainer:()=>Vln,ScreenContentWrapper:()=>Kln,ScreenContext:()=>Oln,ScreenFooter:()=>eun,ScreenStack:()=>Uln,ScreenStackHeaderBackButtonImage:()=>jln,ScreenStackHeaderCenterView:()=>Pln,ScreenStackHeaderConfig:()=>Iln,ScreenStackHeaderLeftView:()=>Nln,ScreenStackHeaderRightView:()=>Mln,ScreenStackHeaderSearchBarView:()=>Fln,ScreenStackHeaderSubview:()=>Lln,ScreenStackItem:()=>Pun,SearchBar:()=>zln,Tabs:()=>$un,compatibilityFlags:()=>fun,enableFreeze:()=>bln,enableScreens:()=>yln,executeNativeBackPress:()=>Run,featureFlags:()=>x5,freezeEnabled:()=>Sln,isSearchBarAvailableForCurrentPlatform:()=>zun,screensEnabled:()=>xln,useTransitionProgress:()=>Wun}),ndn=o((()=>{wln(),kln(),Rln(),Bln(),Hln(),Wln(),Fun(),Lun(),nun(),qln(),Bun(),xun(),Kun(),edn()}));V();var T5;try{T5=(ndn(),d(tdn))}catch{}var rdn=({enabled:e,...t})=>T5==null?(0,W.jsx)(B,{...t}):(0,W.jsx)(T5.ScreenContainer,{enabled:e,...t}),idn=({enabled:e,active:t,...n})=>T5==null?(0,W.jsx)(B,{...n}):(0,W.jsx)(T5.Screen,{enabled:e,activityState:t,...n});V();function adn({enabled:e,focused:t}){let n=H.useRef(void 0),r=H.useRef(0),i=H.useRef(void 0),a=H.useRef(e),o=H.useCallback(()=>{i.current!==void 0&&(clearTimeout(i.current),i.current=void 0)},[]),s=H.useCallback(()=>{if(!a.current)return;o();let e=Lp.State.currentlyFocusedInput();e?.blur(),n.current=e,r.current=Date.now()},[o]),c=H.useCallback(()=>{if(!a.current)return;o();let e=n.current;e&&(Date.now()-r.current<100?i.current=setTimeout(()=>{e?.focus(),n.current=void 0},100):(e?.focus(),n.current=void 0))},[o]),l=H.useCallback(({gesture:e,active:t,closing:r})=>{if(a.current){if(!r){c();return}o(),e?t&&n.current?.blur():Tf.dismiss(),n.current=void 0}},[o,c]);return H.useLayoutEffect(()=>{a.current&&!t&&Tf.dismiss()},[t]),H.useLayoutEffect(()=>{a.current=e}),H.useEffect(()=>()=>o(),[o]),{onPageChangeStart:s,onPageChangeConfirm:l,onPageChangeCancel:c}}var odn=H.createContext(void 0),sdn=50,cdn=135,ldn=({direction:e,gestureDirection:t,gestureResponseDistance:n,layout:r})=>{let i=n===void 0?t===`vertical`||t===`vertical-inverted`?cdn:sdn:n;if(t===`vertical`)return{maxDeltaX:15,minOffsetY:5,hitSlop:{bottom:-r.height+i},enableTrackpadTwoFingerGesture:!0};if(t===`vertical-inverted`)return{maxDeltaX:15,minOffsetY:-5,hitSlop:{top:-r.height+i},enableTrackpadTwoFingerGesture:!0};{let n=-r.width+i;return f5(t,e===`rtl`)===1?{minOffsetX:5,maxDeltaY:20,hitSlop:{right:n},enableTrackpadTwoFingerGesture:!0}:{minOffsetX:-5,maxDeltaY:20,hitSlop:{left:n},enableTrackpadTwoFingerGesture:!0}}};V();function udn({offset:e,radius:t,opacity:n,color:r=`#000`}){return z.select({web:{boxShadow:`${e.width}px ${e.height}px ${t}px ${(0,o5.default)(r).alpha(n).toString()}`},default:{shadowOffset:e,shadowRadius:t,shadowColor:r,shadowOpacity:n}})}V();function ddn({enabled:e,layout:t,style:n,...r}){let[i,a]=H.useState(!1);return H.useEffect(()=>{if(typeof document>`u`||!document.body)return;let e=document.body.clientWidth,n=document.body.clientHeight,r=n===t.height,i=`__react-navigation-stack-mobile-chrome-viewport-fix`,o;if(r&&navigator.maxTouchPoints>0){let e=document.getElementById(i)??document.createElement(`style`);e.id=i;let t=()=>{e.textContent=[`:root { --vh: ${window.innerHeight*.01}px; }`,`body { height: calc(var(--vh, 1vh) * 100); }`].join(`
|
|
902
|
-
`)};t(),document.head.contains(e)||document.head.appendChild(e),window.addEventListener(`resize`,t),o=()=>{window.removeEventListener(`resize`,t)}}else document.getElementById(i)?.remove();return a(e===t.width&&n===t.height),o},[t.height,t.width]),(0,W.jsx)(B,{...r,pointerEvents:`box-none`,style:[e&&i?fdn.page:fdn.card,n]})}var fdn=R.create({page:{minHeight:`100%`},card:{flex:1,overflow:`hidden`}});V();var pdn=.3,mdn=1,E5=0,hdn=z.OS!==`web`,gdn=e=>{if(e){let t=R.flatten(e);return`opacity`in t&&t.opacity!=null}return!1},_dn=({closing:e,layout:t,gestureDirection:n,direction:r,preloaded:i})=>!e&&!i?0:p5(t,n,r===`rtl`),vdn=({style:e})=>e?(0,W.jsx)(lf.View,{pointerEvents:`none`,style:[D5.overlay,e]}):null;function ydn({shadowEnabled:e=!1,gestureEnabled:t=!0,gestureVelocityImpact:n=pdn,overlay:r=vdn,animated:i,interpolationIndex:a,opening:o,closing:s,next:c,current:l,gesture:u,layout:d,insets:f,direction:p,pageOverflowEnabled:m,gestureDirection:h,onOpen:g,onClose:_,onTransition:v,onGestureBegin:y,onGestureCanceled:b,onGestureEnd:x,children:S,overlayEnabled:C,gestureResponseDistance:w,transitionSpec:T,preloaded:E,styleInterpolator:D,containerStyle:O,contentStyle:k}){let A=H.useRef(!1),ee=H.useRef(void 0),te=H.useRef(void 0),ne=H.useRef(void 0),re=H.useRef(void 0),ie=H.useRef(void 0),[j]=H.useState(()=>new lf.Value(E5)),[ae]=H.useState(()=>new lf.Value(f5(h,p===`rtl`))),[oe]=H.useState(()=>({width:new lf.Value(d.width),height:new lf.Value(d.height)})),[se]=H.useState(()=>new lf.Value(E5)),M=T$(()=>{te.current===void 0&&(te.current=Ts.createInteractionHandle())}),ce=T$(()=>{te.current!==void 0&&(Ts.clearInteractionHandle(te.current),te.current=void 0)}),N=T$(({closing:e,velocity:t})=>{let n=_dn({closing:e,layout:d,gestureDirection:h,direction:p,preloaded:E});ee.current=n,j.setValue(e?mdn:E5);let r=e?T.close:T.open,a=r.animation===`spring`?lf.spring:lf.timing;clearTimeout(re.current),ne.current!==void 0&&cancelAnimationFrame(ne.current),v?.({closing:e,gesture:t!==void 0});let o=()=>{e?_():g(),ne.current=requestAnimationFrame(()=>{de()})};i?(M(),a(u,{...r.config,velocity:t,toValue:n,useNativeDriver:hdn,isInteraction:!1}).start(({finished:e})=>{ce(),clearTimeout(re.current),e&&o()})):o()}),P=T$(({nativeEvent:e})=>{switch(e.state){case d5.ACTIVE:clearTimeout(re.current),clearTimeout(ie.current),se.setValue(mdn),M(),y?.();break;case d5.CANCELLED:case d5.FAILED:se.setValue(E5),ce(),N({closing:s,velocity:h===`vertical`||h===`vertical-inverted`?e.velocityY:e.velocityX}),b?.();break;case d5.END:{se.setValue(E5);let t,r,i;h===`vertical`||h===`vertical-inverted`?(t=d.height,r=e.translationY,i=e.velocityY):(t=d.width,r=e.translationX,i=e.velocityX);let a=(r+i*n)*f5(h,p===`rtl`)>t/2?i!==0||r!==0:s;N({closing:a,velocity:i}),a&&(re.current=setTimeout(()=>{_(),ie.current=setTimeout(()=>{de()},32)},16)),x?.();break}}});H.useLayoutEffect(()=>{oe.width.setValue(d.width),oe.height.setValue(d.height),ae.setValue(f5(h,p===`rtl`))},[h,p,ae,oe.width,oe.height,d.width,d.height]);let le=H.useRef(null);H.useEffect(()=>()=>{ce(),ne.current&&cancelAnimationFrame(ne.current),clearTimeout(re.current),clearTimeout(ie.current)},[]);let ue=H.useRef(void 0),de=T$(()=>{if(clearTimeout(re.current),clearTimeout(ie.current),!A.current)clearTimeout(ue.current),ue.current=setTimeout(()=>{A.current=!0,N({closing:s})},0);else{let e=le.current?.opening,t=le.current?_dn(le.current):null,n=_dn({closing:s,layout:d,gestureDirection:h,direction:p,preloaded:E});t!==n||ee.current!==n?N({closing:s}):typeof e==`boolean`&&o&&!e&&(u.setValue(p5(d,h,p===`rtl`)),N({closing:s}))}});H.useEffect(()=>{E||(de(),le.current={opening:o,closing:s,layout:d,gestureDirection:h,direction:p,preloaded:E})},[N,s,p,u,h,d,o,E,de]);let fe=H.useMemo(()=>({index:a,current:{progress:l},next:c&&{progress:c},closing:j,swiping:se,inverted:ae,layouts:{screen:d},insets:{top:f.top,right:f.right,bottom:f.bottom,left:f.left}}),[a,l,c,j,se,ae,d,f.top,f.right,f.bottom,f.left]),{containerStyle:pe,cardStyle:me,overlayStyle:he,shadowStyle:ge}=H.useMemo(()=>D(fe),[D,fe]),F=H.useMemo(()=>t?lf.event([{nativeEvent:h===`vertical`||h===`vertical-inverted`?{translationY:u}:{translationX:u}}],{useNativeDriver:hdn}):void 0,[u,h,t]),{backgroundColor:_e}=R.flatten(k||{}),I=typeof _e==`string`?(0,o5.default)(_e).alpha()===0:!1;return(0,W.jsxs)(odn.Provider,{value:fe,children:[z.OS===`web`?null:(0,W.jsx)(lf.View,{style:{opacity:l},collapsable:!1}),C?(0,W.jsx)(B,{pointerEvents:`box-none`,style:R.absoluteFill,children:r({style:he})}):null,(0,W.jsx)(lf.View,{pointerEvents:`box-none`,style:[D5.container,pe,O],children:(0,W.jsx)(uln,{enabled:d.width!==0&&t,onGestureEvent:F,onHandlerStateChange:P,...ldn({layout:d,direction:p,gestureDirection:h,gestureResponseDistance:w}),children:(0,W.jsxs)(lf.View,{pointerEvents:`box-none`,needsOffscreenAlphaCompositing:gdn(me),style:[D5.container,me],children:[e&&ge&&!I?(0,W.jsx)(lf.View,{pointerEvents:`none`,style:[D5.shadow,h===`horizontal`?[D5.shadowHorizontal,D5.shadowStart]:h===`horizontal-inverted`?[D5.shadowHorizontal,D5.shadowEnd]:h===`vertical`?[D5.shadowVertical,D5.shadowTop]:[D5.shadowVertical,D5.shadowBottom],{backgroundColor:_e},ge]}):null,(0,W.jsx)(ddn,{enabled:m,layout:d,style:k,children:S})]})})})]})}var D5=R.create({container:{flex:1},overlay:{flex:1,backgroundColor:`#000`},shadow:{position:`absolute`},shadowHorizontal:{top:0,bottom:0,width:3,...udn({offset:{width:-1,height:1},radius:5,opacity:.3})},shadowStart:{start:0},shadowEnd:{end:0},shadowVertical:{start:0,end:0,height:3,...udn({offset:{width:1,height:-1},radius:5,opacity:.3})},shadowTop:{top:0},shadowBottom:{bottom:0}});V();var bdn=H.forwardRef(({focused:e,active:t,animated:n,isNextScreenTransparent:r,detachCurrentScreen:i,children:a},o)=>{let[s,c]=H.useState(!1);H.useImperativeHandle(o,()=>({setInert:c}),[]);let l=!n&&r===!1&&i!==!1&&!e;return(0,W.jsx)(B,{"aria-hidden":!e,pointerEvents:(n?s:!e)?`none`:`box-none`,style:[R.absoluteFill,{overflow:t?void 0:`hidden`,display:z.OS!==`web`&&l?`none`:`flex`,visibility:l?`hidden`:`visible`}],collapsable:!1,children:a})});bdn.displayName=`CardA11yWrapper`,V();var xdn=.1;function Sdn({interpolationIndex:e,index:t,active:n,opening:r,closing:i,gesture:a,focused:o,modal:s,getPreviousScene:c,getFocusedRoute:l,hasAbsoluteFloatHeader:u,headerHeight:d,onHeaderHeightChange:f,isParentHeaderShown:p,isNextScreenTransparent:m,detachCurrentScreen:h,layout:g,onCloseRoute:_,onOpenRoute:v,onGestureCancel:y,onGestureEnd:b,onGestureStart:x,onTransitionEnd:S,onTransitionStart:C,preloaded:w,renderHeader:T,safeAreaInsetBottom:E,safeAreaInsetLeft:D,safeAreaInsetRight:O,safeAreaInsetTop:k,scene:A}){let ee=H.useRef(null),{direction:te}=K$(),ne=H.useContext(nln),{options:re}=A.descriptor,{onPageChangeStart:ie,onPageChangeCancel:j,onPageChangeConfirm:ae}=adn({enabled:o&&re.keyboardHandlingEnabled!==!1,focused:o}),oe=()=>{let{route:e}=A.descriptor;S({route:e},!1),v({route:e})},se=()=>{let{route:e}=A.descriptor;S({route:e},!0),_({route:e})},M=()=>{let{route:e}=A.descriptor;ie(),x({route:e})},ce=()=>{let{route:e}=A.descriptor;j(),y({route:e})},N=()=>{let{route:e}=A.descriptor;b({route:e})},P=({closing:e,gesture:t})=>{ee.current?.setInert(e);let{route:r}=A.descriptor;ae?.({gesture:t,active:n,closing:e}),C?.({route:r},e)},le={top:k,right:O,bottom:E,left:D},{colors:ue}=B$();H.useEffect(()=>{let e=A.progress.next?.addListener?.(({value:e})=>{ee.current?.setInert(e>xdn)});return()=>{e&&A.progress.next?.removeListener?.(e)}},[A.progress.next]);let{presentation:de,animation:fe,cardOverlay:pe,cardOverlayEnabled:me,cardShadowEnabled:he,cardStyle:ge,cardStyleInterpolator:F,gestureDirection:_e,gestureEnabled:I,gestureResponseDistance:ve,gestureVelocityImpact:ye,headerMode:be,headerShown:xe,headerTransparent:L,transitionSpec:Se}=A.descriptor.options,{buildHref:Ce}=RKt(),we=c({route:A.descriptor.route}),Te,Ee;if(we){let{options:e,route:t}=we.descriptor;Te=Ecn(e,t.name),Ee=Ce(t.name,t.params)}let De=we!=null,Oe=H.useMemo(()=>{if(De)return{href:Ee,title:Te}},[De,Te,Ee]),ke=fe!==`none`;return(0,W.jsx)(bdn,{ref:ee,focused:o,active:n,animated:ke,isNextScreenTransparent:m,detachCurrentScreen:h,children:(0,W.jsx)(ydn,{animated:ke,interpolationIndex:e,gestureDirection:_e,layout:g,insets:le,direction:te,gesture:a,current:A.progress.current,next:A.progress.next,opening:r,closing:i,onOpen:oe,onClose:se,overlay:pe,overlayEnabled:me,shadowEnabled:he,onTransition:P,onGestureBegin:M,onGestureCanceled:ce,onGestureEnd:N,gestureEnabled:t===0?!1:I,gestureResponseDistance:ve,gestureVelocityImpact:ye,transitionSpec:Se,styleInterpolator:F,pageOverflowEnabled:be!==`float`&&de!==`modal`,preloaded:w,containerStyle:u&&be!==`screen`?{marginTop:d}:null,contentStyle:[{backgroundColor:de===`transparentModal`?`transparent`:ue.background},ge],children:(0,W.jsx)(B,{style:wdn.container,children:(0,W.jsxs)(lln.Provider,{value:s,children:[be===`float`?null:T({mode:`screen`,layout:g,scenes:[we,A],getPreviousScene:c,getFocusedRoute:l,onContentHeightChange:f,style:[wdn.header,L?{minHeight:d}:null]}),(0,W.jsx)(B,{style:wdn.scene,children:(0,W.jsx)(tln.Provider,{value:Oe,children:(0,W.jsx)(l5.Provider,{value:p||xe!==!1,children:(0,W.jsx)(nln.Provider,{value:xe===!1?ne??0:d,children:A.descriptor.render()})})})})]})})})})}var Cdn=H.memo(Sdn),wdn=R.create({container:{flex:1},header:{zIndex:1},scene:{flex:1}});V();var Tdn={default:e5,fade:tcn,fade_from_bottom:Xsn,fade_from_right:$sn,none:e5,reveal_from_bottom:Zsn,scale_from_center:Qsn,slide_from_left:rcn,slide_from_right:$8,slide_from_bottom:z.select({ios:Jsn,default:ecn})},Edn=1e-5,O5=0,Ddn=1,Odn=2,kdn=Object.freeze({options:{}}),Adn=(e,t)=>{let{cardStyleInterpolator:n}=e[t].descriptor.options,r=0;for(let i=t-1;i>=0&&e[i]?.descriptor.options.cardStyleInterpolator===n;i--)r++;return r},k5=e=>e===Esn||e.name===`forModalPresentationIOS`,jdn=(e,t,n)=>{if(n)return!0;let{cardStyleInterpolator:r}=e.descriptor.options;return k5(r)&&t!==0},Mdn=(e,t,n,r,i,a)=>e.reduce((o,s,c)=>{let{headerStatusBarHeight:l=n?0:t.top,headerStyle:u}=s.descriptor.options,d=R.flatten(u||{}),f=`height`in d&&typeof d.height==`number`?d.height:a[s.route.key],p=jdn(s,Adn(e,c),r);return o[s.route.key]=typeof f==`number`?f:Tcn(i,p,l),o},{}),Ndn=(e,t,n)=>{if(t?.gestureDirection)return p5(e,t.gestureDirection,n);let r=t?.presentation===`modal`?ncn.gestureDirection:e5.gestureDirection;return p5(e,t?.animation?Tdn[t?.animation]?.gestureDirection:r,n)},Pdn=(e,t,n,r)=>{let i=Ndn({width:Math.max(1,t.width),height:Math.max(1,t.height)},n,r);return i>0?e.interpolate({inputRange:[0,i],outputRange:[1,0]}):e.interpolate({inputRange:[i,0],outputRange:[0,1]})};function Fdn(e){let t=z.OS!==`web`&&z.OS!==`windows`&&z.OS!==`macos`;return e??(t?`default`:`none`)}function Idn(e){return Fdn(e)!==`none`}var Ldn=class extends H.Component{static getDerivedStateFromProps(e,t){if(e.routes===t.routes&&e.descriptors===t.descriptors)return null;let n=[...e.routes,...e.state.preloadedRoutes].reduce((n,r)=>{let i=e.descriptors[r.key]||e.preloadedDescriptors[r.key],{animation:a}=i?.options||{};return n[r.key]=t.gestures[r.key]||new lf.Value(e.openingRouteKeys.includes(r.key)&&Idn(a)||e.state.preloadedRoutes.includes(r)?Ndn(t.layout,i?.options,e.direction===`rtl`):0),n},{}),r=vln([...e.routes,...e.state.preloadedRoutes],{...e.descriptors,...e.preloadedDescriptors}),i=[...e.routes,...e.state.preloadedRoutes].map((i,a,o)=>{let s=e.state.preloadedRoutes.includes(i),c=s?void 0:o[a-1],l=s?void 0:o[a+1],u=t.scenes[a],d=n[i.key],f=c?n[c.key]:void 0,p=l?n[l.key]:void 0,m=(s?e.preloadedDescriptors:e.descriptors)[i.key]||t.descriptors[i.key]||(u?u.descriptor:kdn),h=l&&(e.descriptors[l?.key]||t.descriptors[l?.key])?.options,g=c&&(e.descriptors[c?.key]||t.descriptors[c?.key])?.options,_=a!==o.length-1&&h&&h?.presentation!==`transparentModal`?h:m.options,v=r.includes(i.key),y=Fdn(_.animation),b=Idn(y),x=y==="default"?_.presentation===`transparentModal`?tcn:_.presentation===`modal`||v?ncn:e5:Tdn[y],{gestureEnabled:S=z.OS===`ios`&&b,gestureDirection:C=x.gestureDirection,transitionSpec:w=x.transitionSpec,cardStyleInterpolator:T=b?x.cardStyleInterpolator:Nsn,headerStyleInterpolator:E=x.headerStyleInterpolator,cardOverlayEnabled:D=z.OS!==`ios`&&_.presentation!==`transparentModal`||k5(T)}=_,O=m.options.headerMode??(!(_.presentation===`modal`||_.presentation===`transparentModal`||h?.presentation===`modal`||h?.presentation===`transparentModal`||k5(T))&&z.OS===`ios`&&m.options.header===void 0?`float`:`screen`),k=e.direction===`rtl`,A={route:i,descriptor:{...m,options:{...m.options,animation:y,cardOverlayEnabled:D,cardStyleInterpolator:T,gestureDirection:C,gestureEnabled:S,headerStyleInterpolator:E,transitionSpec:w,headerMode:O}},progress:{current:Pdn(d,t.layout,m.options,k),next:p&&h?.presentation!==`transparentModal`?Pdn(p,t.layout,h,k):void 0,previous:f?Pdn(f,t.layout,g,k):void 0},__memo:[t.layout,m,h,g,d,p,f]};return u&&A.__memo.every((e,t)=>u.__memo[t]===e)?u:A}),a=t.activeStates;if(e.routes.length!==t.routes.length){let n=1;for(let t=e.routes.length-1;t>=0;t--){let{options:r}=i[t].descriptor,{detachPreviousScreen:a=r.presentation===`transparentModal`?!1:k5(r.cardStyleInterpolator)?t!==_ln(i,e=>{let{cardStyleInterpolator:t}=e.descriptor.options;return t===Esn||t?.name===`forModalPresentationIOS`}):!0}=r;if(a===!1)n++;else if(t<=e.routes.length-2)break}a=e.routes.map((e,r,a)=>{let o,s=t.activeStates[r],c=r>=a.length-n;if(s===O5&&!c)o=O5;else{let e=i[a.length-1],t=r===a.length-1?Odn:c?Ddn:O5;o=e?e.progress.current.interpolate({inputRange:[0,1-Edn,1],outputRange:[1,1,t],extrapolate:`clamp`}):Ddn}return o})}return{routes:e.routes,scenes:i,gestures:n,descriptors:e.descriptors,activeStates:a,headerHeights:Mdn(i,e.insets,e.isParentHeaderShown,e.isParentModal,t.layout,t.headerHeights)}}constructor(e){super(e),this.state={routes:[],scenes:[],gestures:{},layout:sln.initialMetrics.frame,descriptors:this.props.descriptors,activeStates:[],headerHeights:{}}}handleLayout=e=>{let{height:t,width:n}=e.nativeEvent.layout,r={width:n,height:t};this.setState((e,i)=>t===e.layout.height&&n===e.layout.width?null:{layout:r,headerHeights:Mdn(e.scenes,i.insets,i.isParentHeaderShown,i.isParentModal,r,e.headerHeights)})};handleHeaderLayout=({route:e,height:t})=>{this.setState(({headerHeights:n})=>n[e.key]===t?null:{headerHeights:{...n,[e.key]:t}})};getFocusedRoute=()=>{let{state:e}=this.props;return e.routes[e.index]};getPreviousScene=({route:e})=>{let{getPreviousRoute:t}=this.props,{scenes:n}=this.state,r=t({route:e});if(r)return n.find(e=>e.descriptor.route.key===r.key)};render(){let{insets:e,state:t,routes:n,openingRouteKeys:r,closingRouteKeys:i,onOpenRoute:a,onCloseRoute:o,renderHeader:s,isParentHeaderShown:c,isParentModal:l,onTransitionStart:u,onTransitionEnd:d,onGestureStart:f,onGestureEnd:p,onGestureCancel:m,detachInactiveScreens:h=z.OS===`web`||z.OS===`android`||z.OS===`ios`}=this.props,{scenes:g,layout:_,gestures:v,activeStates:y,headerHeights:b}=this.state,x=t.routes[t.index],S=b[x.key],C=this.state.scenes.slice(-2).some(e=>{let{headerMode:t,headerTransparent:n,headerShown:r=!0}=e.descriptor.options??{};return!!(n||r===!1||t===`screen`)});return(0,W.jsxs)(B,{style:A5.container,children:[s({mode:`float`,layout:_,scenes:g,getPreviousScene:this.getPreviousScene,getFocusedRoute:this.getFocusedRoute,onContentHeightChange:this.handleHeaderLayout,style:[A5.floating,C&&[{height:S},A5.absolute]]}),(0,W.jsx)(rdn,{enabled:h,style:A5.container,onLayout:this.handleLayout,children:[...n,...t.preloadedRoutes].map((S,w)=>{let T=x.key===S.key,E=v[S.key],D=g[w],O=t.preloadedRoutes.includes(S)&&!n.includes(S);if(t.preloadedRoutes.includes(S)&&n.includes(S)&&w>=n.length)return null;let{headerShown:k=!0,headerTransparent:A,freezeOnBlur:ee,autoHideHomeIndicator:te}=D.descriptor.options,ne=e.top,re=e.right,ie=e.bottom,j=e.left,ae=k===!1?0:b[S.key],oe=Adn(g,w),se=jdn(D,oe,l),M=g[w+1]?.descriptor.options.presentation===`transparentModal`,ce=g[w+1]?.descriptor.options.detachPreviousScreen!==!1,N=O?O5:y[w];return(0,W.jsx)(idn,{style:[R.absoluteFill],enabled:h,active:N,freezeOnBlur:ee,shouldFreeze:N===O5&&!O,homeIndicatorHidden:te,pointerEvents:`box-none`,children:(0,W.jsx)(Cdn,{index:w,interpolationIndex:oe,modal:se,active:w===n.length-1,focused:T,opening:r.includes(S.key),closing:i.includes(S.key),layout:_,gesture:E,scene:D,safeAreaInsetTop:ne,safeAreaInsetRight:re,safeAreaInsetBottom:ie,safeAreaInsetLeft:j,onGestureStart:f,onGestureCancel:m,onGestureEnd:p,headerHeight:ae,isParentHeaderShown:c,onHeaderHeightChange:this.handleHeaderLayout,getPreviousScene:this.getPreviousScene,getFocusedRoute:this.getFocusedRoute,hasAbsoluteFloatHeader:C&&!A,renderHeader:s,onOpenRoute:a,onCloseRoute:o,onTransitionStart:u,onTransitionEnd:d,isNextScreenTransparent:M,detachCurrentScreen:ce,preloaded:O})},S.key)})})]})}},A5=R.create({container:{flex:1},absolute:{position:`absolute`,top:0,start:0,end:0},floating:{zIndex:1}});V(),Z0();var Rdn=dln??B,zdn=(e,t)=>e.length===t.length&&e.every((e,n)=>Object.is(e,t[n])),Bdn=class extends H.Component{static getDerivedStateFromProps(e,t){let n=[...e.state.routes,...e.state.preloadedRoutes],r=t.previousState?[...t.previousState.routes,...t.previousState.preloadedRoutes]:[];if(zdn(n.map(e=>e.key),r.map(e=>e.key))&&t.routes.length){let i=t.routes.filter(n=>t.closingRouteKeys.includes(n.key)&&!e.state.routes.some(e=>e.key===n.key)),a=t.routes.filter(n=>t.replacingRouteKeys.includes(n.key)&&!e.state.routes.some(e=>e.key===n.key)),o=e.state.routes.slice();if(a.length&&o.splice(o.length-1,0,...a),i.length&&o.push(...i),!zdn(n,r)){let e=n.reduce((e,t)=>(e[t.key]=t,e),{});o=o.map(t=>e[t.key]||t)}let s=[...o,...e.state.preloadedRoutes].reduce((n,r)=>(n[r.key]=e.descriptors[r.key]||t.descriptors[r.key],n),{});return{routes:o,previousState:e.state,descriptors:s}}let i=e.state.index<e.state.routes.length-1?e.state.routes.slice(0,e.state.index+1):e.state.routes,{openingRouteKeys:a,closingRouteKeys:o,replacingRouteKeys:s}=t;o=o.filter(e=>!i.some(t=>t.key===e)),s=s.filter(e=>!i.some(t=>t.key===e));let c=t.previousState?t.previousState.routes[t.previousState.index]:void 0,l=i[i.length-1],u=n=>Idn((e.descriptors[n]||t.descriptors[n])?.options.animation),d=n=>(e.descriptors[n]||t.descriptors[n]).options.animationTypeForReplace??`push`;if(c&&c.key!==l.key){if(r.some(e=>e.key===l.key)&&!i.some(e=>e.key===c.key))u(c.key)&&!o.includes(c.key)&&(o=[...o,c.key],a=a.filter(e=>e!==c.key),s=s.filter(e=>e!==c.key),i=[...i,c]);else if(u(l.key)&&!a.includes(l.key)&&(a=[...a,l.key],o=o.filter(e=>e!==l.key),s=s.filter(e=>e!==l.key),!i.some(e=>e.key===c.key)))if(a=a.filter(e=>e!==c.key),d(l.key)===`pop`)o=[...o,c.key],a=a.filter(e=>e!==l.key),i=[...i,c];else{s=[...s,c.key],o=o.filter(e=>e!==c.key),i=i.slice(),i.splice(i.length-1,0,c);let e=t.routes.filter(e=>s.includes(e.key)&&!i.some(t=>t.key===e.key));e.length&&i.splice(i.length-2,0,...e)}}else (s.length||o.length)&&(i=i.slice(),i.splice(i.length-1,0,...t.routes.filter(({key:e})=>u(e)?s.includes(e)||o.includes(e):!1)));if(!i.length)throw Error(`There should always be at least one route in the navigation state.`);let f=[...i,...e.state.preloadedRoutes].reduce((n,r)=>(n[r.key]=e.descriptors[r.key]||t.descriptors[r.key],n),{});return{routes:i,previousState:e.state,openingRouteKeys:a,closingRouteKeys:o,replacingRouteKeys:s,descriptors:f}}state={routes:[],previousState:void 0,openingRouteKeys:[],closingRouteKeys:[],replacingRouteKeys:[],descriptors:{}};getPreviousRoute=({route:e})=>{let{closingRouteKeys:t,replacingRouteKeys:n}=this.state,r=this.state.routes.filter(r=>r.key===e.key||!t.includes(r.key)&&!n.includes(r.key));return r[r.findIndex(t=>t.key===e.key)-1]};renderHeader=e=>(0,W.jsx)(hln,{...e});handleOpenRoute=({route:e})=>{let{state:t,navigation:n}=this.props,{closingRouteKeys:r,replacingRouteKeys:i}=this.state;r.some(t=>t===e.key)&&i.every(t=>t!==e.key)&&t.routeNames.includes(e.name)&&!t.routes.some(t=>t.key===e.key)?n.dispatch(t=>{let n=[...t.routes.filter(t=>t.key!==e.key),e];return x$({...t,routes:n,index:n.length-1})}):this.setState(t=>{let n=t.routes.findIndex(t=>t.key===e.key),r=new Set(t.routes.slice(0,n).filter(e=>t.replacingRouteKeys.includes(e.key)).map(e=>e.key));return{routes:t.routes.filter(e=>!r.has(e.key)),openingRouteKeys:t.openingRouteKeys.filter(t=>t!==e.key),closingRouteKeys:t.closingRouteKeys.filter(t=>t!==e.key),replacingRouteKeys:t.replacingRouteKeys.filter(e=>!r.has(e))}})};handleCloseRoute=({route:e})=>{let{state:t,navigation:n}=this.props;t.routes.some(t=>t.key===e.key)?n.dispatch({...w$.pop(),source:e.key,target:t.key}):this.setState(t=>({routes:t.routes.filter(t=>t.key!==e.key),openingRouteKeys:t.openingRouteKeys.filter(t=>t!==e.key),closingRouteKeys:t.closingRouteKeys.filter(t=>t!==e.key)}))};handleTransitionStart=({route:e},t)=>this.props.navigation.emit({type:`transitionStart`,data:{closing:t},target:e.key});handleTransitionEnd=({route:e},t)=>this.props.navigation.emit({type:`transitionEnd`,data:{closing:t},target:e.key});handleGestureStart=({route:e})=>{this.props.navigation.emit({type:`gestureStart`,target:e.key})};handleGestureEnd=({route:e})=>{this.props.navigation.emit({type:`gestureEnd`,target:e.key})};handleGestureCancel=({route:e})=>{this.props.navigation.emit({type:`gestureCancel`,target:e.key})};render(){let{state:e,descriptors:t,...n}=this.props,{routes:r,descriptors:i,openingRouteKeys:a,closingRouteKeys:o}=this.state,s=e.preloadedRoutes.reduce((e,t)=>(e[t.key]=e[t.key]||this.props.describe(t,!0),e),{});return(0,W.jsx)(Rdn,{style:Vdn.container,children:(0,W.jsx)(sln,{children:(0,W.jsx)(K0.Consumer,{children:t=>(0,W.jsx)(lln.Consumer,{children:c=>(0,W.jsx)(l5.Consumer,{children:l=>(0,W.jsx)(Ldn,{insets:t,isParentHeaderShown:l,isParentModal:c,getPreviousRoute:this.getPreviousRoute,routes:r,openingRouteKeys:a,closingRouteKeys:o,onOpenRoute:this.handleOpenRoute,onCloseRoute:this.handleCloseRoute,onTransitionStart:this.handleTransitionStart,onTransitionEnd:this.handleTransitionEnd,renderHeader:this.renderHeader,state:e,descriptors:i,onGestureStart:this.handleGestureStart,onGestureEnd:this.handleGestureEnd,onGestureCancel:this.handleGestureCancel,preloadedDescriptors:s,...n})})})})})})}},Vdn=R.create({container:{flex:1}});function Hdn({id:e,initialRouteName:t,UNSTABLE_routeNamesChangeBehavior:n,children:r,layout:i,screenListeners:a,screenOptions:o,screenLayout:s,UNSTABLE_router:c,...l}){let{direction:u}=K$(),{state:d,describe:f,descriptors:p,navigation:m,NavigationContent:h}=yKt(gWt,{id:e,initialRouteName:t,UNSTABLE_routeNamesChangeBehavior:n,children:r,layout:i,screenListeners:a,screenOptions:o,screenLayout:s,UNSTABLE_router:c});return H.useEffect(()=>m.addListener?.(`tabPress`,e=>{let t=m.isFocused();requestAnimationFrame(()=>{d.index>0&&t&&!e.defaultPrevented&&m.dispatch({...w$.popToTop(),target:d.key})})}),[m,d.index,d.key]),(0,W.jsx)(h,{children:(0,W.jsx)(Bdn,{...l,direction:u,state:d,describe:f,descriptors:p,navigation:m})})}function j5(e){return XWt(Hdn)(e)}V();var Udn={blurredTopClearBottom:`linear-gradient(to bottom, #000 0%, #000 50%, transparent 100%)`,blurredBottomClearTop:`linear-gradient(to top, #000 0%, #000 50%, transparent 100%)`,blurredCenterClearTopAndBottom:`linear-gradient(to bottom, transparent 0%, #000 50%, transparent 100%)`},Wdn=`blur(5px)`,Gdn=({direction:e,style:t})=>{let n=Udn[e];return(0,W.jsx)(B,{style:[t,{backdropFilter:Wdn,WebkitBackdropFilter:Wdn,maskImage:n,WebkitMaskImage:n}],pointerEvents:`none`})};V();var Kdn=50,M5=44,qdn=44,Jdn=10,Ydn=54,Xdn=6;function N5(e=!1){let{top:t}=Q4();return(e?16:t)+Ydn}var Zdn=(0,H.memo)(function({title:e,LeftButton:t,RightButton:n,BottomContent:r,hasHeaderRow:i,style:a}){let[o,s]=(0,H.useState)(M5),[c,l]=(0,H.useState)(M5),{COLORS:u}=J(),d=(0,H.useMemo)(()=>Math.max(o,c,M5),[o,c]),f=(0,H.useCallback)(e=>{let t=Math.round(e.nativeEvent.layout.width);t&&t!==o&&s(t)},[o]),p=(0,H.useCallback)(e=>{let t=Math.round(e.nativeEvent.layout.width);t&&t!==c&&l(t)},[c]);return(0,W.jsxs)(B,{style:a,children:[i&&(0,W.jsxs)(B,{style:P5.headerRow,children:[(0,W.jsx)(B,{style:[P5.sideContainer,{minWidth:d}],onLayout:f,children:t??(0,W.jsx)(B,{style:{minWidth:d}})}),e?(0,W.jsx)(Z,{style:[P5.headerTitle,{color:u.textNavigationBar}],numberOfLines:1,allowFontScaling:!1,children:e}):(0,W.jsx)(B,{style:P5.placeHolderTitle}),(0,W.jsx)(B,{style:[P5.sideContainer,{minWidth:d}],onLayout:p,children:n??(0,W.jsx)(B,{style:{minWidth:d}})})]}),r]})});function Qdn({title:e,LeftButton:t,RightButton:n,BottomContent:r,extraBlurSize:i=0,skipTopInset:a=!1,color:o,overlay:s=!1}){let{COLORS:c}=J(),{top:l}=Q4(),u=a?16:l,d=o??c.bgPrimary,f=c3(d,0),p=e!==void 0||t!==void 0||n!==void 0,m=r&&p?Kdn+i:0+i,h=(0,H.useMemo)(()=>({backdrop:{height:u+Ydn+Xdn+m},container:{marginTop:u}}),[u,m]),g=Oq&&s?P5.overlay:void 0;return kq||Oq?(0,W.jsxs)(B,{style:g,children:[(0,W.jsxs)(B,{style:{pointerEvents:`none`},children:[(0,W.jsx)(z4.default,{colors:[d,f],style:[P5.gradient,h.backdrop]}),(0,W.jsx)(Gdn,{direction:`blurredTopClearBottom`,style:[P5.blur,h.backdrop],fallbackColor:d})]}),(0,W.jsx)(Zdn,{title:e,LeftButton:t,RightButton:n,BottomContent:r,style:h.container,hasHeaderRow:p})]}):(0,W.jsxs)(B,{children:[(0,W.jsx)(z4.default,{colors:[d,f],style:[P5.gradient,h.backdrop,{pointerEvents:`none`}]}),(0,W.jsx)(Zdn,{title:e,LeftButton:t,RightButton:n,BottomContent:r,style:h.container,hasHeaderRow:p})]})}var P5=R.create({headerRow:{flexDirection:`row`,alignItems:`center`,paddingHorizontal:16,justifyContent:`space-between`,paddingBottom:Jdn},sideContainer:{minWidth:M5,minHeight:qdn,alignItems:`center`},gradient:{position:`absolute`,top:0,left:0,right:0},blur:{position:`absolute`,top:0,left:0,right:0},overlay:{position:`absolute`,top:0,left:0,right:0},headerTitle:{...Y.Poppins.medium_Base,flex:1,textAlign:`center`,paddingHorizontal:16},placeHolderTitle:{flex:1}}),F5=(0,H.memo)(Qdn),Q=function(e){return e.MainBottomTabs=`MainBottomTabs`,e.SettingsStack=`SettingsStack`,e.Calculation=`Calculation`,e.VisualSearchIntro=`VisualSearchIntro`,e.VisualSearchPrivacyNoticeWebView=`VisualSearchPrivacyNoticeWebView`,e.VisualSearchEducation=`VisualSearchEducation`,e.VisualSearch=`VisualSearch`,e.FoodLibrary=`FoodLibrary`,e.LoadingRecommendation=`LoadingRecommendation`,e.Recommendation=`Recommendation`,e.LeavingRecommendation=`LeavingRecommendation`,e.DashboardTab=`DashboardTab`,e.LogbooksTab=`LogbooksTab`,e.FoodTab=`FoodTab`,e.Dashboard=`Dashboard`,e.ActiveInsulinChart=`ActiveInsulinChart`,e.MyDay=`MyDay`,e.GlucoseBGM=`GlucoseBGM`,e.GlucoseCGM=`GlucoseCGM`,e.CarbohydrateChart=`CarbohydrateChart`,e.RapidInsulinChart=`RapidInsulinChart`,e.TimeInRange=`TimeInRange`,e.FoodAndDrink=`FoodAndDrink`,e.FoodSubcategories=`FoodSubcategories`,e.CuratedFood=`CuratedFood`,e.PersonalFood=`PersonalFood`,e.PersonalFoodItem=`PersonalFoodItem`,e.CuratedFoodItem=`CuratedFoodItem`,e.Settings=`Settings`,e.ProfileStack=`ProfileStack`,e.GlucoseSettings=`GlucoseSettings`,e.ActivitySettings=`ActivitySettings`,e.InsulinSettingsStack=`InsulinSettingsStack`,e.Notifications=`Notifications`,e.AppleHealth=`AppleHealth`,e.Theme=`Theme`,e.SetupGlucoseMeters=`SetupGlucoseMeters`,e.IFU=`IFU`,e.Support=`Support`,e.SupportWebView=`SupportWebView`,e.SupportContact=`SupportContact`,e.Legal=`Legal`,e.GlucoseUnit=`GlucoseUnit`,e.ChangePINCode=`ChangePINCode`,e.Profile=`Profile`,e.AccountWebView=`AccountWebView`,e.PINCode=`PINCode`,e.InsulinSettings=`InsulinSettings`,e.TreatmentType=`TreatmentType`,e.RapidActingInsulin=`RapidActingInsulin`,e.LongActingInsulin=`LongActingInsulin`,e.NovoPenSetupScreen1=`NovoPenSetupScreen1`,e.NovoPenSetupScreen2=`NovoPenSetupScreen2`,e.NovoPenSetupScreen3=`NovoPenSetupScreen3`,e.NovoPenSetupScreen4=`NovoPenSetupScreen4`,e.SmartPenSetupStack=`SmartPenSetupStack`,e.SmartPenSetupScreen1=`SmartPenSetupScreen1`,e.SmartPenSetupScreen2=`SmartPenSetupScreen2`,e.RenameSmartPen=`RenameSmartPen`,e.NewCalculationStack=`NewCalculationStack`,e.CreateLogbook=`CreateLogbook`,e.CreateFood=`CreateFood`,e.RecommendationLogbook=`RecommendationLogbook`,e.LicensingStatusWebView=`LicensingStatusWebView`,e.SetupCGMWebview=`SetupCGMWebview`,e.SetupForecastWebview=`SetupForecastWebview`,e.NovoPenSetupStack=`NovoPenSetupStack`,e.RecommendationDev=`RecommendationDev`,e}({}),I5=function(e){return e.SetupBolusCalculator=`SetupBolusCalculator`,e.QuickGuideStack=`QuickGuideStack`,e.PINCodeSetup=`PINCodeSetup`,e.SetupStart=`SetupStart`,e.Setup=`Setup`,e.QuickGuideStart=`QuickGuideStart`,e.QuickGuide=`QuickGuide`,e.QuickGuideAllSet=`QuickGuideAllSet`,e}({}),$dn=async e=>{let t=`${bq.HEDIA_SERVER_BASE_URL}/api/v3/data/objects`,n=await d8(t,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:JSON.stringify(e)});return await T2(n,X.StatusCode.CREATED,t,X.HTTPRequestMethod.POST),await n.json()},efn=e=>{let t=e.reduce((e,t)=>e+C8(t.amount,t.foodItem.measures[0].gramsPerUnit,t.foodItem.nutritionPer100g.carbohydrates.value),0);return Math.round(t)},tfn={foodIntakeItems:[],visualSearchIds:[],foodIntakeCarbsAmount:0,manualCarbsInput:0},L5=gq()((e,t)=>({...tfn,setManualCarbsInput:t=>{e({manualCarbsInput:Math.round(t)})},addVisualSearchId:t=>{e(e=>({visualSearchIds:[...e.visualSearchIds,t]}))},addFoodIntakeItem:t=>{e(e=>{let n=e.foodIntakeItems.findIndex(e=>e.foodItem.id===t.foodItem.id),r;r=n===-1?[...e.foodIntakeItems,t]:e.foodIntakeItems.map((e,r)=>r===n?t:e);let i=efn(r);return{foodIntakeItems:r,foodIntakeCarbsAmount:i}})},removeFoodIntakeItem:(t,n)=>{e(e=>{let r=e.foodIntakeItems.filter(({foodItem:e})=>!(n===`id`?e.id===t:e.title===t));return{foodIntakeItems:r,foodIntakeCarbsAmount:efn(r)}})},saveCarbohydrates:async e=>{let{foodIntakeItems:n,foodIntakeCarbsAmount:r,manualCarbsInput:i,visualSearchIds:a}=t();if(!n.length&&!i)return null;let o=e.toISOString(),s=n.map(e=>({type:`referenced`,foodId:e.foodItem.id,quantity:{unit:e.foodItem.measures[0].unit,value:e.amount*e.foodItem.measures[0].gramsPerUnit}})),c=i>0?[{type:`standalone`,nutritionPerItem:{carbohydrates:{unit:`g`,value:i}},title:null}]:[],l=await qan({startDate:o,endDate:o,visualSearchIds:a,items:[...s,...c]});try{return{sampleId:(await $dn({type:`carbohydrates`,startDate:o,endDate:o,quantity:{unit:`g`,value:r+i},metadata:{foodIntakeId:l.id}})).id,foodIntakeId:l.id}}catch(e){throw await Jan(l.id).catch(console.error),e}},clear:()=>{e(tfn)}})),nfn={availableGlucoseReadings:[],selectedReadingId:null},R5=gq()((e,t)=>({...nfn,glucoseStoreActions:{set:t=>{e(e=>({...e,...t}))},addAvailableGlucoseReading:t=>{e(e=>{let n=e.availableGlucoseReadings.findIndex(e=>e.id===t.id||e.source===t.source);if(n!==-1){let r=[...e.availableGlucoseReadings];return r[n]=t,{...e,availableGlucoseReadings:r}}return{...e,availableGlucoseReadings:[...e.availableGlucoseReadings,t]}})},setAvailableGlucoseReadings:t=>{e(e=>({...e,availableGlucoseReadings:t}))},setSelectedReadingId:t=>{e(e=>({...e,selectedReadingId:t}))},removeReadingsByDeviceName:t=>{e(e=>{let n=e.availableGlucoseReadings.filter(e=>!(`deviceName`in e)||e.deviceName!==t),r=e.availableGlucoseReadings.find(t=>t.id===e.selectedReadingId),i=r&&`deviceName`in r&&r.deviceName===t?null:e.selectedReadingId;return{...e,availableGlucoseReadings:n,selectedReadingId:i}})},getReadingById:e=>e===null?null:t().availableGlucoseReadings.find(t=>t.id===e)??null,clear:()=>{e(nfn)}}})),rfn={isGoToSettingsPressed:!1,isNoBGModalVisible:!1,showCalculationInfoModal:!1,showDiscardCalculationModal:!1,showDiscardSmartPenSetupModal:!1,showSyncErrorModal:!1},z5=gq()(e=>({...rfn,modalStoreActions:{set:t=>{e(e=>({...e,...t}))},clear:()=>{e(rfn)}}})),ifn={noteId:null,noteBody:``,displayImageUri:null},B5=gq()(e=>({...ifn,noteStoreActions:{set:t=>{e(e=>({...e,...t}))},clear:()=>{e(ifn)}}}));V();var V5={top:10,bottom:10,left:20,right:20},H5=({onPress:e}={})=>{let{goBack:t}=N$(),{COLORS:n}=J();return(0,W.jsx)(wp,{onPress:e??t,testID:`header-back-button`,style:({pressed:e})=>[G5.button,{opacity:e?.5:1,backgroundColor:n.bgBtnSecondary,borderColor:n.border}],hitSlop:V5,children:(0,W.jsx)(X7t,{height:28,width:28})})},U5=({onPress:e})=>{let{pop:t}=N$(),{COLORS:n}=J();return(0,W.jsx)(wp,{onPress:e??(()=>t()),testID:`header-close-button`,style:({pressed:e})=>[G5.button,{opacity:e?.5:1,backgroundColor:n.bgBtnSecondary,borderColor:n.border}],hitSlop:V5,children:(0,W.jsx)(Q7t,{height:28,width:28})})},afn=({style:e})=>{let{navigate:t}=N$(),{COLORS:n}=J(),r=(0,H.useRef)(0);return(0,W.jsx)(wp,{onPress:(0,H.useCallback)(()=>{let e=Date.now();e-r.current<500||(r.current=e,u8(l8.SettingsTabPress),Oq?(L5.getState().clear(),R5.getState().glucoseStoreActions.clear(),B5.getState().noteStoreActions.clear(),t(Q.SettingsStack,{screen:Q.Settings})):t(Q.SettingsStack))},[t]),testID:`header-settings-button`,style:({pressed:t})=>[G5.button,{opacity:t?.5:1,backgroundColor:n.bgBtnSecondary,borderColor:n.border},e],hitSlop:V5,children:(0,W.jsx)(h9t,{})})},ofn=({onPress:e,testID:t=`header-info-button`,style:n})=>{let{COLORS:r}=J(),{modalStoreActions:i}=z5();return(0,W.jsx)(wp,{onPress:e??(()=>i.set({showCalculationInfoModal:!0})),testID:t,style:({pressed:e})=>[G5.button,{opacity:e?.5:1,backgroundColor:r.bgBtnSecondary,borderColor:r.border},n],hitSlop:V5,children:(0,W.jsx)(n9t,{height:28,width:28})})},W5=({onPress:e,disabled:t=!1})=>{let{COLORS:n}=J();return(0,W.jsx)(wp,{testID:`header-confirm-button`,style:({pressed:e})=>[G5.button,{opacity:e||t?.5:1,backgroundColor:n.bgBrand,borderWidth:0}],onPress:e,disabled:t,hitSlop:V5,children:(0,W.jsx)(G4,{height:28,width:28,color:n.iconButtonPrimary})})},sfn=({onPress:e})=>{let{COLORS:t}=J();return(0,W.jsx)(wp,{testID:`header-edit-button`,onPress:e,style:({pressed:e})=>[G5.button,{opacity:e?.5:1,backgroundColor:t.bgBtnSecondary,borderColor:t.border}],hitSlop:V5,children:(0,W.jsx)(e9t,{height:28,width:28})})},cfn=({onPress:e,isLocked:t})=>{let{COLORS:n}=J();return(0,W.jsx)(wp,{testID:`header-lock-button`,onPress:e,style:({pressed:e})=>[G5.button,{opacity:e?.5:1,backgroundColor:n.bgBtnSecondary,borderColor:n.border}],hitSlop:V5,children:t?(0,W.jsx)(i9t,{height:28,width:28}):(0,W.jsx)(m9t,{height:28,width:28})})},G5=R.create({button:{padding:8,borderRadius:22,borderWidth:1}});({...Y.Poppins.medium_Base});var K5={cardStyle:{flex:1},headerShown:!0,headerLeft:()=>(0,W.jsx)(H5,{}),headerTitleStyle:{...Y.Poppins.medium_Base},headerTitleAlign:`center`,headerTitleAllowFontScaling:!1,title:``},lfn={...K5,animation:`slide_from_bottom`,presentation:`modal`,headerLeft:()=>(0,W.jsx)(U5,{}),headerLeftContainerStyle:{flex:1},headerTitleContainerStyle:{flex:3,alignItems:`center`},headerRightContainerStyle:{flex:1}},ufn=async e=>{let t=`${bq.ASSET_BASE_URL}/api/v1/assets/${e}`,n=await d8(t,{method:`GET`,headers:{Accept:`application/json`}});return await T2(n,X.StatusCode.OK,t),n.json()},dfn=async e=>{let t=`${bq.ASSET_BASE_URL}/api/v1/assets/${e}`;await T2(await d8(t,{method:`DELETE`}),X.StatusCode.NO_CONTENT,t,X.HTTPRequestMethod.DELETE)},q5=[`foods`,`personal`],ffn=()=>{let{data:e=[],isLoading:t,isError:n,refetch:r}=b0({queryKey:q5,queryFn:Ran,staleTime:1e3*60*5,networkMode:`offlineFirst`,retry:3});return{personalFoods:e,isPersonalFoodsLoading:t,isPersonalFoodsError:n,refetchPersonalFoods:r}},pfn=()=>{let e=y0(),{mutateAsync:t,isPending:n,isError:r,error:i}=$0t({mutationFn:Gan,onSuccess:()=>{e.invalidateQueries({queryKey:q5})}});return{createPersonalFood:t,isCreatingPersonalFood:n,createPersonalFoodError:r?i:null}},mfn=e=>[`foods`,`item`,e],hfn=e=>{let{data:t=null,isLoading:n,isError:r,refetch:i}=b0({queryKey:mfn(e),queryFn:()=>Han(e),staleTime:1e3*60*5,networkMode:`offlineFirst`,retry:3});return{food:t,isFoodLoading:n,isFoodError:r,refetchFood:i}},J5=[`foods`,`search`],gfn=e=>[...J5,e],_fn=e=>{let{data:t=[],isLoading:n,isError:r,refetch:i}=b0({queryKey:gfn(e),queryFn:()=>Van(e),enabled:e.length>2,staleTime:1e3*60*5,networkMode:`offlineFirst`,retry:3});return{foodSearchResults:t,isFoodSearchLoading:n,isFoodSearchError:r,refetchFoodSearch:i}},vfn=()=>{let e=y0(),{mutateAsync:t,isPending:n}=$0t({mutationFn:e=>Wan(e),onSuccess:(t,n)=>{e.setQueryData(q5,e=>e?.filter(e=>e.id!==n)),e.setQueriesData({queryKey:J5},e=>e?.filter(e=>e.id!==n)),e.setQueryData(mfn(n),null),e.invalidateQueries({queryKey:q5}),e.invalidateQueries({queryKey:J5})}});return{deletePersonalFood:t,isDeletingPersonalFood:n}},yfn=()=>{let e=y0(),{mutateAsync:t,isPending:n}=$0t({mutationFn:({foodId:e,request:t})=>Uan(e,t),onSuccess:t=>{e.setQueryData(mfn(t.id),t),e.setQueryData(q5,e=>e?.map(e=>e.id===t.id?t:e)),e.setQueriesData({queryKey:J5},e=>e?.map(e=>e.id===t.id?t:e)),e.invalidateQueries({queryKey:q5}),e.invalidateQueries({queryKey:J5})}});return{updatePersonalFood:t,isUpdatingPersonalFood:n}};V();var bfn={outlineStyle:`none`};function xfn({value:e,onChangeText:t,imageUri:n,containerStyle:r,testID:i,autoFocus:a,maxLength:o=1024}){let{COLORS:s}=J(),{t:c}=Tq(),l=(0,H.useRef)(null);return(0,H.useEffect)(()=>{if(!a)return;let e=setTimeout(()=>{l.current?.focus()},300);return()=>{clearTimeout(e)}},[a]),(0,W.jsxs)(B,{style:[Sfn.container,{backgroundColor:s.bgInputActive},r],testID:i,children:[(0,W.jsx)(Lp,{ref:l,value:e,onChangeText:t,placeholder:c(`notes_placeholder`),placeholderTextColor:s.labelTertiary,multiline:!0,maxLength:o,style:[Sfn.input,{color:s.labelPrimary},bfn],cursorColor:s.iconBrand,testID:`${i}-input`}),!!n&&(0,W.jsx)(Zu,{source:{uri:n},style:Sfn.image,resizeMode:`cover`,testID:`${i}-image`})]})}var Sfn=R.create({container:{borderRadius:16,padding:16,minHeight:160},input:{...Y.Poppins.regular_Base,flex:1,marginBottom:16,textAlignVertical:`top`,maxHeight:300},image:{width:`100%`,height:234,borderRadius:12,marginTop:12}});V();function Cfn({onPress:e}){let{t}=Tq(),{COLORS:n}=J();return(0,W.jsx)(wp,{accessibilityRole:`button`,style:[wfn.button,{backgroundColor:n.iosKeyboardPicker}],onPress:e,testID:`wheel-picker-modal-cancel`,children:(0,W.jsx)(_d,{maxFontSizeMultiplier:C2.s3,style:[wfn.buttonText,{color:n.textKeyboardButtons}],children:t(`button_cancel`)})})}var wfn=R.create({button:{borderRadius:13},buttonText:{fontSize:17,fontWeight:`600`,paddingHorizontal:16,paddingVertical:15,textAlign:`center`}}),Y5=H.memo(Cfn);V();function Tfn({onPress:e}){let{t}=Tq(),{COLORS:n}=J();return(0,W.jsx)(wp,{accessibilityRole:`button`,style:[Efn.button,{backgroundColor:n.iosKeyboardPicker}],onPress:e,testID:`wheel-picker-modal-confirm`,children:(0,W.jsx)(_d,{maxFontSizeMultiplier:C2.s3,style:[Efn.buttonText,{color:n.textKeyboardButtons}],children:t(`button_confirm`)})})}var Efn=R.create({button:{borderBottomLeftRadius:13,borderBottomRightRadius:13},buttonText:{fontSize:17,fontWeight:`400`,paddingHorizontal:16,paddingVertical:15,textAlign:`center`}}),X5=H.memo(Tfn),Dfn=c({HapticFeedbackTypes:()=>kfn,default:()=>Afn,triggerHaptic:()=>Ofn});function Ofn(e=`selection`,t){}var kfn,Afn,jfn=o((()=>{kfn=function(e){return e.selection=`selection`,e.impactLight=`impactLight`,e.impactMedium=`impactMedium`,e.impactHeavy=`impactHeavy`,e.rigid=`rigid`,e.soft=`soft`,e.notificationSuccess=`notificationSuccess`,e.notificationWarning=`notificationWarning`,e.notificationError=`notificationError`,e.clockTick=`clockTick`,e.contextClick=`contextClick`,e.keyboardPress=`keyboardPress`,e.keyboardRelease=`keyboardRelease`,e.keyboardTap=`keyboardTap`,e.longPress=`longPress`,e.textHandleMove=`textHandleMove`,e.virtualKey=`virtualKey`,e.virtualKeyRelease=`virtualKeyRelease`,e.effectClick=`effectClick`,e.effectDoubleClick=`effectDoubleClick`,e.effectHeavyClick=`effectHeavyClick`,e.effectTick=`effectTick`,e}({}),Afn={trigger:(e,t)=>{}}}));jfn(),V();var Mfn=22,Nfn=26;function Pfn({textStyle:e,style:t,height:n,fontScale:r,option:i,onItemPress:a}){let{COLORS:o}=J();return(0,W.jsx)(B,{style:[Ffn.item,t,{height:n}],children:(0,W.jsx)(wp,{style:Ffn.itemPressable,onPress:a,children:(0,W.jsx)(_d,{allowFontScaling:!1,style:[e,Ffn.itemText,{fontSize:Mfn*r,lineHeight:Nfn*r,color:o.labelPrimary}],children:i})})})}var Ffn=R.create({item:{alignItems:`center`,justifyContent:`center`,zIndex:100},itemPressable:{width:`100%`},itemText:{textAlign:`center`,fontWeight:`400`}}),Ifn=H.memo(Pfn);V();function Lfn({itemHeight:e,visibleRest:t}){let{COLORS:n}=J(),r=e*t;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(z4.default,{colors:[n.iosKeyboardPicker+`FF`,n.iosKeyboardPicker+`4D`],style:[Rfn.mask,{top:0,height:r}]}),(0,W.jsx)(z4.default,{colors:[n.iosKeyboardPicker+`4D`,n.iosKeyboardPicker+`FF`],style:[Rfn.mask,{bottom:0,height:r}]})]})}var Rfn=R.create({mask:{position:`absolute`,left:0,right:0,pointerEvents:`none`}}),zfn=(0,H.memo)(Lfn);V();function Bfn({testID:e,initialScrollIndex:t,options:n,onChange:r,selectedIndicatorStyle:i={},containerStyle:a={},itemStyle:o={},itemTextStyle:s={},itemHeight:c=36,visibleRest:l=3,decelerationRate:u=`normal`,containerProps:d={},flatListProps:f={},accessibilityLabel:p,ref:m}){let{t:h}=Tq(),{COLORS:g}=J(),{width:_,fontScale:v}=em(),y=Math.min(v,C2.s3),b=Math.round(c*y),x=(1+l*2)*b,S=(0,H.useRef)(null),C=(0,H.useRef)(null);(0,H.useImperativeHandle)(m,()=>({scrollToIndex(e){S.current?.scrollToIndex({index:e,animated:!0})}}),[]);let[w]=(0,H.useState)(new lf.Value(0)),T=(0,H.useMemo)(()=>{let e=[...n];for(let t=0;t<l;t++)e.unshift(null),e.push(null);return e},[n,l]),E=(0,H.useMemo)(()=>[...Array(T.length)].map((e,t)=>t*b),[T,b]),D=(0,H.useCallback)(e=>{Oq||C.current!==e&&(C.current=e)},[]),O=(0,H.useCallback)(e=>{let t=e.nativeEvent.contentOffset.y,i=Math.min(n.length-1,Math.max(0,Math.round(t/b)));D(i),Oq&&(r(i),S.current?.scrollToIndex({index:i,animated:!0}))},[D,b,r,n.length]),k=U3t((...e)=>{let t=e[0];O(t)},100),A=(0,H.useCallback)(e=>{let t=e.nativeEvent.contentOffset.y,i=Math.min(b*(n.length-1),Math.max(t,0)),a=Math.floor(Math.floor(i)/b);Math.floor(i%b)>b/2&&a++,r(a)},[b,r,n.length]);return(0,W.jsxs)(B,{accessible:!0,accessibilityHint:h(`wheelpicker_accessibility_label`),accessibilityLabel:p,accessibilityRole:`adjustable`,style:[Vfn.container,{backgroundColor:g.iosKeyboardPicker,height:x,width:_},a],...d,children:[(0,W.jsx)(B,{style:[Vfn.selectedIndicator,{backgroundColor:g.iosSelectorKeyboard},{transform:[{translateY:-b/2}],height:b,width:_-32-20},i]}),(0,W.jsx)(lf.FlatList,{...f,testID:e,ref:S,showsVerticalScrollIndicator:!1,removeClippedSubviews:yvt,onScroll:lf.event([{nativeEvent:{contentOffset:{y:w}}}],{useNativeDriver:!Oq,listener:Oq?k:O}),scrollEventThrottle:16,initialScrollIndex:t,onMomentumScrollEnd:A,snapToInterval:b,snapToOffsets:E,decelerationRate:u,getItemLayout:(e,t)=>({length:b,offset:b*t,index:t}),data:T,keyExtractor:(e,t)=>t.toString(),windowSize:31,initialNumToRender:l*2+1,maxToRenderPerBatch:12,updateCellsBatchingPeriod:50,renderItem:({item:e,index:t})=>(0,W.jsx)(Ifn,{option:e,style:o,textStyle:s,height:b,fontScale:y,onItemPress:()=>{let e=Math.max(0,Math.min(t-l,n.length-1));S.current?.scrollToIndex({index:e,animated:!0})}},`option-${t}`)}),(0,W.jsx)(zfn,{itemHeight:b,visibleRest:l})]})}var Vfn=R.create({container:{borderTopLeftRadius:13,borderTopRightRadius:13,alignSelf:`center`},selectedIndicator:{position:`absolute`,borderRadius:7,top:`50%`,alignSelf:`center`}}),Z5=H.memo(Bfn);V();function Hfn({items:e,isVisible:t,onCancel:n,onConfirm:r,onModalHide:i,initialScrollIndex:a,accessibilityLabel:o,testID:s}){let{COLORS:c}=J(),[l,u]=(0,H.useState)(a),{width:d}=em();(0,H.useEffect)(()=>{u(a)},[a]);let f=(0,H.useCallback)(e=>{u(e)},[]),p=(0,H.useCallback)(()=>{r(parseFloat(e[l]),l)},[e,r,l]),m=(0,H.useCallback)(()=>{u(a),n()},[a,n]);return(0,W.jsx)(u3,{isVisible:t,containerStyle:{backgroundColor:c.bgTransparent},onModalHide:i,children:(0,W.jsxs)(B,{children:[(0,W.jsx)(B,{style:Ufn.pickersContainer,children:(0,W.jsx)(Z5,{testID:s,initialScrollIndex:a,options:e,onChange:f,accessibilityLabel:o,containerStyle:{width:d-32}})}),(0,W.jsxs)(B,{style:Ufn.buttonContainer,children:[(0,W.jsx)(X5,{onPress:p}),(0,W.jsx)(Y5,{onPress:m})]})]})})}var Q5=H.memo(Hfn),Ufn=R.create({pickersContainer:{flexDirection:`row`,borderTopLeftRadius:13,borderTopRightRadius:13,overflow:`hidden`},buttonContainer:{gap:8}});function $5(e){let t=y0(),[n,r]=(0,H.useState)(null);return(0,H.useEffect)(()=>{if(!e){r(null);return}(async()=>{r((await t.fetchQuery({queryKey:[`asset`,e],queryFn:()=>ufn(e),staleTime:X.Milliseconds.Minute*5})).downloadUrl)})().catch(console.error)},[e,t]),n}V();var Wfn=({isLiquid:e,setSelected:t})=>{let{COLORS:n}=J();return(0,W.jsxs)(B,{style:[e7.container,{backgroundColor:n.bgSegmentContainer,borderColor:n.buttonBorder}],children:[(0,W.jsx)(wp,{style:[e7.segment,!e&&{backgroundColor:n.bgSegmentPrimary}],onPress:()=>{t(!1)},testID:`food-type-food-${e}`,children:(0,W.jsx)(Z,{style:[e7.value,{color:e?n.textLabelInactive:n.textLabelActive}],maxFontSizeMultiplier:C2.s0,children:`g`})}),(0,W.jsx)(wp,{style:[e7.segment,e&&{backgroundColor:n.bgSegmentPrimary}],onPress:()=>{t(!0)},testID:`food-type-drink-${e}`,children:(0,W.jsx)(Z,{style:[e7.value,{color:e?n.textLabelActive:n.textLabelInactive}],maxFontSizeMultiplier:C2.s0,children:`ml`})})]})},e7=R.create({container:{flexDirection:`row`,justifyContent:`center`,alignItems:`center`,borderRadius:32,padding:4,borderWidth:1},segment:{flex:1,flexDirection:`row`,justifyContent:`center`,alignItems:`center`,paddingVertical:4,paddingHorizontal:10,borderRadius:16},value:{...Y.Poppins.medium_Base}}),t7=({onModalHide:e})=>{let{t}=Tq(),n=WWt(),{showSyncErrorModal:r,modalStoreActions:i}=z5();return(0,W.jsx)(u3,{isVisible:r&&n,onModalHide:e,onModalShow:()=>{u8(l8.ErrorOffline)},title:t(`glucose_modal_changes_title`),message:t(`glucose_modal_changes_body`),buttons:[{title:t(`glucose_modal_changes_button_confirm`),onPress:()=>{i.set({showSyncErrorModal:!1})}}]})};V();var Gfn={title:``,carbohydrates:null,measure:`g`,description:``},Kfn=e=>e?{title:e.title,carbohydrates:e.nutritionPer100g.carbohydrates.value,measure:e.measures[0]?.unit,description:e.description??``}:Gfn,qfn=a3(0,100),Jfn=`create-food`,Yfn=()=>{let{t:e}=Tq(),{COLORS:t}=J(),{createPersonalFood:n,isCreatingPersonalFood:r}=pfn(),{updatePersonalFood:i,isUpdatingPersonalFood:a}=yfn(),{deletePersonalFood:o,isDeletingPersonalFood:s}=vfn(),{removeFoodIntakeItem:c}=L5(),l=F$(),u=l.params?.personalFoodId,{personalFoods:d}=ffn(),f=u?d.find(e=>e.id===u):void 0,{modalStoreActions:p}=z5(),m=N$(),h=N5(),{bottomWithScroll:g}=Q4(),[_,v]=(0,H.useState)(()=>Kfn(f)),y=(0,H.useRef)(_),b=(0,H.useRef)(!!f);(0,H.useEffect)(()=>{if(b.current||!f||(b.current=!0,_!==y.current))return;let e=Kfn(f);y.current=e,v(e)},[f,_]);let[x,S]=(0,H.useState)(!1),[C,w]=(0,H.useState)(0),[T,E]=(0,H.useState)(!1),[D,O]=(0,H.useState)(!1),k=(0,H.useRef)(!1),[A,ee]=(0,H.useState)(!1),te=(0,H.useRef)(!1),ne=$5(f?.imageId??null),re=_.title.trim().length>0&&_.carbohydrates!==null,ie=T||r||a||s,j=y.current,ae=_.title!==j.title||_.carbohydrates!==j.carbohydrates||_.measure!==j.measure||_.description!==j.description,oe=(0,H.useCallback)(()=>{if(!ae){m.pop();return}ee(!0)},[ae,m]);(0,H.useEffect)(()=>{let r=async()=>{E(!0);try{if(u)if(_.carbohydrates!==j.carbohydrates||_.measure!==j.measure){let e=await n({title:_.title.trim(),description:_.description.trim()||null,imageId:f?.imageId??null,measures:[{unit:_.measure,gramsPerUnit:1}],nutritionPer100g:{carbohydrates:{unit:`g`,value:_.carbohydrates??0}}});try{await o(u)}catch(t){throw await o(e.id).catch(console.error),t}c(u,`id`)}else await i({foodId:u,request:{title:_.title.trim(),description:_.description.trim()||null}});else await n({title:_.title.trim(),description:_.description.trim()||null,measures:[{unit:_.measure,gramsPerUnit:1}],nutritionPer100g:{carbohydrates:{unit:`g`,value:_.carbohydrates??0}}});m.getState().routes.some(({key:e})=>e===l.key)&&m.pop(),u8(l8.FoodLibraryCreatePress)}catch{p.set({showSyncErrorModal:!0})}finally{E(!1)}};m.setOptions({headerTransparent:!0,gestureEnabled:!1,header:()=>(0,W.jsx)(F5,{title:_.title||e(`add_food_segment_food`),LeftButton:(0,W.jsx)(U5,{onPress:oe}),RightButton:ie?(0,W.jsx)(Pf,{size:`small`,color:t.iconBrand,style:n7.activityIndicator}):(0,W.jsx)(W5,{onPress:r,disabled:!ae||!re}),overlay:!0})})},[re,ae,m,_,p,ie,t.iconBrand,n,i,o,c,j.carbohydrates,j.measure,f?.imageId,u,l.key,oe,e]);let se=(0,H.useCallback)(()=>{Tf.dismiss(),w(Math.max(0,_.carbohydrates??0)),S(!0)},[_.carbohydrates]),M=(0,H.useCallback)(e=>{v(t=>({...t,carbohydrates:e})),S(!1)},[]),ce=(0,H.useCallback)(e=>{v(t=>({...t,description:e}))},[]),N=(0,H.useCallback)(()=>{te.current=!0,ee(!1)},[]),P=(0,H.useCallback)(()=>{te.current&&(te.current=!1,m.pop())},[m]),le=(0,H.useCallback)(()=>{k.current=!0,O(!1)},[]),ue=(0,H.useCallback)(async()=>{if(!(!k.current||!f)){k.current=!1;try{f.imageId&&await dfn(f.imageId).catch(console.error),await o(f.id),c(f.id,`id`),m.getState().routes.some(({key:e})=>e===l.key)&&m.pop()}catch{p.set({showSyncErrorModal:!0})}}},[f,o,c,m,l.key,p]);return(0,W.jsxs)(fs,{testID:`${Jfn}-scroll`,keyboardDismissMode:`on-drag`,keyboardShouldPersistTaps:`always`,contentContainerStyle:{paddingTop:h+8,paddingBottom:g},style:{backgroundColor:t.bgSheet},children:[(0,W.jsxs)(B,{style:n7.container,children:[(0,W.jsxs)(B,{style:n7.mandatorySection,children:[(0,W.jsx)(T9t,{value:_.title,placeholder:_.measure===`mL`?e(`food_add_library_input_drink_name`):e(`food_add_library_input_name`),onChangeText:e=>v(t=>({...t,title:e})),maxLength:255,testID:`${Jfn}-name`,autoFocus:!u}),(0,W.jsx)(Y4,{title:e(`food_add_library_item_carbs`),onPress:se,renderRightSlot:()=>(0,W.jsxs)(Z,{style:[n7.rightSlot,{color:t.labelPrimary}],testID:`${Jfn}-carbohydrates`,children:[_.carbohydrates??`-`,` / 100g`]})})]}),(0,W.jsxs)(B,{style:n7.measurementSection,children:[(0,W.jsx)(Z,{style:[n7.measurementQuestion,{color:t.labelPrimary}],children:e(`food_unitToggle_title`)}),(0,W.jsx)(Wfn,{isLiquid:_.measure===`mL`,setSelected:e=>{v(t=>({...t,measure:e?`mL`:`g`}))}})]}),(0,W.jsx)(xfn,{value:_.description,onChangeText:ce,maxLength:255,imageUri:ne,testID:`create-food-notes`}),!!f&&(0,W.jsx)(U4,{type:H4.ErrorSecondary,title:e(`button_delete_food`),testID:`delete_food_button`,disabled:ie,onPress:()=>O(!0),style:n7.deleteButton})]}),(0,W.jsx)(Q5,{isVisible:x,items:qfn,initialScrollIndex:C,onCancel:()=>S(!1),onConfirm:M,testID:`create-food-wheel-picker`}),(0,W.jsx)(u3,{isVisible:A,title:e(`logbook_personal_modal_discard_title`),onModalHide:P,buttons:[{title:e(`button_discard_changes`),type:H4.Error,testID:`discard-button`,onPress:N},{title:e(`button_keep_editing`),type:H4.Secondary,testID:`keep-button`,onPress:()=>ee(!1)}]}),(0,W.jsx)(u3,{isVisible:D,title:e(`food_modal_delete_food_title`),onModalHide:ue,buttons:[{title:e(`button_delete_food`),type:H4.Error,testID:`delete_modal_delete_button`,onPress:le},{title:e(`button_cancel`),type:H4.Secondary,testID:`delete_modal_cancel_button`,onPress:()=>O(!1)}]}),(0,W.jsx)(t7,{})]})},n7=R.create({container:{flex:1,paddingHorizontal:16,gap:16},mandatorySection:{gap:8},measurementSection:{gap:10},measurementQuestion:{...Y.Poppins.regular_SM},rightSlot:{...Y.Poppins.regular_Base,marginRight:8},deleteButton:{marginTop:8},activityIndicator:{width:44,height:44}});function Xfn({uri:e,style:t,onLoadEnd:n}){let r=(0,H.useRef)(null);return(0,H.useEffect)(()=>{let e=r.current;if(!(!n||!e))return e.addEventListener(`load`,n),()=>{e.removeEventListener(`load`,n)}},[r,n]),(0,W.jsx)(`iframe`,{ref:r,src:e,style:t})}function Zfn(){let{language:e}=Cq.getState();return`https://pdf.hedia.io/IFU/${e}/Hedia-IFU-${c8}`}V();var Qfn=()=>(0,W.jsx)(Xfn,{style:$fn.iframe,uri:Zfn()}),$fn=R.create({iframe:{flex:1}}),epn=s(((e,t)=>{function n(e){return e&&e.__esModule?e:{default:e}}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports})),tpn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.default=(V(),d(tm)).StyleSheet.create({container:{flex:1,overflow:`hidden`},loadingOrErrorView:{position:`absolute`,flex:1,justifyContent:`center`,alignItems:`center`,height:`100%`,width:`100%`,backgroundColor:`white`},loadingProgressBar:{height:20},errorText:{fontSize:14,textAlign:`center`,marginBottom:2},errorTextTitle:{fontSize:15,fontWeight:`500`,marginBottom:10},webView:{backgroundColor:`#ffffff`},flexStart:{alignSelf:`flex-start`},colorRed:{color:`red`}})})),npn=u(s((e=>{var t=epn();Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.WebView=void 0,t(p());var n=(V(),d(tm)),r=t(tpn()),i=LJ();e.default=e.WebView=function(){return(0,i.jsx)(n.View,{style:r.default.flexStart,children:(0,i.jsx)(n.Text,{style:r.default.colorRed,children:`React Native WebView does not support this platform.`})})}}))());V(),YQ(),Z0();function rpn({ref:e,url:t,testID:n,incognito:r=!0,onNavigationStateChange:i,onLoadError:a,onShouldStartLoadWithRequest:o,originWhitelist:s,spinnerSize:c=15,style:l}){let{t:u}=Tq(),{COLORS:d,effectiveColorScheme:f}=J(),{bottom:p}=W0(),[m,h]=(0,H.useState)(!1),[g,_]=(0,H.useState)(null),[v,y]=(0,H.useState)(null),b=(0,H.useMemo)(()=>`document.cookie = "theme=${f}; path=/; SameSite=Lax";`,[f]);return t?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(npn.default,{ref:e,source:{uri:t},testID:n,incognito:r,startInLoadingState:!0,renderLoading:()=>(0,W.jsx)(B,{style:r7.centerContainer,children:(0,W.jsx)(g2,{source:_2.LOADING_SPINNER,autoPlay:!0,style:{height:`${c}%`}})}),setSupportMultipleWindows:!1,onHttpError:e=>{let{url:t,statusCode:r}=e.nativeEvent;if(console.error(`WebViewLoader onHttpError: `,n,t.split(/[?#]/)[0],r),a){a();return}h(!0),_(u(`global_modal_swr_title`)),y(u(`global_modal_swr_body`))},onError:e=>{let{url:t,description:r}=e.nativeEvent;if(console.error(`WebViewLoader onError: `,n,t.split(/[?#]/)[0],r),a){a();return}h(!0),r.includes(`ERR_INTERNET_DISCONNECTED`)?(_(u(`settings_modal_no_internet_title`)),y(u(`settings_modal_no_internet_body`))):(_(u(`global_modal_swr_title`)),y(u(`global_modal_swr_body`)))},injectedJavaScriptBeforeContentLoaded:b,onNavigationStateChange:i,onShouldStartLoadWithRequest:o,originWhitelist:s,style:{backgroundColor:d.bgPrimary},containerStyle:[r7.container,{backgroundColor:d.bgPrimary,paddingBottom:p},l]}),m&&(0,W.jsxs)(JQ.View,{entering:BQ.duration(300).delay(2e3),style:r7.centerContainer,children:[(0,W.jsx)(Z,{style:[r7.errorTitle,{color:d.labelPrimary}],children:g}),(0,W.jsx)(Z,{style:[r7.errorSubtitle,{color:d.labelSecondary}],children:v})]})]}):null}var r7=R.create({container:{height:`100%`},centerContainer:{height:`100%`,justifyContent:`center`,marginHorizontal:16},errorTitle:{...Y.Poppins.semiBold_2XL,textAlign:`center`},errorSubtitle:{...Y.Poppins.regular_Base,textAlign:`center`}});V();function ipn(){let e=rln();return Oq?(0,W.jsx)(Xfn,{style:apn.iframe,uri:`https://www.hedia.com/support/partner`}):(0,W.jsx)(rpn,{url:`https://www.hedia.com/support/native`,testID:`support-webview`,style:{paddingTop:e}})}var apn=R.create({iframe:{flex:1}}),opn=()=>({min:X.CONSTANTS.CARBOHYDRATES_INPUT_MIN,max:X.CONSTANTS.CARBOHYDRATES_INPUT_MAX});a3(X.CONSTANTS.CARBOHYDRATES_INPUT_MIN,X.CONSTANTS.CARBOHYDRATES_INPUT_MAX),V();function spn({children:e,offset:t=47}){let{COLORS:n}=J(),{bottom:r}=Q4();return(0,W.jsxs)(B,{children:[(0,W.jsx)(z4.default,{colors:[c3(n.bgPrimary,0),n.bgPrimary],style:[cpn.gradient,{height:r+t+16}],pointerEvents:`none`}),(0,W.jsx)(B,{style:[{paddingBottom:r},cpn.contentContainer],children:e})]})}var cpn=R.create({gradient:{position:`absolute`,bottom:0,left:0,right:0},contentContainer:{position:`absolute`,bottom:0,left:0,right:0,marginHorizontal:16}}),lpn=(0,H.memo)(spn);V();var upn=()=>{let{t:e}=Tq(),{COLORS:t}=J(),{showCalculationInfoModal:n,modalStoreActions:r}=z5(),i=(0,H.useMemo)(()=>[{testID:`close-button`,title:e(`button_close`),onPress:()=>{r.set({showCalculationInfoModal:!1})}}],[r,e]);return(0,W.jsxs)(u3,{testID:`calculation_info_modal`,isVisible:n,title:e(`calcflow_modal_info_title`),buttons:i,enableScroll:!0,containerStyle:i7.modal,children:[(0,W.jsx)(Z,{style:[i7.header,{color:t.labelPrimary}],children:e(`calcflow_modal_info_insulin_title`)}),(0,W.jsx)(Z,{style:[i7.text,{color:t.labelSecondary}],children:e(`calcflow_modal_info_insulin_body`)}),(0,W.jsx)(Z,{style:[i7.header,{color:t.labelPrimary}],children:e(`calcflow_modal_info_glucose_title`)}),(0,W.jsx)(Z,{style:[i7.text,{color:t.labelSecondary}],children:e(`calcflow_modal_info_glucose_body`)}),(0,W.jsx)(Z,{style:[i7.header,{color:t.labelPrimary}],children:e(`calcflow_modal_info_carbohydrates_title`)}),(0,W.jsx)(Z,{style:[i7.text,{color:t.labelSecondary}],children:e(`calcflow_modal_info_carbohydrates_body`)}),(0,W.jsx)(Z,{style:[i7.header,{color:t.labelPrimary}],children:e(`calcflow_modal_info_activity_title`)}),(0,W.jsx)(Z,{style:[i7.text,{color:t.labelSecondary}],children:e(`calcflow_modal_info_activity_body`)}),(0,W.jsx)(Z,{style:[i7.header,{color:t.labelPrimary}],children:e(`calcflow_modal_info_notes_title`)}),(0,W.jsx)(Z,{style:[i7.text,{color:t.labelSecondary}],children:e(`calcflow_modal_info_notes_body`)}),(0,W.jsx)(Z,{style:[i7.header,{color:t.labelPrimary}],children:e(`calcflow_modal_info_calculate_title`)}),(0,W.jsx)(Z,{style:[i7.text,{color:t.labelSecondary}],children:e(`calcflow_modal_info_calculate_body`)})]},`calculation_info_modal`)},i7=R.create({modal:{maxHeight:`92%`},header:{...Y.Poppins.semiBold_Base,marginTop:16},text:{...Y.Poppins.regular_Base}}),dpn=async e=>{let t=`${bq.NOTE_BASE_URL}/api/v1/notes`,n=await d8(t,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:JSON.stringify(e)});return await T2(n,X.StatusCode.CREATED,t,X.HTTPRequestMethod.POST),n.json()},fpn=async e=>{let t=`${bq.NOTE_BASE_URL}/api/v1/notes/${e}`,n=await d8(t,{method:`GET`,headers:{Accept:`application/json`}});return await T2(n,X.StatusCode.OK,t),n.json()},ppn=async(e,t)=>{let n=`${bq.NOTE_BASE_URL}/api/v1/notes/${e}`,r=await d8(n,{method:X.HTTPRequestMethod.PATCH,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:JSON.stringify(t)});return await T2(r,X.StatusCode.OK,n,X.HTTPRequestMethod.PATCH),r.json()},mpn=async e=>{let t=`${bq.NOTE_BASE_URL}/api/v1/notes/${e}`;await T2(await d8(t,{method:`DELETE`}),X.StatusCode.NO_CONTENT,t,X.HTTPRequestMethod.DELETE)};function hpn(){let e=y0(),[t,n]=(0,H.useState)(``),[r,i]=(0,H.useState)(!1),[a,o]=(0,H.useState)(!1),s=(0,H.useRef)(null),c=(0,H.useRef)(``),l=(0,H.useRef)(null),u=(0,H.useRef)(t);u.current=t;let d=(0,H.useCallback)(async t=>{if(s.current===null){l.current=t,s.current=t,i(!0),o(!1);try{let r=await e.fetchQuery({queryKey:[`note`,t],queryFn:()=>fpn(t),staleTime:X.Milliseconds.Minute*5});s.current=r.id,c.current=r.body,n(r.body)}catch{s.current=null,o(!0)}finally{i(!1)}}},[e]),f=(0,H.useCallback)(()=>{let e=l.current;e&&d(e).catch(console.error)},[d]);return{noteBody:t,setNoteBody:n,displayImageUri:null,onImageSelected:()=>void 0,onImageRemoved:()=>void 0,loadNote:d,saveNote:(0,H.useCallback)(async()=>{let t=u.current;if(!t.trim())return s.current&&=(await mpn(s.current),e.removeQueries({queryKey:[`note`,s.current]}),null),null;if(s.current&&t===c.current)return s.current;if(s.current){let n=await ppn(s.current,{body:t});return e.setQueryData([`note`,n.id],n),s.current}let n=await dpn({body:t});return s.current=n.id,e.setQueryData([`note`,n.id],n),n.id},[e]),deleteNoteAndAssets:(0,H.useCallback)(async t=>{try{let n=await e.fetchQuery({queryKey:[`note`,t],queryFn:()=>fpn(t),staleTime:X.Milliseconds.Minute*5});for(let t of n.assetIds)await dfn(t).catch(console.error),e.removeQueries({queryKey:[`asset`,t]});await mpn(t),e.removeQueries({queryKey:[`note`,t]})}catch(e){console.error(`[useNotes::deleteNoteAndAssets] Failed:`,e)}},[e]),discardChanges:()=>Promise.resolve(),isLoading:r,loadFailed:a,retryLoad:f,hasNoteContent:(0,H.useMemo)(()=>!a&&t.trim().length>0,[t,a]),isNoteModified:(0,H.useMemo)(()=>t!==c.current,[t])}}var gpn={selectedEventUUID:null,activityDurationSeconds:0},a7=gq()(e=>({...gpn,activityStoreActions:{set:t=>{e(e=>({...e,...t}))},clear:()=>{e(gpn)}}})),_pn={product:`llu.android`,version:`4.16.0`,"cache-control":`no-cache`};r8t({headers:i8t(p4(),p4())});var vpn={headers:_pn,credentials:null,patientId:null,credentialsRetryAt:null};gq()(vq(e=>({...vpn,setHeaders(t){e({headers:t})},setCredentials(t){e({credentials:t})},setCredentialsRetryAt(t){e({credentialsRetryAt:t})},setPatientId(t){e({patientId:t})},clear:()=>{e(vpn)}}),{name:`LIBRE_AUTH_STORE`,storage:_q(Sq)}));var ypn={setupCalculatorSettings:{},totalDailyDosage:null},bpn=gq()(e=>({...ypn,setupCalculatorActions:{setSetupCalculatorStoreValues:t=>{e(e=>({setupCalculatorSettings:{...e.setupCalculatorSettings,...t}}))},setTotalDailyDosage:t=>{e({totalDailyDosage:t})},clear:()=>{e(ypn)}}})),o7=()=>bpn(e=>e.setupCalculatorActions),s7=()=>bpn(e=>e.setupCalculatorSettings),xpn=()=>bpn(e=>e.totalDailyDosage),Spn={privacyNoticeAccepted:!1,extraFoodItems:[],visualSearchId:null},c7=gq()(vq(e=>({...Spn,acceptPrivacyNotice:()=>{e({privacyNoticeAccepted:!0})},addExtraFoodItem:t=>{e(e=>{let n=e.extraFoodItems.findIndex(e=>e.foodItem.id===t.foodItem.id);return n===-1?{extraFoodItems:[...e.extraFoodItems,t]}:{extraFoodItems:e.extraFoodItems.map((e,r)=>r===n?t:e)}})},setVisualSearchId:t=>{e({visualSearchId:t})},clearExtraFoodItems:()=>{e({extraFoodItems:[]})},clearVisualSearchId:()=>{e({visualSearchId:null})},clear:()=>{e(Spn)}}),{name:`VISUAL_SEARCH_STORE`,storage:_q(Sq)})),l7=()=>{L5.getState().clear(),R5.getState().glucoseStoreActions.clear(),a7.getState().activityStoreActions.clear(),B5.getState().noteStoreActions.clear()},Cpn=()=>{let{t:e}=Tq(),{showDiscardCalculationModal:t,modalStoreActions:n,isGoToSettingsPressed:r}=z5(),{deleteNoteAndAssets:i}=hpn(),a=N$(),o=(0,H.useRef)(!1),s=(0,H.useCallback)(()=>{let e=B5.getState().noteId;e&&i(e).catch(console.error),l7(),o.current=!0,n.set({showDiscardCalculationModal:!1})},[i,n]),c=(0,H.useCallback)(()=>{o.current&&(o.current=!1,a.pop()),r&&((yvt||kq)&&a.reset({index:1,routes:[{name:Q.MainBottomTabs},{name:Q.SettingsStack,state:{routes:[{name:Q.Settings},{name:Q.ActivitySettings}],index:1}}]}),n.set({isGoToSettingsPressed:!1}))},[r,n,a]),l=(0,H.useMemo)(()=>[{testID:`discard-button`,title:e(`calcflow_modal_discard_cal_button`),type:H4.Error,onPress:s},{testID:`cancel-button`,title:e(`button_cancel`),type:H4.Secondary,onPress:()=>{n.set({showDiscardCalculationModal:!1,isGoToSettingsPressed:!1})}}],[s,n,e]);return(0,W.jsx)(u3,{testID:`discard_calculation_modal`,isVisible:t,title:e(`calcflow_modal_discard_cal_title`),onModalHide:c,buttons:l},`discard_calculation_modal`)};function wpn(e,t){let n=e3(e,t?.in),r=n.getFullYear(),i=n.getMonth(),a=$4(n,0);return a.setFullYear(r,i+1,0),a.setHours(0,0,0,0),a.getDate()}function Tpn(e,t,n){let r=e3(e,n?.in),i=r.getFullYear(),a=r.getDate(),o=$4(n?.in||e,0);o.setFullYear(i,t,15),o.setHours(0,0,0,0);let s=wpn(o);return r.setMonth(t,Math.min(a,s)),r}function Epn(e,t,n){let r=e3(e,n?.in);return isNaN(+r)?$4(n?.in||e,NaN):(t.year!=null&&r.setFullYear(t.year),t.month!=null&&(r=Tpn(r,t.month)),t.date!=null&&r.setDate(t.date),t.hours!=null&&r.setHours(t.hours),t.minutes!=null&&r.setMinutes(t.minutes),t.seconds!=null&&r.setSeconds(t.seconds),t.milliseconds!=null&&r.setMilliseconds(t.milliseconds),r)}function Dpn(e,t,n){return Yon(e,-t,n)}var u7=function(e){return e.Create=`Create`,e.Edit=`Edit`,e.Delete=`Delete`,e}({});function Opn(){let e=Epn(Dpn(new Date,4),{seconds:0,milliseconds:0});return K8.getLogbooks(e).map(e=>({uuid:e.uuid,time:e.entry_timestamp,insulinValue:e.insulin_entered_units?.toString()??``}))}function kpn(){let[e,t]=(0,H.useState)(Opn),[n,r]=(0,H.useState)(null),[i,a]=(0,H.useState)(!1),[o,s]=(0,H.useState)(`Create`),[c,l]=(0,H.useState)(void 0),u=(0,H.useCallback)(()=>{t(Opn())},[]);return(0,H.useEffect)(()=>{n&&u()},[n,u]),V$((0,H.useCallback)(()=>{u()},[u])),(0,H.useEffect)(()=>{q8.syncAll().catch(console.error).finally(()=>{u()})},[u]),{entries:e,animatedEntryId:n,isInfoModalVisible:i,setIsInfoModalVisible:a,registerInsulinAction:o,editingInsulinEntry:c,refresh:u,handleEditInsulinEntry:(0,H.useCallback)(t=>{let n=e.find(e=>e.uuid===t);n&&(s(`Edit`),l(n))},[e]),handleEntryAnimationFinished:(0,H.useCallback)(()=>{r(null)},[]),handleRegisterInsulinPressed:(0,H.useCallback)(()=>{s(`Create`),l(void 0)},[]),handleRegisterInsulinClose:(0,H.useCallback)(e=>{r(e||`deleted-${Date.now()}`)},[])}}if(!H.useState)throw Error(`mobx-react-lite requires React with Hooks support`);if(!yrn)throw Error(`mobx-react-lite@3 requires mobx at least version 6 to be available`);var d7=_();function Apn(e){e()}function jpn(e){e||=Apn,arn({reactionScheduler:e})}function Mpn(e){return srn(e)}var Npn=!1;function Ppn(){return Npn}var Fpn=1e4,Ipn=1e4,Lpn=function(){function e(e){var t=this;Object.defineProperty(this,"finalize",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"registrations",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"sweepTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sweep",{enumerable:!0,configurable:!0,writable:!0,value:function(e){e===void 0&&(e=Fpn),clearTimeout(t.sweepTimeout),t.sweepTimeout=void 0;var n=Date.now();t.registrations.forEach(function(r,i){n-r.registeredAt>=e&&(t.finalize(r.value),t.registrations.delete(i))}),t.registrations.size>0&&t.scheduleSweep()}}),Object.defineProperty(this,"finalizeAllImmediately",{enumerable:!0,configurable:!0,writable:!0,value:function(){t.sweep(0)}})}return Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){this.registrations.set(n,{value:t,registeredAt:Date.now()}),this.scheduleSweep()}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.registrations.delete(e)}}),Object.defineProperty(e.prototype,"scheduleSweep",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.sweepTimeout===void 0&&(this.sweepTimeout=setTimeout(this.sweep,Ipn))}}),e}(),Rpn=new(typeof FinalizationRegistry<`u`?FinalizationRegistry:Lpn)(function(e){var t;(t=e.reaction)==null||t.dispose(),e.reaction=null}),zpn=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.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),Bpn=s(((e,t)=>{t.exports=zpn()}))();function Vpn(e){e.reaction=new E6(`observer${e.name}`,function(){var t;e.stateVersion=Symbol(),(t=e.onStoreChange)==null||t.call(e)})}function Hpn(e,t){if(t===void 0&&(t=`observed`),Ppn())return e();var n=H.useRef(null);if(!n.current){var r={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:t,subscribe:function(e){return Rpn.unregister(r),r.onStoreChange=e,r.reaction||(Vpn(r),r.stateVersion=Symbol()),function(){var e;r.onStoreChange=null,(e=r.reaction)==null||e.dispose(),r.reaction=null}},getSnapshot:function(){return r.stateVersion}};n.current=r}var i=n.current;i.reaction||(Vpn(i),Rpn.register(n,i,i)),H.useDebugValue(i.reaction,Mpn),(0,Bpn.useSyncExternalStore)(i.subscribe,i.getSnapshot,i.getSnapshot);var a,o;if(i.reaction.track(function(){try{a=e()}catch(e){o=e}}),o)throw o;return a}var Upn=typeof Symbol==`function`&&Symbol.for,Wpn=Object.getOwnPropertyDescriptor(function(){},`name`)?.configurable??!1,Gpn=Upn?Symbol.for(`react.forward_ref`):typeof H.forwardRef==`function`&&(0,H.forwardRef)(function(e){return null}).$$typeof,Kpn=Upn?Symbol.for(`react.memo`):typeof H.memo==`function`&&(0,H.memo)(function(e){return null}).$$typeof;function f7(e,t){if(Kpn&&e.$$typeof===Kpn)throw Error("[mobx-react-lite] You are trying to use `observer` on a function component wrapped in either another `observer` or `React.memo`. The observer already applies 'React.memo' for you.");if(Ppn())return e;var n=t?.forwardRef??!1,r=e,i=e.displayName||e.name;if(Gpn&&e.$$typeof===Gpn&&(n=!0,r=e.render,typeof r!=`function`))throw Error("[mobx-react-lite] `render` property of ForwardRef was not a function");var a=function(e,t){return Hpn(function(){return r(e,t)},i)};return a.displayName=e.displayName,Wpn&&Object.defineProperty(a,"name",{value:e.name,writable:!0,configurable:!0}),e.contextTypes&&(a.contextTypes=e.contextTypes),n&&(a=(0,H.forwardRef)(a)),a=(0,H.memo)(a),Jpn(e,a),a}var qpn={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function Jpn(e,t){Object.keys(e).forEach(function(n){qpn[n]||Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}function Ypn(e){var t=e.children,n=e.render;t&&n&&console.error("MobX Observer: Do not use children and render in the same time in `Observer`");var r=t||n;return typeof r==`function`?Hpn(r):null}Ypn.displayName=`Observer`,jpn(d7.unstable_batchedUpdates),Rpn.finalizeAllImmediately,V();function Xpn(){return H.useEffect(()=>{console.warn(`DateTimePicker is not supported on: ${z.OS}`)},[]),null}var Zpn=Xpn;V();var p7=(e,t)=>{let n=e.indexOf(t);return n===-1?0:n},m7=(e,t)=>{let n=new Date(e);return n.setHours(t,0,0,0),{date:n,formatted:I8(n,`HH:mm`)}},h7=Array.from({length:60},(e,t)=>t.toString().padStart(2,`0`));function Qpn({isVisible:e,initialValue:t,min:n,max:r,onCancel:i,onConfirm:a,onModalHide:o}){let{COLORS:s}=J(),{width:c}=em(),l=(0,H.useRef)(null),u=(0,H.useRef)(null),[d,f]=(0,H.useState)(t),p=(0,H.useMemo)(()=>{if(!n||!r){let e=new Date;return Array.from({length:24},(t,n)=>m7(e,n))}let e=n.getHours(),t=r.getHours(),i=[];if(J9t(n,r)&&n<r&&e<=t)for(let r=e;r<=t;r++)i.push(m7(n,r));else{for(let t=e;t<24;t++)i.push(m7(n,t));for(let e=0;e<=t;e++)i.push(m7(r,e))}return i},[n,r]),m=(0,H.useMemo)(()=>p.map(e=>I8(e.date,`HH`)),[p]),h=(0,H.useMemo)(()=>{let[e]=I8(t,`HH:mm`).split(`:`);return p7(m,e)},[t,m]),g=(0,H.useMemo)(()=>{let[,e]=I8(t,`HH:mm`).split(`:`);return p7(h7,e)},[t]),_=(0,H.useMemo)(()=>{let[e]=I8(d,`HH:mm`).split(`:`);return p7(m,e)},[d,m]),v=(0,H.useMemo)(()=>{let[,e]=I8(d,`HH:mm`).split(`:`);return p7(h7,e)},[d]),y=(0,H.useMemo)(()=>n?p7(m,I8(n,`HH`)):null,[n,m]),b=(0,H.useMemo)(()=>r?p7(m,I8(r,`HH`)):null,[r,m]),x=(0,H.useMemo)(()=>n?parseInt(I8(n,`mm`),10):null,[n]),S=(0,H.useMemo)(()=>r?parseInt(I8(r,`mm`),10):null,[r]),C=(0,H.useCallback)((e,t)=>{let n=e<0||e>=m.length,r=t<0||t>=h7.length;if(n||r)return;let i=p[e].date;f(Epn(i,{minutes:parseInt(h7[t],10),seconds:0,milliseconds:0}))},[m.length,p]),w=(0,H.useCallback)(e=>{u.current?.scrollToIndex(e)},[]),T=(0,H.useCallback)(e=>{if(b===null||y===null||S===null||x===null){C(e,v);return}let t=v;if(e===y&&v<x){t=x,w(x),C(e,t);return}if(e===b&&v>S){t=S,w(S),C(e,t);return}C(e,v)},[b,y,S,x,v,C,w]),E=(0,H.useCallback)(e=>{if(b===null||y===null||S===null||x===null){C(_,e);return}let t=e;if(_===y&&e<x){t=x,w(x),C(_,t);return}if(_===b&&e>S){t=S,w(S),C(_,t);return}C(_,t)},[b,S,y,x,_,C,w]),D=(0,H.useCallback)(()=>{a(d)},[a,d]),O=(0,H.useCallback)(()=>{f(t),i()},[i,t]);return(0,W.jsx)(u3,{isVisible:e,containerStyle:{backgroundColor:s.bgTransparent},onModalHide:o,children:(0,W.jsxs)(B,{children:[(0,W.jsxs)(B,{style:g7.pickersContainer,children:[(0,W.jsx)(Z5,{ref:l,initialScrollIndex:h,options:m,onChange:T,containerStyle:[g7.itemContainerLeft,{width:(c-32)/2}],selectedIndicatorStyle:[g7.selectedIndicatorLeft,{width:(c-32)/2-10}],itemStyle:g7.itemLeft,testID:`hours-wheel-picker`},`hours-wheel-picker`),(0,W.jsx)(Z5,{ref:u,initialScrollIndex:g,options:h7,onChange:E,containerStyle:[g7.itemContainerRight,{width:(c-32)/2}],selectedIndicatorStyle:[g7.selectedIndicatorRight,{width:(c-32)/2-10}],itemStyle:g7.itemRight,testID:`minutes-wheel-picker`},`minutes-wheel-picker`)]}),(0,W.jsxs)(B,{style:g7.buttonContainer,children:[(0,W.jsx)(X5,{onPress:D}),(0,W.jsx)(Y5,{onPress:O})]})]})})}var $pn=H.memo(Qpn),g7=R.create({buttonContainer:{gap:8},pickersContainer:{flexDirection:`row`,borderTopLeftRadius:13,borderTopRightRadius:13,overflow:`hidden`},itemContainerLeft:{borderTopRightRadius:0,paddingLeft:16},itemContainerRight:{borderTopLeftRadius:0,paddingRight:16},itemLeft:{alignSelf:`flex-end`,marginRight:16},itemRight:{alignSelf:`flex-start`,marginLeft:16},selectedIndicatorRight:{alignSelf:`flex-start`,borderTopLeftRadius:0,borderBottomLeftRadius:0},selectedIndicatorLeft:{alignSelf:`flex-end`,borderTopRightRadius:0,borderBottomRightRadius:0}}),emn=({onPress:e})=>(0,W.jsx)(X5,{onPress:e}),tmn=({onPress:e})=>(0,W.jsx)(Y5,{onPress:e}),nmn=.5,rmn=e=>{switch(e){case X.InjectionMethod.PenWhole:return a3(X.CONSTANTS.INSULIN_DOSE_MIN,X.CONSTANTS.INSULIN_DOSE_MAX);case X.InjectionMethod.PenHalf:return q9t(X.CONSTANTS.INSULIN_DOSE_MIN,X.CONSTANTS.INSULIN_DOSE_MAX,nmn);case X.InjectionMethod.Pump:return o3(X.CONSTANTS.INSULIN_DOSE_MIN,X.CONSTANTS.INSULIN_DOSE_MAX);default:throw Error(`[insulin::getInsulinInputSequentialArray] Unsupported injection method!`)}},imn=e=>{switch(e){case X.InjectionMethod.PenWhole:return 0;case X.InjectionMethod.PenHalf:return 1;case X.InjectionMethod.Pump:return 1;default:throw Error(`[insulin::getInsulinInputDecimalPlaces] Unsupported injection method!`)}};V(),Z0();function amn({action:e=u7.Create,insulinEntry:t,onClose:n}){let{t:r}=Tq(),{COLORS:i,isDark:a,effectiveColorScheme:o}=J(),{bottom:s}=W0(),[c,l]=(0,H.useState)(!1),[u,d]=(0,H.useState)(t?.insulinValue),[f,p]=(0,H.useState)(!1),[m,h]=(0,H.useState)(t?.time),[g,_]=(0,H.useState)(),[v,y]=(0,H.useState)(!1),[b,x]=(0,H.useState)(!1),S=(0,H.useRef)(!1),{initialInsulinValue:C,initialDate:w}=(0,H.useMemo)(()=>({initialInsulinValue:t?.insulinValue,initialDate:t?.time}),[t]),T=(0,H.useCallback)(()=>{l(!0)},[]);(0,H.useEffect)(()=>{e===u7.Create&&setTimeout(()=>{T()},300),d(t?.insulinValue),h(t?.time)},[e,T,t]);let E=k8.injectionMethod;if(E===void 0)throw Error(`[RegisterActiveInsulin::render] injectionMethod is undefined`);let D=(0,H.useMemo)(()=>rmn(E),[E]),O=(0,H.useCallback)(async()=>{try{if(!u||!m){console.error(`[RegisterActiveInsulin::handleConfirm] insulinValue or date is undefined`),y(!0);return}let r=e===u7.Create,i=r?dsn({entry_timestamp:m,insulin_entered_units:parseFloat(u)}):{...K8.getLogbookByUUID(t.uuid),entry_timestamp:m,insulin_entered_units:parseFloat(u)};if(!await K8.addLogbook(i,r?void 0:t.uuid)){y(!0);return}n(i.uuid)}catch(e){console.error(`[RegisterActiveInsulin::handleConfirm] Error saving insulin entry:`,e),y(!0)}},[m,u,e,t,n]),k=(0,H.useCallback)(async()=>{try{if(!t)return;await K8.deleteLogbook(t.uuid)?n():y(!0)}catch(e){console.error(`[RegisterActiveInsulin::deleteInsulinEntry] Error deleting insulin entry:`,e),y(!0)}},[t,n]),A=(0,H.useCallback)(()=>{S.current=!0,x(!1)},[]),ee=(0,H.useCallback)(()=>{S.current&&(S.current=!1,k().catch(console.error))},[k]),te=(0,H.useCallback)(()=>{p(!0)},[]),ne=(0,H.useCallback)(e=>{let t=new Date,n=R9t(e,{start:Epn(Dpn(t,4),{seconds:0,milliseconds:0}),end:t})?void 0:r(`error_insulin_intake_hint`);h(e),_(n),p(!1)},[r]),re=(0,H.useCallback)(()=>{p(!1)},[]),ie=(0,H.useCallback)(e=>{d(e.toString()),l(!1)},[]),j=(0,H.useMemo)(()=>{if(!u)return 0;let e=imn(E);return D.findIndex(t=>t===parseFloat(u).toFixed(e))},[u,D,E]);function ae(){return(0,W.jsxs)(B,{style:_7.header,children:[(0,W.jsx)(U5,{onPress:n}),(0,W.jsx)(Z,{style:_7.headerTitle,numberOfLines:1,ellipsizeMode:`middle`,children:r(`register_insulin_title`,{timeFourHour:I8(Dpn(new Date,4),`HH:mm`)})}),(0,W.jsx)(W5,{onPress:O,disabled:!m||!u||!!g||w===m&&C===u})]})}function oe(){return(0,W.jsx)(B,{style:[_7.setTimeButton,{backgroundColor:i.bgPill}],children:(0,W.jsx)(Z,{style:[_7.setTimeText,{color:i.labelPrimary},f&&{color:i.textLink},!!g&&{color:i.textInputDanger}],children:m?I8(m,`HH:mm`):r(`register_insulin_time_button_unit`)})})}return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(ae,{}),(0,W.jsxs)(fs,{contentContainerStyle:_7.contentContainer,children:[(0,W.jsxs)(B,{style:_7.screen,children:[(0,W.jsx)(Y4,{title:r(`register_insulin_input_title`),testID:`insulin-input`,onPress:T,renderRightSlot:()=>(0,W.jsxs)(B,{style:_7.insulinRightSlot,children:[(0,W.jsx)(Z,{style:[_7.insulinText,{color:i.labelPrimary}],children:u}),(0,W.jsx)(Z,{style:[_7.unitsText,{color:i.labelPrimary}],children:r(u&&parseFloat(u)===1?`unit`:`units`)})]}),style:c?{borderColor:i.borderInputFocus}:void 0}),(0,W.jsx)(B4,{isAnimated:!!g,children:(0,W.jsx)(Y4,{renderLeftSlot:()=>(0,W.jsx)(Z,{children:r(`register_insulin_time_input_title`)}),testID:`time-input`,errorMessage:g,onPress:te,renderRightSlot:oe,style:f?{flexWrap:`wrap`,paddingVertical:8,borderColor:i.borderInputFocus}:_7.rowInsulin})})]}),e===u7.Edit&&(0,W.jsx)(U4,{title:r(`button_delete`),onPress:()=>{x(!0)},type:H4.Error})]}),(0,W.jsx)(Q5,{isVisible:c,items:D,onConfirm:ie,onCancel:()=>{l(!1)},initialScrollIndex:j,testID:`insulin-wheel-picker`}),kq?(0,W.jsx)(Zpn,{testID:`date-time-picker`,isVisible:f,display:`spinner`,date:m??new Date,mode:new Date().getHours()>=4?`time`:`datetime`,minimumDate:new Date(1900,0,1),maximumDate:new Date,onConfirm:ne,onCancel:re,customConfirmButtonIOS:emn,customCancelButtonIOS:tmn,pickerContainerStyleIOS:{backgroundColor:i.iosKeyboardPicker},themeVariant:o,isDarkModeEnabled:a,pickerStyleIOS:_7.alignCenter,modalStyleIOS:{paddingBottom:s},is24Hour:!0,locale:`en_GB`}):(0,W.jsx)($pn,{isVisible:f,initialValue:m??new Date,onConfirm:ne,onCancel:re}),(0,W.jsx)(u3,{isVisible:b,onModalHide:ee,title:r(`register_insulin_modal_title`),message:r(`register_insulin_modal_body`),buttons:[{title:r(`button_delete`),testID:`confirm_delete`,type:H4.Error,onPress:A},{title:r(`button_cancel`),type:H4.Secondary,onPress:()=>{x(!1)}}]}),(0,W.jsx)(u3,{isVisible:v,title:r(`glucose_modal_changes_title`),message:r(`glucose_modal_changes_body`),buttons:[{title:r(`glucose_modal_changes_button_confirm`),onPress:()=>{y(!1)}}]})]})}var omn=f7(amn),_7=R.create({header:{width:`100%`,flexDirection:`row`,justifyContent:`space-between`,alignItems:`center`,paddingHorizontal:16,paddingBottom:12},headerTitle:{...Y.Poppins.medium_Base,flex:1,textAlign:`center`,marginHorizontal:8},contentContainer:{flex:1,paddingHorizontal:16,paddingTop:32,paddingBottom:440,gap:24},screen:{gap:16},rowInsulin:{flexWrap:`wrap`,paddingVertical:8},insulinRightSlot:{flexDirection:`row`,flex:1,alignItems:`center`,marginRight:8},setTimeButton:{borderRadius:16,paddingHorizontal:12,paddingVertical:8},setTimeText:{...Y.Poppins.medium_Base},insulinText:{...Y.Poppins.medium_Base,marginRight:4},unitsText:{...Y.Poppins.medium_Base},alignCenter:{alignSelf:`center`}});V();function smn({entriesCount:e,onInfoPress:t}){let{t:n}=Tq(),{COLORS:r}=J(),i=e>0;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(B,{style:v7.iconContainer,children:[(0,W.jsx)(r9t,{}),(0,W.jsx)(wp,{testID:`info-button`,style:v7.infoIconButton,onPress:t,children:(0,W.jsx)(n9t,{height:32,width:32,color:r.iconBrand})})]}),(0,W.jsx)(Z,{style:v7.title,children:n(i?`Recent_insulin_title`:`Recent_insulin_empty_title`)}),(0,W.jsx)(Z,{style:[v7.subtitle,v7.headerSubtitle,{color:r.labelSecondary}],children:n(i?`recent_insulin_body`:`Recent_insulin_empty_body`)})]})}function cmn(){return(0,W.jsx)(B,{style:v7.separatorList})}var v7=R.create({iconContainer:{marginBottom:16},title:{...Y.Poppins.semiBold_2XL,marginBottom:8},subtitle:{...Y.Poppins.regular_SM},headerSubtitle:{marginBottom:48},infoIconButton:{position:`absolute`,right:0},separatorList:{height:8}});V(),Z0();function lmn({onNoInsulinPressed:e}){let{t}=Tq(),{COLORS:n}=J(),{entries:r,animatedEntryId:i,isInfoModalVisible:a,setIsInfoModalVisible:o,registerInsulinAction:s,editingInsulinEntry:c,handleEditInsulinEntry:l,handleEntryAnimationFinished:u,handleRegisterInsulinPressed:d,handleRegisterInsulinClose:f}=kpn(),p=(0,H.useRef)(null),m=(0,H.useCallback)(()=>{u8(l8.RecentInsulinRegisterPress),d(),p.current?.present()},[d]),h=(0,H.useCallback)(e=>{f(e),p.current?.close()},[f]),g=(0,H.useCallback)(e=>{l(e),p.current?.present()},[l]);return(0,W.jsxs)(X0,{edges:[`bottom`],children:[(0,W.jsx)(Wc,{testID:`active_insulin_list`,data:r,keyExtractor:e=>e.uuid,contentContainerStyle:y7.contentContainer,ListHeaderComponent:()=>(0,W.jsx)(smn,{entriesCount:r.length,onInfoPress:()=>{o(!0)}}),ListHeaderComponentStyle:void 0,renderItem:({item:e,index:n})=>{let r=parseFloat(e.insulinValue)===1?t(`unit`):t(`units`);return(0,W.jsx)(I7t,{isAnimated:i===e.uuid,onAnimationFinished:u,children:(0,W.jsx)(Y4,{title:I8(e.time,`HH:mm`),onPress:()=>{g(e.uuid)},testID:`entry-${n}`,renderRightSlot:()=>(0,W.jsxs)(B,{style:y7.rightSlot,children:[(0,W.jsx)(Z,{style:y7.insulinValueText,children:`${e.insulinValue} ${r}`}),(0,W.jsx)(K4,{})]})})})},ItemSeparatorComponent:cmn,ListFooterComponent:()=>(0,W.jsxs)(B,{style:y7.buttonsWrapper,children:[(0,W.jsx)(U4,{title:r.length>0?t(`recent_insulin_button_add`):t(`recent_insulin_empty_button_add`),onPress:m,testID:`register-insulin-button`,type:r.length>0?H4.Secondary:H4.Primary}),(0,W.jsx)(U4,{title:r.length>0?t(`Recent_insulin_button_continue`):t(`recent_insulin_empty_button_continue`),type:r.length>0?H4.Primary:H4.Secondary,onPress:e})]}),ListFooterComponentStyle:y7.footer}),(0,W.jsx)(_$,{ref:p,handleIndicatorStyle:{height:0},backdropComponent:V4,backgroundStyle:{backgroundColor:n.bgSheet,borderRadius:36},stackBehavior:`push`,enablePanDownToClose:!1,children:(0,W.jsx)(y$,{children:(0,W.jsx)(omn,{action:s,insulinEntry:c,onClose:h})})}),(0,W.jsx)(u3,{isVisible:a,onRequestClose:()=>{o(!1)},title:t(`Recent_insulin_modal_title`),message:t(`Recent_insulin_modal_body`),buttons:[{title:t(`button_close`),onPress:()=>{o(!1)}}]},`recent_insulin_info`)]})}var y7=R.create({contentContainer:{paddingHorizontal:16,paddingBottom:16},footer:{paddingTop:48},buttonsWrapper:{gap:8},rightSlot:{flexDirection:`row`,alignItems:`center`},insulinValueText:{...Y.Poppins.regular_Base,marginRight:16}}),b7=()=>R5(e=>e.selectedReadingId&&e.availableGlucoseReadings.find(t=>t.id===e.selectedReadingId)||null),umn=e=>R5(t=>t.availableGlucoseReadings.find(t=>t.source===e)||null),dmn=()=>({fetchLibreCgmData:()=>Promise.resolve()});V();var fmn={top:16,bottom:16,left:16,right:16};function pmn({activity:e,isChecked:t,index:n=0,onEdit:r,toggleActivitySwitch:i}){let{t:a}=Tq(),{COLORS:o}=J();if(!k8.activity)throw Error(`[ActivityCard::render] No settings found!`);if(!k8.glucoseUnit)throw Error(`[ActivityCard::render] No glucose unit found!`);let{activityIntensity:s,durationSeconds:c,startTimestamp:l,type:u,uuid:d}=e;if(!l)throw Error(`[ActivityCard::render] No startTimestamp!`);let f=s?R8[s]():null,p=(0,H.useMemo)(()=>Math.round(c/60),[c]),[m,h]=(0,H.useState)(esn(l,p)),g=(0,H.useMemo)(()=>{try{let e=k8.activity;if(!e)throw Error(`[ActivityCard::reduction] No settings found!`);return((0,b8.getReduction)(p,e,s,new Date(l))*100).toFixed(0)}catch(e){return console.error(`Error calculating reduction for activity`,e),null}},[s,p,l]),_=t?1:.5,v=`activity-${p}-${s}-${u}-${t}`.toLowerCase(),y=`activity-card-${n}`;return(0,H.useEffect)(()=>{let e=()=>setInterval(()=>{h(esn(l,p))},X.Milliseconds.Minute),n=e=>{e&&clearInterval(e)},r=t?e():null;return()=>{n(r)}},[t,l,p]),g===null?null:(0,W.jsxs)(wp,{testID:v,style:[x7.card,{backgroundColor:o.bgSecondary}],onPress:()=>{r(d)},children:[(0,W.jsxs)(B,{style:x7.headerContainer,children:[(0,W.jsxs)(B,{style:x7.left,children:[(0,W.jsxs)(B,{style:[x7.headerContent,{opacity:_}],children:[(0,W.jsx)(W7t,{height:24,width:24,color:o.iconButtonSecondary}),(0,W.jsxs)(Z,{style:x7.header,children:[`${$on(p)} ${a(`activity_card__active_min`)}`,f&&`, `+f]})]}),(0,W.jsxs)(Z,{style:[x7.expiresIn,{color:o.labelSecondary,opacity:_}],children:[a(`activity_card_active_time`),` `,m]})]}),(0,W.jsx)(wp,{onPress:()=>{i(d)},hitSlop:fmn,children:(0,W.jsx)(Np,{testID:`${y}-${t}`,value:t,onValueChange:()=>{i(d)},trackColor:{true:o.bgSliderForeground,false:o.bgSliderBackground},thumbColor:o.toggleKnob,activeThumbColor:o.toggleKnob,activeTrackColor:o.bgSliderForeground})})]}),!!g&&(0,W.jsxs)(B,{style:[x7.reduction,{opacity:_}],children:[(0,W.jsx)(Z,{style:x7.reductionText,children:a(`activity_card_insulinReduction`)}),(0,W.jsx)(Z,{style:x7.reductionValue,children:` ${g}%`})]})]})}var x7=R.create({card:{marginBottom:12,overflow:`hidden`,borderRadius:16,padding:16},headerContainer:{flexDirection:`row`,justifyContent:`space-between`},left:{flex:1},headerContent:{flexDirection:`row`,alignItems:`center`,gap:4},header:{...Y.Poppins.regular_SM},expiresIn:{...Y.Poppins.regular_XS,marginBottom:8},reduction:{flexDirection:`row`,alignItems:`baseline`,justifyContent:`space-between`,gap:8},reductionText:{...Y.Poppins.regular_SM,flexShrink:1},reductionValue:{...Y.Poppins.bold_2XL}});V();var mmn=({selectedActivity:e,onClose:t})=>{let{t:n}=Tq(),{COLORS:r}=J(),{navigate:i}=N$(),{activityStoreActions:a}=a7(),{modalStoreActions:o,isGoToSettingsPressed:s}=z5(),[c,l]=(0,H.useState)(!1),{activity:u}=k8;if(u===void 0)throw Error(`[CreateActivity::render] activitySettings is undefined`);let d=(0,H.useMemo)(()=>({uuid:i3(),startTimestamp:null,deleted:!1,type:null,activityIntensity:null,durationSeconds:0}),[]),f=(0,H.useMemo)(()=>e??d,[d,e]),p=(0,H.useMemo)(()=>f.startTimestamp===null?null:new Date(f.startTimestamp).getTime()+f.durationSeconds*X.Milliseconds.Second>Date.now()?0:1,[f]),[m,h]=(0,H.useState)(f),[g,_]=(0,H.useState)(p),v=(0,H.useMemo)(()=>g===null?!1:g===1?m.durationSeconds>0&&!!m.startTimestamp:m.durationSeconds>0&&!!m.activityIntensity&&!!m.startTimestamp,[m,g]),y=(0,H.useMemo)(()=>!s3(m,f),[m,f]),b=(0,H.useCallback)(async()=>{let n=e?.uuid,r=n?{...m,uuid:i3()}:m;if(await S8.create(r,n)){let e=S8.getEventWithHighestReduction(u);a.set({selectedEventUUID:e?.uuid??r.uuid,activityDurationSeconds:e?.durationSeconds??0}),u8(n?l8.ActivityEditPress:l8.ActivityAddPress),t()}else o.set({showSyncErrorModal:!0})},[m,u,a,o,t,e?.uuid]),x=e=>{h(t=>({...t,...e}))},S=e=>{let t=e*60,n=Date.now()-(g===1?t*X.Milliseconds.Second:0);x({durationSeconds:t,startTimestamp:new Date(n).toISOString()})},C=e=>{x({activityIntensity:X.ActivityIntensity[e]})},w=()=>{_(0),m.durationSeconds!==0&&x({startTimestamp:new Date().toISOString()})},T=()=>{_(1),x({activityIntensity:null}),m.durationSeconds!==0&&x({startTimestamp:new Date(Date.now()-m.durationSeconds*X.Milliseconds.Second).toISOString()})},E=()=>{x({durationSeconds:0,activityIntensity:null})},D=()=>{E(),o.set({isGoToSettingsPressed:!0})},O=()=>{s&&(t(),o.set({showDiscardCalculationModal:!Oq}),Oq&&(i(Q.SettingsStack,{screen:Q.ActivitySettings}),o.set({isGoToSettingsPressed:!1})))},k=(0,H.useMemo)(()=>Math.round(m.durationSeconds/60),[m.durationSeconds]),A=(0,H.useMemo)(()=>{if(!v)return!1;let{activityIntensity:e}=m,{hard:t,light:n,moderate:r,post:i}=u,a=g===0;if(g===1)return k===120?i.fromSixtyone!==null:!0;if(a){if(k===60&&e===X.ActivityIntensity.hard)return t.fromFortysix!==null;if(k===120&&e===X.ActivityIntensity.hard)return t.fromSixtyone!==null;if(k===120&&e===X.ActivityIntensity.moderate)return r.fromSixtyone!==null;if(k===120&&e===X.ActivityIntensity.light)return n.fromSixtyone!==null}return!0},[m,u,g,v,k]);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(GUt,{testID:`create-activity-scroll-view`,style:[S7.container,{backgroundColor:r.bgSheet}],contentContainerStyle:S7.contentContainer,children:[(0,W.jsxs)(B,{style:S7.header,children:[(0,W.jsx)(U5,{onPress:t}),(0,W.jsx)(W5,{onPress:b,disabled:!v||!y})]}),(0,W.jsxs)(B,{style:S7.cardMandatory,children:[(0,W.jsxs)(B,{children:[(0,W.jsx)(Z,{style:[S7.headerTitle,{color:r.labelSecondary}],children:n(`new_activity_when_title`)}),(0,W.jsxs)(B,{style:[S7.segmentContainer,{backgroundColor:r.bgSegmentContainer,borderColor:r.buttonBorder}],children:[(0,W.jsx)(wp,{style:[S7.segment,g===0&&{backgroundColor:r.bgSegmentPrimary}],onPress:w,testID:`starting-now-touchable-${g===0}`,children:(0,W.jsx)(Z,{style:[S7.value,{color:g===0?r.textLabelActive:r.textLabelInactive}],children:n(`new_activity_when_option1`)})}),(0,W.jsx)(B,{style:[S7.borderLeft,{backgroundColor:r.divider}]}),(0,W.jsx)(wp,{style:[S7.segment,g===1&&{backgroundColor:r.bgSegmentPrimary}],onPress:T,testID:`just-finished-now-touchable-${g===1}`,children:(0,W.jsx)(Z,{style:[S7.value,{color:g===1?r.textLabelActive:r.textLabelInactive}],children:n(`new_activity_when_option2`)})})]})]}),(0,W.jsxs)(B,{children:[(0,W.jsx)(Z,{style:[S7.headerTitle,{color:r.labelSecondary}],children:n(`new_activity_duration_title`)}),(0,W.jsxs)(B,{style:[S7.segmentContainer,{backgroundColor:r.bgSegmentContainer,borderColor:r.buttonBorder}],children:[(0,W.jsx)(wp,{style:[S7.segment,k===29&&{backgroundColor:r.bgSegmentPrimary}],onPress:()=>{S(29)},children:(0,W.jsx)(Z,{style:[S7.value,{color:k===29?r.textLabelActive:r.textLabelInactive}],children:`0-29`})}),(0,W.jsx)(B,{style:[S7.borderLeft,{backgroundColor:r.divider}]}),(0,W.jsx)(wp,{style:[S7.segment,k===45&&{backgroundColor:r.bgSegmentPrimary}],onPress:()=>{S(45)},children:(0,W.jsx)(Z,{style:[S7.value,{color:k===45?r.textLabelActive:r.textLabelInactive}],children:`30-45`})}),(0,W.jsx)(B,{style:[S7.borderLeft,{backgroundColor:r.divider}]}),(0,W.jsx)(wp,{style:[S7.segment,k===60&&{backgroundColor:r.bgSegmentPrimary}],onPress:()=>{S(60)},children:(0,W.jsx)(Z,{style:[S7.value,{color:k===60?r.textLabelActive:r.textLabelInactive}],children:`46-60`})}),(0,W.jsx)(B,{style:[S7.borderLeft,{backgroundColor:r.divider}]}),(0,W.jsx)(wp,{style:[S7.segment,k===120&&{backgroundColor:r.bgSegmentPrimary}],onPress:()=>{S(120)},children:(0,W.jsx)(Z,{style:[S7.value,{color:k===120?r.textLabelActive:r.textLabelInactive}],children:`61-120`})})]})]}),(0,W.jsxs)(B,{style:{opacity:g===1?.5:1},children:[(0,W.jsxs)(B,{style:{flexDirection:`row`,justifyContent:`space-between`},children:[(0,W.jsx)(Z,{style:[S7.headerTitle,{color:r.labelSecondary}],children:n(`new_activity_intensity_title`)}),(0,W.jsx)(wp,{onPress:()=>{g!==1&&l(!0)},children:(0,W.jsx)(n9t,{width:24,height:24,color:r.iconBrand})})]}),(0,W.jsxs)(B,{style:[S7.segmentContainer,{backgroundColor:r.bgSegmentContainer,borderColor:r.buttonBorder}],children:[(0,W.jsx)(wp,{style:[S7.segment,m.activityIntensity===X.ActivityIntensity.light&&{backgroundColor:r.bgSegmentPrimary}],onPress:()=>{g!==1&&C(X.ActivityIntensity.light)},testID:`activity-light-touchable-${m.activityIntensity===X.ActivityIntensity.light}`,children:(0,W.jsx)(Z,{style:[S7.value,{color:m.activityIntensity===X.ActivityIntensity.light?r.textLabelActive:r.textLabelInactive}],maxFontSizeMultiplier:C2.s2,children:n(`activity_intensity_1`)})}),(0,W.jsx)(B,{style:[S7.borderLeft,{backgroundColor:r.divider}]}),(0,W.jsx)(wp,{style:[S7.segment,m.activityIntensity===X.ActivityIntensity.moderate&&{backgroundColor:r.bgSegmentPrimary}],onPress:()=>{g!==1&&C(X.ActivityIntensity.moderate)},testID:`activity-moderate-touchable-${m.activityIntensity===X.ActivityIntensity.moderate}`,children:(0,W.jsx)(Z,{style:[S7.value,{color:m.activityIntensity===X.ActivityIntensity.moderate?r.textLabelActive:r.textLabelInactive}],maxFontSizeMultiplier:C2.s2,children:n(`activity_intensity_2`)})}),(0,W.jsx)(B,{style:[S7.borderLeft,{backgroundColor:r.divider}]}),(0,W.jsx)(wp,{style:[S7.segment,m.activityIntensity===X.ActivityIntensity.hard&&{backgroundColor:r.bgSegmentPrimary}],onPress:()=>{g!==1&&C(X.ActivityIntensity.hard)},testID:`activity-hard-touchable-${m.activityIntensity===X.ActivityIntensity.hard}`,children:(0,W.jsx)(Z,{style:[S7.value,{color:m.activityIntensity===X.ActivityIntensity.hard?r.textLabelActive:r.textLabelInactive}],maxFontSizeMultiplier:C2.s2,children:n(`activity_intensity_3`)})})]})]})]})]}),(0,W.jsx)(t7,{}),(0,W.jsx)(u3,{isVisible:!A&&v,title:n(`new_activity_modal_reduction_title`),message:n(`new_activity_modal_reduction_subtitle`),onModalHide:O,buttons:[{title:n(`button_settings`),testID:`settings-button`,onPress:D},{title:n(`button_cancel`),testID:`cancel-button`,onPress:E,type:H4.Secondary}]}),(0,W.jsxs)(u3,{isVisible:c,title:n(`calcflow_activityInfo_modal_title`),buttons:[{title:n(`button_close`),onPress:()=>{l(!1)}}],children:[(0,W.jsx)(Z,{style:S7.intensityDescriptionTitle,children:n(`calcflow_activityInfo_modal_intensity1_title`)}),(0,W.jsx)(Z,{style:[S7.intensityDescriptionText,{color:r.labelSecondary}],children:n(`calcflow_activityInfo_modal_intensity1_body`)}),(0,W.jsx)(Z,{style:S7.intensityDescriptionTitle,children:n(`calcflow_activityInfo_modal_intensity2_title`)}),(0,W.jsx)(Z,{style:[S7.intensityDescriptionText,{color:r.labelSecondary}],children:n(`calcflow_activityInfo_modal_intensity2_body`)}),(0,W.jsx)(Z,{style:S7.intensityDescriptionTitle,children:n(`calcflow_activityInfo_modal_intensity3_title`)}),(0,W.jsx)(Z,{style:[S7.intensityDescriptionText,{color:r.labelSecondary}],children:n(`calcflow_activityInfo_modal_intensity3_body`)})]})]})},S7=R.create({container:{marginHorizontal:16},contentContainer:{paddingBottom:64},header:{flexDirection:`row`,justifyContent:`space-between`,marginBottom:32},cardMandatory:{gap:24},headerTitle:{...Y.Poppins.regular_SM,marginHorizontal:16,marginBottom:8},segmentContainer:{flexDirection:`row`,justifyContent:`center`,alignItems:`center`,borderRadius:16,borderWidth:1,padding:2},segment:{flex:1,flexDirection:`row`,justifyContent:`center`,alignItems:`center`,alignSelf:`stretch`,paddingVertical:4,paddingHorizontal:10,borderRadius:16},borderLeft:{alignSelf:`center`,height:16,width:1},value:{...Y.Poppins.regular_Base},intensityDescriptionTitle:{...Y.Poppins.semiBold_Base,marginTop:16},intensityDescriptionText:{...Y.Poppins.regular_Base}}),hmn=f7(mmn);V();var gmn=()=>{let{t:e}=Tq(),{COLORS:t}=J(),{addListener:n,removeListener:r}=N$(),i=(0,H.useRef)(null),a=(0,H.useRef)(!1),{activity:o}=k8,{selectedEventUUID:s,activityStoreActions:c}=a7(),[l,u]=(0,H.useState)(null),[d,f]=(0,H.useState)([]);(0,H.useEffect)(()=>{if(!a.current){let e=S8.getEventWithHighestReduction(o);c.set({selectedEventUUID:e?.uuid??null,activityDurationSeconds:e?.durationSeconds??0}),a.current=!0}},[o,c]);let p=()=>{f(S8.getActiveEvents())};(0,H.useEffect)(()=>{let e=Sf.addEventListener(`change`,e=>{e===`active`&&p()});return n(`focus`,p),()=>{r(`focus`,p),e.remove()}},[r,n]);let m=(0,H.useCallback)(e=>{let t=S8.getByUUID(e);c.set({selectedEventUUID:s===e?null:e,activityDurationSeconds:s===e?0:t.durationSeconds})},[c,s]),h=()=>{u8(l8.CalculationActivityPress),Tf.dismiss(),i.current?.present()},g=e=>{u(S8.getByUUID(e)),h()};return(0,W.jsxs)(W.Fragment,{children:[d.map((e,t)=>(0,W.jsx)(pmn,{index:t,toggleActivitySwitch:m,isChecked:s===e.uuid,onEdit:g,activity:e},e.uuid)),(0,W.jsxs)(wp,{testID:`add-activity-button`,onPress:h,style:({pressed:e})=>[_mn.smallButton,{backgroundColor:t.bgButtonSecondary,opacity:e?.5:1}],children:[(0,W.jsx)(W7t,{color:t.iconButtonSecondary}),(0,W.jsx)(Z,{style:_mn.buttonText,children:e(`calcflow_activity_button_add`)})]}),(0,W.jsx)(B,{style:{height:24,borderTopWidth:1,borderTopColor:t.divider}}),(0,W.jsx)(_$,{ref:i,handleIndicatorStyle:{height:0},backdropComponent:V4,backgroundStyle:{backgroundColor:t.bgSheet,borderRadius:36},enablePanDownToClose:!1,children:(0,W.jsx)(hmn,{selectedActivity:l,onClose:()=>{u(null),i.current?.close(),p()}})})]})},_mn=R.create({smallButton:{flexDirection:`row`,alignSelf:`flex-start`,alignItems:`center`,borderRadius:16,paddingHorizontal:16,paddingVertical:8,marginBottom:24,gap:8},buttonText:{...Y.Poppins.medium_SM,alignSelf:`center`}});V();var vmn=()=>{let{COLORS:e}=J(),{navigate:t}=N$(),{foodIntakeItems:n,removeFoodIntakeItem:r}=L5(),i=(0,H.useCallback)((e,t)=>{e?r(e,`id`):r(t,`title`)},[r]),a=(0,H.useCallback)(e=>{if(e.source===`curated`){t(Q.FoodLibrary,{screen:Q.CuratedFoodItem,params:{foodId:e.id,categoryId:e.categoryId}});return}t(Q.FoodLibrary,{screen:Q.PersonalFoodItem,params:{foodId:e.id}})},[t]),o=(0,H.useCallback)(({item:t,index:n,itemKey:r})=>{let{measures:o,nutritionPer100g:s,id:c,title:l}=t.foodItem,u=C8(t.amount,o[0].gramsPerUnit,s.carbohydrates.value);return(0,W.jsxs)(B,{style:[C7.pill,{backgroundColor:e.bgPill}],children:[(0,W.jsxs)(wp,{onPress:()=>{a(t.foodItem)},style:({pressed:e})=>[C7.pillContent,{opacity:e?.5:1}],testID:`carbs-item-${n}`,children:[(0,W.jsx)(Z,{numberOfLines:1,ellipsizeMode:`middle`,style:[C7.title,{color:e.labelPrimary}],testID:`carbs-item-${n}-title`,children:l}),(0,W.jsx)(Z,{style:[C7.value,{color:e.labelPrimary}],testID:`carbs-item-${n}-amount`,children:`${u} g`})]}),(0,W.jsx)(wp,{onPress:()=>{i(c,l)},testID:`carbs-item-${n}-remove-icon`,hitSlop:16,children:(0,W.jsx)(Z7t,{width:16,height:16})})]},r)},[e.bgPill,e.labelPrimary,a,i]);return(0,W.jsx)(B,{style:C7.container,children:n.map((e,t)=>o({item:e,index:t,itemKey:e.foodItem.id||`${t}-${e.foodItem.title}`}))})},C7=R.create({container:{flexDirection:`row`,flexWrap:`wrap`,padding:16,gap:8},pill:{flexDirection:`row`,alignItems:`center`,paddingHorizontal:8,paddingVertical:6,borderRadius:16,maxWidth:`100%`},pillContent:{flexDirection:`row`,alignItems:`center`,flexShrink:1},title:{...Y.Poppins.regular_XS,marginRight:2,flexShrink:1},value:{...Y.Poppins.regular_XS,marginRight:2}});V();var ymn=(0,H.forwardRef)(({onFocusChange:e},t)=>{let{t:n}=Tq(),{COLORS:r}=J(),{navigate:i}=N$(),a=(0,H.useRef)(null);(0,H.useImperativeHandle)(t,()=>({blur:()=>a.current?.blur()}));let{foodIntakeItems:o,foodIntakeCarbsAmount:s,manualCarbsInput:c,setManualCarbsInput:l}=L5(),[u,d]=(0,H.useState)(!1),[f,p]=(0,H.useState)(``),m=WWt();(0,H.useEffect)(()=>{m&&!u&&p(c===0?``:c.toString())},[m,u,c]);let h=()=>{a.current?.focus(),d(!0),e?.(!0)},g=()=>{u8(l8.CalculationCarbsPress),h()},_=()=>{d(!1),e?.(!1),l(Number(f)),u8(l8.CalculationManualInput)};return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(B,{style:[w7.carbsSection,{backgroundColor:r.bgListActive,borderColor:u?r.borderInputFocus:r.bgListActive}],children:[(0,W.jsx)(Y4,{testID:`carbs-input`,renderLeftSlot:()=>(0,W.jsxs)(B,{style:w7.inputRow,children:[(0,W.jsx)(G7t,{width:24,height:24,color:r.labelPrimary}),(0,W.jsx)(Z,{testID:`carbs-input-unit`,children:n(`calcflow_carbohydrates_title`)})]}),renderRightSlot:()=>(0,W.jsxs)(B,{style:w7.inputRow,children:[(0,W.jsx)(I4,{testID:`carbs-input-field`,ref:a,value:f,onFocus:g,onBlur:_,onChangeText:p,style:[w7.numberInput,{color:r.labelPrimary}],selectTextOnFocus:!!f&&!u}),(0,W.jsx)(Z,{style:[w7.unit,{color:r.labelPrimary}],children:`g`})]}),onPress:h,containerStyle:{borderBottomLeftRadius:0,borderBottomRightRadius:0},style:{paddingVertical:12,backgroundColor:r.bgListActive}}),o.length>0&&(0,W.jsxs)(B,{style:{borderTopWidth:1,borderTopColor:r.divider},children:[(0,W.jsx)(vmn,{}),(0,W.jsx)(H7t,{}),(0,W.jsxs)(B,{style:[w7.totalContainer,{backgroundColor:r.bgListActive}],children:[(0,W.jsx)(Z,{style:w7.totalTitle,children:n(`calcflow_carbohydrates_total`)}),(0,W.jsxs)(B,{style:w7.totalGramsContainer,children:[(0,W.jsx)(Z,{style:w7.totalValue,testID:`total-carbs-value`,children:s+c}),(0,W.jsx)(Z,{style:w7.totalUnits,testID:`total-carbs-unit`,children:n(`my_food_add_unit`)})]})]})]})]}),(0,W.jsxs)(B,{style:w7.buttonsContainer,children:[(0,W.jsxs)(wp,{testID:`add-food-from-library-button`,onPress:()=>{u8(l8.CalculationFoodLibraryPress),i(Q.FoodLibrary)},style:({pressed:e})=>[w7.smallButton,{backgroundColor:r.bgButtonSecondary,opacity:e?.5:1}],children:[(0,W.jsx)(u9t,{color:r.labelPrimary}),(0,W.jsx)(Z,{style:[w7.title,{color:r.textButtonSecondary}],children:n(`calcflow_button_foodLibrary`)})]}),!Oq&&(0,W.jsx)(aen,{onPress:()=>{if(u8(l8.CalculationScanFoodPress),!c7.getState().privacyNoticeAccepted){i(Q.VisualSearchIntro);return}i(Q.VisualSearch)},text:n(`calcflow_button_scan`),style:w7.scanFoodButton})]}),(0,W.jsx)(B,{style:{height:24,borderTopWidth:1,borderTopColor:r.divider}})]})});ymn.displayName=`Carbs`;var w7=R.create({inputRow:{flexDirection:`row`,justifyContent:`flex-start`,alignItems:`center`,marginRight:8,gap:4},carbsSection:{borderWidth:2,borderRadius:16,marginBottom:12},numberInput:{...Y.Poppins.regular_Base,lineHeight:z.select({ios:0,default:Y.Poppins.regular_Base.lineHeight}),textAlign:`right`,maxWidth:40},totalContainer:{flexDirection:`row`,justifyContent:`space-between`,alignItems:`baseline`,padding:16,paddingTop:8,borderRadius:16},totalTitle:{...Y.Poppins.medium_Base},totalGramsContainer:{flexDirection:`row`,alignItems:`baseline`},totalValue:{...Y.Poppins.bold_2XL},totalUnits:{...Y.Poppins.medium_Base,marginLeft:8},unit:{...Y.Poppins.regular_Base},buttonsContainer:{flexDirection:`row`,justifyContent:`flex-start`,gap:12},smallButton:{flexDirection:`row`,alignItems:`center`,alignSelf:`flex-start`,borderRadius:16,paddingHorizontal:16,paddingVertical:8,marginBottom:24,gap:8},scanFoodButton:{alignSelf:`flex-start`,marginBottom:24},title:{...Y.Poppins.medium_SM,alignSelf:`center`}}),bmn=`hda`,xmn=e=>e.device_name.toLowerCase()===bmn||e.source_name.toLowerCase()===bmn,Smn=e=>({id:e.id,object_id:e.id,user_id:e.userId,type:e.type,quantity:{unit:e.quantity.unit.toLowerCase(),value:e.quantity.value},timestamp:new Date(e.startDate),source_id:e.source.id,device_name:e.device.name,source_name:e.source.name}),Cmn=(e,t=Date.now())=>e.map(Smn).filter(e=>!xmn(e)&&e.timestamp.getTime()<=t).sort((e,t)=>t.timestamp.getTime()-e.timestamp.getTime())[0]??null,wmn=(e,t)=>{let{inputMax:n,inputMin:r}=L8(t);return!isNaN(e)&&e>=r&&e<=n};V();var Tmn=()=>{let{t:e}=Tq(),{COLORS:t}=J(),{glucoseStoreActions:n}=R5(),r=umn(`external`),i=b7()?.source===`external`,{glucoseUnit:a}=k8;if(a===void 0)throw Error(`[Glucose::render] glucoseUnit must be non-undefined.`);let[o,s]=(0,H.useState)(!1),[c,l]=(0,H.useState)(!1);H3t(()=>{r&&s(Date.now()-r.timestamp>X.Milliseconds.Minute*10)},1e3),(0,H.useEffect)(()=>{(async()=>{try{let e=`${bq.HEDIA_SERVER_BASE_URL}/api/v2/samples`,t=await d8(e);await T2(t,X.StatusCode.OK,e);let r=await t.json();if(r.length===0)return;let i=Cmn(r);if(!i)return;let{unit:a,value:o}=i.quantity;if(!wmn(o,a)){n.setSelectedReadingId(null);return}let s={id:i3(),source:`external`,value:o,unit:a,sampleId:i.id,sourceId:i.source_id,sourceName:i.source_name,deviceName:i.device_name,timestamp:i.timestamp.getTime()};n.addAvailableGlucoseReading(s),n.setSelectedReadingId(s.id),fin(i)}catch(e){console.error(`[DevicesSection.web::getSamples]`,e)}})()},[n]);let u=(0,H.useCallback)(()=>{if(bq.IS_PRODUCTION===`true`)return;let e={id:`TEST`,object_id:`TEST`,user_id:`TEST`,type:`blood_glucose`,timestamp:new Date(Date.now()-(Math.random()*4+5)*X.Milliseconds.Minute),source_id:`TEST`,quantity:{unit:X.BloodGlucoseUnit.MMOL_L,value:Math.random()*32.199999999999996+1.1},source_name:`HDA Test Name`,device_name:`HDA Test Device`},t={id:i3(),source:`external`,value:e.quantity.value,unit:e.quantity.unit,timestamp:e.timestamp.getTime(),sampleId:e.id,sourceId:e.source_id,sourceName:e.source_name,deviceName:e.device_name};n.addAvailableGlucoseReading(t),n.setSelectedReadingId(t.id)},[n]);return(0,W.jsxs)(B,{style:T7.container,children:[r?.source===`external`?(0,W.jsx)(wp,{style:[T7.button,{backgroundColor:i?t.bgButtonPrimary:t.bgButtonSecondary}],onPress:()=>{!o&&n.setSelectedReadingId(r.id)},children:(0,W.jsx)(Z,{style:[T7.title,{color:i?t.textButtonPrimary:t.textButtonSecondary}],children:r.deviceName})}):(0,W.jsx)(wp,{style:[T7.button,{backgroundColor:t.bgButtonSecondary}],onPress:()=>{l(!0)},onLongPress:()=>{u()},children:(0,W.jsx)(Z,{style:[T7.title,{color:t.labelPrimary}],children:e(`import_modal_reading_title`)})}),(0,W.jsx)(u3,{isVisible:c,title:e(`import_modal_reading_title`),message:e(`import_modal_reading_body`),buttons:[{testID:`close-button`,title:e(`button_close`),onPress:()=>{l(!1)}}]})]})},T7=R.create({container:{marginTop:12},button:{alignSelf:`flex-start`,paddingVertical:8,paddingHorizontal:16,borderRadius:16},title:{...Y.Poppins.medium_SM}});V();var Emn=e=>e.replace(`,`,`.`),Dmn=300,Omn=(0,H.forwardRef)(({onFocusChange:e},t)=>{let{t:n}=Tq(),{COLORS:r}=J(),i=(0,H.useRef)(null);(0,H.useImperativeHandle)(t,()=>({blur:()=>i.current?.blur()}));let{glucoseUnit:a}=k8;if(a===void 0)throw Error(`[Glucose::render] glucoseUnit must be non-undefined.`);let{decimalPlaces:o,inputMax:s,inputMin:c,text:l}=(0,H.useMemo)(()=>L8(a),[a]),[u,d]=(0,H.useState)(``),[f,p]=(0,H.useState)(!1),m=b7(),{glucoseStoreActions:h,availableGlucoseReadings:g}=R5(),{isNoBGModalVisible:_,modalStoreActions:v}=z5(),[y,b]=(0,H.useState)(!1),[x,S]=(0,H.useState)(!1),[C,w]=(0,H.useState)(`hidden`),[T,E]=(0,H.useState)(`hidden`);V$((0,H.useCallback)(()=>{let e=setInterval(()=>{let e=m?.timestamp;T===`open`||!e||m.source===`cgm`||Date.now()-e>X.Milliseconds.Minute*10&&(E(`open`),d(``))},1e3);return()=>{clearInterval(e)}},[T,m])),(0,H.useEffect)(()=>{d(m===null?``:B8(m.value,m.unit,a))},[m,a]);let D=()=>{u===``||m===null||m.source===`manual`?A():w(`open`)},O=(0,H.useCallback)(e=>{d(Emn(e))},[]),k=(0,H.useCallback)(()=>{u8(l8.CalculationGlucosePress),p(!0),e?.(!0)},[e]),A=(0,H.useCallback)(()=>{i.current?.focus()},[]),ee=(0,H.useCallback)(()=>{if(Oq){A();return}setTimeout(A,Dmn)},[A]),te=(0,H.useCallback)(()=>{d(m&&B8(m.value,m.unit,a)||``)},[a,m]),ne=(0,H.useCallback)(()=>g.find(e=>{let t=B8(e.value,e.unit,a),n=Date.now()-e.timestamp>X.Milliseconds.Minute*10;return t===u&&e.source!==`manual`&&!n}),[g,a,u]),re=(0,H.useCallback)(e=>!isNaN(e)&&e>=c&&e<=s,[s,c]),ie=(0,H.useCallback)(e=>({id:i3(),source:`manual`,value:e,unit:a,timestamp:Date.now()}),[a]),j=(0,H.useCallback)(()=>{if(p(!1),e?.(!1),u===``){h.setSelectedReadingId(null);return}let t=ne();if(t){h.setSelectedReadingId(t.id);return}let n=parseFloat(u);if(!re(n)){S(!0);return}d(n.toFixed(o));let r=ie(n);h.addAvailableGlucoseReading(r),h.setSelectedReadingId(r.id)},[ie,ne,o,h,u,re,e]),ae=()=>{(0,d7.flushSync)(()=>{w(`hidden`),h.setSelectedReadingId(null)}),ee()},oe=()=>{w(`closing`)},se=()=>{w(`hidden`)},M=()=>{u8(l8.ExpiredGlucose),h.setSelectedReadingId(null)},ce=()=>{(0,d7.flushSync)(()=>{E(`hidden`)}),ee()},N=()=>{E(`closing`)},P=()=>{E(`hidden`)},le=()=>{(0,d7.flushSync)(()=>{v.set({isNoBGModalVisible:!1})}),ee()},ue=()=>{b(!0),v.set({isNoBGModalVisible:!1})},de=()=>{b(!1)},fe=m===null||m.source===`manual`;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Y4,{testID:`glucose-input`,renderLeftSlot:()=>{let e=ne(),t;switch(e?.source){case`cgm`:t=n(`from_source`,{source:e.sourceName});break;case`device`:t=n(`from_source`,{source:e.deviceName});break;default:t=n(`calcflow_glucose_title`);break}return(0,W.jsxs)(B,{style:E7.inputRow,children:[(0,W.jsx)($7t,{height:24,width:24,color:r.labelPrimary}),(0,W.jsx)(Z,{testID:`glucose-input-unit`,ellipsizeMode:`tail`,numberOfLines:1,style:E7.sourceText,children:t})]})},renderRightSlot:()=>(0,W.jsxs)(B,{style:E7.rightSlot,children:[(0,W.jsx)(I4,{testID:`glucose-input-field`,ref:i,value:u,inputMode:a===X.BloodGlucoseUnit.MMOL_L?`decimal`:`numeric`,maxLength:a===X.BloodGlucoseUnit.MMOL_L?4:3,editable:fe||f,onChangeText:O,onFocus:k,onBlur:j,style:[E7.numberInput,{color:fe?r.labelPrimary:r.labelBrand,width:a===X.BloodGlucoseUnit.MMOL_L?48:36}],selectTextOnFocus:!!u&&!f}),(0,W.jsx)(Z,{style:[E7.unit,{color:fe?r.labelPrimary:r.labelBrand}],children:l})]}),onPress:D,style:{...E7.groupedRow,...f&&{borderColor:r.borderInputFocus}}}),(0,W.jsx)(Tmn,{glucoseUnit:a,inputRef:i}),(0,W.jsx)(B,{style:[E7.divider,{borderTopColor:r.divider}]}),T!==`hidden`&&(0,W.jsx)(u3,{isVisible:T===`open`,title:n(`calcflow_modal_expired_title`),message:n(`calcflow_modal_expired_body`),icon:()=>(0,W.jsx)($7t,{width:96,height:96,color:r.labelPrimary}),onModalShow:M,onModalHide:P,buttons:[{title:n(`calcflow_modal_expire_button_add`),onPress:ce},{title:n(`button_cancel`),type:H4.Secondary,onPress:N}]}),(0,W.jsx)(u3,{isVisible:x,title:n(`calcflow_modal_glucose_invalid_title`,{min:osn(c,a),max:osn(s,a)}),buttons:[{testID:`close-button`,title:n(`button_close`),onPress:()=>{S(!1),te()}}]}),C!==`hidden`&&(0,W.jsx)(u3,{isVisible:C===`open`,title:n(`calcflow_modal_change_synced_value_title`),onModalHide:se,buttons:[{testID:`change-button`,type:H4.Error,title:n(`calcflow_modal_button_changeValue`),onPress:ae},{testID:`keep-button`,type:H4.Secondary,title:n(`calcflow_modal_button_keepValue`),onPress:oe}]}),(_||y)&&(0,W.jsx)(u3,{isVisible:_,title:n(`calcflow_modal_enter_glucose_title`),message:n(`calcflow_modal_enter_glucose_body`),icon:()=>(0,W.jsx)($7t,{width:96,height:96,color:r.labelPrimary}),onModalHide:de,buttons:[{title:n(`calcflow_modal_enter_glucose_button_add`),onPress:le},{title:n(`button_cancel`),type:H4.Secondary,onPress:ue}]})]})});Omn.displayName=`Glucose`;var E7=R.create({groupedRow:{paddingVertical:12},inputRow:{flexDirection:`row`,justifyContent:`flex-start`,alignItems:`center`,marginRight:8,gap:4},rightSlot:{flexDirection:`row`,alignItems:`center`,marginRight:8,gap:4},sourceText:{flexShrink:1},numberInput:{...Y.Poppins.regular_Base,lineHeight:z.select({ios:0,default:Y.Poppins.regular_Base.lineHeight}),textAlign:`right`,textAlignVertical:`center`},unit:{...Y.Poppins.regular_Base},divider:{marginTop:24,height:24,borderTopWidth:1}});V();function kmn({description:e,assetId:t,imageUri:n,onPress:r,testID:i}){let{COLORS:a}=J(),{t:o}=Tq(),s=$5(n?void 0:t),c=n??s,l=e||o(`notes_placeholder`),u=l===o(`notes_placeholder`);return u&&!c?null:(0,W.jsxs)(wp,{style:({pressed:e})=>[Amn.container,{backgroundColor:a.bgSecondary},e&&r&&{opacity:.9}],onPress:r,disabled:!r,testID:`${i}-button`,children:[(0,W.jsx)(Z,{style:[Amn.text,{color:u?a.labelTertiary:a.labelPrimary}],children:l}),!!c&&(0,W.jsx)(Zu,{source:{uri:c},style:Amn.thumbnail,resizeMode:`cover`,testID:`${i}-thumbnail`})]})}var Amn=R.create({container:{flexDirection:`row`,borderRadius:16,padding:16,gap:12,alignItems:`flex-start`},text:{...Y.Poppins.regular_Base,flex:1},thumbnail:{width:64,height:64,borderRadius:8}});V();var jmn=({onClose:e,onConfirm:t})=>{let{COLORS:n}=J(),{t:r}=Tq(),{noteId:i}=B5(),{noteStoreActions:a}=B5(),[o,s]=(0,H.useState)(!1),[c,l]=(0,H.useState)(!1),{noteBody:u,setNoteBody:d,loadNote:f,saveNote:p,isLoading:m,hasNoteContent:h}=hpn();(0,H.useEffect)(()=>{i&&f(i).catch(console.error)},[i,f]);let g=(0,H.useCallback)(async()=>{s(!0);try{let e=await p();a.set({noteId:e,noteBody:u}),t()}catch{l(!0)}finally{s(!1)}},[p,a,u,t]),_=(0,H.useCallback)(()=>{e()},[e]),v=!h||o;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(B,{style:Mmn.header,children:[(0,W.jsx)(U5,{onPress:_}),o?(0,W.jsx)(Pf,{size:`small`,color:n.iconBrand}):(0,W.jsx)(W5,{onPress:g,disabled:v})]}),m?(0,W.jsx)(B,{style:Mmn.loader,children:(0,W.jsx)(Pf,{size:`large`,color:n.iconBrand})}):(0,W.jsx)(xfn,{value:u,onChangeText:d,testID:`calculation-notes`,autoFocus:!0,containerStyle:Mmn.container}),(0,W.jsx)(u3,{isVisible:c,testID:`note-save-failed-modal`,title:r(`notes_cannotSave_modal_header`),message:r(`notes_cannotSave_modal_body`),buttons:[{title:r(`glucose_modal_changes_button_confirm`),testID:`note-save-failed-confirm-button`,type:H4.Primary,onPress:()=>{l(!1)}}]})]})},Mmn=R.create({header:{flexDirection:`row`,justifyContent:`space-between`,alignItems:`center`,paddingHorizontal:16,paddingBottom:12},loader:{flex:1,justifyContent:`center`,alignItems:`center`,minHeight:200},container:{margin:16}});V();var Nmn=()=>{let{t:e}=Tq(),{COLORS:t}=J(),{noteBody:n,displayImageUri:r}=B5(),i=(0,H.useRef)(null),a=()=>{u8(l8.CalculationNotesPress),Tf.dismiss(),i.current?.present()};return(0,W.jsxs)(W.Fragment,{children:[n.trim()||r?(0,W.jsx)(B,{style:Pmn.noteContainer,children:(0,W.jsx)(kmn,{description:n,imageUri:r,onPress:a,testID:`note-display`})}):(0,W.jsxs)(wp,{testID:`add-notes-button`,onPress:a,style:({pressed:e})=>[Pmn.smallButton,{backgroundColor:t.bgButtonSecondary,opacity:e?.5:1}],children:[(0,W.jsx)(c9t,{height:20,width:20,color:t.labelPrimary}),(0,W.jsx)(Z,{style:[Pmn.title,{color:t.textButtonSecondary}],children:e(`calcflow_notes_button_add`)})]}),(0,W.jsx)(_$,{ref:i,handleIndicatorStyle:{height:0},backdropComponent:V4,backgroundStyle:{backgroundColor:t.bgSheet,borderRadius:36},enablePanDownToClose:!1,enableDynamicSizing:!1,snapPoints:[`85%`],children:(0,W.jsx)(y$,{children:(0,W.jsx)(jmn,{onClose:()=>{Tf.dismiss(),i.current?.dismiss()},onConfirm:()=>{Tf.dismiss(),i.current?.dismiss()}})})})]})},Pmn=R.create({smallButton:{flexDirection:`row`,alignSelf:`flex-start`,alignItems:`center`,borderRadius:16,paddingHorizontal:16,paddingVertical:8,marginBottom:24,gap:8},noteContainer:{marginBottom:24},title:{...Y.Poppins.medium_SM,alignSelf:`center`}});V();var Fmn=()=>{let{t:e}=Tq(),{COLORS:t}=J(),{bottomWithFooterButton:n}=Q4(),r=N5(),i=(0,H.useRef)(null),a=N$(),o=F$(),{modalStoreActions:s}=z5(),{noteId:c}=B5(),{foodIntakeItems:l,manualCarbsInput:u,foodIntakeCarbsAmount:d}=L5(),[f,p]=(0,H.useState)(!1),m=b7(),h=o.params?.errorType??null,g=h===Eq.Sync,_=(0,H.useRef)(!1),v=(0,H.useRef)(!1),y=(0,H.useRef)(null),b=(0,H.useRef)(null),x=(0,H.useCallback)(e=>{_.current=e},[]),S=(0,H.useCallback)(e=>{v.current=e},[]),{fetchLibreCgmData:C}=dmn(),w=(0,H.useCallback)(()=>(u8(l8.AbortCalculationPress),m||u>0||l.length>0||c?s.set({showDiscardCalculationModal:!0}):a.goBack(),!0),[u,a,m,s,l.length,c]);V$((0,H.useCallback)(()=>{if(Oq)return;let e=Cf.addEventListener(`hardwareBackPress`,w);return()=>{e.remove()}},[w])),(0,H.useEffect)(()=>{C()},[C]),(0,H.useLayoutEffect)(()=>{a.setOptions({headerTransparent:!0,header:()=>(0,W.jsx)(F5,{title:e(`calcflow_navigation`),LeftButton:Oq?void 0:(0,W.jsx)(U5,{onPress:w}),RightButton:Oq?(0,W.jsxs)(B,{style:[D7.buttonsWrapper,{backgroundColor:t.bgButtonSecondary,borderColor:t.border}],children:[(0,W.jsx)(ofn,{style:D7.noBorder}),(0,W.jsx)(afn,{style:D7.noBorder})]}):(0,W.jsx)(ofn,{}),overlay:!0})})},[t.bgButtonSecondary,t.border,w,a,e]);let[T,E]=(0,H.useState)(Oq);(0,H.useEffect)(()=>{if(!Oq)return a.addListener(`transitionStart`,({data:e})=>{e.closing||!a.isFocused()||E(!0)})},[a]),(0,H.useEffect)(()=>{if(!T)return;let e=setTimeout(()=>{i.current?.present()},100);return()=>{clearTimeout(e)}},[T]);let D=(0,H.useCallback)(()=>{if(_.current||v.current){y.current?.blur(),b.current?.blur();return}if(m===null){u8(l8.SummaryEmptyGlucose),s.set({isNoBGModalVisible:!0});return}if(d+u>opn().max){p(!0);return}a.navigate(Q.LoadingRecommendation)},[m,a,s,d,u]),O=(0,H.useCallback)(()=>{u8(l8.RecentInsulinContinuePress),i.current?.close()},[]);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(fs,{testID:`calculation-scroll-view`,keyboardShouldPersistTaps:`handled`,contentContainerStyle:[D7.scrollView,{backgroundColor:t.bgPrimary,paddingTop:r+16,paddingBottom:n}],children:[(0,W.jsx)(Omn,{ref:b,onFocusChange:S}),(0,W.jsx)(ymn,{ref:y,onFocusChange:x}),(0,W.jsx)(gmn,{}),(0,W.jsx)(Nmn,{})]}),(0,W.jsx)(lpn,{children:(0,W.jsx)(U4,{type:H4.Primary,testID:`calculate-button`,title:e(`calcflow_button_calculate`),onPress:D,inactive:m===null})}),(0,W.jsx)(_$,{ref:i,handleIndicatorStyle:{height:0},backdropComponent:V4,backgroundStyle:{backgroundColor:t.bgSheet,borderRadius:36},enablePanDownToClose:!1,children:(0,W.jsx)(y$,{children:(0,W.jsx)(lmn,{onNoInsulinPressed:O})})}),(0,W.jsx)(u3,{isVisible:h!==null,title:e(g?`recommendation_no_save_modal_title`:`rejected_input_modal_title`),message:e(g?`recommendation_no_save_modal_body`:`rejected_input_modal_body`),buttons:[{title:e(`button_close`),onPress:()=>{a.navigate(Q.Calculation)}}]}),(0,W.jsx)(u3,{isVisible:f,title:e(`calcflow_carbohydrates_invalid_modal_title`),message:e(`calcflow_carbohydrates_invalid_modal_body`),buttons:[{title:e(`button_close`),onPress:()=>{p(!1)}}]}),(0,W.jsx)(upn,{}),(0,W.jsx)(Cpn,{})]})},D7=R.create({scrollView:{paddingHorizontal:16},buttonsWrapper:{flexDirection:`row`,padding:0,borderRadius:44,borderWidth:1},noBorder:{borderWidth:0}});V();var Imn=1e3;function Lmn(){let e=N$(),t=F$(),[n,r]=(0,H.useState)(!1);return(0,H.useEffect)(()=>{setTimeout(()=>{r(!0)},Imn)},[]),(0,H.useEffect)(()=>{n&&(Oq?(window.location.href=`/redirect?status=success`,xq.clearAll()):e.popTo(Q.MainBottomTabs,{screen:Q.DashboardTab,params:{screen:Q.Dashboard,params:{action:hvt.Saved,logbookEntry:t.params.logbookEntry}}}))},[n,e,t.params.logbookEntry]),(0,W.jsx)(B,{style:Rmn.animationContainer,children:(0,W.jsx)(g2,{autoPlay:!0,source:_2.LEAVING_RECOMMENDATION,style:Rmn.animation,webStyle:Rmn.animation,resizeMode:`cover`,loop:!1})})}var Rmn=R.create({animationContainer:{flex:1,justifyContent:`center`,alignItems:`center`},animation:{width:256,height:256}}),zmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SHARED_COLORS=e.LIGHT_COLORS=e.DARK_COLORS=void 0,e.DARK_COLORS={base100:`#616161`,base200:`#555555`,base300:`#4A4A4A`,base350:`#404040`,base400:`#363636`,base500:`#373739`,base600:`#2A2A2C`,base700:`#1C1C1E`,base800:`#141414`,base900:`#000000`,base100a:`#E9E0FF1A`,base600a:`#2A2A2C99`,base700a:`#1C1C1E80`,base800a:`#14141499`,primary100:`#B5D8FF`,primary200:`#9EC6FF`,primary300:`#87B5FF`,primary400:`#73ADFF`,primary500:`#5F99F9`,primary600:`#4A85F0`,primary700:`#4A73ED`,primary800:`#4A5DEB`,primary900:`#3D4AC6`,primary100a:`#B5D8FF99`,primary300a:`#87B5FF4D`,primary400a:`#73ADFF80`,primary900a:`#3D4AC699`,red50:`#F9E6E9`,red100:`#F9C9CE`,red200:`#EA9797`,red300:`#E07171`,red400:`#EA514E`,red500:`#EF4235`,red600:`#E03834`,red700:`#CF2E2E`,red800:`#C22727`,red900:`#B31B1B`,red300a:`#E0717166`,green50:`#E3F0E4`,green100:`#C4E1C5`,green200:`#A2D2A4`,green300:`#7EC381`,green400:`#64B768`,green500:`#4AAC4E`,green600:`#429D46`,green700:`#378B3B`,green800:`#2D7B31`,green900:`#1A5C1F`,yellow50:`#FAF8E2`,yellow100:`#FAF4C0`,yellow200:`#FAF09A`,yellow300:`#FAEC74`,yellow400:`#FAE956`,yellow500:`#FAE63A`,yellow600:`#F8D434`,yellow700:`#F6BC2C`,yellow800:`#F4A524`,yellow900:`#F07C17`,shadow:`#FFFFFF00`,iosKeyboardPicker:`#282828`,iosSelectorKeyboard:`#5858593D`,gradientQuickGuideBottom:`#000000`,gradientQuickGuideTop:`#0000000D`,graphActiveInsulin:`#66D6FF`,graphActiveInsulinSecondary:`#66D6FF1A`,graphCarbohydrate:`#FFB224`,graphCarbohydrateSecondary:`#E88C2B`,graphGlucoseAverage:`#FF8CD8`,graphPhysicalActivity:`#D7EB98`,graphPhysicalActivitySecondary:`#79A762`,graphRapid:`#66D6FF`,graphRapidSecondary:`#00ACEB`,rectangleRangeGraphMyDay:`#5CE59C33`,graphVeryHighGlucose:`#F07C17`,graphVeryHighGlucoseSecondary:`#F4A524`,graphHighGlucose:`#F6BC2C`,graphHighGlucoseSecondary:`#F8D434`,graphTargetGlucose:`#4AAC4E`,graphTargetGlucoseSecondary:`#64B768`,graphLowGlucose:`#EF4235`,graphLowGlucoseSecondary:`#EA514E`,graphVeryLowGlucose:`#B31B1B`,graphVeryLowGlucoseSecondary:`#C22727`},e.LIGHT_COLORS={base50:`#FFFFFF`,base100:`#F7F7FA`,base200:`#F2F2F7`,base300:`#ECECF1`,base400:`#E0E0E6`,base500:`#CFCFD7`,base600:`#B5B5BD`,base700:`#9999A3`,base800:`#6E6E78`,base900:`#3F3F46`,base100a:`#F7F7FA1A`,base600a:`#B5B5BD99`,base700a:`#9999A3B3`,base900a:`#3F3F4699`,primary100:`#EEF0FE`,primary200:`#D7DBFB`,primary300:`#B6BFF8`,primary400:`#8F9EF4`,primary500:`#4A5DEB`,primary600:`#3F4DD5`,primary700:`#3540B8`,primary800:`#2D359B`,primary900:`#242A7C`,primary100a:`#B5D8FF99`,primary300a:`#87B5FF4D`,primary400a:`#73ADFF80`,primary900a:`#3D4AC699`,red50:`#F9E6E9`,red100:`#FCCBCB`,red200:`#F9A6A7`,red300:`#F47475`,red400:`#EB494B`,red500:`#D82E30`,red600:`#B62325`,red700:`#962021`,red800:`#7D2021`,red900:`#440B0D`,red300a:`#E0717166`,green50:`#E3F0E4`,green100:`#BEF6D2`,green200:`#8DEEAF`,green300:`#59DC86`,green400:`#39C365`,green500:`#2BA250`,green600:`#237F42`,green700:`#1F6437`,green800:`#1A522F`,green900:`#092E17`,yellow50:`#FAF8E2`,yellow100:`#FAF5C5`,yellow200:`#F9ED7D`,yellow300:`#FAE84D`,yellow400:`#FAE84D`,yellow500:`#F7C62F`,yellow600:`#F6B82B`,yellow700:`#F3A425`,yellow800:`#F2941F`,yellow900:`#F0831A`,shadow:`#00000029`,iosKeyboardPicker:`#FFFFFF`,iosSelectorKeyboard:`#F4F4F4`,gradientQuickGuideBottom:`#FFFFFF`,gradientQuickGuideTop:`#FFFFFF0D`,graphActiveInsulin:`#008DFF`,graphActiveInsulinSecondary:`#42ABFF1A`,graphCarbohydrate:`#FF9E38`,graphCarbohydrateSecondary:`#EB892F`,graphGlucoseAverage:`#E539AB`,graphPhysicalActivity:`#5BA400`,graphPhysicalActivitySecondary:`#5DA800`,graphRapid:`#008DFF`,graphRapidSecondary:`#42ABFF`,rectangleRangeGraphMyDay:`#5CE59C33`,graphVeryHighGlucose:`#FF9000`,graphVeryHighGlucoseSecondary:`#F07C00`,graphHighGlucose:`#EAB308`,graphHighGlucoseSecondary:`#F8C62B`,graphTargetGlucose:`#008B4F`,graphTargetGlucoseSecondary:`#089B5C`,graphLowGlucose:`#BC0027`,graphLowGlucoseSecondary:`#DC2626`,graphVeryLowGlucose:`#A30022`,graphVeryLowGlucoseSecondary:`#94001F`},e.SHARED_COLORS={white100:`#FFFFFF0D`,white200:`#FFFFFF1A`,white300:`#FFFFFF33`,white400:`#FFFFFF66`,white500:`#FFFFFF99`,white600:`#FFFFFFCC`,white700:`#FFFFFFE6`,white800:`#FFFFFFF2`,white900:`#FFFFFF`,black100:`#0000000D`,black200:`#0000001A`,black300:`#00000033`,black400:`#0000004D`,black500:`#00000080`,black600:`#000000A6`,black700:`#000000D9`,black800:`#000000F2`,black900:`#000000`,noRisk:`#DFB38F`,lowRisk:`#DB988D`,moderateRisk:`#A76762`,highRisk:`#773751`,iosTextStatusBar:`#FFFFFF`,iosAccentBlue:`#0A84FF`,iosButtonHighlight:`#434343`,iosKeyboard:`#383838BF`,transparent:`transparent`,plusInnerShadow:`#8752F2`,plusOuterShadow:`#6422EE`}})),Bmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DARK_SEMANTIC_COLORS=void 0;var t=zmn(),n={...t.DARK_COLORS,...t.SHARED_COLORS};e.DARK_SEMANTIC_COLORS={bgPrimary:n.base900,bgSecondary:n.base700,bgTertiary:n.base600,bgMultiSheet:n.white300,bgSheet:n.base900,bgModal:n.base700,bgOverlay:n.black500,bgBrand:n.primary800,bgToggle:n.base350,bgSpecial:n.base900,bgTransparent:n.transparent,labelPrimary:n.white900,labelSecondary:n.white500,labelTertiary:n.white400,labelBrand:n.primary500,labelBrandInactive:n.primary400a,bgActivationCode:n.base700,borderActivationCodeDanger:n.red500,borderActivationCodeFocus:n.primary500,textActivationCodeDanger:n.red500,textButtonPrimary:n.white900,textButtonPrimaryDisabled:n.white400,bgButtonPrimary:n.primary800,bgButtonPrimaryDisabled:n.primary900,iconButtonPrimary:n.white900,iconButtonPrimaryDisabled:n.white400,textButtonSecondary:n.white900,textButtonSecondaryDisabled:n.white400,bgButtonSecondary:n.base600,bgButtonSecondaryDisabled:n.base100a,iconButtonSecondary:n.white900,iconButtonSecondaryDisabled:n.white400,textButtonPlain:n.white900,textButtonPlainDisabled:n.white400,iconButtonPlain:n.white900,iconButtonPlainDisabled:n.white400,textButtonPrimaryDanger:n.white900,textButtonPrimaryDangerDisabled:n.white400,bgButtonPrimaryDanger:n.red700,bgButtonPrimaryDangerDisabled:n.red300a,iconButtonPrimaryDanger:n.white900,iconButtonPrimaryDangerDisabled:n.white400,textButtonSecondaryDanger:n.red600,textButtonSecondaryDangerDisabled:n.red300a,bgButtonSecondaryDanger:n.base600,bgButtonSecondaryDangerDisabled:n.base100a,iconButtonSecondaryDanger:n.red600,iconButtonSecondaryDangerDisabled:n.red300a,textLink:n.primary500,buttonBorder:n.shadow,borderAvatar:n.white500,paginationActive:n.primary800,paginationInactive:n.white300,graphDivider:n.white300,borderGraphNow:n.white900,overlay:n.black500,nowOverlay:n.white200,veryHighGlucose:n.yellow900,veryHighGlucoseSecondary:n.yellow800,highGlucose:n.yellow700,highGlucoseSecondary:n.yellow600,targetGlucose:n.green500,targetGlucoseSecondary:n.green400,lowGlucose:n.red500,lowGlucoseSecondary:n.red400,veryLowGlucose:n.red900,veryLowGlucoseSecondary:n.red800,graphGlucoseAverage:n.graphGlucoseAverage,graphDotGlucoseAverage:n.green500,graphDotStrokeGlucoseAverage:n.white900,graphActiveInsulin:n.graphActiveInsulin,graphActiveInsulinSecondary:n.graphActiveInsulinSecondary,strokeDotGraphActiveInsulin:n.white900,graphOverlay:n.base700a,graphRapid:n.graphRapid,graphRapidSecondary:n.graphRapidSecondary,graphCarbohydrate:n.graphCarbohydrate,graphCarbohydrateSecondary:n.graphCarbohydrateSecondary,graphPhysicalActivity:n.graphPhysicalActivity,graphPhysicalActivitySecondary:n.graphPhysicalActivitySecondary,rectangleRangeGraphMyDay:n.rectangleRangeGraphMyDay,bgInputActive:n.base600,bgInputInactive:n.base700,bgInputHover:n.white300,borderInputFocus:n.primary500,borderInputDanger:n.red500,textInputDanger:n.red500,bgSecondaryInputInactive:n.base600,bgSecondaryInputActive:n.base600,bgListActive:n.base600,bgListInactive:n.base700,bgListHover:n.white300,bgListPlainHover:n.white200,bgLogbookManual:n.base600,bgLogbookRecommendation:n.base700,borderListFocused:n.primary500,textListHightlight:n.primary500,iosTextStatusBar:n.white900,iosBGNudge:n.white900,iosKeyboardPicker:n.iosKeyboardPicker,iosSelectorKeyboard:n.iosSelectorKeyboard,iosButtonHighlight:n.iosButtonHighlight,iosKeyboard:n.iosKeyboard,textKeyboardButtons:n.iosAccentBlue,textNavigationBar:n.white900,bgNavigationBar:n.base800,textNavigationBarLabel:n.primary500,iconNavigationBarActive:n.primary500,bgCalculatorActive:n.primary900,bgCalculatorInactive:n.base600,iconActive:n.white900,borderCalculator:n.base600,bgIconBolus:n.primary900,bgNumber:n.white600,textNumber:n.black900,bgSegmentContainer:n.base600,bgSegmentCard:n.base600,bgSegmentPrimary:n.primary800,textLabelActive:n.white900,textLabelInactive:n.white900,bgSliderBackground:n.base500,bgSliderForeground:n.primary600,bgSliderKnob:n.white900,bgSliderCalculator:n.base500,textSlider:n.white900,iconSearch:n.white500,textSearchPlaceholder:n.white500,textSearchText:n.white900,bgSearch:n.white300,bgToastDefault:n.base300,textToastDefault:n.white900,iconToastDefault:n.white900,textTableActive:n.white900,textTableSecondary:n.white500,textTableHighlight:n.primary500,bgTableOdd:n.base600,bgTableEven:n.base700,textCarbRecommendation:n.white900,iconCarbRecommendation:n.white900,bgGradientTop:n.primary700,bgGradientBottom:n.primary600,bgLogbookTop:n.base600,bgGradientOverlayTop:n.black100,bgGradientOverlayBottom:n.black900,divider:n.white200,iconBrand:n.primary500,iconBrandInactive:n.primary400a,iconSuccess:n.green500,iconWarning:n.yellow800,iconDanger:n.red500,textSuccess:n.green500,textWarning:n.yellow800,textDanger:n.red700,textPdf:n.black900,toggleKnob:n.white900,plusInnerShadow:n.plusInnerShadow,plusOuterShadow:n.plusOuterShadow,gradientQuickGuide:[n.gradientQuickGuideTop,n.gradientQuickGuideBottom],gradientActiveInsulin:[n.graphActiveInsulinSecondary,n.graphActiveInsulin],gradientCarbohydrates:[n.graphCarbohydrateSecondary,n.graphCarbohydrate],gradientPhysicalActivity:[n.graphPhysicalActivitySecondary,n.graphPhysicalActivity],gradientRapid:[n.graphRapidSecondary,n.graphRapid],gradientVeryHigh:[n.graphVeryHighGlucose,n.graphVeryHighGlucoseSecondary],gradientHigh:[n.graphHighGlucose,n.graphHighGlucoseSecondary],gradientTarget:[n.graphTargetGlucose,n.graphTargetGlucoseSecondary],gradientLow:[n.graphLowGlucoseSecondary,n.graphLowGlucose],gradientVeryLow:[n.graphVeryLowGlucose,n.graphVeryLowGlucoseSecondary]}})),Vmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LIGHT_SEMANTIC_COLORS=void 0;var t=zmn(),n={...t.LIGHT_COLORS,...t.SHARED_COLORS};e.LIGHT_SEMANTIC_COLORS={bgPrimary:n.base200,bgSecondary:n.base50,bgTertiary:n.base100,bgMultiSheet:n.black300,bgSheet:n.base200,bgModal:n.base100,bgOverlay:n.black500,bgBrand:n.primary500,bgToggle:n.base500,bgSpecial:n.base50,bgTransparent:n.transparent,labelPrimary:n.black900,labelSecondary:n.black500,labelTertiary:n.black400,labelBrand:n.primary600,labelBrandInactive:n.primary400a,bgActivationCode:n.base700,borderActivationCodeDanger:n.red500,borderActivationCodeFocus:n.primary500,textActivationCodeDanger:n.red500,textButtonPrimary:n.white900,textButtonPrimaryDisabled:n.white400,bgButtonPrimary:n.primary500,bgButtonPrimaryDisabled:n.primary400,iconButtonPrimary:n.white900,iconButtonPrimaryDisabled:n.white400,textButtonSecondary:n.black900,textButtonSecondaryDisabled:n.black400,bgButtonSecondary:n.base50,bgButtonSecondaryDisabled:n.base400,iconButtonSecondary:n.black900,iconButtonSecondaryDisabled:n.black400,textButtonPlain:n.black900,textButtonPlainDisabled:n.black400,iconButtonPlain:n.black900,iconButtonPlainDisabled:n.black400,textButtonPrimaryDanger:n.white900,textButtonPrimaryDangerDisabled:n.white400,bgButtonPrimaryDanger:n.red600,bgButtonPrimaryDangerDisabled:n.red800,iconButtonPrimaryDanger:n.white900,iconButtonPrimaryDangerDisabled:n.white400,textButtonSecondaryDanger:n.red500,textButtonSecondaryDangerDisabled:n.red300a,bgButtonSecondaryDanger:n.base50,bgButtonSecondaryDangerDisabled:n.base400,iconButtonSecondaryDanger:n.red500,iconButtonSecondaryDangerDisabled:n.red300a,textLink:n.primary500,buttonBorder:n.base300,borderAvatar:n.white500,paginationActive:n.primary800,paginationInactive:n.black300,graphDivider:n.white200,borderGraphNow:n.black900,overlay:n.white500,nowOverlay:n.white300,veryHighGlucose:n.yellow900,veryHighGlucoseSecondary:n.yellow800,highGlucose:n.yellow700,highGlucoseSecondary:n.yellow600,targetGlucose:n.green600,targetGlucoseSecondary:n.green500,lowGlucose:n.red500,lowGlucoseSecondary:n.red400,veryLowGlucose:n.red700,veryLowGlucoseSecondary:n.red600,graphGlucoseAverage:n.graphGlucoseAverage,graphDotGlucoseAverage:n.green500,graphDotStrokeGlucoseAverage:n.white900,graphActiveInsulin:n.graphActiveInsulin,graphActiveInsulinSecondary:n.graphActiveInsulinSecondary,strokeDotGraphActiveInsulin:n.white900,graphOverlay:n.white900,graphRapid:n.graphRapid,graphRapidSecondary:n.graphRapidSecondary,graphCarbohydrate:n.graphCarbohydrate,graphCarbohydrateSecondary:n.graphCarbohydrateSecondary,graphPhysicalActivity:n.graphPhysicalActivity,graphPhysicalActivitySecondary:n.graphPhysicalActivitySecondary,rectangleRangeGraphMyDay:n.rectangleRangeGraphMyDay,bgInputActive:n.base50,bgInputInactive:n.base400,bgInputHover:n.black100,borderInputFocus:n.primary500,borderInputDanger:n.red500,textInputDanger:n.red500,bgSecondaryInputInactive:n.base200,bgSecondaryInputActive:n.base50,bgListActive:n.base50,bgListInactive:n.base400,bgListHover:n.black100,bgListPlainHover:n.black100,bgLogbookManual:n.primary300a,bgLogbookRecommendation:n.base50,borderListFocused:n.primary500,textListHightlight:n.primary500,iosTextStatusBar:n.black900,iosBGNudge:n.black900,iosKeyboardPicker:n.iosKeyboardPicker,iosSelectorKeyboard:n.iosSelectorKeyboard,iosButtonHighlight:n.white700,iosKeyboard:n.iosKeyboard,textKeyboardButtons:n.iosAccentBlue,textNavigationBar:n.black900,bgNavigationBar:n.base100,textNavigationBarLabel:n.primary500,iconNavigationBarActive:n.primary500,bgCalculatorActive:n.primary500,bgCalculatorInactive:n.white900,iconActive:n.white900,borderCalculator:n.base300,bgIconBolus:n.primary500,bgNumber:n.black500,textNumber:n.white900,bgSegmentContainer:n.base50,bgSegmentCard:n.base100,bgSegmentPrimary:n.primary500,textLabelActive:n.white900,textLabelInactive:n.base900,bgSliderBackground:n.black200,bgSliderForeground:n.primary600,bgSliderKnob:n.primary600,bgSliderCalculator:n.white900,textSlider:n.black900,iconSearch:n.black500,textSearchPlaceholder:n.black500,textSearchText:n.black900,bgSearch:n.base50,bgToastDefault:n.base50,textToastDefault:n.black900,iconToastDefault:n.black900,textTableActive:n.black900,textTableSecondary:n.black500,textTableHighlight:n.primary600,bgTableOdd:n.base200,bgTableEven:n.base50,textCarbRecommendation:n.white900,iconCarbRecommendation:n.white900,bgGradientTop:n.primary700,bgGradientBottom:n.primary600,bgLogbookTop:n.base400,bgGradientOverlayTop:n.black100,bgGradientOverlayBottom:n.black100,divider:n.black200,iconBrand:n.primary600,iconBrandInactive:n.primary400a,iconSuccess:n.green500,iconWarning:n.yellow900,iconDanger:n.red500,textSuccess:n.green500,textWarning:n.yellow900,textDanger:n.red700,textPdf:n.white900,toggleKnob:n.white900,plusInnerShadow:n.plusInnerShadow,plusOuterShadow:n.plusOuterShadow,gradientQuickGuide:[n.gradientQuickGuideTop,n.gradientQuickGuideBottom],gradientActiveInsulin:[n.graphActiveInsulinSecondary,n.graphActiveInsulin],gradientCarbohydrates:[n.graphCarbohydrateSecondary,n.graphCarbohydrate],gradientPhysicalActivity:[n.graphPhysicalActivitySecondary,n.graphPhysicalActivity],gradientRapid:[n.graphRapidSecondary,n.graphRapid],gradientVeryHigh:[n.graphVeryHighGlucose,n.graphVeryHighGlucoseSecondary],gradientHigh:[n.graphHighGlucose,n.graphHighGlucoseSecondary],gradientTarget:[n.graphTargetGlucose,n.graphTargetGlucoseSecondary],gradientLow:[n.graphLowGlucoseSecondary,n.graphLowGlucose],gradientVeryLow:[n.graphVeryLowGlucose,n.graphVeryLowGlucoseSecondary]}})),Hmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TEXT_SCALING=e.FontFamily=e.FONTS=void 0;var t=e.FontFamily=function(e){return e.PoppinsBold=`Poppins-Bold`,e.PoppinsSemiBold=`Poppins-SemiBold`,e.PoppinsMedium=`Poppins-Medium`,e.PoppinsRegular=`Poppins-Regular`,e}({});e.TEXT_SCALING={s0:1,s1:1.118,s2:1.235,s3:1.353},e.FONTS={Poppins:{bold_6XL:{fontFamily:t.PoppinsBold,fontSize:60,lineHeight:72},semiBold_6XL:{fontFamily:t.PoppinsSemiBold,fontSize:60,lineHeight:72},bold_4XL:{fontFamily:t.PoppinsBold,fontSize:36,lineHeight:43},semiBold_4XL:{fontFamily:t.PoppinsSemiBold,fontSize:36,lineHeight:43},bold_2XL:{fontFamily:t.PoppinsBold,fontSize:24,lineHeight:31},semiBold_2XL:{fontFamily:t.PoppinsSemiBold,fontSize:24,lineHeight:31},medium_2XL:{fontFamily:t.PoppinsMedium,fontSize:24,lineHeight:31},bold_Base:{fontFamily:t.PoppinsBold,fontSize:16,lineHeight:24},semiBold_Base:{fontFamily:t.PoppinsSemiBold,fontSize:16,lineHeight:24},medium_Base:{fontFamily:t.PoppinsMedium,fontSize:16,lineHeight:24},regular_Base:{fontFamily:t.PoppinsRegular,fontSize:16,lineHeight:24},bold_SM:{fontFamily:t.PoppinsBold,fontSize:14,lineHeight:21},semiBold_SM:{fontFamily:t.PoppinsSemiBold,fontSize:14,lineHeight:21},medium_SM:{fontFamily:t.PoppinsMedium,fontSize:14,lineHeight:21},regular_SM:{fontFamily:t.PoppinsRegular,fontSize:14,lineHeight:21},bold_XS:{fontFamily:t.PoppinsBold,fontSize:12,lineHeight:18},semiBold_XS:{fontFamily:t.PoppinsSemiBold,fontSize:12,lineHeight:18},medium_XS:{fontFamily:t.PoppinsMedium,fontSize:12,lineHeight:18},regular_XS:{fontFamily:t.PoppinsRegular,fontSize:12,lineHeight:18},bold_XXS:{fontFamily:t.PoppinsBold,fontSize:10,lineHeight:15},semiBold_XXS:{fontFamily:t.PoppinsSemiBold,fontSize:10,lineHeight:15},medium_XXS:{fontFamily:t.PoppinsMedium,fontSize:10,lineHeight:15},regular_XXS:{fontFamily:t.PoppinsRegular,fontSize:10,lineHeight:15}}}})),O7=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ColorScheme=e.COLORS=void 0,Object.defineProperty(e,"FONTS",{enumerable:!0,get:function(){return i.FONTS}}),Object.defineProperty(e,"FontFamily",{enumerable:!0,get:function(){return i.FontFamily}}),Object.defineProperty(e,"TEXT_SCALING",{enumerable:!0,get:function(){return i.TEXT_SCALING}}),e.getColors=o;var t=(V(),d(tm)),n=Bmn(),r=Vmn(),i=Hmn(),a=e.ColorScheme=function(e){return e.Light=`light`,e.Dark=`dark`,e.System=`system`,e}({});function o(e){let i=t.Appearance.getColorScheme();switch(e){case a.Light:return r.LIGHT_SEMANTIC_COLORS;case a.Dark:return n.DARK_SEMANTIC_COLORS;case a.System:return i===`light`?r.LIGHT_SEMANTIC_COLORS:n.DARK_SEMANTIC_COLORS;default:return n.DARK_SEMANTIC_COLORS}}e.COLORS=o()})),k7=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.useSemanticColors=e.ColorSchemeProvider=void 0;var t=a(p()),n=O7(),r=Bmn(),i=LJ();function a(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(a=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}var o=(0,t.createContext)(r.DARK_SEMANTIC_COLORS);e.ColorSchemeProvider=({colorScheme:e,children:r})=>{let a=(0,t.useMemo)(()=>(0,n.getColors)(e),[e]);return(0,i.jsx)(o.Provider,{value:a,children:r})},e.useSemanticColors=()=>(0,t.useContext)(o)})),Umn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,a(p());var t=i((F4(),d(P4))),n=k7(),r=LJ();function i(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(i=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}function a(e){return e&&e.__esModule?e:{default:e}}function o(e){let i=(0,n.useSemanticColors)();return(0,r.jsx)(t.default,{width:24,height:24,viewBox:`0 0 24 24`,...e,children:(0,r.jsx)(t.Path,{d:`M7.668 13.77h0a1.375 1.375 0 00-.758 1.776c.642 1.638 2.097 3.053 4.194 3.297h0a1.36 1.36 0 001.503-1.207h0a1.368 1.368 0 00-1.193-1.517h0c-.962-.111-1.652-.743-1.98-1.582l-.448.176.447-.175a1.352 1.352 0 00-1.765-.768zM12 21.52c-3.177 0-5.476-1.785-6.648-4.133-1.18-2.361-1.197-5.247.157-7.405 2.079-3.033 5.034-5.346 6.234-6.216a.434.434 0 01.514 0c1.2.87 4.155 3.183 6.234 6.216 1.354 2.158 1.336 5.044.157 7.405-1.172 2.348-3.471 4.133-6.648 4.133z`,fill:i.labelPrimary,stroke:i.labelPrimary,strokeWidth:.96})})}e.default=o})),Wmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,a(p());var t=i((F4(),d(P4))),n=k7(),r=LJ();function i(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(i=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}function a(e){return e&&e.__esModule?e:{default:e}}function o(e){let i=(0,n.useSemanticColors)();return(0,r.jsxs)(t.default,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,r.jsx)(t.Mask,{id:`a`,fill:i.labelPrimary,children:(0,r.jsx)(t.Path,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M17.862 4.741a2.493 2.493 0 01-2.49 2.489 2.492 2.492 0 01-2.49-2.489 2.492 2.492 0 012.49-2.491 2.493 2.493 0 012.49 2.491zm1.326 5.237c-1.271.056-2.72.02-3.824-.658-.385-.237-.744-.562-1.125-.907-.211-.191-.422-.382-.64-.562-2.246-1.865-5.681-1.71-7.818.353a1 1 0 101.388 1.439c1.056-1.018 2.637-1.326 3.974-.893-.818 1.14-1.496 2.52-1.013 4.322.225.84.699 1.452 1.118 1.99l.008.011c.404.524.724.94.777 1.469.105 1.04-.42 2.164-.928 3.249l-.253.547a1.002 1.002 0 00.91 1.413 1 1 0 00.912-.588l.243-.525v-.003c.593-1.267 1.265-2.704 1.106-4.292-.111-1.103-.685-1.845-1.19-2.5l-.004-.004c-.347-.447-.646-.834-.767-1.285-.267-.996.079-1.772.767-2.718l.028.024.039.035c.43.39.877.795 1.42 1.129 1.299.798 2.819.972 4.143.972.282 0 .556-.01.817-.02a1 1 0 00.955-1.043c-.024-.552-.511-.971-1.043-.955zm-10.37 4.539c-.533.289-1.12.567-1.81.654-.446.055-.915.052-1.404.046l-.162-.001c-.234-.001-.469-.003-.704.005a1 1 0 00.03 1.999h.029c.24-.008.482-.006.722-.004h.065c.536.007 1.093.01 1.672-.061 1.022-.127 1.845-.516 2.515-.88a1 1 0 00-.954-1.758z`})}),(0,r.jsx)(t.Path,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M17.862 4.741a2.493 2.493 0 01-2.49 2.489 2.492 2.492 0 01-2.49-2.489 2.492 2.492 0 012.49-2.491 2.493 2.493 0 012.49 2.491zm1.326 5.237c-1.271.056-2.72.02-3.824-.658-.385-.237-.744-.562-1.125-.907-.211-.191-.422-.382-.64-.562-2.246-1.865-5.681-1.71-7.818.353a1 1 0 101.388 1.439c1.056-1.018 2.637-1.326 3.974-.893-.818 1.14-1.496 2.52-1.013 4.322.225.84.699 1.452 1.118 1.99l.008.011c.404.524.724.94.777 1.469.105 1.04-.42 2.164-.928 3.249l-.253.547a1.002 1.002 0 00.91 1.413 1 1 0 00.912-.588l.243-.525v-.003c.593-1.267 1.265-2.704 1.106-4.292-.111-1.103-.685-1.845-1.19-2.5l-.004-.004c-.347-.447-.646-.834-.767-1.285-.267-.996.079-1.772.767-2.718l.028.024.039.035c.43.39.877.795 1.42 1.129 1.299.798 2.819.972 4.143.972.282 0 .556-.01.817-.02a1 1 0 00.955-1.043c-.024-.552-.511-.971-1.043-.955zm-10.37 4.539c-.533.289-1.12.567-1.81.654-.446.055-.915.052-1.404.046l-.162-.001c-.234-.001-.469-.003-.704.005a1 1 0 00.03 1.999h.029c.24-.008.482-.006.722-.004h.065c.536.007 1.093.01 1.672-.061 1.022-.127 1.845-.516 2.515-.88a1 1 0 00-.954-1.758z`,fill:i.labelPrimary}),(0,r.jsx)(t.Path,{d:`M15.364 9.32l-.525.851h.001l.524-.851zm3.824.658l-.03-1h-.014l.044 1zm-4.95-1.565l.672-.742-.671.742zm-.64-.562l-.638.769.002.002.637-.771zm-7.817.353l.693.72h.001l-.694-.72zm-.026 1.414l-.72.693v.002l.72-.695zm1.414.025l-.694-.72h-.002l.696.72zm3.974-.893l.812.582.798-1.112-1.302-.422-.308.952zm-1.013 4.322l.965-.26-.965.26zm1.118 1.99l.791-.61-.002-.003-.79.614zm.008.011l-.792.61.792-.61zm.777 1.469l-.995.098v.002l.995-.1zm-.928 3.249l-.906-.424-.002.004.908.42zm-.253.547l-.908-.42-.004.008.912.412zm.499 1.324l-.413.91.004.002.409-.912zm1.323-.5l-.908-.42-.003.008.91.413zm.243-.524l-.906-.424-.002.004.908.42zm0-.003l-.905-.423.906.424zm1.106-4.292l-.995.1.995-.1zm-1.19-2.5l.79-.611-.79.611zm-.004-.004l.79-.612v-.002l-.79.614zm-.767-1.285l-.966.258.966-.258zm.767-2.718l.672-.74-.825-.75-.656.901.809.589zm.028.024l-.65.761.65-.76zm.039.035l-.69.723.008.009.01.008.672-.74zm1.42 1.129l.524-.852-.523.852zm4.96.952l.042.999h.001l-.043-1zm.955-1.043l-1 .043 1-.043zM7.008 15.17l.123.992h.003l-.126-.992zm1.81-.654l-.477-.88.476.88zm-3.214.7l.012-1h-.008l-.004 1zm-.162-.001l-.005 1 .005-1zm-.704.005l.03 1h.002l-.032-1zm-.97 1.028l1-.028v-.001l-1 .029zm1.029.97v1h.03l-.03-1zm.722-.003l-.008 1h.008v-1zm0 0l.008-1H5.52v1zm.065 0l.012-1h-.004l-.008 1zm1.672-.061l.124.992-.124-.992zm2.515-.88l.478.878-.478-.878zm.402-1.356l-.879.476.001.002.879-.478zm5.199-6.689a3.493 3.493 0 003.49-3.489h-2c0 .82-.67 1.489-1.49 1.489v2zm-3.49-3.489a3.492 3.492 0 003.49 3.489v-2c-.82 0-1.49-.669-1.49-1.489h-2zm3.49-3.491a3.492 3.492 0 00-3.49 3.491h2c0-.822.67-1.491 1.49-1.491v-2zm3.49 3.491a3.493 3.493 0 00-3.49-3.491v2c.82 0 1.49.669 1.49 1.491h2zm-4.022 5.43c1.392.856 3.126.861 4.392.806l-.088-1.998c-1.277.056-2.438-.008-3.257-.511l-1.047 1.704zm-1.273-1.017c.365.33.794.723 1.272 1.017l1.049-1.703c-.292-.18-.581-.437-.978-.797l-1.343 1.483zm-.605-.532c.197.163.392.338.606.532l1.342-1.483c-.208-.188-.436-.395-.675-.591l-1.273 1.542zm-6.487.301c1.78-1.718 4.642-1.833 6.485-.303l1.277-1.539c-2.649-2.2-6.657-2.003-9.15.403l1.388 1.44zm0 .001s-.001-.001 0 0v-.001l-.001.002-1.387-1.442a2 2 0 00-.053 2.828l1.441-1.387zm-.002 0h.002c0-.001 0 0 0 0h-.001v-.002l-1.438 1.391a2 2 0 002.828.048l-1.39-1.437zm4.978-1.126c-1.667-.54-3.64-.164-4.976 1.125l1.388 1.44c.774-.747 1.965-.988 2.971-.662l.617-1.903zm-.356 5.015c-.368-1.376.113-2.439.86-3.48L10.33 8.166c-.89 1.24-1.763 2.937-1.166 5.164l1.931-.518zm.942 1.636c-.426-.548-.775-1.015-.942-1.636l-1.931.517c.283 1.06.882 1.816 1.294 2.346l1.58-1.227zm.01.013l-.008-.01-1.583 1.221.008.01 1.583-1.22zm.98 1.98c-.086-.867-.62-1.514-.98-1.98l-1.583 1.222c.449.582.554.765.573.957l1.99-.198zm-1.017 3.773c.25-.532.534-1.138.737-1.75.204-.614.353-1.307.28-2.024l-1.99.201c.033.324-.028.713-.188 1.192-.16.481-.391.98-.65 1.533l1.811.848zm-.25.542l.252-.547-1.815-.84-.253.548 1.815.84zm.003-.006c.001 0 0 0 0 0v-.002 0l-1.823-.823a2.002 2.002 0 00.998 2.646l.825-1.821zm0 0h.001l-.005-.002-.817 1.825c.262.118.542.177.82.177v-2zm0 0v2a2 2 0 001.822-1.176l-1.822-.825zm.246-.533l-.243.525 1.815.84.243-.525-1.815-.84zm.002-.006v.002l1.812.847v-.002l-1.812-.847zm1.017-3.77c.128 1.272-.404 2.461-1.016 3.77l1.811.847c.574-1.226 1.386-2.911 1.195-4.817l-1.99.2zm-.987-1.987c.514.664.908 1.201.987 1.987l1.99-.2c-.143-1.418-.896-2.365-1.395-3.01l-1.582 1.223zm-.004-.005l.004.005 1.582-1.223-.003-.005-1.583 1.223zm-.941-1.637c.183.682.626 1.231.943 1.639l1.58-1.227c-.378-.486-.533-.71-.592-.93l-1.931.518zm.924-3.566c-.743 1.022-1.31 2.123-.924 3.566l1.931-.518c-.147-.55-.023-1.001.61-1.871L12.02 9.247zm1.486-.147a.403.403 0 00-.005-.004l-1.345 1.48.052.045L13.506 9.1zm.08.071c-.036-.034-.07-.063-.08-.071l-1.298 1.521.007.006.001.001-.01-.01 1.38-1.447zm1.254 1c-.453-.278-.834-.62-1.272-1.017l-1.344 1.481c.423.384.934.85 1.57 1.24l1.046-1.704zm3.619.825c-1.259 0-2.556-.17-3.619-.824l-1.047 1.704c1.533.942 3.276 1.12 4.666 1.12v-2zm.774-.02c-.255.011-.513.02-.774.02v2c.302 0 .592-.01.859-.021l-.085-1.998zm-.001 0l.087 1.999a2 2 0 001.91-2.086l-1.997.087zm-.014.001c-.003 0-.003 0 0 .001a.045.045 0 01.014.008c.004.004.004.006.003.003a.044.044 0 01-.003-.013l1.998-.087c-.05-1.13-1.026-1.942-2.073-1.91l.06 1.998zM7.134 16.163c.88-.111 1.602-.464 2.16-.768l-.954-1.757c-.505.274-.957.478-1.457.54l.25 1.985zm-1.543.053c.482.006 1.017.012 1.54-.053l-.245-1.985c-.369.046-.772.045-1.27.039l-.025 2zm-.153 0h.16l.01-2h-.16l-.01 2zm-.668.004c.213-.006.43-.005.667-.004l.01-2c-.23-.001-.483-.003-.74.005l.063 2zm-.002 0l-.058-1.999a2 2 0 00-1.941 2.057l2-.058zm0 0c-.002 0 0 0 0 0-.001-.001-.001-.001 0 0v.001c0 .001 0 .001 0 0l-2 .055a2 2 0 002 1.944v-2zm.029 0h-.03v2h.03v-2zm.73-.004c-.237-.002-.497-.004-.76.004l.06 2c.219-.008.44-.006.684-.004l.016-2zm-.008 0v2-2zm.073 0h-.065l-.015 2h.065l.015-2zm1.541-.054c-.504.063-.997.06-1.537.055l-.023 2c.532.006 1.151.011 1.807-.07l-.247-1.985zm2.161-.766c-.631.343-1.324.662-2.16.766l.246 1.985c1.207-.15 2.16-.609 2.869-.994l-.955-1.757zm.001 0c0 .002 0 .002 0 0v-.001c0-.001 0-.001 0 0v.001h-.002l.957 1.757a2 2 0 00.802-2.712l-1.757.956zm0 0l1.758-.954a2.001 2.001 0 00-2.712-.805l.953 1.759z`,fill:i.labelPrimary,mask:`url(#a)`})]})}e.default=o})),A7=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TIMEOUT_MODAL_TRIGGER=e.TARGET_BGL_MMOL_LIMITS=e.INSULIN_TO_CARBS_RATIO_LIMITS=e.INSULIN_SENSITIVITY_MMOL_LIMITS=e.INSULIN_DOSE_LIMITS=e.CURRENT_BGL_MMOL_LIMITS=e.CARBOHYDRATES_LIMITS=e.BOLUS_SECONDS_PASSED_LIMITS=e.ACTIVITY_TARGET_BGL_MMOL_LIMITS=e.ACTIVITY_SETTINGS_INTERVAL_LIMITS=e.ACTIVITY_POSTPONE_GLUCOSE_MMOLL=e.ACTIVITY_POSTPONE_GLUCOSE_MGDL=e.ACTIVITY_DURATION_MINUTES_LIMITS=void 0;var t=E2();e.ACTIVITY_POSTPONE_GLUCOSE_MMOLL=5,e.ACTIVITY_POSTPONE_GLUCOSE_MGDL=90,e.TIMEOUT_MODAL_TRIGGER=600*1e3,e.CARBOHYDRATES_LIMITS={min:t.CONSTANTS.CARBOHYDRATES_INPUT_MIN,max:t.CONSTANTS.CARBOHYDRATES_INPUT_MAX},e.INSULIN_DOSE_LIMITS={min:t.CONSTANTS.INSULIN_DOSE_MIN,max:t.CONSTANTS.INSULIN_DOSE_MAX},e.BOLUS_SECONDS_PASSED_LIMITS={min:t.CONSTANTS.BOLUS_SECONDS_MIN,max:t.CONSTANTS.BOLUS_SECONDS_MAX},e.ACTIVITY_DURATION_MINUTES_LIMITS={min:t.CONSTANTS.ACTIVITY_DURATION_MIN,max:t.CONSTANTS.ACTIVITY_DURATION_MAX},e.INSULIN_SENSITIVITY_MMOL_LIMITS={min:t.CONSTANTS.INSULIN_SENSITIVITY_MIN,max:t.CONSTANTS.INSULIN_SENSITIVITY_MAX},e.INSULIN_TO_CARBS_RATIO_LIMITS={min:t.CONSTANTS.INSULIN_TO_CARBS_RATIO_MIN,max:t.CONSTANTS.INSULIN_TO_CARBS_RATIO_MAX},e.CURRENT_BGL_MMOL_LIMITS={min:t.CONSTANTS.GLUCOSE_INPUT_MIN_MMOLL,max:t.CONSTANTS.GLUCOSE_INPUT_MAX_MMOLL},e.TARGET_BGL_MMOL_LIMITS={min:t.CONSTANTS.TARGET_GLUCOSE_MIN,max:t.CONSTANTS.TARGET_GLUCOSE_MAX},e.ACTIVITY_TARGET_BGL_MMOL_LIMITS={min:t.CONSTANTS.ACTIVITY_TARGET_GLUCOSE_MIN,max:t.CONSTANTS.ACTIVITY_TARGET_GLUCOSE_MAX},e.ACTIVITY_SETTINGS_INTERVAL_LIMITS={min:t.CONSTANTS.ACTIVITY_REDUCTION_MIN,max:t.CONSTANTS.ACTIVITY_REDUCTION_MAX}})),j7=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.useLanguage=e.LanguageProvider=e.LanguageContext=void 0;var t=i(p()),n=G_t(),r=LJ();function i(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(i=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}var a=e.LanguageContext=(0,t.createContext)(void 0);e.LanguageProvider=({children:e})=>{let{language:i,changeLanguage:o,t:s}=(0,n.useTranslation)(),c=t.default.useMemo(()=>({language:i,changeLanguage:o,t:s}),[i,o,s]);return(0,r.jsx)(a.Provider,{value:c,children:e})},e.useLanguage=()=>{let e=(0,t.useContext)(a);if(!e)throw Error(`useLanguage must be used within a LanguageProvider`);return e}})),M7=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.convertAndFormatBGL=i,e.convertBGL=n,e.createSequentialArrayInteger=e.createSequentialArrayHalf=e.createSequentialArrayDecimal=void 0,e.formatBGL=r,e.formatUnit=void 0;var t=E2();function n(e,n,r){if(n!==t.BloodGlucoseUnit.MG_DL&&n!==t.BloodGlucoseUnit.MMOL_L)throw Error(`Unsupported glucose unit! ${n}`);if(n===r)return e;switch(r){case t.BloodGlucoseUnit.MG_DL:return e*t.CONSTANTS.MGDL_PER_MMOLL_BGL;case t.BloodGlucoseUnit.MMOL_L:return e*t.CONSTANTS.MMOLL_PER_MGDL_BGL;default:throw Error(`Unsupported glucose unit! ${r}`)}}function r(e,n){let r=n===t.BloodGlucoseUnit.MG_DL?0:1;return(Math.round(e*10)/10).toFixed(r)}function i(e,t,i){return r(n(e,t,i),i)}e.formatUnit=e=>`${e.substring(0,e.length-1)}${e.substring(e.length-1,e.length).toUpperCase()}`,e.createSequentialArrayHalf=(e,t)=>Array.from({length:(t-e)/.5+1},(t,n)=>(e+n*.5).toFixed(1)),e.createSequentialArrayInteger=(e,t)=>Array.from({length:t-e+1},(t,n)=>(e+n).toString()),e.createSequentialArrayDecimal=(e,t)=>Array.from({length:(t-e)*10+1},(t,n)=>(e+n/10).toFixed(1))})),Gmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.useDebouncedCallback=m,e.useFontScale=f;var t=p(),n=(V(),d(tm)),r=Hmn(),i=()=>{let e=n.PixelRatio.getFontScale();return Math.min(e>0?e:1,r.TEXT_SCALING.s3)},a=i(),o=new Set,s=[],c=()=>{let e=i();e!==a&&(a=e,o.forEach(e=>e()))},l=e=>(o.size===0&&(s=[n.AppState.addEventListener(`change`,e=>{e===`active`&&c()}),n.Dimensions.addEventListener(`change`,c)]),o.add(e),c(),()=>{o.delete(e),o.size===0&&(s.forEach(e=>e.remove()),s=[])}),u=()=>a;function f(){return(0,t.useSyncExternalStore)(l,u)}function m(e,n){let r=(0,t.useRef)(null),i=(0,t.useRef)(e);return(0,t.useEffect)(()=>{i.current=e},[e]),(0,t.useCallback)((...e)=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{i.current(...e)},n)},[n])}})),N7=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=s(p()),n=(V(),d(tm)),r=Gmn(),i=k7(),a=O7(),o=LJ();function s(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(s=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}function c(e){let s=(0,i.useSemanticColors)(),c=(0,r.useFontScale)(),l=(0,t.useMemo)(()=>{let t=n.StyleSheet.flatten([{...a.FONTS.Poppins.regular_Base,color:s.labelPrimary},e.style]);return typeof t.fontSize==`number`&&(t.fontSize*=c),typeof t.lineHeight==`number`&&(t.lineHeight*=c),t},[s,e.style,c]);return(0,o.jsx)(n.Text,{...e,allowFontScaling:!1,style:l,children:e.children})}e.default=c})),Kmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=g(p()),n=(V(),d(tm)),r=E2(),i=h(Umn()),a=h(Wmn()),o=A7(),s=k7(),c=j7(),l=O7(),u=M7(),f=h(N7()),m=LJ();function h(e){return e&&e.__esModule?e:{default:e}}function g(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(g=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}function _({glucoseReading:e,hasActivity:l,bloodGlucoseUnit:d}){let{t:p}=(0,c.useLanguage)(),h=(0,s.useSemanticColors)(),g=(0,t.useMemo)(()=>(0,u.convertBGL)(e.value,e.unit,r.BloodGlucoseUnit.MMOL_L),[e]),_=(0,t.useMemo)(()=>r.CONSTANTS.LEVEL_TWO_HYPOGLYCEMIA_MIN<=g&&g<r.CONSTANTS.LEVEL_TWO_HYPOGLYCEMIA_MAX?p(`recommendation_suggestions_remeasure_very_low`):r.CONSTANTS.LEVEL_ONE_HYPOGLYCEMIA_MIN<=g&&g<r.CONSTANTS.LEVEL_ONE_HYPOGLYCEMIA_MAX?p(`recommendation_suggestions_remeasure_low`):r.CONSTANTS.SEVERE_HYPOGLYCEMIA_MIN<g&&g<=r.CONSTANTS.SEVERE_HYPERGLYCEMIA_MAX?p(`recommendation_suggestions_measure_ketone`):null,[g,p]),y=(0,t.useMemo)(()=>r.CONSTANTS.LOW_GLUCOSE_MESSAGE_ACTIVITY_MIN<=g&&g<=r.CONSTANTS.LOW_GLUCOSE_MESSAGE_ACTIVITY_MAX?p(`recommendation_suggestions_postpone_activity`,{displayUnit:(0,u.formatUnit)(d),value:d===r.BloodGlucoseUnit.MG_DL?o.ACTIVITY_POSTPONE_GLUCOSE_MGDL.toString():o.ACTIVITY_POSTPONE_GLUCOSE_MMOLL.toString()}):r.CONSTANTS.HIGH_GLUCOSE_MESSAGE_ACTIVITY_MIN<=g&&g<=r.CONSTANTS.HIGH_GLUCOSE_MESSAGE_ACTIVITY_MAX?p(`recommendation_suggestions_reduce_intensity`):null,[g,d,p]);return(0,m.jsxs)(n.View,{style:v.container,children:[_&&(0,m.jsxs)(n.View,{style:v.row,children:[(0,m.jsx)(i.default,{style:v.icon,testID:`blood-icon`}),(0,m.jsx)(f.default,{style:[v.text,{color:h.labelPrimary}],testID:`blood-glucose-message`,children:_})]}),l&&y&&(0,m.jsxs)(n.View,{style:v.row,children:[(0,m.jsx)(a.default,{style:v.icon,testID:`run-icon`}),(0,m.jsx)(f.default,{style:[v.text,{color:h.labelPrimary}],testID:`activity-message`,children:y})]})]})}var v=n.StyleSheet.create({container:{gap:16,flexWrap:`wrap`},text:{...l.FONTS.Poppins.regular_SM,flex:1},row:{flexDirection:`row`,gap:8},icon:{alignSelf:`center`}});e.default=_})),qmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,a(p());var t=i((F4(),d(P4))),n=k7(),r=LJ();function i(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(i=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}function a(e){return e&&e.__esModule?e:{default:e}}function o(e){let i=(0,n.useSemanticColors)();return(0,r.jsx)(t.default,{width:42,height:42,viewBox:`0 0 42 42`,fill:`none`,...e,children:(0,r.jsx)(t.Path,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M14.075 5.202a1.313 1.313 0 011.539-1.04c2.41.468 4.109 1.686 5.178 3.328.874 1.34 1.283 2.895 1.394 4.422a15.383 15.383 0 002.662-.475c1.134-.306 3.85-.727 6.424.425 2.686 1.202 4.946 3.988 5.289 9.548a.988.988 0 01.002.051c.043 5.242-1.626 9.2-3.54 11.88-.955 1.336-1.972 2.359-2.874 3.067a8.58 8.58 0 01-1.27.842c-.347.183-.72.336-1.074.389-1.64.386-3.142.11-4.34-.222-.369-.102-.751-.222-1.087-.327-.188-.06-.361-.114-.509-.158-.473-.141-.768-.202-.961-.202-.203 0-.504.059-.972.19-.152.043-.336.098-.535.158-.328.097-.7.208-1.049.301-1.194.317-2.684.588-4.327.262-.359-.052-.74-.209-1.097-.398-.39-.206-.82-.49-1.271-.844-.903-.709-1.92-1.73-2.873-3.066-1.911-2.678-3.575-6.63-3.533-11.872 0-.017 0-.034.002-.051.343-5.56 2.603-8.346 5.29-9.548 2.574-1.152 5.29-.731 6.423-.425.863.232 1.725.388 2.586.468-.106-1.119-.415-2.148-.96-2.982-.663-1.02-1.735-1.845-3.478-2.183a1.312 1.312 0 01-1.039-1.538zm.98 12.966a1.313 1.313 0 00-1.126-2.371c-1.911.908-3.296 2.796-3.584 4.894a1.312 1.312 0 102.6.358 3.85 3.85 0 012.11-2.881z`,fill:i.graphCarbohydrateSecondary})})}e.default=o})),Jmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,i(p());var t=(F4(),d(P4)),n=k7(),r=LJ();function i(e){return e&&e.__esModule?e:{default:e}}e.default=e=>{let i=(0,n.useSemanticColors)();return(0,r.jsxs)(t.Svg,{width:24,height:25,viewBox:`0 0 24 25`,fill:`none`,...e,children:[(0,r.jsx)(t.Path,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M3.99312 4.2711C4.97691 3.21491 6.37794 2.62354 8.03206 2.62354H11.6091C12.0233 2.62354 12.3591 2.95933 12.3591 3.37354C12.3591 3.78775 12.0233 4.12354 11.6091 4.12354H8.03206C6.75004 4.12354 5.76199 4.57281 5.09074 5.29347C4.414 6.02002 4.00391 7.08289 4.00391 8.39968V16.3464C4.00391 17.6647 4.4124 18.7277 5.08783 19.4539C5.75756 20.1739 6.74517 20.6235 8.03206 20.6235H16.467C17.7555 20.6235 18.7433 20.1738 19.4128 19.4539C20.088 18.7278 20.4961 17.6649 20.4961 16.3464V12.7654C20.4961 12.3512 20.8319 12.0154 21.2461 12.0154C21.6603 12.0154 21.9961 12.3512 21.9961 12.7654V16.3464C21.9961 17.9738 21.4886 19.4244 20.5112 20.4754C19.5281 21.5326 18.1263 22.1235 16.467 22.1235H8.03206C6.37405 22.1235 4.97259 21.5324 3.98947 20.4754C3.01204 19.4245 2.50391 17.974 2.50391 16.3464V8.39968C2.50391 6.77158 3.01482 5.32139 3.99312 4.2711Z`,fill:e?.color??i.labelPrimary}),(0,r.jsx)(t.Path,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M17.4779 4.79025L11.947 10.8273C11.6292 11.1844 11.4306 11.6319 11.3786 12.1085L11.2367 13.4178C11.1888 13.8615 11.5777 14.2282 12.0174 14.1548C12.0173 14.1548 12.0175 14.1547 12.0174 14.1548L13.2872 13.9418C13.8024 13.8552 14.2724 13.5962 14.6197 13.2079L14.6257 13.2012L20.1012 7.2259L20.1038 7.2231C20.4768 6.82017 20.4526 6.1918 20.0494 5.81853L18.8817 4.73742C18.8817 4.73738 18.8818 4.73746 18.8817 4.73742C18.4788 4.36513 17.8501 4.38948 17.4779 4.79025ZM16.376 3.77252C17.311 2.76233 18.8891 2.70159 19.8999 3.63592L21.0684 4.71777C21.0683 4.71776 21.0684 4.71779 21.0684 4.71777C22.0786 5.65306 22.1405 7.22926 21.206 8.24047C21.2055 8.24101 21.205 8.24155 21.2045 8.24209L15.7346 14.2114C15.1602 14.8521 14.3846 15.2784 13.5359 15.4211L12.2655 15.6341C10.8457 15.8717 9.59091 14.6883 9.74532 13.2569L9.88736 11.9465C9.97332 11.1584 10.3028 10.4163 10.8313 9.82475L10.8376 9.81777L16.3734 3.77534L16.376 3.77252Z`,fill:e?.color??i.labelPrimary})]})}})),Ymn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,i(p());var t=(V(),d(tm)),n=k7(),r=LJ();function i(e){return e&&e.__esModule?e:{default:e}}var a=()=>{let e=(0,n.useSemanticColors)();return(0,r.jsx)(t.View,{style:[o.container,{backgroundColor:e.bgOverlay}],testID:`backdrop`})},o=t.StyleSheet.create({container:{position:`absolute`,top:0,left:0,right:0,bottom:0}});e.default=a})),Xmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.CheckmarkCircleFilledHeight=void 0,i(p());var t=r((F4(),d(P4))),n=LJ();function r(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,i=new WeakMap;return(r=function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?r(o,t,a):o[t]=e[t]);return o})(e,t)}function i(e){return e&&e.__esModule?e:{default:e}}e.CheckmarkCircleFilledHeight=140;function a(e){return(0,n.jsxs)(t.default,{width:128,height:128,viewBox:`0 0 128 128`,fill:`none`,...e,children:[(0,n.jsx)(t.Circle,{cx:64,cy:64,r:63,fill:`#4A5DEB`,stroke:`#4A73ED`,strokeWidth:2}),(0,n.jsx)(t.Path,{d:`M43 67C43 67 54 78.5 55.5 79C57 79.5 85.5 49 85.5 49`,stroke:`white`,strokeWidth:5.33333,strokeLinecap:`round`})]})}e.default=a})),Zmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,o(p());var t=(V(),d(tm)),n=a(Xmn()),r=k7(),i=LJ();function a(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(a=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}function o(e){return e&&e.__esModule?e:{default:e}}var s=()=>{let e=(0,r.useSemanticColors)(),{height:a}=(0,t.useWindowDimensions)();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.default,{style:[c.checkmark,{top:(a-n.CheckmarkCircleFilledHeight)/2}],testID:`timeout-modal-checkmark`}),(0,i.jsx)(t.View,{style:[c.container,{backgroundColor:e.bgOverlay}],testID:`backdrop-checkmark`})]})},c=t.StyleSheet.create({checkmark:{alignSelf:`center`,position:`absolute`},container:{position:`absolute`,top:0,left:0,right:0,bottom:0}});e.default=s})),P7=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=l(p()),n=(V(),d(tm)),r=(Z0(),d(z4t)),i=k7(),a=c(Ymn()),o=c(Zmn()),s=LJ();function c(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(l=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}var u=300;function f({testID:e,isVisible:c,onModalHide:l,onModalShow:d,onRequestClose:f,containerStyle:p,children:h,checkmark:g}){let{height:_}=(0,n.useWindowDimensions)(),{bottom:v}=(0,r.useSafeAreaInsets)(),y=(0,i.useSemanticColors)(),[b,x]=(0,t.useState)(0),[S,C]=(0,t.useState)(!1),w=(0,t.useRef)(new n.Animated.Value(_)).current;(0,t.useEffect)(()=>{S||w.setValue(_)},[S,_,w]);let T=(0,t.useCallback)(()=>{n.Animated.timing(w,{toValue:0,duration:u,easing:n.Easing.out(n.Easing.cubic),useNativeDriver:n.Platform.OS!==`web`}).start(({finished:e})=>{e&&d&&d()})},[d,w]),E=(0,t.useCallback)(()=>{let e=b>0?b:_;n.Animated.timing(w,{toValue:e,duration:u,easing:n.Easing.out(n.Easing.cubic),useNativeDriver:n.Platform.OS!==`web`}).start(({finished:e})=>{e&&(C(!1),l&&l())})},[b,_,l,w]);(0,t.useEffect)(()=>{S&&!c?E():!S&&c&&(C(!0),T())},[c,S,E,T]);let D=(0,t.useCallback)(e=>{x(e.nativeEvent.layout.height+v)},[v]);return S?(0,s.jsx)(n.Modal,{visible:!0,transparent:!0,statusBarTranslucent:!0,onRequestClose:f,children:(0,s.jsxs)(n.View,{style:[m.overlay,{backgroundColor:y.bgTransparent}],children:[g?(0,s.jsx)(o.default,{}):(0,s.jsx)(a.default,{}),(0,s.jsx)(n.Animated.View,{testID:e,accessibilityRole:`alert`,onLayout:D,style:[m.modal,{backgroundColor:y.bgModal},{transform:[{translateY:w}]},{paddingBottom:v+16},p],children:h})]})}):null}var m=n.StyleSheet.create({modal:{width:`100%`,maxHeight:`85%`,paddingTop:32,paddingBottom:16,paddingHorizontal:16,borderTopRightRadius:36,borderTopLeftRadius:36},backdrop:{position:`absolute`,left:0,right:0,top:0,bottom:0},overlay:{flex:1,justifyContent:`flex-end`}});e.default=t.default.memo(f)})),Qmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"HapticFeedbackTypes",{enumerable:!0,get:function(){return n.HapticFeedbackTypes}}),e.triggerHaptic=i;var t=(V(),d(tm)),n=r((jfn(),d(Dfn)));function r(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,i=new WeakMap;return(r=function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?r(o,t,a):o[t]=e[t]);return o})(e,t)}function i(e=t.Platform.OS===`ios`?n.HapticFeedbackTypes.selection:n.HapticFeedbackTypes.effectTick,r){n.default.trigger(e,{...r})}})),$mn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=i(p()),n=(V(),d(tm)),r=LJ();function i(e){return e&&e.__esModule?e:{default:e}}var a=22,o=26;function s({type:e,height:t,option:i,index:s,fontScale:l,onItemPress:u,colors:d}){return(0,r.jsx)(n.Pressable,{onPress:u,testID:`${e}-wheel-picker-item-`+s,children:(0,r.jsx)(n.Animated.View,{style:[c.option,{height:t}],children:(0,r.jsx)(n.Text,{allowFontScaling:!1,style:[c.itemTextStyle,{fontSize:a*l,lineHeight:o*l,color:d.labelPrimary}],children:i})})})}e.default=t.default.memo(s);var c=n.StyleSheet.create({option:{alignItems:`center`,justifyContent:`center`,zIndex:100},itemTextStyle:{fontWeight:`400`}})})),ehn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=l(p()),n=(V(),d(tm)),r=c(R4()),i=Gmn(),a=Qmn(),o=c($mn()),s=LJ();function c(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(l=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}function u({type:e,initialScrollIndex:c,selectedIndex:l,options:u,onChange:d,visibleRest:p=3,decelerationRate:m=`normal`,colors:h}){let{width:g}=(0,n.useWindowDimensions)(),_=(0,i.useFontScale)(),v=Math.round(35*_),y=v*p,b=(0,t.useRef)(null),x=(0,t.useRef)(null),S=(0,t.useMemo)(()=>new n.Animated.Value(0),[]),C=(1+p*2)*v,w=(0,t.useMemo)(()=>{let e=[...u];for(let t=0;t<p;t++)e.unshift(null),e.push(null);return e},[u,p]),T=(0,t.useMemo)(()=>[...Array(w.length)].map((e,t)=>t*v),[w,v]),E=(0,t.useRef)(v);(0,t.useEffect)(()=>{E.current!==v&&(E.current=v,x.current=l,b.current?.scrollToOffset({offset:l*v,animated:!1}))},[v,l]);let D=(0,t.useCallback)(e=>{let t=Math.min(v*(u.length-1),Math.max(e.nativeEvent.contentOffset.y,0)),n=Math.floor(Math.floor(t)/v);Math.floor(t%v)>v/2&&n++,n!==l&&d(n)},[v,u.length,l,d]),O=(0,t.useCallback)(e=>{n.Platform.OS!==`web`&&x.current!==e&&(x.current=e,(0,a.triggerHaptic)())},[]),k=(0,t.useCallback)(e=>{let t=Math.round(Math.round(e.nativeEvent.contentOffset.y)/v),r=Math.min(u.length-1,Math.max(t,0));O(r),r!==l&&d(r),n.Platform.OS===`web`&&b.current?.scrollToIndex({index:r,animated:!0})},[O,d,l,u.length,v]),A=(0,i.useDebouncedCallback)(k,100),ee=(0,t.useCallback)(e=>{d(e),b.current?.scrollToIndex({index:e,animated:!0})},[d]);return(0,s.jsxs)(n.View,{style:[f.containerPicker,{height:C,backgroundColor:h.iosKeyboardPicker}],testID:`${e}-wheel-picker`,children:[(0,s.jsx)(n.View,{style:[f.selectedIndicator,{backgroundColor:h.iosSelectorKeyboard,transform:[{translateY:-v/2}],height:v,width:g-32-20}]}),(0,s.jsx)(n.Animated.FlatList,{testID:`${e}-wheel-picker-list`,ref:b,style:f.scrollView,showsVerticalScrollIndicator:!1,onScroll:n.Animated.event([{nativeEvent:{contentOffset:{y:S}}}],{useNativeDriver:n.Platform.OS!==`web`,listener:n.Platform.OS===`web`?A:k}),onMomentumScrollEnd:D,snapToInterval:v,snapToOffsets:T,decelerationRate:m,initialScrollIndex:c,getItemLayout:(e,t)=>({length:v,offset:v*t,index:t}),data:w,keyExtractor:(e,t)=>t.toString(),renderItem:({item:t,index:n})=>(0,s.jsx)(o.default,{type:e,index:n,option:t,height:v,fontScale:_,onItemPress:()=>ee(Math.max(0,Math.min(n-p,u.length-1))),colors:h})}),(0,s.jsx)(r.default,{colors:[h.iosKeyboardPicker+`FF`,h.iosKeyboardPicker+`4D`],style:[f.mask,{top:0,height:y}]}),(0,s.jsx)(r.default,{colors:[h.iosKeyboardPicker+`4D`,h.iosKeyboardPicker+`FF`],style:[f.mask,{bottom:0,height:y}]})]})}e.default=t.default.memo(u);var f=n.StyleSheet.create({containerPicker:{borderTopLeftRadius:13,borderTopRightRadius:13,overflow:`hidden`},selectedIndicator:{position:`absolute`,borderRadius:7,top:`50%`,alignSelf:`center`},scrollView:{overflow:`hidden`,flex:1},mask:{position:`absolute`,left:0,right:0,pointerEvents:`none`}})})),thn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=u(p()),n=(V(),d(tm)),r=k7(),i=j7(),a=l(P7()),o=l(N7()),s=l(ehn()),c=LJ();function l(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(u=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}e.default=(0,t.memo)(e=>{let{isVisible:l,items:u,initialScrollIndex:d,type:p,onCancel:m,onConfirm:h,onDismiss:g}=e,{t:_}=(0,i.useLanguage)(),v=(0,r.useSemanticColors)(),[y,b]=(0,t.useState)(d),x=(0,t.useCallback)(e=>{b(e)},[]),S=(0,t.useCallback)(()=>{h(parseFloat(u[y]))},[u,y,h]),C=(0,t.useCallback)(()=>{b(d),m()},[d,m]);return(0,c.jsx)(a.default,{isVisible:l,onModalHide:g,containerStyle:{backgroundColor:v.bgTransparent},children:(0,c.jsxs)(n.View,{testID:`${p}-wheelpicker-modal`,children:[(0,c.jsx)(s.default,{type:p,selectedIndex:y,initialScrollIndex:d,options:u,onChange:x,colors:v}),(0,c.jsxs)(n.View,{style:f.buttonContainer,children:[(0,c.jsx)(n.Pressable,{testID:`${p}-wheel-picker-modal-confirm-button`,accessibilityRole:`button`,onPress:S,style:({pressed:e})=>[f.confirmButton,{backgroundColor:e?v.iosButtonHighlight:v.iosKeyboardPicker}],children:(0,c.jsx)(o.default,{style:[f.buttonText,{color:v.textKeyboardButtons}],children:_(`button_confirm`)})}),(0,c.jsx)(n.Pressable,{testID:`${p}-wheel-picker-modal-cancel-button`,accessibilityRole:`button`,onPress:C,style:({pressed:e})=>[f.secondaryButton,{backgroundColor:e?v.iosButtonHighlight:v.iosKeyboardPicker}],children:(0,c.jsx)(o.default,{style:[f.cancelText,{color:v.textKeyboardButtons}],children:_(`button_cancel`)})})]})]})})});var f=n.StyleSheet.create({buttonContainer:{gap:8},buttonText:{fontSize:17,lineHeight:22,fontWeight:`400`,paddingHorizontal:16,paddingVertical:14,textAlign:`center`},secondaryButton:{borderRadius:13},cancelText:{fontSize:17,lineHeight:22,fontWeight:`600`,paddingHorizontal:16,paddingVertical:14,textAlign:`center`},confirmButton:{borderBottomLeftRadius:13,borderBottomRightRadius:13}})})),nhn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=g(p()),n=(V(),d(tm)),r=h(qmn()),i=h(Jmn()),a=A7(),o=k7(),s=j7(),c=O7(),l=M7(),u=h(N7()),f=h(thn()),m=LJ();function h(e){return e&&e.__esModule?e:{default:e}}function g(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(g=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}var _=(0,l.createSequentialArrayInteger)(a.CARBOHYDRATES_LIMITS.min,a.CARBOHYDRATES_LIMITS.max);function v({carbsRecommendation:e,editedCarbsRecommendation:a,onDismiss:c,onConfirm:l}){let{t:d}=(0,s.useLanguage)(),p=(0,o.useSemanticColors)(),[h,g]=(0,t.useState)(!1),v=(0,t.useCallback)(()=>{g(!1)},[]),b=(0,t.useCallback)(()=>{g(!0)},[]),x=(0,t.useCallback)(e=>{g(!1),l(e)},[l]),S=(0,t.useCallback)(()=>{if(a!==null)return _.findIndex(e=>e===a.toString());let t=Math.round(e);return _.findIndex(e=>e===t.toString())},[a,e]);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(n.View,{style:[y.card,{backgroundColor:p.bgSecondary}],testID:`carbs-recommendation-display`,children:(0,m.jsxs)(n.View,{style:y.row,children:[(0,m.jsx)(r.default,{}),(0,m.jsxs)(n.View,{style:y.body,children:[(0,m.jsxs)(n.View,{style:y.valueRow,children:[(0,m.jsx)(u.default,{style:[y.label,{color:p.labelPrimary}],children:d(`recommendation_carb_eat`)+` `}),a===null?(0,m.jsx)(u.default,{style:[y.valueBold,{color:p.labelPrimary}],children:`${e} g`}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(u.default,{style:[y.valueEdited,{color:p.labelSecondary}],children:`${e} g`}),(0,m.jsx)(u.default,{style:[y.valueBold,{color:p.labelPrimary}],children:` ${a} g`})]})]}),(0,m.jsx)(u.default,{style:[y.subtitle,{color:p.labelPrimary}],children:d(`recommendation_carb_title`)})]}),(0,m.jsx)(n.TouchableOpacity,{onPress:b,testID:`carbohydrates-edit-button`,hitSlop:10,style:y.editButton,children:(0,m.jsx)(i.default,{style:y.editIcon})})]})}),(0,m.jsx)(f.default,{type:`carbohydrates`,items:_,isVisible:h,initialScrollIndex:S(),onConfirm:x,onCancel:v,onDismiss:c})]})}e.default=v;var y=n.StyleSheet.create({card:{borderRadius:16,marginBottom:32},row:{flexDirection:`row`,justifyContent:`center`,alignItems:`center`,padding:24,gap:12},body:{flex:1},valueRow:{flexDirection:`row`,alignItems:`center`},label:{...c.FONTS.Poppins.medium_Base},valueBold:{...c.FONTS.Poppins.semiBold_Base},subtitle:{...c.FONTS.Poppins.regular_Base,lineHeight:23},valueEdited:{...c.FONTS.Poppins.regular_Base,textDecorationLine:`line-through`,opacity:.6},editIcon:{marginLeft:4},editButton:{alignSelf:`flex-start`}})})),rhn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,i(p());var t=(V(),d(tm)),n=k7(),r=LJ();function i(e){return e&&e.__esModule?e:{default:e}}function a(){let e=(0,n.useSemanticColors)(),i=Array.from({length:25},(e,t)=>`dot-${t}`);return(0,r.jsx)(t.View,{style:o.container,children:i.map(n=>(0,r.jsx)(t.View,{testID:n,style:[o.line,{backgroundColor:e.divider}]},n))})}var o=t.StyleSheet.create({container:{flexDirection:`row`,justifyContent:`space-between`,alignItems:`center`,width:`100%`},line:{width:8,height:1,borderRadius:4}});e.default=a})),ihn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,a(p());var t=i((F4(),d(P4))),n=k7(),r=LJ();function i(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(i=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}function a(e){return e&&e.__esModule?e:{default:e}}function o(e){let i=(0,n.useSemanticColors)();return(0,r.jsx)(t.default,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,r.jsx)(t.Path,{d:`M4.227 8.207a.831.831 0 011.008-.069l.087.069L12 14.295l6.678-6.088a.83.83 0 011.008-.069l.087.069c.275.25.3.643.075.919l-.075.079-7.226 6.588a.831.831 0 01-1.008.069l-.086-.069-7.226-6.588a.663.663 0 010-.998z`,fill:i.labelSecondary})})}e.default=o})),ahn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,a(p());var t=i((F4(),d(P4))),n=k7(),r=LJ();function i(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(i=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}function a(e){return e&&e.__esModule?e:{default:e}}function o(e){let i=(0,n.useSemanticColors)();return(0,r.jsx)(t.default,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,r.jsx)(t.Path,{d:`M19.773 15.793a.831.831 0 01-1.008.069l-.087-.069L12 9.704l-6.678 6.09a.831.831 0 01-1.008.068l-.087-.069a.66.66 0 01-.075-.919l.075-.079 7.226-6.588a.83.83 0 011.008-.069l.086.069 7.226 6.588a.663.663 0 010 .998z`,fill:i.labelSecondary})})}e.default=o})),ohn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,r(p());var t=r((F4(),d(P4))),n=LJ();function r(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,i=new WeakMap;return(r=function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?r(o,t,a):o[t]=e[t]);return o})(e,t)}function i(e){return(0,n.jsx)(t.default,{width:20,height:20,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,n.jsx)(t.Path,{d:`M11.7012 4.125C11.8651 3.95886 12.1261 3.95886 12.29 4.125L18.2441 10.1582C19.2467 11.1743 19.2467 12.8256 18.2441 13.8418L12.29 19.875C12.1261 20.0411 11.8661 20.0411 11.7021 19.875L5.74805 13.8418C4.74547 12.8257 4.74558 11.1744 5.74805 10.1582L11.7012 4.125Z`,fill:`#401782`,stroke:`#9B8BF3`,strokeWidth:2})})}e.default=i})),shn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.styles=e.default=void 0,o(p());var t=(V(),d(tm)),n=k7(),r=O7(),i=o(N7()),a=LJ();function o(e){return e&&e.__esModule?e:{default:e}}function s({title:e,value:r,unit:o,hasSeparator:s,testID:l,icon:u}){let d=(0,n.useSemanticColors)();return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(t.View,{style:c.itemContainer,testID:l,children:[(0,a.jsx)(t.View,{style:c.itemTitleContainer,children:(0,a.jsx)(i.default,{style:[c.title,{color:d.labelPrimary}],testID:l+`-title`,children:e})}),(0,a.jsxs)(t.View,{style:c.row,children:[u&&(0,a.jsx)(t.View,{style:c.icon,testID:l+`-icon`,children:u}),(0,a.jsx)(i.default,{style:[c.itemText,{color:d.labelSecondary}],testID:l+`-value`,children:r}),!!o&&(0,a.jsx)(t.View,{style:c.row,children:(0,a.jsx)(i.default,{style:[c.itemText,{color:d.labelSecondary}],testID:l+`-unit`,children:` `+o})})]})]}),s&&(0,a.jsx)(t.View,{style:[c.divider,{backgroundColor:d.divider}],testID:l+`-divider`})]})}e.default=s;var c=e.styles=t.StyleSheet.create({itemContainer:{flex:1,flexDirection:`row`,alignItems:`center`,justifyContent:`space-between`,paddingVertical:12,gap:8},itemTitleContainer:{alignSelf:`flex-start`},icon:{marginRight:8,alignSelf:`center`},title:{...r.FONTS.Poppins.regular_Base},itemText:{...r.FONTS.Poppins.regular_Base,textAlign:`right`},divider:{height:1},row:{flexDirection:`row`,flexShrink:1,justifyContent:`flex-end`}})})),chn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.styles=e.default=void 0;var t=g(p()),n=(V(),d(tm)),r=h(ihn()),i=h(ahn()),a=h(ohn()),o=k7(),s=j7(),c=O7(),l=M7(),u=h(N7()),f=h(shn()),m=LJ();function h(e){return e&&e.__esModule?e:{default:e}}function g(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(g=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}function _({carbIntakeValue:e,activeInsulin:c,glucoseReading:d,bloodGlucoseUnit:p,activity:h,trackExpandDetails:g}){let{t:_}=(0,s.useLanguage)(),y=(0,o.useSemanticColors)(),[b,x]=(0,t.useState)(!1),S=(0,t.useMemo)(()=>({light:_(`activity_intensity_1`),moderate:_(`activity_intensity_2`),hard:_(`activity_intensity_3`)}),[_]),C=(0,t.useCallback)(()=>{n.Platform.OS===`ios`&&n.LayoutAnimation.configureNext(n.LayoutAnimation.Presets.easeInEaseOut),x(e=>{let t=!e;return t&&g(),t})},[g]),w=(0,t.useMemo)(()=>{if(!h)return``;let{activityDuration:e,activityIntensity:t,activityReduction:n}=h,r=n?Math.round(n*100):0,i=t?`${S[t]},`:``,a=`${r}% ${_(`recommendation_reduction`)}`;return`${(e=>e<=29?`0-29 min`:e<=45?`30-45 min`:e<=60?`46-60 min`:`61-120 min`)(e)}. ${i} \n ${a}`},[S,h,_]),T=(0,t.useMemo)(()=>[{title:_(`recommendation_summary_active_insulin_title`),value:c,unit:_(c===1?`unit`:`units`),testID:`active-insulin-item`},{title:_(`Glucose`),value:(0,l.convertAndFormatBGL)(d.value,d.unit,p),unit:(0,l.formatUnit)(p),testID:`blood-glucose-item`,icon:d.source===`forecast`?(0,m.jsx)(a.default,{}):void 0},{title:_(`recommendation_carbohydrates_title`),value:e||`-`,unit:e?_(e===1?`gram`:`grams`):void 0,testID:`carbs-item`},h!==void 0&&{title:_(`recommendation_activity_title`),value:w,testID:`activity-item`}].filter(e=>e),[_,c,d,p,e,h,w]);return(0,m.jsxs)(n.View,{style:v.container,children:[(0,m.jsxs)(n.TouchableOpacity,{style:v.clickableContainer,onPress:C,hitSlop:10,children:[(0,m.jsx)(u.default,{style:[v.title,{color:y.labelSecondary}],children:_(`recommendation_card_cal_details_title`)}),(0,m.jsx)(n.View,{style:v.expandButton,testID:`chevron-`+b,children:b?(0,m.jsx)(i.default,{style:v.chevron}):(0,m.jsx)(r.default,{style:v.chevron})})]}),b&&(0,m.jsx)(n.View,{children:T.map(({title:e,unit:t,value:n,testID:r,icon:i},a,o)=>(0,m.jsx)(f.default,{icon:i,testID:r,title:e,value:n,unit:t,hasSeparator:a!==o.length-1},e))})]})}e.default=_;var v=e.styles=n.StyleSheet.create({container:{padding:16,gap:16},clickableContainer:{flexDirection:`row`,justifyContent:`center`,alignItems:`center`},expandButton:{justifyContent:`center`,alignItems:`center`},chevron:{alignSelf:`center`,marginLeft:4},title:{...c.FONTS.Poppins.medium_SM,textAlign:`center`}})})),lhn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,s(p());var t=(V(),d(tm)),n=k7(),r=j7(),i=O7(),a=s(N7()),o=LJ();function s(e){return e&&e.__esModule?e:{default:e}}function c({prefixTestID:e,onSave:i,onDelete:s,onLayout:c}){let{t:u}=(0,r.useLanguage)(),d=(0,n.useSemanticColors)();return(0,o.jsxs)(t.View,{style:[l.container,{backgroundColor:d.bgNavigationBar,borderTopColor:d.divider}],onLayout:c,testID:e+`-footer`,children:[(0,o.jsx)(t.TouchableOpacity,{style:[l.saveButton,{backgroundColor:d.bgButtonPrimary,borderColor:d.divider}],onPress:i,testID:e+`-footer-save-button`,children:(0,o.jsx)(a.default,{style:[l.saveText,{color:d.textButtonPrimary}],children:u(`button_save`)})}),(0,o.jsx)(t.TouchableOpacity,{style:[l.deleteButton,{backgroundColor:d.bgButtonSecondaryDanger,borderColor:d.buttonBorder}],onPress:s,testID:e+`-footer-delete-button`,children:(0,o.jsx)(a.default,{style:[l.deleteText,{color:d.textButtonSecondaryDanger}],children:u(`button_delete`)})})]})}var l=t.StyleSheet.create({container:{justifyContent:`flex-end`,gap:16,padding:16,borderTopWidth:1},saveButton:{paddingHorizontal:16,paddingVertical:12,borderRadius:16,borderWidth:1},deleteButton:{paddingHorizontal:16,paddingVertical:12,borderRadius:16,borderWidth:2},saveText:{...i.FONTS.Poppins.semiBold_Base,textAlign:`center`},deleteText:{...i.FONTS.Poppins.semiBold_Base,textAlign:`center`}});e.default=c})),uhn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,c(p());var t=(V(),d(tm)),n=c(R4()),r=k7(),i=j7(),a=O7(),o=c(N7()),s=LJ();function c(e){return e&&e.__esModule?e:{default:e}}function l({isEdited:e}){let{t:a}=(0,i.useLanguage)(),c=(0,r.useSemanticColors)(),{width:l}=(0,t.useWindowDimensions)();return e?(0,s.jsx)(n.default,{colors:[c.bgGradientBottom,c.bgGradientTop],style:[u.gradientContainer],testID:`edited-recommendation-header`,children:(0,s.jsxs)(t.View,{style:u.containerChanges,children:[(0,s.jsx)(o.default,{style:[u.text,{color:c.textCarbRecommendation}],children:a(`recommendation_change_title`).toUpperCase()}),(0,s.jsx)(o.default,{style:[u.text,u.textCrossed,{color:c.textCarbRecommendation}],children:a(`recommendation_card_title`).toUpperCase()})]})}):(0,s.jsx)(n.default,{colors:[c.bgGradientBottom,c.bgGradientTop],style:[u.gradientContainer,{width:l-32}],testID:`initial-recommendation-header`,children:(0,s.jsx)(t.View,{style:u.container,children:(0,s.jsx)(o.default,{style:[u.text,{color:c.textCarbRecommendation}],children:a(`recommendation_card_title`).toUpperCase()})})})}var u=t.StyleSheet.create({gradientContainer:{borderTopLeftRadius:16,borderTopRightRadius:16},container:{flex:1,paddingVertical:20},containerChanges:{flex:1,paddingVertical:8},text:{...a.FONTS.Poppins.medium_Base,textAlign:`center`},textCrossed:{textDecorationLine:`line-through`,opacity:.5}});e.default=l})),dhn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=_(p()),n=(V(),d(tm)),r=Nan(),i=E2(),a=g(Jmn()),o=A7(),s=k7(),c=j7(),l=O7(),u=M7(),f=g(N7()),m=g(thn()),h=LJ();function g(e){return e&&e.__esModule?e:{default:e}}function _(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(_=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}function v({initialValue:e,editedValue:l,wasLimited:d,injectionMethod:p,onDismiss:g,onConfirm:_}){let{t:v}=(0,c.useLanguage)(),b=(0,s.useSemanticColors)(),[x,S]=(0,t.useState)(!1),C=(0,t.useCallback)(()=>{S(!0)},[]),w=(0,t.useCallback)(()=>{S(!1)},[]),T=(0,t.useCallback)(e=>{S(!1),_(e)},[_]),E=(0,t.useMemo)(()=>{let{min:t,max:n}=o.INSULIN_DOSE_LIMITS,r=d?e:n;return p===i.InjectionMethod.Pump?(0,u.createSequentialArrayDecimal)(t,r):p===i.InjectionMethod.PenWhole?(0,u.createSequentialArrayInteger)(t,r):(0,u.createSequentialArrayHalf)(t,r)},[p,e,d]),D=(0,t.useMemo)(()=>p===i.InjectionMethod.PenWhole?0:1,[p]),O=(0,t.useCallback)(()=>{if(l!==null)return E.findIndex(e=>e===l.toFixed(D));let t=(0,r.roundInsulinValue)(e,p);return E.findIndex(e=>e===t.toFixed(D))},[l,e,E,p,D]);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(n.View,{style:[y.container,{backgroundColor:b.bgSecondary}],children:[(0,h.jsx)(f.default,{style:[y.title,{color:b.labelSecondary}],testID:`insulin-display-title`,children:v(`recommendation_rapid_title`)}),(0,h.jsxs)(n.TouchableOpacity,{style:y.row,testID:`insulin-current-value-container`,onPress:C,children:[(0,h.jsx)(f.default,{style:[y.value,{color:b.labelPrimary}],testID:`insulin-value`,children:`${l??e} `}),(0,h.jsx)(n.TouchableOpacity,{onPress:C,testID:`insulin-edit-button`,hitSlop:10,children:(0,h.jsx)(a.default,{})})]}),l===null?(0,h.jsx)(f.default,{style:[y.unit,{color:b.labelSecondary}],testID:`insulin-current-unit`,children:v(e===1?`unit`:`units`)}):(0,h.jsxs)(f.default,{style:[y.crossedOut,{color:b.labelSecondary}],testID:`insulin-initial-value`,children:[`${e} `,(0,h.jsx)(f.default,{style:[y.unit,{color:b.labelSecondary}],testID:`insulin-initial-unit`,children:v(e===1?`unit`:`units`)})]})]}),(0,h.jsx)(m.default,{type:`insulin`,items:E,isVisible:x,initialScrollIndex:O(),onConfirm:T,onCancel:w,onDismiss:g})]})}var y=n.StyleSheet.create({container:{paddingVertical:32,justifyContent:`center`,alignItems:`center`},title:{...l.FONTS.Poppins.regular_Base,marginBottom:8},row:{flexDirection:`row`,alignItems:`center`,alignContent:`center`},value:{...l.FONTS.Poppins.bold_6XL,lineHeight:n.Platform.select({ios:0,default:l.FONTS.Poppins.bold_6XL.lineHeight}),textAlign:`center`},crossedOut:{...l.FONTS.Poppins.medium_2XL,textDecorationLine:`line-through`},unit:{...l.FONTS.Poppins.medium_2XL}});e.default=v})),F7=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.styles=void 0;var t=(V(),d(tm)),n=O7();e.styles=t.StyleSheet.create({containerStyle:{opacity:.5},handleIndicatorStyle:{display:`none`},title:{...n.FONTS.Poppins.semiBold_2XL,marginBottom:4},message:{marginBottom:32},buttonContainer:{gap:16},button:{paddingHorizontal:16,paddingVertical:12,borderRadius:16},buttonText:{...n.FONTS.Poppins.semiBold_Base,textAlign:`center`},secondaryButton:{paddingHorizontal:16,paddingVertical:12,borderRadius:16,borderWidth:2},secondaryButtonText:{...n.FONTS.Poppins.semiBold_Base,textAlign:`center`}})})),fhn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,c(p());var t=(V(),d(tm)),n=k7(),r=j7(),i=c(N7()),a=c(P7()),o=F7(),s=LJ();function c(e){return e&&e.__esModule?e:{default:e}}e.default=e=>{let{isVisible:c,onPressClose:l}=e,{t:u}=(0,r.useLanguage)(),d=(0,n.useSemanticColors)();return(0,s.jsx)(a.default,{isVisible:c,children:(0,s.jsxs)(t.View,{testID:`delete-failure-modal-visible-`+c,children:[(0,s.jsx)(i.default,{style:[o.styles.title,{color:d.labelPrimary}],testID:`delete-modal-failure-title`,children:u(`new_activity_modal_no_delete_title`)}),(0,s.jsx)(i.default,{style:[o.styles.message,{color:d.labelSecondary}],testID:`delete-modal-failure-message`,children:u(`new_activity_modal_no_delete_body`)}),(0,s.jsx)(t.TouchableOpacity,{style:[o.styles.button,{backgroundColor:d.bgButtonPrimary}],onPress:l,testID:`delete-modal-failure-close-button`,children:(0,s.jsx)(i.default,{style:[o.styles.buttonText,{color:d.textButtonPrimary}],children:u(`button_close`)})})]})})}})),phn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,c(p());var t=(V(),d(tm)),n=k7(),r=j7(),i=c(N7()),a=c(P7()),o=F7(),s=LJ();function c(e){return e&&e.__esModule?e:{default:e}}e.default=e=>{let{isVisible:c,onPressDelete:l,onPressCancel:u,onDismiss:d}=e,{t:f}=(0,r.useLanguage)(),p=(0,n.useSemanticColors)();return(0,s.jsx)(a.default,{onModalHide:d,isVisible:c,children:(0,s.jsxs)(t.View,{testID:`delete-modal-visible-`+c,children:[(0,s.jsx)(i.default,{style:[o.styles.title,{color:p.labelPrimary}],testID:`delete-modal-title`,children:f(`recommendation_modal_delete_rec_title`)}),(0,s.jsx)(i.default,{style:[o.styles.message,{color:p.labelSecondary}],testID:`delete-modal-message`,children:f(`recommendation_modal_delete_rec_body`)}),(0,s.jsxs)(t.View,{style:o.styles.buttonContainer,children:[(0,s.jsx)(t.TouchableOpacity,{style:[o.styles.button,{backgroundColor:p.bgButtonPrimaryDanger}],onPress:l,testID:`delete-modal-delete-button`,children:(0,s.jsx)(i.default,{style:[o.styles.buttonText,{color:p.textButtonPrimary}],children:f(`recommendation_modal_delete_rec_button_danger_delete`)})}),(0,s.jsx)(t.TouchableOpacity,{style:[o.styles.secondaryButton,{backgroundColor:p.bgButtonSecondary,borderColor:p.buttonBorder}],onPress:u,testID:`delete-modal-cancel-button`,children:(0,s.jsx)(i.default,{style:[o.styles.secondaryButtonText,{color:p.textButtonSecondary}],children:f(`button_cancel`)})})]})]})})}})),mhn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,c(p());var t=(V(),d(tm)),n=k7(),r=j7(),i=c(N7()),a=c(P7()),o=F7(),s=LJ();function c(e){return e&&e.__esModule?e:{default:e}}e.default=e=>{let{isVisible:c,onPressClose:l}=e,{t:u}=(0,r.useLanguage)(),d=(0,n.useSemanticColors)();return(0,s.jsx)(a.default,{isVisible:c,children:(0,s.jsxs)(t.View,{testID:`edit-failure-modal-visible-`+c,children:[(0,s.jsx)(i.default,{style:[o.styles.title,{color:d.labelPrimary}],testID:`edit-modal-failure-title`,children:u(`glucose_modal_changes_title`)}),(0,s.jsx)(i.default,{style:[o.styles.message,{color:d.labelSecondary}],testID:`edit-modal-failure-message`,children:u(`glucose_modal_changes_body`)}),(0,s.jsx)(t.TouchableOpacity,{style:[o.styles.button,{backgroundColor:d.bgButtonPrimary}],onPress:l,testID:`edit-modal-failure-close-button`,children:(0,s.jsx)(i.default,{style:[o.styles.buttonText,{color:d.textButtonPrimary}],children:u(`glucose_modal_changes_button_confirm`)})})]})})}})),hhn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.getLimitedValue=m;var t=f(p()),n=(V(),d(tm)),r=E2(),i=k7(),a=j7(),o=u(N7()),s=u(P7()),c=F7(),l=LJ();function u(e){return e&&e.__esModule?e:{default:e}}function f(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(f=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}function m(e){return r.CONSTANTS.INSULIN_DOSE_MAX-r.CONSTANTS.INSULIN_DOSE_MAX*e}e.default=e=>{let{isVisible:u,activityReduction:d,onPress:f}=e,{t:p}=(0,a.useLanguage)(),h=(0,i.useSemanticColors)(),g=(0,t.useMemo)(()=>d===null?p(`recommendation_modal_safety_limitation_body`,{SAFETY_INSULIN_LIMIT:`${r.CONSTANTS.INSULIN_DOSE_MAX}`}):p(`recommendation_modal_safety_limitation2_body`,{0:`${m(d)}`,SAFETY_INSULIN_LIMIT:`${r.CONSTANTS.INSULIN_DOSE_MAX}`,1:`${(d*100).toFixed(0)}`,2:`${m(d)}`}),[d,p]);return(0,l.jsx)(s.default,{isVisible:u,children:(0,l.jsxs)(n.View,{testID:`limitation-modal-visible-`+u,children:[(0,l.jsx)(o.default,{style:[c.styles.title,{color:h.labelPrimary}],children:p(`recommendation_modal_safety_limitation_title`)}),(0,l.jsx)(o.default,{style:[c.styles.message,{color:h.labelSecondary}],testID:`limitation-modal-message`,children:g}),(0,l.jsx)(n.TouchableOpacity,{style:[c.styles.button,{backgroundColor:h.bgButtonPrimary}],onPress:f,testID:`limitation-modal-button`,children:(0,l.jsx)(o.default,{style:[c.styles.buttonText,{color:h.textButtonPrimary}],children:p(`button_understood`)})})]})})}})),ghn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,c(p());var t=(V(),d(tm)),n=k7(),r=j7(),i=c(N7()),a=c(P7()),o=F7(),s=LJ();function c(e){return e&&e.__esModule?e:{default:e}}e.default=e=>{let{isVisible:c,onPressClose:l}=e,{t:u}=(0,r.useLanguage)(),d=(0,n.useSemanticColors)();return(0,s.jsx)(a.default,{isVisible:c,children:(0,s.jsxs)(t.View,{testID:`save-failure-modal-visible-`+c,children:[(0,s.jsx)(i.default,{style:[o.styles.title,{color:d.labelPrimary}],testID:`save-modal-failure-title`,children:u(`no_save_modal_title`)}),(0,s.jsx)(i.default,{style:[o.styles.message,{color:d.labelSecondary}],testID:`save-modal-failure-message`,children:u(`no_save_modal_body`)}),(0,s.jsx)(t.TouchableOpacity,{style:[o.styles.button,{backgroundColor:d.bgButtonPrimary}],onPress:l,testID:`save-modal-failure-close-button`,children:(0,s.jsx)(i.default,{style:[o.styles.buttonText,{color:d.textButtonPrimary}],children:u(`button_close`)})})]})})}})),_hn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,c(p());var t=(V(),d(tm)),n=k7(),r=j7(),i=c(N7()),a=c(P7()),o=F7(),s=LJ();function c(e){return e&&e.__esModule?e:{default:e}}e.default=e=>{let{isVisible:c,onPressViewInLogbook:l,onPressCancel:u,onDismiss:d}=e,{t:f}=(0,r.useLanguage)(),p=(0,n.useSemanticColors)(),m=t.Platform.OS===`web`;return(0,s.jsx)(a.default,{checkmark:!0,onModalHide:d,isVisible:c,children:(0,s.jsxs)(t.View,{testID:`timeout-modal-visible-`+c,children:[(0,s.jsx)(i.default,{style:[o.styles.title,{color:p.labelPrimary}],testID:`timeout-modal-title`,children:f(`recommendation_modal_auto_saved_title`)}),(0,s.jsx)(i.default,{style:[o.styles.message,{color:p.labelSecondary}],testID:`timeout-modal-message`,children:f(`recommendation_modal_auto_saved_body`)}),(0,s.jsxs)(t.View,{style:o.styles.buttonContainer,children:[!m&&(0,s.jsx)(t.TouchableOpacity,{style:[o.styles.button,{backgroundColor:p.bgButtonPrimary}],onPress:l,testID:`timeout-modal-view-button`,children:(0,s.jsx)(i.default,{style:[o.styles.buttonText,{color:p.textButtonPrimary}],children:f(`recommendation_modal_auto_saved_button_confirm`)})}),(0,s.jsx)(t.TouchableOpacity,{style:[o.styles.secondaryButton,{backgroundColor:p.bgButtonSecondary,borderColor:p.buttonBorder}],onPress:u,testID:`timeout-modal-close-button`,children:(0,s.jsx)(i.default,{style:[o.styles.secondaryButtonText,{color:p.textButtonSecondary}],children:f(`button_close`)})})]})]})})}})),vhn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,i(p());var t=r((F4(),d(P4))),n=LJ();function r(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,i=new WeakMap;return(r=function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?r(o,t,a):o[t]=e[t]);return o})(e,t)}function i(e){return e&&e.__esModule?e:{default:e}}function a(e){return(0,n.jsxs)(t.default,{width:29,height:28,viewBox:`0 0 29 28`,fill:`none`,...e,children:[(0,n.jsx)(t.Path,{d:`M14.5 0.5C21.9558 0.5 28 6.54416 28 14C28 21.4558 21.9558 27.5 14.5 27.5C7.04416 27.5 1 21.4558 1 14C1 6.54416 7.04416 0.5 14.5 0.5Z`,fill:`#4A5DEB`}),(0,n.jsx)(t.Path,{d:`M14.5 0.5C21.9558 0.5 28 6.54416 28 14C28 21.4558 21.9558 27.5 14.5 27.5C7.04416 27.5 1 21.4558 1 14C1 6.54416 7.04416 0.5 14.5 0.5Z`,stroke:`#FFFFFF`}),(0,n.jsx)(t.Path,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M20.8158 11.1809C21.0614 11.4221 21.0614 11.8132 20.8158 12.0544L14.9448 17.8191C14.6991 18.0603 14.3009 18.0603 14.0552 17.8191L8.18424 12.0544C7.93859 11.8132 7.93859 11.4221 8.18424 11.1809C8.4299 10.9397 8.82812 10.9397 9.07378 11.1809L14.5 16.5089L19.9262 11.1809C20.1718 10.9397 20.5701 10.9397 20.8158 11.1809Z`,fill:`#FFFFFF`})]})}e.default=a})),yhn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=c(p()),n=(V(),d(tm)),r=s(R4()),i=s(vhn()),a=k7(),o=LJ();function s(e){return e&&e.__esModule?e:{default:e}}function c(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(c=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}function l({scrollToEnd:e,isVisibleArrow:s,isVisibleBlur:c}){let l=(0,a.useSemanticColors)(),d=(0,t.useRef)(new n.Animated.Value(155)).current,f=(0,t.useRef)(new n.Animated.Value(+!!c)).current;return(0,t.useEffect)(()=>{n.Animated.timing(f,{toValue:+!!c,duration:400,useNativeDriver:n.Platform.OS!==`web`}).start()},[c,f]),(0,t.useEffect)(()=>{s&&n.Animated.spring(d,{toValue:0,damping:10,stiffness:100,mass:1,useNativeDriver:n.Platform.OS!==`web`}).start()},[s,d]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.Pressable,{style:u.scrollToEndButton,testID:`scroll-hint-arrow`,children:s&&(0,o.jsx)(n.Animated.View,{style:{backgroundColor:l.bgButtonPrimary,borderRadius:24,transform:[{translateY:d}]},children:(0,o.jsx)(n.TouchableOpacity,{testID:`scroll-hint-arrow-button`,onPress:e,children:(0,o.jsx)(i.default,{})})})}),(0,o.jsx)(n.Animated.View,{style:[u.gradient,{opacity:f}],pointerEvents:`none`,testID:`scroll-hint-blur`,children:(0,o.jsx)(r.default,{colors:l.gradientQuickGuide,style:u.linearGradient})})]})}var u=n.StyleSheet.create({scrollToEndButton:{position:`absolute`,bottom:80,alignSelf:`center`},gradient:{position:`absolute`,left:0,right:0,bottom:0,height:145},linearGradient:{flex:1}});e.default=l})),I7=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getParsedType=e.ZodParsedType=e.objectUtil=e.util=void 0;var t;(function(e){e.assertEqual=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`&&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})(t||(e.util=t={}));var n;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(n||(e.objectUtil=n={})),e.ZodParsedType=t.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),e.getParsedType=t=>{switch(typeof t){case`undefined`:return e.ZodParsedType.undefined;case`string`:return e.ZodParsedType.string;case`number`:return Number.isNaN(t)?e.ZodParsedType.nan:e.ZodParsedType.number;case`boolean`:return e.ZodParsedType.boolean;case`function`:return e.ZodParsedType.function;case`bigint`:return e.ZodParsedType.bigint;case`symbol`:return e.ZodParsedType.symbol;case`object`:return Array.isArray(t)?e.ZodParsedType.array:t===null?e.ZodParsedType.null:t.then&&typeof t.then==`function`&&t.catch&&typeof t.catch==`function`?e.ZodParsedType.promise:typeof Map<`u`&&t instanceof Map?e.ZodParsedType.map:typeof Set<`u`&&t instanceof Set?e.ZodParsedType.set:typeof Date<`u`&&t instanceof Date?e.ZodParsedType.date:e.ZodParsedType.object;default:return e.ZodParsedType.unknown}}})),bhn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ZodError=e.quotelessJson=e.ZodIssueCode=void 0;var t=I7();e.ZodIssueCode=t.util.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`]),e.quotelessJson=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,`$1:`);var n=class e extends Error{get errors(){return this.issues}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}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,t.util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=e=>e.message){let t={},n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};e.ZodError=n,n.create=e=>new n(e)})),xhn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=bhn(),n=I7();e.default=(e,r)=>{let i;switch(e.code){case t.ZodIssueCode.invalid_type:i=e.received===n.ZodParsedType.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case t.ZodIssueCode.invalid_literal:i=`Invalid literal value, expected ${JSON.stringify(e.expected,n.util.jsonStringifyReplacer)}`;break;case t.ZodIssueCode.unrecognized_keys:i=`Unrecognized key(s) in object: ${n.util.joinValues(e.keys,`, `)}`;break;case t.ZodIssueCode.invalid_union:i=`Invalid input`;break;case t.ZodIssueCode.invalid_union_discriminator:i=`Invalid discriminator value. Expected ${n.util.joinValues(e.options)}`;break;case t.ZodIssueCode.invalid_enum_value:i=`Invalid enum value. Expected ${n.util.joinValues(e.options)}, received '${e.received}'`;break;case t.ZodIssueCode.invalid_arguments:i=`Invalid function arguments`;break;case t.ZodIssueCode.invalid_return_type:i=`Invalid function return type`;break;case t.ZodIssueCode.invalid_date:i=`Invalid date`;break;case t.ZodIssueCode.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(i=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(i=`${i} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?i=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?i=`Invalid input: must end with "${e.validation.endsWith}"`:n.util.assertNever(e.validation):i=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case t.ZodIssueCode.too_small:i=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`||e.type===`bigint`?`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 t.ZodIssueCode.too_big:i=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 t.ZodIssueCode.custom:i=`Invalid input`;break;case t.ZodIssueCode.invalid_intersection_types:i=`Intersection results could not be merged`;break;case t.ZodIssueCode.not_multiple_of:i=`Number must be a multiple of ${e.multipleOf}`;break;case t.ZodIssueCode.not_finite:i=`Number must be finite`;break;default:i=r.defaultError,n.util.assertNever(e)}return{message:i}}})),Shn=s((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.defaultErrorMap=void 0,e.setErrorMap=i,e.getErrorMap=a;var n=t(xhn());e.defaultErrorMap=n.default;var r=n.default;function i(e){r=e}function a(){return r}})),Chn=s((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.isAsync=e.isValid=e.isDirty=e.isAborted=e.OK=e.DIRTY=e.INVALID=e.ParseStatus=e.EMPTY_PATH=e.makeIssue=void 0,e.addIssueToContext=i;var n=Shn(),r=t(xhn());e.makeIssue=e=>{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}},e.EMPTY_PATH=[];function i(t,i){let a=(0,n.getErrorMap)(),o=(0,e.makeIssue)({issueData:i,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,a,a===r.default?void 0:r.default].filter(e=>!!e)});t.common.issues.push(o)}e.ParseStatus=class t{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(t,n){let r=[];for(let i of n){if(i.status===`aborted`)return e.INVALID;i.status===`dirty`&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(e,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return t.mergeObjectSync(e,r)}static mergeObjectSync(t,n){let r={};for(let i of n){let{key:n,value:a}=i;if(n.status===`aborted`||a.status===`aborted`)return e.INVALID;n.status===`dirty`&&t.dirty(),a.status===`dirty`&&t.dirty(),n.value!==`__proto__`&&(a.value!==void 0||i.alwaysSet)&&(r[n.value]=a.value)}return{status:t.value,value:r}}},e.INVALID=Object.freeze({status:`aborted`}),e.DIRTY=e=>({status:`dirty`,value:e}),e.OK=e=>({status:`valid`,value:e}),e.isAborted=e=>e.status===`aborted`,e.isDirty=e=>e.status===`dirty`,e.isValid=e=>e.status===`valid`,e.isAsync=e=>typeof Promise<`u`&&e instanceof Promise})),whn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),Thn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.errorUtil=void 0;var t;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(t||(e.errorUtil=t={}))})),Ehn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.discriminatedUnion=e.date=e.boolean=e.bigint=e.array=e.any=e.coerce=e.ZodFirstPartyTypeKind=e.late=e.ZodSchema=e.Schema=e.ZodReadonly=e.ZodPipeline=e.ZodBranded=e.BRAND=e.ZodNaN=e.ZodCatch=e.ZodDefault=e.ZodNullable=e.ZodOptional=e.ZodTransformer=e.ZodEffects=e.ZodPromise=e.ZodNativeEnum=e.ZodEnum=e.ZodLiteral=e.ZodLazy=e.ZodFunction=e.ZodSet=e.ZodMap=e.ZodRecord=e.ZodTuple=e.ZodIntersection=e.ZodDiscriminatedUnion=e.ZodUnion=e.ZodObject=e.ZodArray=e.ZodVoid=e.ZodNever=e.ZodUnknown=e.ZodAny=e.ZodNull=e.ZodUndefined=e.ZodSymbol=e.ZodDate=e.ZodBoolean=e.ZodBigInt=e.ZodNumber=e.ZodString=e.ZodType=void 0,e.NEVER=e.void=e.unknown=e.union=e.undefined=e.tuple=e.transformer=e.symbol=e.string=e.strictObject=e.set=e.record=e.promise=e.preprocess=e.pipeline=e.ostring=e.optional=e.onumber=e.oboolean=e.object=e.number=e.nullable=e.null=e.never=e.nativeEnum=e.nan=e.map=e.literal=e.lazy=e.intersection=e.instanceof=e.function=e.enum=e.effect=void 0,e.datetimeRegex=A,e.custom=Re;var t=bhn(),n=Shn(),r=Thn(),i=Chn(),a=I7(),o=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||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},s=(e,n)=>{if((0,i.isValid)(n))return{success:!0,data:n.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 n=new t.ZodError(e.common.issues);return this._error=n,this._error}}};function c(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 l=class{get description(){return this._def.description}_getType(e){return(0,a.getParsedType)(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:(0,a.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new i.ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:(0,a.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if((0,i.isAsync)(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:(0,a.getParsedType)(e)};return s(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,a.getParsedType)(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return(0,i.isValid)(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>(0,i.isValid)(e)?{value:e.value}:{issues:t.common.issues})}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:(0,a.getParsedType)(e)},r=this._parse({data:e,path:n.path,parent:n});return s(n,await((0,i.isAsync)(r)?r:Promise.resolve(r)))}refine(e,n){let r=e=>typeof n==`string`||n===void 0?{message:n}:typeof n==`function`?n(e):n;return this._refinement((n,i)=>{let a=e(n),o=()=>i.addIssue({code:t.ZodIssueCode.custom,...r(n)});return typeof Promise<`u`&&a instanceof Promise?a.then(e=>e?!0:(o(),!1)):a?!0:(o(),!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 Oe({schema:this,typeName:ze.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:e=>this[`~validate`](e)}}optional(){return ke.create(this,this._def)}nullable(){return Ae.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return fe.create(this)}promise(){return De.create(this,this._def)}or(e){return he.create([this,e],this._def)}and(e){return I.create(this,e,this._def)}transform(e){return new Oe({...c(this._def),schema:this,typeName:ze.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new je({...c(this._def),innerType:this,defaultValue:t,typeName:ze.ZodDefault})}brand(){return new Pe({typeName:ze.ZodBranded,type:this,...c(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new Me({...c(this._def),innerType:this,catchValue:t,typeName:ze.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Fe.create(this,e)}readonly(){return Ie.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};e.ZodType=l,e.Schema=l,e.ZodSchema=l;var u=/^c[^\s-]{8,}$/i,d=/^[0-9a-z]+$/,f=/^[0-9A-HJKMNP-TV-Z]{26}$/i,p=/^[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,m=/^[a-z0-9_-]{21}$/i,h=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,g=/^[-+]?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)?)??$/,_=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,v=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,y,b=/^(?:(?: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])$/,x=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,S=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,C=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,w=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,T=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,E=`((\\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])))`,D=RegExp(`^${E}$`);function O(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function k(e){return RegExp(`^${O(e)}$`)}function A(e){let t=`${E}T${O(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function ee(e,t){return!!((t===`v4`||!t)&&b.test(e)||(t===`v6`||!t)&&S.test(e))}function te(e,t){if(!h.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function ne(e,t){return!!((t===`v4`||!t)&&x.test(e)||(t===`v6`||!t)&&C.test(e))}var re=class e extends l{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==a.ZodParsedType.string){let n=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.string,received:n.parsedType}),i.INVALID}let n=new i.ParseStatus,r;for(let o of this._def.checks)if(o.kind===`min`)e.data.length<o.value&&(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{code:t.ZodIssueCode.too_small,minimum:o.value,type:`string`,inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind===`max`)e.data.length>o.value&&(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{code:t.ZodIssueCode.too_big,maximum:o.value,type:`string`,inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind===`length`){let a=e.data.length>o.value,s=e.data.length<o.value;(a||s)&&(r=this._getOrReturnCtx(e,r),a?(0,i.addIssueToContext)(r,{code:t.ZodIssueCode.too_big,maximum:o.value,type:`string`,inclusive:!0,exact:!0,message:o.message}):s&&(0,i.addIssueToContext)(r,{code:t.ZodIssueCode.too_small,minimum:o.value,type:`string`,inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind===`email`)_.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{validation:`email`,code:t.ZodIssueCode.invalid_string,message:o.message}),n.dirty());else if(o.kind===`emoji`)y||=new RegExp(v,`u`),y.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{validation:`emoji`,code:t.ZodIssueCode.invalid_string,message:o.message}),n.dirty());else if(o.kind===`uuid`)p.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{validation:`uuid`,code:t.ZodIssueCode.invalid_string,message:o.message}),n.dirty());else if(o.kind===`nanoid`)m.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{validation:`nanoid`,code:t.ZodIssueCode.invalid_string,message:o.message}),n.dirty());else if(o.kind===`cuid`)u.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{validation:`cuid`,code:t.ZodIssueCode.invalid_string,message:o.message}),n.dirty());else if(o.kind===`cuid2`)d.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{validation:`cuid2`,code:t.ZodIssueCode.invalid_string,message:o.message}),n.dirty());else if(o.kind===`ulid`)f.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{validation:`ulid`,code:t.ZodIssueCode.invalid_string,message:o.message}),n.dirty());else if(o.kind===`url`)try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{validation:`url`,code:t.ZodIssueCode.invalid_string,message:o.message}),n.dirty()}else o.kind===`regex`?(o.regex.lastIndex=0,o.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{validation:`regex`,code:t.ZodIssueCode.invalid_string,message:o.message}),n.dirty())):o.kind===`trim`?e.data=e.data.trim():o.kind===`includes`?e.data.includes(o.value,o.position)||(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{code:t.ZodIssueCode.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind===`toLowerCase`?e.data=e.data.toLowerCase():o.kind===`toUpperCase`?e.data=e.data.toUpperCase():o.kind===`startsWith`?e.data.startsWith(o.value)||(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{code:t.ZodIssueCode.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind===`endsWith`?e.data.endsWith(o.value)||(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{code:t.ZodIssueCode.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind===`datetime`?A(o).test(e.data)||(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{code:t.ZodIssueCode.invalid_string,validation:`datetime`,message:o.message}),n.dirty()):o.kind===`date`?D.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{code:t.ZodIssueCode.invalid_string,validation:`date`,message:o.message}),n.dirty()):o.kind===`time`?k(o).test(e.data)||(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{code:t.ZodIssueCode.invalid_string,validation:`time`,message:o.message}),n.dirty()):o.kind===`duration`?g.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{validation:`duration`,code:t.ZodIssueCode.invalid_string,message:o.message}),n.dirty()):o.kind===`ip`?ee(e.data,o.version)||(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{validation:`ip`,code:t.ZodIssueCode.invalid_string,message:o.message}),n.dirty()):o.kind===`jwt`?te(e.data,o.alg)||(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{validation:`jwt`,code:t.ZodIssueCode.invalid_string,message:o.message}),n.dirty()):o.kind===`cidr`?ne(e.data,o.version)||(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{validation:`cidr`,code:t.ZodIssueCode.invalid_string,message:o.message}),n.dirty()):o.kind===`base64`?w.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{validation:`base64`,code:t.ZodIssueCode.invalid_string,message:o.message}),n.dirty()):o.kind===`base64url`?T.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{validation:`base64url`,code:t.ZodIssueCode.invalid_string,message:o.message}),n.dirty()):a.util.assertNever(o);return{status:n.value,value:e.data}}_regex(e,n,i){return this.refinement(t=>e.test(t),{validation:n,code:t.ZodIssueCode.invalid_string,...r.errorUtil.errToObj(i)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...r.errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...r.errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...r.errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...r.errorUtil.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...r.errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...r.errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...r.errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...r.errorUtil.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...r.errorUtil.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...r.errorUtil.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...r.errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...r.errorUtil.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...r.errorUtil.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,...r.errorUtil.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,...r.errorUtil.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...r.errorUtil.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...r.errorUtil.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...r.errorUtil.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...r.errorUtil.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...r.errorUtil.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...r.errorUtil.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...r.errorUtil.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...r.errorUtil.errToObj(t)})}nonempty(e){return this.min(1,r.errorUtil.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`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let 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}};e.ZodString=re,re.create=e=>new re({checks:[],typeName:ze.ZodString,coerce:e?.coerce??!1,...c(e)});function ie(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var j=class e extends l{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)!==a.ZodParsedType.number){let n=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.number,received:n.parsedType}),i.INVALID}let n,r=new i.ParseStatus;for(let o of this._def.checks)o.kind===`int`?a.util.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.invalid_type,expected:`integer`,received:`float`,message:o.message}),r.dirty()):o.kind===`min`?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.too_small,minimum:o.value,type:`number`,inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind===`max`?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.too_big,maximum:o.value,type:`number`,inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind===`multipleOf`?ie(e.data,o.value)!==0&&(n=this._getOrReturnCtx(e,n),(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):o.kind===`finite`?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.not_finite,message:o.message}),r.dirty()):a.util.assertNever(o);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,r.errorUtil.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,r.errorUtil.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,r.errorUtil.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,r.errorUtil.toString(t))}setLimit(t,n,i,a){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:r.errorUtil.toString(a)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:r.errorUtil.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:r.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:r.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:r.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:r.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:r.errorUtil.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:r.errorUtil.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:r.errorUtil.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:r.errorUtil.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`&&a.util.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)}};e.ZodNumber=j,j.create=e=>new j({checks:[],typeName:ze.ZodNumber,coerce:e?.coerce||!1,...c(e)});var ae=class e extends l{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==a.ZodParsedType.bigint)return this._getInvalidInput(e);let n,r=new i.ParseStatus;for(let o of this._def.checks)o.kind===`min`?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.too_small,type:`bigint`,minimum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind===`max`?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.too_big,type:`bigint`,maximum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind===`multipleOf`?e.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):a.util.assertNever(o);return{status:r.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.bigint,received:n.parsedType}),i.INVALID}gte(e,t){return this.setLimit(`min`,e,!0,r.errorUtil.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,r.errorUtil.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,r.errorUtil.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,r.errorUtil.toString(t))}setLimit(t,n,i,a){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:r.errorUtil.toString(a)}]})}_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:r.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:r.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:r.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:r.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:r.errorUtil.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}};e.ZodBigInt=ae,ae.create=e=>new ae({checks:[],typeName:ze.ZodBigInt,coerce:e?.coerce??!1,...c(e)});var oe=class extends l{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==a.ZodParsedType.boolean){let n=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.boolean,received:n.parsedType}),i.INVALID}return(0,i.OK)(e.data)}};e.ZodBoolean=oe,oe.create=e=>new oe({typeName:ze.ZodBoolean,coerce:e?.coerce||!1,...c(e)});var se=class e extends l{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==a.ZodParsedType.date){let n=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.date,received:n.parsedType}),i.INVALID}if(Number.isNaN(e.data.getTime())){let n=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.invalid_date}),i.INVALID}let n=new i.ParseStatus,r;for(let o of this._def.checks)o.kind===`min`?e.data.getTime()<o.value&&(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{code:t.ZodIssueCode.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:`date`}),n.dirty()):o.kind===`max`?e.data.getTime()>o.value&&(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{code:t.ZodIssueCode.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:`date`}),n.dirty()):a.util.assertNever(o);return{status:n.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:r.errorUtil.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:r.errorUtil.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)}};e.ZodDate=se,se.create=e=>new se({checks:[],coerce:e?.coerce||!1,typeName:ze.ZodDate,...c(e)});var M=class extends l{_parse(e){if(this._getType(e)!==a.ZodParsedType.symbol){let n=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.symbol,received:n.parsedType}),i.INVALID}return(0,i.OK)(e.data)}};e.ZodSymbol=M,M.create=e=>new M({typeName:ze.ZodSymbol,...c(e)});var ce=class extends l{_parse(e){if(this._getType(e)!==a.ZodParsedType.undefined){let n=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.undefined,received:n.parsedType}),i.INVALID}return(0,i.OK)(e.data)}};e.ZodUndefined=ce,ce.create=e=>new ce({typeName:ze.ZodUndefined,...c(e)});var N=class extends l{_parse(e){if(this._getType(e)!==a.ZodParsedType.null){let n=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.null,received:n.parsedType}),i.INVALID}return(0,i.OK)(e.data)}};e.ZodNull=N,N.create=e=>new N({typeName:ze.ZodNull,...c(e)});var P=class extends l{constructor(){super(...arguments),this._any=!0}_parse(e){return(0,i.OK)(e.data)}};e.ZodAny=P,P.create=e=>new P({typeName:ze.ZodAny,...c(e)});var le=class extends l{constructor(){super(...arguments),this._unknown=!0}_parse(e){return(0,i.OK)(e.data)}};e.ZodUnknown=le,le.create=e=>new le({typeName:ze.ZodUnknown,...c(e)});var ue=class extends l{_parse(e){let n=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.never,received:n.parsedType}),i.INVALID}};e.ZodNever=ue,ue.create=e=>new ue({typeName:ze.ZodNever,...c(e)});var de=class extends l{_parse(e){if(this._getType(e)!==a.ZodParsedType.undefined){let n=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.void,received:n.parsedType}),i.INVALID}return(0,i.OK)(e.data)}};e.ZodVoid=de,de.create=e=>new de({typeName:ze.ZodVoid,...c(e)});var fe=class e extends l{_parse(e){let{ctx:n,status:r}=this._processInputParams(e),s=this._def;if(n.parsedType!==a.ZodParsedType.array)return(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.array,received:n.parsedType}),i.INVALID;if(s.exactLength!==null){let e=n.data.length>s.exactLength.value,a=n.data.length<s.exactLength.value;(e||a)&&((0,i.addIssueToContext)(n,{code:e?t.ZodIssueCode.too_big:t.ZodIssueCode.too_small,minimum:a?s.exactLength.value:void 0,maximum:e?s.exactLength.value:void 0,type:`array`,inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&((0,i.addIssueToContext)(n,{code:t.ZodIssueCode.too_small,minimum:s.minLength.value,type:`array`,inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&((0,i.addIssueToContext)(n,{code:t.ZodIssueCode.too_big,maximum:s.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((e,t)=>s.type._parseAsync(new o(n,e,n.path,t)))).then(e=>i.ParseStatus.mergeArray(r,e));let c=[...n.data].map((e,t)=>s.type._parseSync(new o(n,e,n.path,t)));return i.ParseStatus.mergeArray(r,c)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:r.errorUtil.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:r.errorUtil.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:r.errorUtil.toString(n)}})}nonempty(e){return this.min(1,e)}};e.ZodArray=fe,fe.create=(e,t)=>new fe({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ze.ZodArray,...c(t)});function pe(e){if(e instanceof me){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=ke.create(pe(r))}return new me({...e._def,shape:()=>t})}else if(e instanceof fe)return new fe({...e._def,type:pe(e.element)});else if(e instanceof ke)return ke.create(pe(e.unwrap()));else if(e instanceof Ae)return Ae.create(pe(e.unwrap()));else if(e instanceof ve)return ve.create(e.items.map(e=>pe(e)));else return e}var me=class e extends l{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=a.util.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==a.ZodParsedType.object){let n=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.object,received:n.parsedType}),i.INVALID}let{status:n,ctx:r}=this._processInputParams(e),{shape:s,keys:c}=this._getCached(),l=[];if(!(this._def.catchall instanceof ue&&this._def.unknownKeys===`strip`))for(let e in r.data)c.includes(e)||l.push(e);let u=[];for(let e of c){let t=s[e],n=r.data[e];u.push({key:{status:`valid`,value:e},value:t._parse(new o(r,n,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof ue){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of l)u.push({key:{status:`valid`,value:e},value:{status:`valid`,value:r.data[e]}});else if(e===`strict`)l.length>0&&((0,i.addIssueToContext)(r,{code:t.ZodIssueCode.unrecognized_keys,keys:l}),n.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of l){let n=r.data[t];u.push({key:{status:`valid`,value:t},value:e._parse(new o(r,n,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of u){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>i.ParseStatus.mergeObjectSync(n,e)):i.ParseStatus.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(t){return r.errorUtil.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let i=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:r.errorUtil.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:ze.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of a.util.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of a.util.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return pe(this)}partial(t){let n={};for(let e of a.util.objectKeys(this.shape)){let r=this.shape[e];t&&!t[e]?n[e]=r:n[e]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of a.util.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof ke;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return we(a.util.objectKeys(this.shape))}};e.ZodObject=me,me.create=(e,t)=>new me({shape:()=>e,unknownKeys:`strip`,catchall:ue.create(),typeName:ze.ZodObject,...c(t)}),me.strictCreate=(e,t)=>new me({shape:()=>e,unknownKeys:`strict`,catchall:ue.create(),typeName:ze.ZodObject,...c(t)}),me.lazycreate=(e,t)=>new me({shape:e,unknownKeys:`strip`,catchall:ue.create(),typeName:ze.ZodObject,...c(t)});var he=class extends l{_parse(e){let{ctx:n}=this._processInputParams(e),r=this._def.options;function a(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let t of e)if(t.result.status===`dirty`)return n.common.issues.push(...t.ctx.common.issues),t.result;let r=e.map(e=>new t.ZodError(e.ctx.common.issues));return(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.invalid_union,unionErrors:r}),i.INVALID}if(n.common.async)return Promise.all(r.map(async e=>{let t={...n,common:{...n.common,issues:[]},parent:null};return{result:await e._parseAsync({data:n.data,path:n.path,parent:t}),ctx:t}})).then(a);{let e,a=[];for(let t of r){let r={...n,common:{...n.common,issues:[]},parent:null},i=t._parseSync({data:n.data,path:n.path,parent:r});if(i.status===`valid`)return i;i.status===`dirty`&&!e&&(e={result:i,ctx:r}),r.common.issues.length&&a.push(r.common.issues)}if(e)return n.common.issues.push(...e.ctx.common.issues),e.result;let o=a.map(e=>new t.ZodError(e));return(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.invalid_union,unionErrors:o}),i.INVALID}}get options(){return this._def.options}};e.ZodUnion=he,he.create=(e,t)=>new he({options:e,typeName:ze.ZodUnion,...c(t)});var ge=e=>e instanceof Se?ge(e.schema):e instanceof Oe?ge(e.innerType()):e instanceof Ce?[e.value]:e instanceof Te?e.options:e instanceof Ee?a.util.objectValues(e.enum):e instanceof je?ge(e._def.innerType):e instanceof ce?[void 0]:e instanceof N?[null]:e instanceof ke?[void 0,...ge(e.unwrap())]:e instanceof Ae?[null,...ge(e.unwrap())]:e instanceof Pe||e instanceof Ie?ge(e.unwrap()):e instanceof Me?ge(e._def.innerType):[],F=class e extends l{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==a.ZodParsedType.object)return(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.object,received:n.parsedType}),i.INVALID;let r=this.discriminator,o=n.data[r],s=this.optionsMap.get(o);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):((0,i.addIssueToContext)(n,{code:t.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),i.INVALID)}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=ge(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:ze.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...c(r)})}};e.ZodDiscriminatedUnion=F;function _e(e,t){let n=(0,a.getParsedType)(e),r=(0,a.getParsedType)(t);if(e===t)return{valid:!0,data:e};if(n===a.ZodParsedType.object&&r===a.ZodParsedType.object){let n=a.util.objectKeys(t),r=a.util.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=_e(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}else if(n===a.ZodParsedType.array&&r===a.ZodParsedType.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=_e(i,a);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}else if(n===a.ZodParsedType.date&&r===a.ZodParsedType.date&&+e==+t)return{valid:!0,data:e};else return{valid:!1}}var I=class extends l{_parse(e){let{status:n,ctx:r}=this._processInputParams(e),a=(e,a)=>{if((0,i.isAborted)(e)||(0,i.isAborted)(a))return i.INVALID;let o=_e(e.value,a.value);return o.valid?(((0,i.isDirty)(e)||(0,i.isDirty)(a))&&n.dirty(),{status:n.value,value:o.data}):((0,i.addIssueToContext)(r,{code:t.ZodIssueCode.invalid_intersection_types}),i.INVALID)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([e,t])=>a(e,t)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};e.ZodIntersection=I,I.create=(e,t,n)=>new I({left:e,right:t,typeName:ze.ZodIntersection,...c(n)});var ve=class e extends l{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==a.ZodParsedType.array)return(0,i.addIssueToContext)(r,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.array,received:r.parsedType}),i.INVALID;if(r.data.length<this._def.items.length)return(0,i.addIssueToContext)(r,{code:t.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),i.INVALID;!this._def.rest&&r.data.length>this._def.items.length&&((0,i.addIssueToContext)(r,{code:t.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),n.dirty());let s=[...r.data].map((e,t)=>{let n=this._def.items[t]||this._def.rest;return n?n._parse(new o(r,e,r.path,t)):null}).filter(e=>!!e);return r.common.async?Promise.all(s).then(e=>i.ParseStatus.mergeArray(n,e)):i.ParseStatus.mergeArray(n,s)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};e.ZodTuple=ve,ve.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new ve({items:e,typeName:ze.ZodTuple,rest:null,...c(t)})};var ye=class e extends l{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==a.ZodParsedType.object)return(0,i.addIssueToContext)(r,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.object,received:r.parsedType}),i.INVALID;let s=[],c=this._def.keyType,l=this._def.valueType;for(let e in r.data)s.push({key:c._parse(new o(r,e,r.path,e)),value:l._parse(new o(r,r.data[e],r.path,e)),alwaysSet:e in r.data});return r.common.async?i.ParseStatus.mergeObjectAsync(n,s):i.ParseStatus.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof l?new e({keyType:t,valueType:n,typeName:ze.ZodRecord,...c(r)}):new e({keyType:re.create(),valueType:t,typeName:ze.ZodRecord,...c(n)})}};e.ZodRecord=ye;var be=class extends l{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==a.ZodParsedType.map)return(0,i.addIssueToContext)(r,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.map,received:r.parsedType}),i.INVALID;let s=this._def.keyType,c=this._def.valueType,l=[...r.data.entries()].map(([e,t],n)=>({key:s._parse(new o(r,e,r.path,[n,`key`])),value:c._parse(new o(r,t,r.path,[n,`value`]))}));if(r.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let t of l){let r=await t.key,a=await t.value;if(r.status===`aborted`||a.status===`aborted`)return i.INVALID;(r.status===`dirty`||a.status===`dirty`)&&n.dirty(),e.set(r.value,a.value)}return{status:n.value,value:e}})}else{let e=new Map;for(let t of l){let r=t.key,a=t.value;if(r.status===`aborted`||a.status===`aborted`)return i.INVALID;(r.status===`dirty`||a.status===`dirty`)&&n.dirty(),e.set(r.value,a.value)}return{status:n.value,value:e}}}};e.ZodMap=be,be.create=(e,t,n)=>new be({valueType:t,keyType:e,typeName:ze.ZodMap,...c(n)});var xe=class e extends l{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==a.ZodParsedType.set)return(0,i.addIssueToContext)(r,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.set,received:r.parsedType}),i.INVALID;let s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&((0,i.addIssueToContext)(r,{code:t.ZodIssueCode.too_small,minimum:s.minSize.value,type:`set`,inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&((0,i.addIssueToContext)(r,{code:t.ZodIssueCode.too_big,maximum:s.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());let c=this._def.valueType;function l(e){let t=new Set;for(let r of e){if(r.status===`aborted`)return i.INVALID;r.status===`dirty`&&n.dirty(),t.add(r.value)}return{status:n.value,value:t}}let u=[...r.data.values()].map((e,t)=>c._parse(new o(r,e,r.path,t)));return r.common.async?Promise.all(u).then(e=>l(e)):l(u)}min(t,n){return new e({...this._def,minSize:{value:t,message:r.errorUtil.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:r.errorUtil.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};e.ZodSet=xe,xe.create=(e,t)=>new xe({valueType:e,minSize:null,maxSize:null,typeName:ze.ZodSet,...c(t)});var L=class e extends l{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==a.ZodParsedType.function)return(0,i.addIssueToContext)(r,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.function,received:r.parsedType}),i.INVALID;function o(e,a){return(0,i.makeIssue)({data:e,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,(0,n.getErrorMap)(),n.defaultErrorMap].filter(e=>!!e),issueData:{code:t.ZodIssueCode.invalid_arguments,argumentsError:a}})}function s(e,a){return(0,i.makeIssue)({data:e,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,(0,n.getErrorMap)(),n.defaultErrorMap].filter(e=>!!e),issueData:{code:t.ZodIssueCode.invalid_return_type,returnTypeError:a}})}let c={errorMap:r.common.contextualErrorMap},l=r.data;if(this._def.returns instanceof De){let e=this;return(0,i.OK)(async function(...n){let r=new t.ZodError([]),i=await e._def.args.parseAsync(n,c).catch(e=>{throw r.addIssue(o(n,e)),r}),a=await Reflect.apply(l,this,i);return await e._def.returns._def.type.parseAsync(a,c).catch(e=>{throw r.addIssue(s(a,e)),r})})}else{let e=this;return(0,i.OK)(function(...n){let r=e._def.args.safeParse(n,c);if(!r.success)throw new t.ZodError([o(n,r.error)]);let i=Reflect.apply(l,this,r.data),a=e._def.returns.safeParse(i,c);if(!a.success)throw new t.ZodError([s(i,a.error)]);return a.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:ve.create(t).rest(le.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||ve.create([]).rest(le.create()),returns:n||le.create(),typeName:ze.ZodFunction,...c(r)})}};e.ZodFunction=L;var Se=class extends l{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})}};e.ZodLazy=Se,Se.create=(e,t)=>new Se({getter:e,typeName:ze.ZodLazy,...c(t)});var Ce=class extends l{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(n,{received:n.data,code:t.ZodIssueCode.invalid_literal,expected:this._def.value}),i.INVALID}return{status:`valid`,value:e.data}}get value(){return this._def.value}};e.ZodLiteral=Ce,Ce.create=(e,t)=>new Ce({value:e,typeName:ze.ZodLiteral,...c(t)});function we(e,t){return new Te({values:e,typeName:ze.ZodEnum,...c(t)})}var Te=class e extends l{_parse(e){if(typeof e.data!=`string`){let n=this._getOrReturnCtx(e),r=this._def.values;return(0,i.addIssueToContext)(n,{expected:a.util.joinValues(r),received:n.parsedType,code:t.ZodIssueCode.invalid_type}),i.INVALID}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),r=this._def.values;return(0,i.addIssueToContext)(n,{received:n.data,code:t.ZodIssueCode.invalid_enum_value,options:r}),i.INVALID}return(0,i.OK)(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})}};e.ZodEnum=Te,Te.create=we;var Ee=class extends l{_parse(e){let n=a.util.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==a.ZodParsedType.string&&r.parsedType!==a.ZodParsedType.number){let e=a.util.objectValues(n);return(0,i.addIssueToContext)(r,{expected:a.util.joinValues(e),received:r.parsedType,code:t.ZodIssueCode.invalid_type}),i.INVALID}if(this._cache||=new Set(a.util.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=a.util.objectValues(n);return(0,i.addIssueToContext)(r,{received:r.data,code:t.ZodIssueCode.invalid_enum_value,options:e}),i.INVALID}return(0,i.OK)(e.data)}get enum(){return this._def.values}};e.ZodNativeEnum=Ee,Ee.create=(e,t)=>new Ee({values:e,typeName:ze.ZodNativeEnum,...c(t)});var De=class extends l{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==a.ZodParsedType.promise&&n.common.async===!1)return(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.promise,received:n.parsedType}),i.INVALID;let r=n.parsedType===a.ZodParsedType.promise?n.data:Promise.resolve(n.data);return(0,i.OK)(r.then(e=>this._def.type.parseAsync(e,{path:n.path,errorMap:n.common.contextualErrorMap})))}};e.ZodPromise=De,De.create=(e,t)=>new De({type:e,typeName:ze.ZodPromise,...c(t)});var Oe=class extends l{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ze.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,o={addIssue:e=>{(0,i.addIssueToContext)(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),r.type===`preprocess`){let e=r.transform(n.data,o);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return i.INVALID;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?i.INVALID:r.status===`dirty`||t.value===`dirty`?(0,i.DIRTY)(r.value):r});{if(t.value===`aborted`)return i.INVALID;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?i.INVALID:r.status===`dirty`||t.value===`dirty`?(0,i.DIRTY)(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,o);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`?i.INVALID:(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`?i.INVALID:(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(!(0,i.isValid)(e))return i.INVALID;let a=r.transform(e.value,o);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=>(0,i.isValid)(e)?Promise.resolve(r.transform(e.value,o)).then(e=>({status:t.value,value:e})):i.INVALID);a.util.assertNever(r)}};e.ZodEffects=Oe,e.ZodTransformer=Oe,Oe.create=(e,t,n)=>new Oe({schema:e,typeName:ze.ZodEffects,effect:t,...c(n)}),Oe.createWithPreprocess=(e,t,n)=>new Oe({schema:t,effect:{type:`preprocess`,transform:e},typeName:ze.ZodEffects,...c(n)});var ke=class extends l{_parse(e){return this._getType(e)===a.ZodParsedType.undefined?(0,i.OK)(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};e.ZodOptional=ke,ke.create=(e,t)=>new ke({innerType:e,typeName:ze.ZodOptional,...c(t)});var Ae=class extends l{_parse(e){return this._getType(e)===a.ZodParsedType.null?(0,i.OK)(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};e.ZodNullable=Ae,Ae.create=(e,t)=>new Ae({innerType:e,typeName:ze.ZodNullable,...c(t)});var je=class extends l{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===a.ZodParsedType.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};e.ZodDefault=je,je.create=(e,t)=>new je({innerType:e,typeName:ze.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...c(t)});var Me=class extends l{_parse(e){let{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return(0,i.isAsync)(a)?a.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new t.ZodError(r.common.issues)},input:r.data})})):{status:`valid`,value:a.status===`valid`?a.value:this._def.catchValue({get error(){return new t.ZodError(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};e.ZodCatch=Me,Me.create=(e,t)=>new Me({innerType:e,typeName:ze.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...c(t)});var Ne=class extends l{_parse(e){if(this._getType(e)!==a.ZodParsedType.nan){let n=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.nan,received:n.parsedType}),i.INVALID}return{status:`valid`,value:e.data}}};e.ZodNaN=Ne,Ne.create=e=>new Ne({typeName:ze.ZodNaN,...c(e)}),e.BRAND=Symbol(`zod_brand`);var Pe=class extends l{_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}};e.ZodBranded=Pe;var Fe=class e extends l{_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`?i.INVALID:e.status===`dirty`?(t.dirty(),(0,i.DIRTY)(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`?i.INVALID: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:ze.ZodPipeline})}};e.ZodPipeline=Fe;var Ie=class extends l{_parse(e){let t=this._def.innerType._parse(e),n=e=>((0,i.isValid)(e)&&(e.value=Object.freeze(e.value)),e);return(0,i.isAsync)(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};e.ZodReadonly=Ie,Ie.create=(e,t)=>new Ie({innerType:e,typeName:ze.ZodReadonly,...c(t)});function Le(e,t){let n=typeof e==`function`?e(t):typeof e==`string`?{message:e}:e;return typeof n==`string`?{message:n}:n}function Re(e,t={},n){return e?P.create().superRefine((r,i)=>{let a=e(r);if(a instanceof Promise)return a.then(e=>{if(!e){let e=Le(t,r),a=e.fatal??n??!0;i.addIssue({code:`custom`,...e,fatal:a})}});if(!a){let e=Le(t,r),a=e.fatal??n??!0;i.addIssue({code:`custom`,...e,fatal:a})}}):P.create()}e.late={object:me.lazycreate};var ze;(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`})(ze||(e.ZodFirstPartyTypeKind=ze={})),e.instanceof=(e,t={message:`Input not instance of ${e.name}`})=>Re(t=>t instanceof e,t);var Be=re.create;e.string=Be;var Ve=j.create;e.number=Ve,e.nan=Ne.create,e.bigint=ae.create;var He=oe.create;e.boolean=He,e.date=se.create,e.symbol=M.create,e.undefined=ce.create,e.null=N.create,e.any=P.create,e.unknown=le.create,e.never=ue.create,e.void=de.create,e.array=fe.create,e.object=me.create,e.strictObject=me.strictCreate,e.union=he.create,e.discriminatedUnion=F.create,e.intersection=I.create,e.tuple=ve.create,e.record=ye.create,e.map=be.create,e.set=xe.create,e.function=L.create,e.lazy=Se.create,e.literal=Ce.create,e.enum=Te.create,e.nativeEnum=Ee.create,e.promise=De.create;var Ue=Oe.create;e.effect=Ue,e.transformer=Ue,e.optional=ke.create,e.nullable=Ae.create,e.preprocess=Oe.createWithPreprocess,e.pipeline=Fe.create,e.ostring=()=>Be().optional(),e.onumber=()=>Ve().optional(),e.oboolean=()=>He().optional(),e.coerce={string:(e=>re.create({...e,coerce:!0})),number:(e=>j.create({...e,coerce:!0})),boolean:(e=>oe.create({...e,coerce:!0})),bigint:(e=>ae.create({...e,coerce:!0})),date:(e=>se.create({...e,coerce:!0}))},e.NEVER=i.INVALID})),Dhn=s((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(Shn(),e),n(Chn(),e),n(whn(),e),n(I7(),e),n(Ehn(),e),n(bhn(),e)})),Ohn=s((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.z=void 0;var a=r(Dhn());e.z=a,i(Dhn(),e),e.default=a})),khn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.recommendationPropsSchema=e.calculatorParamsSchema=e.activitySchema=e.activityReductionSchema=void 0;var t=Ohn(),n=E2(),r=A7(),i=O7(),a=(e,n)=>t.z.number().refine(t=>t>=e.min&&t<=e.max,{message:n}),o=e.activityReductionSchema=t.z.object({fromZero:a(r.ACTIVITY_SETTINGS_INTERVAL_LIMITS),fromThirty:a(r.ACTIVITY_SETTINGS_INTERVAL_LIMITS),fromFortysix:a(r.ACTIVITY_SETTINGS_INTERVAL_LIMITS),fromSixtyone:a(r.ACTIVITY_SETTINGS_INTERVAL_LIMITS).nullable()}),s=e.activitySchema=t.z.object({activityDuration:a(r.ACTIVITY_DURATION_MINUTES_LIMITS),activityIntensity:t.z.nativeEnum(n.ActivityIntensity).nullable(),activitySettings:t.z.object({light:o,moderate:o,hard:t.z.object({...o.shape,fromFortysix:a(r.ACTIVITY_SETTINGS_INTERVAL_LIMITS).nullable()}),post:o,target:a(r.ACTIVITY_TARGET_BGL_MMOL_LIMITS)}),activityDate:t.z.date()}).nullable(),c=e.calculatorParamsSchema=t.z.object({glucoseReading:t.z.object({value:t.z.number(),unit:t.z.nativeEnum(n.BloodGlucoseUnit),source:t.z.enum([`manual`,`forecast`,`device`,`external`,`cgm`]),timestamp:t.z.number(),id:t.z.string().uuid()}),targetBGL:a(r.TARGET_BGL_MMOL_LIMITS),insulinSensitivity:a(r.INSULIN_SENSITIVITY_MMOL_LIMITS),carbohydrates:a(r.CARBOHYDRATES_LIMITS),carbohydrateRatio:a(r.INSULIN_TO_CARBS_RATIO_LIMITS),recentBoluses:t.z.array(t.z.object({secondsPassed:a(r.BOLUS_SECONDS_PASSED_LIMITS),insulinDose:a(r.INSULIN_DOSE_LIMITS),id:t.z.string().uuid()})),activity:s});e.recommendationPropsSchema=t.z.object({bloodGlucoseUnit:t.z.nativeEnum(n.BloodGlucoseUnit),injectionMethod:t.z.nativeEnum(n.InjectionMethod),language:t.z.enum([`da`,`de`,`en`,`es`,`fr`,`it`,`sv`,`pl`]),calculatorParams:c,colorScheme:t.z.nativeEnum(i.ColorScheme)})})),Ahn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.SyncStatus=e.RecommendationScreen=void 0;var t=O(p()),n=(V(),d(tm)),r=(Z0(),d(z4t)),i=Nan(),a=E2(),o=D(Kmn()),s=D(nhn()),c=D(rhn()),l=D(chn()),u=D(lhn()),f=D(uhn()),m=D(dhn()),h=D(fhn()),g=D(phn()),_=D(mhn()),v=D(hhn()),y=D(ghn()),b=D(_hn()),x=D(yhn()),S=A7(),C=k7(),w=j7(),T=khn(),E=LJ();function D(e){return e&&e.__esModule?e:{default:e}}function O(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(O=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}var k=e.SyncStatus=function(e){return e.Idle=`Idle`,e.Success=`Success`,e.Loading=`Loading`,e.Failure=`Failure`,e}({}),A=e=>{let d=(0,r.useSafeAreaInsets)(),{changeLanguage:p}=(0,w.useLanguage)(),D=(0,C.useSemanticColors)(),{height:O}=(0,n.useWindowDimensions)(),A=(0,t.useMemo)(()=>O-d.bottom-d.top,[O,d.bottom,d.top]),ee=(0,t.useRef)(null),{deleteStatus:ne,editStatus:re,saveStatus:ie,calculatorParams:j,bloodGlucoseUnit:ae,injectionMethod:oe,transferEditedRecommendation:se,closeCalculationFooter:M,closeCalculationTimeoutModal:ce,deleteCalculation:N,closeCalculationViewInlogbook:P,trackRecommendationTimeout:le,trackExpandDetails:ue}=e,{glucoseReading:de,carbohydrates:fe,activity:pe}=j,me=(0,t.useRef)((0,i.calculateRecommendation)(j)).current,[he,ge]=(0,t.useState)(null),[F,_e]=(0,t.useState)(null),[I,ve]=(0,t.useState)(null),[ye,be]=(0,t.useState)(null),[xe,L]=(0,t.useState)(0),[Se,Ce]=(0,t.useState)(0),[we,Te]=(0,t.useState)(0),[Ee,De]=(0,t.useState)(!0),[Oe,ke]=(0,t.useState)(!1),[Ae,je]=(0,t.useState)(!1),[Me,Ne]=(0,t.useState)(!0),[Pe,Fe]=(0,t.useState)(!1),[Ie,Le]=(0,t.useState)(!1),[Re,ze]=(0,t.useState)(!1),[Be,Ve]=(0,t.useState)(!1),[He,Ue]=(0,t.useState)(!1),[We,Ge]=(0,t.useState)(!1),[Ke,qe]=(0,t.useState)(!1),[Je,Ye]=(0,t.useState)(!1),[Xe,Ze]=(0,t.useState)(!1),[Qe,$e]=(0,t.useState)(!1);(0,t.useEffect)(()=>{ne===k.Failure&&Ze(!0)},[ne]),(0,t.useEffect)(()=>{ie===k.Failure&&Ye(!0)},[ie]),(0,t.useEffect)(()=>{re===k.Success&&(ge(F),ve(ye))},[ne,re,ye,F,ie]),(0,t.useEffect)(()=>{T.recommendationPropsSchema.parse(e),p(e.language)},[p,e]),(0,t.useEffect)(()=>{me.wasLimited&&qe(!0)},[me.wasLimited]),(0,t.useEffect)(()=>{let e=me.recommendationDate.getTime(),t=setInterval(()=>{new Date().getTime()-e>S.TIMEOUT_MODAL_TRIGGER&&!We&&!Re&&(ze(!0),Ge(!0),le())},a.Milliseconds.Second*1);return()=>clearInterval(t)},[Re,We,me,le]);let et=(0,t.useCallback)(e=>{let t=me.recommendationDate.getTime(),n=new Date().getTime()-t>S.TIMEOUT_MODAL_TRIGGER;e===`active`&&n&&!Be&&(Ge(!0),le())},[me,le,Be]),tt=(0,t.useCallback)(()=>(Ue(!0),!0),[]);(0,t.useEffect)(()=>{let e=n.AppState.addEventListener(`change`,et),t=null;return n.Platform.OS===`android`&&(t=n.BackHandler.addEventListener(`hardwareBackPress`,tt)),()=>{e.remove(),t?.remove()}},[et,tt]);let nt=(0,t.useMemo)(()=>{if(pe)return{activityDuration:pe.activityDuration,activityIntensity:pe.activityIntensity,activityReduction:me.activityReduction}},[pe,me.activityReduction]),rt=(0,t.useCallback)(e=>{n.LayoutAnimation.configureNext(n.LayoutAnimation.Presets.easeInEaseOut);let t=(0,i.roundInsulinValue)(me.bolus,oe),r=Math.round(me.carbRecommendation),a=e===t?null:e;e===t?(ge(null),_e(null)):_e(e),se({modified:I,suggested:r},{modified:a,suggested:t},me.recommendationDate)},[me,oe,I,se]),it=(0,t.useCallback)(e=>{n.LayoutAnimation.configureNext(n.LayoutAnimation.Presets.easeInEaseOut);let t=(0,i.roundInsulinValue)(me.bolus,oe),r=Math.round(me.carbRecommendation),a=e===r?null:e;e===r?(ve(null),be(null)):be(e),se({modified:a,suggested:r},{modified:he,suggested:t},me.recommendationDate)},[me,oe,he,se]),at=(0,t.useCallback)(()=>{Pe&&N()},[N,Pe]),ot=(0,t.useCallback)(()=>{Ve(!0),Ie?P():ce()},[Ie,ce,P]),st=(0,t.useCallback)(()=>{Le(!0),Ge(!1)},[]),ct=(0,t.useCallback)(()=>{Fe(!0),Ue(!1)},[]),lt=(0,t.useCallback)(()=>{re===k.Failure&&$e(!0)},[re]),ut=(0,t.useCallback)(()=>{$e(!1)},[]),dt=(0,t.useCallback)((e,t)=>{Te(t)},[]),ft=(0,t.useCallback)(()=>{ee?.current?.scrollToEnd(),je(!0),setTimeout(()=>Ne(!1),1)},[]),pt=(0,t.useCallback)(e=>{let{layoutMeasurement:{height:t},contentOffset:{y:n}}=e.nativeEvent,r=Math.round(t+n),i=r>=we-xe,a=r>=Math.round(we);ke(i),Ee&&De(!1),a&&je(!0),a&&setTimeout(()=>Ne(!1),1)},[xe,we,Ee]),mt=(0,t.useMemo)(()=>Math.round(Se+xe),[Se,xe]);return Re?(0,E.jsx)(n.View,{style:[{flex:1,backgroundColor:D.bgPrimary}],children:(0,E.jsx)(n.View,{style:te.timeoutContainer,children:(0,E.jsx)(b.default,{isVisible:We,onPressViewInLogbook:st,onPressCancel:()=>Ge(!1),onDismiss:ot})})}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(n.ScrollView,{ref:ee,scrollEventThrottle:16,style:[te.scrollView,{backgroundColor:D.bgPrimary}],contentContainerStyle:Ae&&te.scrollViewContentContainer,testID:`recommendation-screen`,onScroll:pt,onContentSizeChange:dt,children:[(0,E.jsxs)(n.View,{testID:`recommendation-content`,onLayout:({nativeEvent:e})=>Ce(e.layout.height),style:te.content,children:[(0,E.jsxs)(n.View,{style:[te.mainContainer,{backgroundColor:D.bgSecondary}],children:[(0,E.jsx)(f.default,{isEdited:he!==null}),(0,E.jsx)(m.default,{initialValue:(0,i.roundInsulinValue)(me.bolus,oe),editedValue:he,injectionMethod:oe,wasLimited:me.wasLimited,onDismiss:lt,onConfirm:rt}),(0,E.jsx)(c.default,{}),(0,E.jsx)(l.default,{glucoseReading:de,bloodGlucoseUnit:ae,trackExpandDetails:ue,carbIntakeValue:Math.round(fe),activeInsulin:Math.round(me.activeInsulin*10)/10,activity:nt})]}),(0,E.jsxs)(n.View,{style:te.carbsContainer,children:[Math.round(me.carbRecommendation)>0&&(0,E.jsx)(s.default,{carbsRecommendation:Math.round(me.carbRecommendation),editedCarbsRecommendation:I,onDismiss:lt,onConfirm:it}),(0,E.jsx)(o.default,{glucoseReading:de,hasActivity:pe!==null,bloodGlucoseUnit:ae})]})]}),mt>A&&Me&&(0,E.jsx)(u.default,{prefixTestID:`scroll`,onSave:ft,onDelete:ft,onLayout:({nativeEvent:e})=>L(e.layout.height)})]}),(0,E.jsx)(x.default,{scrollToEnd:ft,isVisibleArrow:mt>A&&Ee,isVisibleBlur:mt>A&&!Oe&&!Ae}),(mt<=A||Ae)&&(0,E.jsx)(u.default,{prefixTestID:`fixed`,onSave:M,onDelete:()=>Ue(!0),onLayout:({nativeEvent:e})=>L(e.layout.height)}),(0,E.jsx)(v.default,{isVisible:Ke,activityReduction:me.activityReduction,onPress:()=>qe(!1)}),(0,E.jsx)(g.default,{isVisible:He,onPressDelete:ct,onDismiss:at,onPressCancel:()=>Ue(!1)}),(0,E.jsx)(h.default,{isVisible:Xe,onPressClose:()=>Ze(!1)}),(0,E.jsx)(y.default,{isVisible:Je,onPressClose:()=>Ye(!1)}),(0,E.jsx)(_.default,{isVisible:Qe,onPressClose:ut})]})};e.RecommendationScreen=A;var ee=e=>(0,E.jsx)(w.LanguageProvider,{children:(0,E.jsx)(C.ColorSchemeProvider,{colorScheme:e.colorScheme,children:(0,E.jsx)(A,{...e})})}),te=n.StyleSheet.create({timeoutContainer:{flex:1,opacity:.5},scrollView:{flex:1},scrollViewContentContainer:{paddingBottom:32},content:{gap:32,paddingVertical:32},mainContainer:{borderRadius:16,marginHorizontal:16},carbsContainer:{paddingHorizontal:16}});e.default=ee})),L7=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"RecommendationScreenWrapper",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"SyncStatus",{enumerable:!0,get:function(){return t.SyncStatus}}),Object.defineProperty(e,"recommendationPropsSchema",{enumerable:!0,get:function(){return n.recommendationPropsSchema}});var t=r(Ahn()),n=khn();function r(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,i=new WeakMap;return(r=function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?r(o,t,a):o[t]=e[t]);return o})(e,t)}}))();function R7(e,t){return+e3(e)<+e3(t)}function jhn(e,t){return+e3(e)==+e3(t)}function Mhn(){return Object.assign({},v8())}function Nhn(e,t){let n=Phn(t)?new t(0):$4(t,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}function Phn(e){return typeof e==`function`&&e.prototype?.constructor===e}var Fhn=10,Ihn=class{subPriority=0;validate(e,t){return!0}},Lhn=class extends Ihn{constructor(e,t,n,r,i){super(),this.value=e,this.validateValue=t,this.setValue=n,this.priority=r,i&&(this.subPriority=i)}validate(e,t){return this.validateValue(e,this.value,t)}set(e,t,n){return this.setValue(e,t,this.value,n)}},Rhn=class extends Ihn{priority=Fhn;subPriority=-1;constructor(e,t){super(),this.context=e||(e=>$4(t,e))}set(e,t){return t.timestampIsSet?e:$4(e,Nhn(e,this.context))}},z7=class{run(e,t,n,r){let i=this.parse(e,t,n,r);return i?{setter:new Lhn(i.value,this.validate,this.set,this.priority,this.subPriority),rest:i.rest}:null}validate(e,t,n){return!0}},zhn=class extends z7{priority=140;parse(e,t,n){switch(t){case`G`:case`GG`:case`GGG`:return n.era(e,{width:`abbreviated`})||n.era(e,{width:`narrow`});case`GGGGG`:return n.era(e,{width:`narrow`});default:return n.era(e,{width:`wide`})||n.era(e,{width:`abbreviated`})||n.era(e,{width:`narrow`})}}set(e,t,n){return t.era=n,e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`R`,`u`,`t`,`T`]},B7={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},V7={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function H7(e,t){return e&&{value:t(e.value),rest:e.rest}}function U7(e,t){let n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function W7(e,t){let n=t.match(e);if(!n)return null;if(n[0]===`Z`)return{value:0,rest:t.slice(1)};let r=n[1]===`+`?1:-1,i=n[2]?parseInt(n[2],10):0,a=n[3]?parseInt(n[3],10):0,o=n[5]?parseInt(n[5],10):0;return{value:r*(i*P9t+a*N9t+o*F9t),rest:t.slice(n[0].length)}}function Bhn(e){return U7(B7.anyDigitsSigned,e)}function G7(e,t){switch(e){case 1:return U7(B7.singleDigit,t);case 2:return U7(B7.twoDigits,t);case 3:return U7(B7.threeDigits,t);case 4:return U7(B7.fourDigits,t);default:return U7(RegExp(`^\\d{1,`+e+`}`),t)}}function Vhn(e,t){switch(e){case 1:return U7(B7.singleDigitSigned,t);case 2:return U7(B7.twoDigitsSigned,t);case 3:return U7(B7.threeDigitsSigned,t);case 4:return U7(B7.fourDigitsSigned,t);default:return U7(RegExp(`^-?\\d{1,`+e+`}`),t)}}function Hhn(e){switch(e){case`morning`:return 4;case`evening`:return 17;case`pm`:case`noon`:case`afternoon`:return 12;default:return 0}}function Uhn(e,t){let n=t>0,r=n?t:1-t,i;if(r<=50)i=e||100;else{let t=r+50,n=Math.trunc(t/100)*100,a=e>=t%100;i=e+n-(a?100:0)}return n?i:1-i}function Whn(e){return e%400==0||e%4==0&&e%100!=0}var Ghn=class extends z7{priority=130;incompatibleTokens=[`Y`,`R`,`u`,`w`,`I`,`i`,`e`,`c`,`t`,`T`];parse(e,t,n){let r=e=>({year:e,isTwoDigitYear:t===`yy`});switch(t){case`y`:return H7(G7(4,e),r);case`yo`:return H7(n.ordinalNumber(e,{unit:`year`}),r);default:return H7(G7(t.length,e),r)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,n){let r=e.getFullYear();if(n.isTwoDigitYear){let t=Uhn(n.year,r);return e.setFullYear(t,0,1),e.setHours(0,0,0,0),e}let i=!(`era`in t)||t.era===1?n.year:1-n.year;return e.setFullYear(i,0,1),e.setHours(0,0,0,0),e}},Khn=class extends z7{priority=130;parse(e,t,n){let r=e=>({year:e,isTwoDigitYear:t===`YY`});switch(t){case`Y`:return H7(G7(4,e),r);case`Yo`:return H7(n.ordinalNumber(e,{unit:`year`}),r);default:return H7(G7(t.length,e),r)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,n,r){let i=von(e,r);if(n.isTwoDigitYear){let t=Uhn(n.year,i);return e.setFullYear(t,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),y8(e,r)}let a=!(`era`in t)||t.era===1?n.year:1-n.year;return e.setFullYear(a,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),y8(e,r)}incompatibleTokens=[`y`,`R`,`u`,`Q`,`q`,`M`,`L`,`I`,`d`,`D`,`i`,`t`,`T`]},qhn=class extends z7{priority=130;parse(e,t){return Vhn(t===`R`?4:t.length,e)}set(e,t,n){let r=$4(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),j8(r)}incompatibleTokens=[`G`,`y`,`Y`,`u`,`Q`,`q`,`M`,`L`,`w`,`d`,`D`,`e`,`c`,`t`,`T`]},Jhn=class extends z7{priority=130;parse(e,t){return Vhn(t===`u`?4:t.length,e)}set(e,t,n){return e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`G`,`y`,`Y`,`R`,`w`,`I`,`i`,`e`,`c`,`t`,`T`]},Yhn=class extends z7{priority=120;parse(e,t,n){switch(t){case`Q`:case`QQ`:return G7(t.length,e);case`Qo`:return n.ordinalNumber(e,{unit:`quarter`});case`QQQ`:return n.quarter(e,{width:`abbreviated`,context:`formatting`})||n.quarter(e,{width:`narrow`,context:`formatting`});case`QQQQQ`:return n.quarter(e,{width:`narrow`,context:`formatting`});default:return n.quarter(e,{width:`wide`,context:`formatting`})||n.quarter(e,{width:`abbreviated`,context:`formatting`})||n.quarter(e,{width:`narrow`,context:`formatting`})}}validate(e,t){return t>=1&&t<=4}set(e,t,n){return e.setMonth((n-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`q`,`M`,`L`,`w`,`I`,`d`,`D`,`i`,`e`,`c`,`t`,`T`]},Xhn=class extends z7{priority=120;parse(e,t,n){switch(t){case`q`:case`qq`:return G7(t.length,e);case`qo`:return n.ordinalNumber(e,{unit:`quarter`});case`qqq`:return n.quarter(e,{width:`abbreviated`,context:`standalone`})||n.quarter(e,{width:`narrow`,context:`standalone`});case`qqqqq`:return n.quarter(e,{width:`narrow`,context:`standalone`});default:return n.quarter(e,{width:`wide`,context:`standalone`})||n.quarter(e,{width:`abbreviated`,context:`standalone`})||n.quarter(e,{width:`narrow`,context:`standalone`})}}validate(e,t){return t>=1&&t<=4}set(e,t,n){return e.setMonth((n-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`Q`,`M`,`L`,`w`,`I`,`d`,`D`,`i`,`e`,`c`,`t`,`T`]},Zhn=class extends z7{incompatibleTokens=[`Y`,`R`,`q`,`Q`,`L`,`w`,`I`,`D`,`i`,`e`,`c`,`t`,`T`];priority=110;parse(e,t,n){let r=e=>e-1;switch(t){case`M`:return H7(U7(B7.month,e),r);case`MM`:return H7(G7(2,e),r);case`Mo`:return H7(n.ordinalNumber(e,{unit:`month`}),r);case`MMM`:return n.month(e,{width:`abbreviated`,context:`formatting`})||n.month(e,{width:`narrow`,context:`formatting`});case`MMMMM`:return n.month(e,{width:`narrow`,context:`formatting`});default:return n.month(e,{width:`wide`,context:`formatting`})||n.month(e,{width:`abbreviated`,context:`formatting`})||n.month(e,{width:`narrow`,context:`formatting`})}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.setMonth(n,1),e.setHours(0,0,0,0),e}},Qhn=class extends z7{priority=110;parse(e,t,n){let r=e=>e-1;switch(t){case`L`:return H7(U7(B7.month,e),r);case`LL`:return H7(G7(2,e),r);case`Lo`:return H7(n.ordinalNumber(e,{unit:`month`}),r);case`LLL`:return n.month(e,{width:`abbreviated`,context:`standalone`})||n.month(e,{width:`narrow`,context:`standalone`});case`LLLLL`:return n.month(e,{width:`narrow`,context:`standalone`});default:return n.month(e,{width:`wide`,context:`standalone`})||n.month(e,{width:`abbreviated`,context:`standalone`})||n.month(e,{width:`narrow`,context:`standalone`})}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.setMonth(n,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`q`,`Q`,`M`,`w`,`I`,`D`,`i`,`e`,`c`,`t`,`T`]};function $hn(e,t,n){let r=e3(e,n?.in),i=bon(r,n)-t;return r.setDate(r.getDate()-i*7),e3(r,n?.in)}var egn=class extends z7{priority=100;parse(e,t,n){switch(t){case`w`:return U7(B7.week,e);case`wo`:return n.ordinalNumber(e,{unit:`week`});default:return G7(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,n,r){return y8($hn(e,n,r),r)}incompatibleTokens=[`y`,`R`,`u`,`q`,`Q`,`M`,`L`,`I`,`d`,`D`,`i`,`t`,`T`]};function tgn(e,t,n){let r=e3(e,n?.in),i=_on(r,n)-t;return r.setDate(r.getDate()-i*7),r}var ngn=class extends z7{priority=100;parse(e,t,n){switch(t){case`I`:return U7(B7.week,e);case`Io`:return n.ordinalNumber(e,{unit:`week`});default:return G7(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,n){return j8(tgn(e,n))}incompatibleTokens=[`y`,`Y`,`u`,`q`,`Q`,`M`,`L`,`w`,`d`,`D`,`e`,`c`,`t`,`T`]},rgn=[31,28,31,30,31,30,31,31,30,31,30,31],ign=[31,29,31,30,31,30,31,31,30,31,30,31],agn=class extends z7{priority=90;subPriority=1;parse(e,t,n){switch(t){case`d`:return U7(B7.date,e);case`do`:return n.ordinalNumber(e,{unit:`date`});default:return G7(t.length,e)}}validate(e,t){let n=Whn(e.getFullYear()),r=e.getMonth();return n?t>=1&&t<=ign[r]:t>=1&&t<=rgn[r]}set(e,t,n){return e.setDate(n),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`q`,`Q`,`w`,`I`,`D`,`i`,`e`,`c`,`t`,`T`]},ogn=class extends z7{priority=90;subpriority=1;parse(e,t,n){switch(t){case`D`:case`DD`:return U7(B7.dayOfYear,e);case`Do`:return n.ordinalNumber(e,{unit:`date`});default:return G7(t.length,e)}}validate(e,t){return Whn(e.getFullYear())?t>=1&&t<=366:t>=1&&t<=365}set(e,t,n){return e.setMonth(0,n),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`q`,`Q`,`M`,`L`,`w`,`I`,`d`,`E`,`i`,`e`,`c`,`t`,`T`]};function K7(e,t,n){let r=e3(e,n?.in);return isNaN(t)?$4(n?.in||e,NaN):(t&&r.setDate(r.getDate()+t),r)}function sgn(e,t,n){let r=v8(),i=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=e3(e,n?.in),o=a.getDay(),s=(t%7+7)%7,c=7-i;return K7(a,t<0||t>6?t-(o+c)%7:(s+c)%7-(o+c)%7,n)}var cgn=class extends z7{priority=90;parse(e,t,n){switch(t){case`E`:case`EE`:case`EEE`:return n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`});case`EEEEE`:return n.day(e,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`});default:return n.day(e,{width:`wide`,context:`formatting`})||n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,r){return e=sgn(e,n,r),e.setHours(0,0,0,0),e}incompatibleTokens=[`D`,`i`,`e`,`c`,`t`,`T`]},lgn=class extends z7{priority=90;parse(e,t,n,r){let i=e=>{let t=Math.floor((e-1)/7)*7;return(e+r.weekStartsOn+6)%7+t};switch(t){case`e`:case`ee`:return H7(G7(t.length,e),i);case`eo`:return H7(n.ordinalNumber(e,{unit:`day`}),i);case`eee`:return n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`});case`eeeee`:return n.day(e,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`});default:return n.day(e,{width:`wide`,context:`formatting`})||n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,r){return e=sgn(e,n,r),e.setHours(0,0,0,0),e}incompatibleTokens=[`y`,`R`,`u`,`q`,`Q`,`M`,`L`,`I`,`d`,`D`,`E`,`i`,`c`,`t`,`T`]},ugn=class extends z7{priority=90;parse(e,t,n,r){let i=e=>{let t=Math.floor((e-1)/7)*7;return(e+r.weekStartsOn+6)%7+t};switch(t){case`c`:case`cc`:return H7(G7(t.length,e),i);case`co`:return H7(n.ordinalNumber(e,{unit:`day`}),i);case`ccc`:return n.day(e,{width:`abbreviated`,context:`standalone`})||n.day(e,{width:`short`,context:`standalone`})||n.day(e,{width:`narrow`,context:`standalone`});case`ccccc`:return n.day(e,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(e,{width:`short`,context:`standalone`})||n.day(e,{width:`narrow`,context:`standalone`});default:return n.day(e,{width:`wide`,context:`standalone`})||n.day(e,{width:`abbreviated`,context:`standalone`})||n.day(e,{width:`short`,context:`standalone`})||n.day(e,{width:`narrow`,context:`standalone`})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,r){return e=sgn(e,n,r),e.setHours(0,0,0,0),e}incompatibleTokens=[`y`,`R`,`u`,`q`,`Q`,`M`,`L`,`I`,`d`,`D`,`E`,`i`,`e`,`t`,`T`]};function dgn(e,t){let n=e3(e,t?.in).getDay();return n===0?7:n}function fgn(e,t,n){let r=e3(e,n?.in);return K7(r,t-dgn(r,n),n)}var pgn=class extends z7{priority=90;parse(e,t,n){let r=e=>e===0?7:e;switch(t){case`i`:case`ii`:return G7(t.length,e);case`io`:return n.ordinalNumber(e,{unit:`day`});case`iii`:return H7(n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`}),r);case`iiiii`:return H7(n.day(e,{width:`narrow`,context:`formatting`}),r);case`iiiiii`:return H7(n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`}),r);default:return H7(n.day(e,{width:`wide`,context:`formatting`})||n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`}),r)}}validate(e,t){return t>=1&&t<=7}set(e,t,n){return e=fgn(e,n),e.setHours(0,0,0,0),e}incompatibleTokens=[`y`,`Y`,`u`,`q`,`Q`,`M`,`L`,`w`,`d`,`D`,`E`,`e`,`c`,`t`,`T`]},mgn=class extends z7{priority=80;parse(e,t,n){switch(t){case`a`:case`aa`:case`aaa`:return n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`});case`aaaaa`:return n.dayPeriod(e,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(e,{width:`wide`,context:`formatting`})||n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`})}}set(e,t,n){return e.setHours(Hhn(n),0,0,0),e}incompatibleTokens=[`b`,`B`,`H`,`k`,`t`,`T`]},hgn=class extends z7{priority=80;parse(e,t,n){switch(t){case`b`:case`bb`:case`bbb`:return n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`});case`bbbbb`:return n.dayPeriod(e,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(e,{width:`wide`,context:`formatting`})||n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`})}}set(e,t,n){return e.setHours(Hhn(n),0,0,0),e}incompatibleTokens=[`a`,`B`,`H`,`k`,`t`,`T`]},ggn=class extends z7{priority=80;parse(e,t,n){switch(t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`});case`BBBBB`:return n.dayPeriod(e,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(e,{width:`wide`,context:`formatting`})||n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`})}}set(e,t,n){return e.setHours(Hhn(n),0,0,0),e}incompatibleTokens=[`a`,`b`,`t`,`T`]},_gn=class extends z7{priority=70;parse(e,t,n){switch(t){case`h`:return U7(B7.hour12h,e);case`ho`:return n.ordinalNumber(e,{unit:`hour`});default:return G7(t.length,e)}}validate(e,t){return t>=1&&t<=12}set(e,t,n){let r=e.getHours()>=12;return r&&n<12?e.setHours(n+12,0,0,0):!r&&n===12?e.setHours(0,0,0,0):e.setHours(n,0,0,0),e}incompatibleTokens=[`H`,`K`,`k`,`t`,`T`]},vgn=class extends z7{priority=70;parse(e,t,n){switch(t){case`H`:return U7(B7.hour23h,e);case`Ho`:return n.ordinalNumber(e,{unit:`hour`});default:return G7(t.length,e)}}validate(e,t){return t>=0&&t<=23}set(e,t,n){return e.setHours(n,0,0,0),e}incompatibleTokens=[`a`,`b`,`h`,`K`,`k`,`t`,`T`]},ygn=class extends z7{priority=70;parse(e,t,n){switch(t){case`K`:return U7(B7.hour11h,e);case`Ko`:return n.ordinalNumber(e,{unit:`hour`});default:return G7(t.length,e)}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.getHours()>=12&&n<12?e.setHours(n+12,0,0,0):e.setHours(n,0,0,0),e}incompatibleTokens=[`h`,`H`,`k`,`t`,`T`]},bgn=class extends z7{priority=70;parse(e,t,n){switch(t){case`k`:return U7(B7.hour24h,e);case`ko`:return n.ordinalNumber(e,{unit:`hour`});default:return G7(t.length,e)}}validate(e,t){return t>=1&&t<=24}set(e,t,n){let r=n<=24?n%24:n;return e.setHours(r,0,0,0),e}incompatibleTokens=[`a`,`b`,`h`,`H`,`K`,`t`,`T`]},xgn=class extends z7{priority=60;parse(e,t,n){switch(t){case`m`:return U7(B7.minute,e);case`mo`:return n.ordinalNumber(e,{unit:`minute`});default:return G7(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,n){return e.setMinutes(n,0,0),e}incompatibleTokens=[`t`,`T`]},Sgn=class extends z7{priority=50;parse(e,t,n){switch(t){case`s`:return U7(B7.second,e);case`so`:return n.ordinalNumber(e,{unit:`second`});default:return G7(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,n){return e.setSeconds(n,0),e}incompatibleTokens=[`t`,`T`]},Cgn=class extends z7{priority=30;parse(e,t){return H7(G7(t.length,e),e=>Math.trunc(e*10**(-t.length+3)))}set(e,t,n){return e.setMilliseconds(n),e}incompatibleTokens=[`t`,`T`]},wgn=class extends z7{priority=10;parse(e,t){switch(t){case`X`:return W7(V7.basicOptionalMinutes,e);case`XX`:return W7(V7.basic,e);case`XXXX`:return W7(V7.basicOptionalSeconds,e);case`XXXXX`:return W7(V7.extendedOptionalSeconds,e);default:return W7(V7.extended,e)}}set(e,t,n){return t.timestampIsSet?e:$4(e,e.getTime()-A8(e)-n)}incompatibleTokens=[`t`,`T`,`x`]},Tgn=class extends z7{priority=10;parse(e,t){switch(t){case`x`:return W7(V7.basicOptionalMinutes,e);case`xx`:return W7(V7.basic,e);case`xxxx`:return W7(V7.basicOptionalSeconds,e);case`xxxxx`:return W7(V7.extendedOptionalSeconds,e);default:return W7(V7.extended,e)}}set(e,t,n){return t.timestampIsSet?e:$4(e,e.getTime()-A8(e)-n)}incompatibleTokens=[`t`,`T`,`X`]},Egn=class extends z7{priority=40;parse(e){return Bhn(e)}set(e,t,n){return[$4(e,n*1e3),{timestampIsSet:!0}]}incompatibleTokens=`*`},Dgn=class extends z7{priority=20;parse(e){return Bhn(e)}set(e,t,n){return[$4(e,n),{timestampIsSet:!0}]}incompatibleTokens=`*`},Ogn={G:new zhn,y:new Ghn,Y:new Khn,R:new qhn,u:new Jhn,Q:new Yhn,q:new Xhn,M:new Zhn,L:new Qhn,w:new egn,I:new ngn,d:new agn,D:new ogn,E:new cgn,e:new lgn,c:new ugn,i:new pgn,a:new mgn,b:new hgn,B:new ggn,h:new _gn,H:new vgn,K:new ygn,k:new bgn,m:new xgn,s:new Sgn,S:new Cgn,X:new wgn,x:new Tgn,t:new Egn,T:new Dgn},kgn=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Agn=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,jgn=/^'([^]*?)'?$/,Mgn=/''/g,Ngn=/\S/,Pgn=/[a-zA-Z]/;function q7(e,t,n,r){let i=()=>$4(r?.in||n,NaN),a=Mhn(),o=r?.locale??a.locale??uon,s=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,c=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0;if(!t)return e?i():e3(n,r?.in);let l={firstWeekContainsDate:s,weekStartsOn:c,locale:o},u=[new Rhn(r?.in,n)],d=t.match(Agn).map(e=>{let t=e[0];if(t in Eon){let n=Eon[t];return n(e,o.formatLong)}return e}).join(``).match(kgn),f=[];for(let n of d){!r?.useAdditionalWeekYearTokens&&jon(n)&&Mon(n,t,e),!r?.useAdditionalDayOfYearTokens&&Aon(n)&&Mon(n,t,e);let a=n[0],s=Ogn[a];if(s){let{incompatibleTokens:t}=s;if(Array.isArray(t)){let e=f.find(e=>t.includes(e.token)||e.token===a);if(e)throw RangeError(`The format string mustn't contain \`${e.fullToken}\` and \`${n}\` at the same time`)}else if(s.incompatibleTokens===`*`&&f.length>0)throw RangeError(`The format string mustn't contain \`${n}\` and any other token at the same time`);f.push({token:a,fullToken:n});let r=s.run(e,n,o.match,l);if(!r)return i();u.push(r.setter),e=r.rest}else{if(a.match(Pgn))throw RangeError("Format string contains an unescaped latin alphabet character `"+a+"`");if(n===`''`?n=`'`:a===`'`&&(n=Fgn(n)),e.indexOf(n)===0)e=e.slice(n.length);else return i()}}if(e.length>0&&Ngn.test(e))return i();let p=u.map(e=>e.priority).sort((e,t)=>t-e).filter((e,t,n)=>n.indexOf(e)===t).map(e=>u.filter(t=>t.priority===e).sort((e,t)=>t.subPriority-e.subPriority)).map(e=>e[0]),m=e3(n,r?.in);if(isNaN(+m))return i();let h={};for(let e of p){if(!e.validate(m,l))return i();let t=e.set(m,h,l);Array.isArray(t)?(m=t[0],Object.assign(h,t[1])):m=t}return m}function Fgn(e){return e.match(jgn)[1].replace(Mgn,`'`)}function Ign(e){let{glucoseLevelTargets:t}=k8;if(t===void 0)throw Error(`[ParameterTimeIntervalsUtils::getBGLParameters] glucoseLevelTargets is undefined.`);let n=t.use===X.Usage.Overall,{overallTargetBGL:r,targetBGLIntervals:i}=t;if(n){if(r===void 0)throw Error(`[ParameterTimeIntervalsUtils::getBGLParameters] overallTargetBGL cannot be undefined`);return r}if(i===void 0)throw Error(`[ParameterTimeIntervalsUtils::getBGLParameters] targetBGLIntervals cannot be undefined`);return Rgn(e,i)}function Lgn(e){let t=k8.treatmentParameters?.use===X.Usage.Overall,{treatmentParameters:n}=k8;if(n===void 0)throw Error(`[ParameterTimeIntervalsUtils::getInsulinParameters] treatmentParameters is undefined.`);return t?n.overallParameters:Rgn(e,n.parameterIntervals)}function Rgn(e,t){let n=I8(e,`HH:mm`),r=zgn(t),i=q7(n,`HH:mm`,new Date);for(let e=0;e<r.length;e++)if(Bgn(r[e],r[(e+1)%r.length],i))return t[e];throw Error(`[ParameterTimeIntervalsUtils::getDailyParameters] The parameter interval has not been found`)}function zgn(e){let t=[];for(let n of e)t.push(q7(n.startTime,`HH:mm`,new Date));return t}function Bgn(e,t,n){let r=R7(e,t),i=jhn(e,n)||R7(e,n),a=Vgn(e),o=Vgn(t,!r),s=Vgn(n,!i);return a<=s&&s<o}function Vgn(e,t){return e.getMinutes()+(e.getHours()+(t?24:0))*60}V();var Hgn=1600;function Ugn({setRemeasurementNotification:e}){let{t,language:n}=Tq(),r=b7(),{selectedEventUUID:i}=a7(),{manualCarbsInput:a,foodIntakeCarbsAmount:o,saveCarbohydrates:s}=L5(),{noteId:c}=B5(),l=N$(),u=(0,H.useRef)(!1),[d,f]=H.useState(!1),[p,m]=H.useState(null),[h,g]=H.useState(null),{glucoseUnit:_,injectionMethod:v,activity:y}=k8;if(_===void 0)throw Error(`[LoadingRecommendationScreen::render] glucoseUnit is undefined`);if(v===void 0)throw Error(`[LoadingRecommendationScreen::render] injectionMethod is undefined`);if(y===void 0)throw Error(`[LoadingRecommendationScreen::render] activity is undefined`);if(r===null)throw Error(`[LoadingRecommendationScreen::render] selectedGlucoseReading is undefined`);let b=(0,H.useMemo)(()=>K8.getRecentBoluses(),[]),x=(0,H.useMemo)(()=>i?S8.getByUUID(i):null,[i]),S=(0,H.useMemo)(()=>{if(!x?.startTimestamp)return null;let e={activitySettings:y,activityDate:new Date(x.startTimestamp),activityDuration:x.durationSeconds/60,activityIntensity:x.activityIntensity};try{return(0,b8.getReduction)(e.activityDuration,e.activitySettings,e.activityIntensity,e.activityDate),e}catch(e){return console.error(`Error calculating activity reduction for recommendation`,e),null}},[y,x]),C=(0,H.useMemo)(()=>{let{target:e}=Ign(new Date),{carbohydrateRatio:t,insulinSensitivity:i}=Lgn(new Date);return{bloodGlucoseUnit:_,injectionMethod:v,language:n,calculatorParams:{glucoseReading:r,activity:S,carbohydrateRatio:t,insulinSensitivity:i,carbohydrates:a+o,targetBGL:e,recentBoluses:b}}},[_,v,n,r,S,a,o,b]),w=(0,H.useCallback)(async()=>{let t=L7.recommendationPropsSchema.omit({colorScheme:!0}).safeParse(C);if(!t.success){u8(l8.RecommendationInvalid),console.error(t.error),g(Eq.Validation);return}try{let{activeInsulin:t,carbRecommendation:n,bolus:i,activityReduction:l,recentBolusesIds:u,recommendationDate:d}=(0,b8.calculateRecommendation)(C.calculatorParams),f=a+o,p=z8(C.calculatorParams.glucoseReading.value,C.calculatorParams.glucoseReading.unit,X.BloodGlucoseUnit.MMOL_L),h=(0,b8.roundInsulinValue)(i,C.injectionMethod),_=Math.round(n),v=r.source===`external`||r.source===`forecast`,y=null,b=null;try{let e=await s(d);y=e?.sampleId??null,b=e?.foodIntakeId??null}catch(e){console.error(`[LoadingRecommendationScreen::saveRecommendation] saveCarbohydrates failed:`,e)}let S=await K8.addLogbook(dsn({blood_glucose_millimolar:p,blood_glucose_millimolar_sample_id:v?r.sampleId:null,glucose_sample_source_id:v?r.sourceId:null,entry_timestamp:d,event_uuid:x?x.uuid:null,is_bolus_calculation:!0,carbohydrates_suggested_grams:_,carbohydrates_entered_grams:f+_,carbohydrates_input_grams:f,carbohydrates_sample_id:y,carbohydrates_manual_grams:a||null,carbohydrates_food_grams:o||null,food_intake_id:b,insulin_entered_units:h,insulin_suggested_units:h,active_insulin:t,activity_reduction:l,active_insulin_source_logbook_ids:u,note_id:c}));if(S===null){g(Eq.Sync);return}if(S.blood_glucose_millimolar!==null&&e!==void 0)try{await e(S.blood_glucose_millimolar)}catch(e){console.error(`[LoadingRecommendationScreen::saveRecommendation] Remeasurement reminder failed:`,e)}m(S),u8(l8.RecommendationSuccess)}catch(e){console.error(`[LoadingRecommendationScreen::saveRecommendation] Unexpected error:`,e),g(Eq.System)}},[C,x,r,a,e,o,s,c]);return u.current||(u.current=!0,w().catch(console.error)),(0,H.useEffect)(()=>{setTimeout(()=>{f(!0)},Hgn)},[]),(0,H.useEffect)(()=>(l.setOptions({gestureEnabled:!1}),l.addListener(`beforeRemove`,({preventDefault:e})=>{d||e()})),[d,l]),(0,H.useEffect)(()=>{d&&p!==null&&h===null&&l.replace(Q.Recommendation,{...C,logbookEntry:lsn(p)}),d&&h!==null&&l.navigate(Q.Calculation,{errorType:h})},[h,d,p,C,l]),(0,W.jsxs)(B,{style:J7.animationContainer,children:[(0,W.jsx)(g2,{autoPlay:!0,source:_2.LOADING_RECOMMENDATION,style:J7.animation,webStyle:J7.animation,resizeMode:`cover`,loop:!0}),(0,W.jsx)(Z,{style:J7.text,children:t(`recommendation_loading_title`)})]})}var J7=R.create({animationContainer:{flex:1,justifyContent:`center`,alignItems:`center`},text:{...Y.Poppins.bold_Base,marginTop:32},animation:{width:128,height:128}}),Wgn=f7(Ugn),Ggn=5e3,Kgn=async()=>{try{return(await T3(`${bq.HEDIA_SERVER_BASE_URL}/ping`,{headers:Aq},Ggn)).ok}catch{return!1}};V(),Z0();function qgn(){let{COLORS:e,effectiveColorScheme:t}=J(),n=N$(),r=F$(),{manualCarbsInput:i,foodIntakeCarbsAmount:a}=L5(),[o,s]=(0,H.useState)(L7.SyncStatus.Idle),[c,l]=(0,H.useState)(L7.SyncStatus.Idle),[u,d]=(0,H.useState)(L7.SyncStatus.Idle),{bloodGlucoseUnit:f,calculatorParams:p,injectionMethod:m,language:h,logbookEntry:g}=r.params,[_,v]=(0,H.useState)(()=>usn(g));Cvt(),(0,H.useEffect)(()=>{n.setOptions({gestureEnabled:!1})},[n]);let y=(0,H.useCallback)(async(e,t)=>{d(L7.SyncStatus.Loading);let n=i+a,r=dsn({..._,insulin_entered_units:t.modified??t.suggested,carbohydrates_overwritten_suggested_grams:e.modified,carbohydrates_entered_grams:n+(e.modified??e.suggested)}),o=await K8.addLogbook(r,_.uuid);o?(v(o),d(L7.SyncStatus.Success)):d(L7.SyncStatus.Failure)},[i,_,a]),b=(0,H.useCallback)(()=>{if(Oq)throw Error(`Recommendation::handleOnCloseCalculationViewInLogbook] Cannot view-in-logbook on web`);n.popTo(Q.MainBottomTabs,{screen:Q.LogbooksTab,params:{logbookEntry:lsn(_)}}),l7()},[n,_]),x=(0,H.useCallback)(()=>{Oq?(window.location.href=`/redirect?status=success`,xq.clearAll()):n.popTo(Q.MainBottomTabs,{screen:Q.DashboardTab,params:{screen:Q.Dashboard}}),l7()},[n]),S=(0,H.useCallback)(async()=>{s(L7.SyncStatus.Loading);let e=await K8.deleteLogbook(_.uuid);Oq?e?(window.location.href=`/redirect?status=success`,l7(),xq.clearAll()):s(L7.SyncStatus.Failure):(l7(),n.popTo(Q.MainBottomTabs,{screen:Q.DashboardTab,params:{screen:Q.Dashboard,params:{action:hvt.Deleted}}}))},[_.uuid,n]),C=(0,H.useCallback)(async()=>{l(L7.SyncStatus.Loading);let e=()=>{l(L7.SyncStatus.Success),l7(),n.replace(Q.LeavingRecommendation,{logbookEntry:lsn(_)})};Oq?await Kgn()?e():l(L7.SyncStatus.Failure):e()},[n,_]);return(0,W.jsx)(X0,{style:[Jgn.container,{backgroundColor:e.bgPrimary}],children:(0,W.jsx)(L7.RecommendationScreenWrapper,{deleteStatus:o,saveStatus:c,editStatus:u,bloodGlucoseUnit:f,injectionMethod:m,language:h,colorScheme:t,calculatorParams:p,closeCalculationViewInlogbook:b,closeCalculationFooter:C,closeCalculationTimeoutModal:x,transferEditedRecommendation:y,deleteCalculation:S,trackExpandDetails:()=>{u8(l8.RecommendationViewDetailsPress)},trackRecommendationTimeout:()=>{u8(l8.RecommendationExpired)}})})}var Jgn=R.create({container:{flex:1}}),Ygn=e=>[`foods`,`curated`,e],Xgn=e=>{let{data:t=[],isLoading:n,isError:r,refetch:i}=b0({queryKey:Ygn(e),queryFn:()=>zan(e),staleTime:1e3*60*5,networkMode:`offlineFirst`,retry:3});return{curatedFoods:t,isCuratedFoodsLoading:n,isCuratedFoodsError:r,refetchCuratedFoods:i}},Zgn=e=>[`foods`,`categories`,e],Y7=()=>{let{language:e}=Cq(),{data:t=[],isLoading:n,isError:r,refetch:i}=b0({queryKey:Zgn(e),queryFn:()=>Kan(e),staleTime:1e3*60*5,networkMode:`offlineFirst`,retry:3});return{foodCategories:t,isFoodCategoriesLoading:n,isFoodCategoriesError:r,refetchFoodCategories:i}},Qgn=()=>{let e=N$().getParent(Q.NewCalculationStack),t=(0,H.useCallback)(()=>{e?.goBack()},[e]);return{isInCalculationFlow:e!==void 0,dismissFoodLibrary:t}},X7=e=>{let t=N$(),{isInCalculationFlow:n,dismissFoodLibrary:r}=Qgn(),{addFoodIntakeItem:i}=L5(),{addExtraFoodItem:a}=c7();return{canAddToCalculation:n||!!e,addToCalculation:(0,H.useCallback)((o,s)=>{if(e){a({foodItem:o,amount:s}),n?r():t.popTo(Q.VisualSearch);return}i({foodItem:o,amount:s}),r()},[e,a,n,t,i,r])}},$gn={tabBarHeight:0,paddingBottomScreenWithTabBar:0},Z7=gq()(vq(e=>({...$gn,setTabBarHeight:t=>{e({tabBarHeight:t,paddingBottomScreenWithTabBar:t+24})},clear:()=>{e($gn)}}),{name:`DIMENSIONS_STORE`,storage:_q(Sq)}));V();function e_n({icon:e,message:t}){let{COLORS:n}=J();return(0,W.jsxs)(B,{style:t_n.container,children:[e,(0,W.jsx)(Z,{style:[t_n.message,{color:n.labelSecondary}],children:t})]})}var t_n=R.create({container:{flex:1,alignItems:`center`,justifyContent:`center`},message:{...Y.Poppins.regular_SM,marginTop:13,textAlign:`center`}}),Q7=(0,H.memo)(e_n),n_n=({item:e,expandable:t,isExpanded:n,onExpand:r,onPress:i,onAddToCalculation:a,testID:o})=>{let{t:s}=Tq(),[c,l]=(0,H.useState)(``),u=$5(e.source===`personal`?e.imageId:null);(0,H.useEffect)(()=>{n||l(``)},[n]);let d=(0,H.useMemo)(()=>C8(Number(c||0),e.measures[0].gramsPerUnit,e.nutritionPer100g.carbohydrates.value),[c,e]),f=(0,H.useCallback)(()=>{a(e,Number(c)||0)},[a,e,c]);return(0,W.jsx)(y9t,{onPress:i,title:e.title,carbsPer100:e.nutritionPer100g.carbohydrates.value,unit:e.measures[0].unit,carbs:d,expandable:t,isExpanded:n,amount:c,imageUri:u,onAddPress:r,onChangeAmount:l,testID:o,children:n&&(0,W.jsx)(U4,{title:s(`foodAmount_button_addToCalculation`),disabled:!c,onPress:f,style:{marginTop:10}})})};V();var r_n=()=>{let{COLORS:e,isDark:t}=J(),{t:n}=Tq(),r=N$(),{categoryId:i,subcategoryId:a,cameFromVisualSearch:o}=F$().params,{canAddToCalculation:s,addToCalculation:c}=X7(o),l=N5(s&&kq),{bottomWithScroll:u}=Q4(),{paddingBottomScreenWithTabBar:d}=Z7(),{foodCategories:f}=Y7(),p=f.find(e=>e.id===i),m=p?.subcategories.find(e=>e.id===a),{curatedFoods:h,isCuratedFoodsLoading:g}=Xgn(a||i),_=t?p?.color.dark:p?.color.light,v=(t?m?.color.dark:m?.color.light)||_;(0,H.useLayoutEffect)(()=>{r.setOptions({header:()=>(0,W.jsx)(F5,{title:m?.title||p?.title,LeftButton:(0,W.jsx)(H5,{}),color:v,skipTopInset:s&&kq,overlay:!0})})},[r,m,p,v,s]);let[y,b]=(0,H.useState)(null),x=(0,H.useCallback)(({item:e})=>(0,W.jsx)(n_n,{item:e,expandable:s,isExpanded:y===e.id,onExpand:()=>b(e.id),onPress:()=>{r.navigate(Q.CuratedFoodItem,{foodId:e.id,categoryId:a||i,cameFromVisualSearch:o})},onAddToCalculation:c,testID:`curated-food-item-${e.id}`}),[i,a,o,r,s,c,y]),S=(0,H.useCallback)(e=>(0,W.jsx)(Z2t,{...e,bottomOffset:16}),[]);return(0,W.jsxs)(B,{style:[$7.screen,{backgroundColor:e.bgPrimary}],children:[v&&(0,W.jsx)(z4.default,{colors:[v,c3(v,0)],style:$7.gradient,pointerEvents:`none`}),g?(0,W.jsx)(x2,{}):(0,W.jsx)(Wc,{style:$7.list,data:h,keyExtractor:e=>e.id,renderItem:x,contentContainerStyle:[$7.contentContainer,{paddingTop:l+8,paddingBottom:s?u:d}],scrollEventThrottle:16,keyboardShouldPersistTaps:`handled`,renderScrollComponent:S,ListEmptyComponent:(0,W.jsx)(Q7,{icon:(0,W.jsx)(t9t,{}),message:n(`food_empty_state_no_food`)})})]})},$7=R.create({screen:{flex:1},gradient:{position:`absolute`,top:0,left:0,right:0,height:`50%`},contentContainer:{gap:8,paddingHorizontal:16},list:{flex:1}}),i_n=[Q.CuratedFoodItem,Q.PersonalFoodItem],a_n=(e,t)=>{if(e.name!==t.name)return!1;let n=e.params,r=t.params;return n?.categoryId===r?.categoryId&&n?.subcategoryId===r?.subcategoryId},o_n=(e,t)=>{let n=e.routes.filter(e=>!i_n.includes(e.name)).map(e=>({name:e.name,params:e.params})),r=t[t.length-1],i=n.findIndex(e=>a_n(e,r));if(i>=0)return n.slice(0,i+1);let a=t.filter(e=>!n.some(t=>a_n(t,e)));return[...n,...a]},s_n=()=>{let e=N$();return(0,H.useCallback)(t=>{e.dispatch(e=>{let n=o_n(e,t);return x$({...e,routes:n,index:n.length-1})})},[e])};V(),F4();var c_n={ringSize:120,strokeWidth:10,gap:14},l_n={ringSize:36,strokeWidth:4.5,gap:6},u_n=({totalAmount:e=100,carbsValue:t,carbsUnit:n,size:r=`large`})=>{let{COLORS:i}=J(),{ringSize:a,strokeWidth:o,gap:s}=r===`large`?c_n:l_n,c=(a-o)/2,l=2*Math.PI*c,u=a/2,d=Math.min(Math.max(t/e,0),1),f=Math.round(t*10)/10,p=d?s:s/2,m=l*d,h=(m+p)/l*360;return(0,W.jsxs)(B,{style:[e9.ringContainer,{width:a,height:a}],children:[(0,W.jsxs)(E4,{width:a,height:a,style:e9.ringSvg,children:[(0,W.jsx)(x4,{cx:u,cy:u,r:c,transform:`rotate(${h}, ${u}, ${u})`,stroke:i.border,strokeWidth:o,fill:`none`,strokeDasharray:[Math.max(l-m-p*2,0),l],strokeLinecap:`round`}),d>0&&(0,W.jsx)(x4,{cx:u,cy:u,r:c,stroke:i.bgFoodCarbsRing,strokeWidth:o,fill:`none`,strokeDasharray:[m,l-m],strokeLinecap:`round`})]}),r===`large`&&(0,W.jsx)(B,{style:e9.ringCenter,children:(0,W.jsxs)(Z,{style:[e9.carbsNumber,{color:i.labelPrimary}],maxFontSizeMultiplier:C2.s0,children:[f,(0,W.jsx)(Z,{style:[e9.carbsUnit,{color:i.labelPrimary}],children:n})]})})]})},e9=R.create({ringContainer:{alignItems:`center`,justifyContent:`center`},ringSvg:{transform:[{rotate:`-90deg`}],position:`absolute`},ringCenter:{alignItems:`center`,justifyContent:`center`},carbsNumber:{...Y.Poppins.semiBold_4XL},carbsUnit:{...Y.Poppins.medium_Base}});V();var d_n=({title:e,color:t,iconUri:n,onPress:r})=>{let{COLORS:i}=J();return(0,W.jsxs)(Yf,{style:[f_n.pill,{borderColor:i.border,backgroundColor:t}],onPress:r,testID:`food-category-pill`,children:[!!n&&(0,W.jsx)(Zu,{source:{uri:n},style:f_n.icon}),(0,W.jsx)(Z,{style:[f_n.label,{color:i.textFoodCategoryPill}],children:e})]})},f_n=R.create({pill:{flexDirection:`row`,alignItems:`center`,paddingVertical:6,paddingHorizontal:12,borderRadius:32,borderWidth:1},icon:{width:20,height:20,marginRight:4},label:{...Y.Poppins.regular_XS}});V();var p_n=`444`,m_n=({amount:e,onChangeAmount:t,unit:n,carbs:r,autoFocus:i=!1,testID:a})=>{let{t:o}=Tq(),{COLORS:s}=J(),[c,l]=(0,H.useState)(!1),u=(0,H.useRef)(null),d=(0,H.useCallback)(()=>{c||u.current?.focus()},[c]);return(0,W.jsxs)(B,{style:t9.inputContainer,children:[(0,W.jsx)(Z,{style:[t9.amountLabel,{color:s.labelPrimary}],children:o(`foodAmountInputField_weight`)}),(0,W.jsxs)(wp,{accessible:!1,onPress:d,style:[t9.inputBox,{backgroundColor:s.bgVsInput,borderColor:c?s.borderInputFocus:s.border}],children:[n===`g`?(0,W.jsx)(_9t,{}):(0,W.jsx)(v9t,{}),(0,W.jsxs)(B,{style:t9.inputValue,children:[(0,W.jsxs)(B,{children:[(0,W.jsx)(Z,{"aria-hidden":!0,style:t9.inputSizer,children:p_n}),(0,W.jsx)(I4,{ref:u,value:e,onChangeText:t,onFocusChange:l,autoFocus:i,selectTextOnFocus:!0,style:[t9.input,{color:s.labelPrimary}],testID:`${a}-food-input`})]}),(0,W.jsx)(Z,{style:[t9.inputUnit,{color:s.labelSecondary}],children:n})]})]}),(0,W.jsx)(Z,{style:[t9.carbsResult,{color:s.labelSecondary}],children:`= ${e?r:`-`} ${o(`my_food_add_unit`)}`})]})},t9=R.create({inputContainer:{alignItems:`center`,gap:8},amountLabel:{...Y.Poppins.regular_Base,textAlign:`center`},inputBox:{alignSelf:`center`,flexDirection:`row`,alignItems:`center`,justifyContent:`center`,gap:10,paddingHorizontal:16,paddingVertical:12,borderRadius:16,borderWidth:1},inputValue:{flexDirection:`row`,alignItems:`center`,gap:3},inputSizer:{...Y.Poppins.medium_2XL,opacity:0},input:{position:`absolute`,top:0,bottom:0,left:0,right:0,...Y.Poppins.medium_2XL,lineHeight:z.select({ios:0,default:Y.Poppins.medium_2XL.lineHeight}),includeFontPadding:!1,textAlign:`right`,padding:0},inputUnit:{...Y.Poppins.regular_Base},carbsResult:{...Y.Poppins.regular_Base,textAlign:`center`}});V();var h_n=({amount:e,onChangeAmount:t,unit:n,carbs:r,onAdd:i,testID:a})=>{let{t:o}=Tq(),{COLORS:s}=J();return(0,W.jsxs)(B,{style:[g_n.container,{borderColor:s.border,backgroundColor:s.bgInputLayer}],children:[(0,W.jsx)(m_n,{amount:e,onChangeAmount:t,unit:n,carbs:r,autoFocus:!0,testID:a}),(0,W.jsx)(U4,{title:o(`foodAmount_button_addToCalculation`),onPress:i,disabled:!e,style:g_n.addButton})]})},g_n=R.create({container:{alignSelf:`stretch`,padding:16,gap:16,borderWidth:1,borderRadius:24},addButton:{alignSelf:`center`}});V();var __n=56,v_n=20,y_n=100,n9=(e,t)=>{if(!e)return`-`;let n=e.value*t/100;return`${Math.round(n*10)/10} ${e.unit}`},b_n=(e,t)=>{if(t)for(let n of e){if(n.id===t)return{...n,browseCategoryId:n.id};let e=n.subcategories.find(e=>e.id===t);if(e)return{...e,browseCategoryId:n.id}}},x_n=()=>{let{t:e}=Tq(),{params:t}=F$(),{COLORS:n,isDark:r}=J(),{bottomWithScroll:i,topInsideModal:a}=Q4(),o=N$(),{canAddToCalculation:s,addToCalculation:c}=X7(t.cameFromVisualSearch),l=s_n(),u=[r9.headerRow,{paddingTop:a}],d={paddingTop:a+__n+v_n,paddingBottom:i},{food:f,isFoodLoading:p,isFoodError:m}=hfn(t.foodId),{foodCategories:h}=Y7(),{foodIntakeItems:g}=L5(),[_,v]=(0,H.useState)(()=>{let e=g.find(e=>e.foodItem.id===t.foodId);return e?e.amount.toString():c7.getState().extraFoodItems.find(e=>e.foodItem.id===t.foodId)?.amount.toString()??null}),y=f?.source===`curated`?f:null;(0,H.useEffect)(()=>{y||p||m||o.goBack()},[y,p,m,o]);let b=(0,H.useMemo)(()=>y?C8(Number(_||0),y.measures[0].gramsPerUnit,y.nutritionPer100g.carbohydrates.value):0,[y,_]),x=b_n(h,t.categoryId??y?.categoryId),S=r?x?.color.dark:x?.color.light,C=(0,H.useMemo)(()=>{if(!x)return;let e={name:Q.FoodSubcategories,params:{categoryId:x.browseCategoryId}};return x.id===x.browseCategoryId?[e]:[e,{name:Q.CuratedFood,params:{categoryId:x.browseCategoryId,subcategoryId:x.id}}]},[x]),w=(0,H.useCallback)(()=>{C&&l(C)},[C,l]),T=(0,H.useCallback)(()=>{y&&c(y,Number(_)||0)},[y,_,c]),E=s&&Number(_)>0?Number(_):y_n,D=(0,H.useMemo)(()=>{if(!y)return[];let t=E*y.measures[0].gramsPerUnit;return[{id:`1`,title:e(`food_library_item_carbohydrates`),value:n9(y.nutritionPer100g.carbohydrates,t)},{id:`2`,title:e(`food_library_item_energy`),value:n9(y.nutritionPer100g.energy,t)},{id:`3`,title:e(`food_library_item_protein`),value:n9(y.nutritionPer100g.protein,t)},{id:`4`,title:e(`food_library_item_sugar`),value:n9(y.nutritionPer100g.sugar,t)},{id:`5`,title:e(`food_library_item_fibers`),value:n9(y.nutritionPer100g.fibers,t)},{id:`6`,title:e(`food_library_item_fat`),value:n9(y.nutritionPer100g.fat,t)},{id:`7`,title:e(`food_library_item_sfat`),value:n9(y.nutritionPer100g.saturatedFat,t)}]},[e,y,E]);return y?(0,W.jsxs)(B,{style:r9.screen,children:[!!S&&(0,W.jsx)(z4.default,{colors:[S,c3(S,0)],style:R.absoluteFill,pointerEvents:`none`}),(0,W.jsxs)(fs,{style:r9.scrollableContent,contentContainerStyle:d,keyboardDismissMode:`on-drag`,keyboardShouldPersistTaps:`handled`,children:[(0,W.jsxs)(B,{style:r9.topSection,children:[(0,W.jsx)(Z,{style:[r9.title,{color:n.labelPrimary}],numberOfLines:2,children:y.title}),s?(0,W.jsx)(h_n,{amount:_||``,onChangeAmount:v,unit:y.measures[0].unit,carbs:b,onAdd:T,testID:`curated-food-item-input`}):(0,W.jsxs)(B,{style:r9.carbsContainer,children:[(0,W.jsx)(u_n,{totalAmount:100,carbsValue:y.nutritionPer100g.carbohydrates.value,carbsUnit:y.nutritionPer100g.carbohydrates.unit}),(0,W.jsx)(Z,{style:[r9.carbsLabel,{color:n.labelPrimary}],children:`${Math.round(y.nutritionPer100g.carbohydrates.value*10)/10} carbs / 100${y.nutritionPer100g.carbohydrates.unit}`})]})]}),(0,W.jsxs)(B,{style:r9.section,children:[!!x&&(0,W.jsxs)(B,{style:r9.categorySection,children:[(0,W.jsx)(Z,{style:[r9.categorySectionTitle,{color:n.labelSecondary}],children:e(`food_library_info_category`)}),(0,W.jsx)(d_n,{title:x.title,color:S,iconUri:x.icon,onPress:w})]}),(0,W.jsx)(Z,{style:[r9.contentsTitle,{color:n.labelPrimary}],children:e(`food_library_carb_body`,{amount:E.toString(),unit:y.measures[0].unit})}),D.map(e=>(0,W.jsxs)(B,{style:[r9.contentsRow,{borderBottomColor:n.border}],children:[(0,W.jsx)(Z,{style:[r9.contentsText,{color:n.labelSecondary}],children:e.title}),(0,W.jsx)(Z,{style:[r9.contentsText,{color:n.labelSecondary}],children:e.value})]},e.id)),(0,W.jsx)(B,{style:[r9.contentsRow,{borderBottomColor:n.bgTransparent}],children:(0,W.jsx)(Z,{style:[r9.contentsText,{color:n.labelSecondary}],children:`${e(`food_library_source`)} ${y.provider.name}`})})]})]}),(0,W.jsx)(B,{style:u,children:(0,W.jsx)(U5,{})})]}):(0,W.jsxs)(B,{style:r9.screen,children:[!!S&&(0,W.jsx)(z4.default,{colors:[S,c3(S,0)],style:R.absoluteFill,pointerEvents:`none`}),(0,W.jsx)(B,{style:r9.topSection,children:(0,W.jsx)(B,{style:u,children:(0,W.jsx)(U5,{})})}),m?(0,W.jsx)(Q7,{icon:(0,W.jsx)(s9t,{}),message:e(`food_offline_state_default`)}):(0,W.jsx)(x2,{})]})},r9=R.create({screen:{flex:1},topSection:{alignItems:`center`,paddingHorizontal:16,marginBottom:32},headerRow:{position:`absolute`,top:0,left:0,right:0,flexDirection:`row`,justifyContent:`space-between`,paddingHorizontal:16,paddingBottom:10},title:{...Y.Poppins.medium_2XL,textAlign:`center`,marginBottom:32,paddingHorizontal:16},carbsContainer:{alignItems:`center`},carbsLabel:{...Y.Poppins.regular_Base,marginTop:12},scrollableContent:{flex:1},section:{paddingHorizontal:16},categorySection:{flexDirection:`row`,alignItems:`center`,marginBottom:45},categorySectionTitle:{...Y.Poppins.regular_SM,marginRight:7},contentsTitle:{...Y.Poppins.medium_Base,marginBottom:6},contentsRow:{flexDirection:`row`,justifyContent:`space-between`,paddingVertical:10,borderBottomWidth:1},contentsText:{...Y.Poppins.regular_Base}}),S_n=[`foods`,`recent`],C_n=e=>{let{data:t=[],isLoading:n,isError:r,refetch:i}=b0({queryKey:S_n,queryFn:Ban,enabled:e,networkMode:`offlineFirst`,retry:3});return{recentFoods:t,isRecentFoodsLoading:n,isRecentFoodsError:r,refetchRecentFoods:i}};V();var w_n=({onPress:e,title:t,description:n,imageUrl:r,color:i})=>{let{COLORS:a}=J();return(0,W.jsxs)(Yf,{style:[i9.row,{backgroundColor:a.bgSecondary,borderColor:a.buttonBorder}],onPress:e,children:[(0,W.jsx)(B,{style:[i9.imageContainer,{backgroundColor:i}],children:(0,W.jsx)(Zu,{source:{uri:r},style:i9.categoryImage,resizeMode:`contain`})}),(0,W.jsxs)(B,{style:i9.textContainer,children:[(0,W.jsx)(Z,{style:[i9.title,{color:a.labelPrimary}],numberOfLines:1,ellipsizeMode:`tail`,children:t}),!!n&&(0,W.jsx)(Z,{style:[i9.description,{color:a.labelSecondary}],numberOfLines:2,ellipsizeMode:`tail`,children:n})]}),(0,W.jsx)(K4,{width:18,height:18,color:a.labelTertiary})]})},i9=R.create({row:{flexDirection:`row`,alignItems:`center`,borderRadius:16,borderWidth:1,paddingRight:12,paddingVertical:4,paddingLeft:4},imageContainer:{width:80,height:80,borderRadius:12,overflow:`hidden`,alignItems:`center`,justifyContent:`center`,flexShrink:0},categoryImage:{width:68,height:68},textContainer:{flex:1,paddingHorizontal:12,justifyContent:`center`},title:{...Y.Poppins.medium_Base},description:{...Y.Poppins.regular_SM,marginTop:2}});V();var T_n=Oq?{outlineStyle:`none`}:{},E_n=({isSearchActive:e,onSearch:t,onClear:n,onFocus:r,onBlur:i})=>{let{t:a}=Tq(),{COLORS:o}=J(),s=(0,H.useRef)(null),[c,l]=(0,H.useState)(``),u=U3t(t,300),d=(0,H.useCallback)(()=>{u.cancel(),l(``),s.current?.blur(),n()},[u,n]),f=(0,H.useCallback)(()=>{c.length>2&&(u.cancel(),t(c))},[u,t,c]),p=(0,H.useCallback)(e=>{if(l(e),e.length>2){u(e);return}u.cancel(),t(e)},[u,t]),m=(0,H.useCallback)(()=>{s.current?.focus()},[]);return(0,W.jsxs)(wp,{style:[D_n.container,{backgroundColor:o.bgInputActive,borderColor:o.buttonBorder}],onPress:m,accessible:!1,children:[(0,W.jsx)(u9t,{height:24,width:24}),(0,W.jsx)(Lp,{ref:s,testID:`food-searchbar-input`,autoCapitalize:`none`,placeholder:a(`food_search_title`),placeholderTextColor:o.labelSecondary,cursorColor:o.textSearchText,maxFontSizeMultiplier:C2.s3,style:[D_n.searchInput,{color:o.textSearchText}],multiline:!1,maxLength:64,value:c,onChangeText:p,onSubmitEditing:f,onFocus:r,onBlur:i,autoCorrect:!1,enterKeyHint:`search`}),(e||c.length>0)&&(0,W.jsx)(wp,{testID:`food-searchbar-clear`,onPress:d,hitSlop:10,children:(0,W.jsx)(Z7t,{color:o.labelSecondary,width:16,height:16})})]})},D_n=R.create({container:{flex:1,flexDirection:`row`,alignItems:`center`,height:48,borderRadius:16,borderWidth:1,paddingLeft:16,paddingRight:12,gap:4},searchInput:{...Y.Poppins.regular_Base,lineHeight:z.select({ios:0,default:Y.Poppins.regular_Base.lineHeight}),flex:1,includeFontPadding:!1,...T_n}});V();function O_n({showScanButton:e,isSearchActive:t,onSearch:n,onClearSearch:r,onSearchFocus:i,onSearchBlur:a,onScanFoodPress:o}){return(0,W.jsxs)(B,{style:k_n.row,children:[(0,W.jsx)(E_n,{isSearchActive:t,onSearch:n,onClear:r,onFocus:i,onBlur:a}),e&&!Oq&&(0,W.jsx)(aen,{onPress:o,style:{width:48,height:48}})]})}var k_n=R.create({row:{flexDirection:`row`,alignItems:`center`,gap:10,paddingVertical:12}}),A_n=(0,H.memo)(O_n),j_n=`/assets/webp/heart.webp`;V();var M_n=({onPress:e})=>{let{COLORS:t}=J(),{t:n}=Tq();return(0,W.jsxs)(Yf,{style:[a9.container,{backgroundColor:t.bgSecondary,borderColor:t.buttonBorder}],onPress:e,children:[(0,W.jsx)(B,{style:[a9.imageContainer,{backgroundColor:t.bgMyFoodCategory}],children:(0,W.jsx)(Zu,{source:j_n,style:a9.heartImage})}),(0,W.jsx)(Z,{style:[a9.title,{color:t.labelPrimary}],numberOfLines:1,children:n(`food_segment_button_my_food`)}),(0,W.jsx)(K4,{width:18,height:18,color:t.labelTertiary})]})},a9=R.create({container:{flexDirection:`row`,alignItems:`center`,borderRadius:16,borderWidth:1,paddingLeft:4,paddingRight:12,paddingVertical:4,gap:12},imageContainer:{width:80,height:52,borderRadius:12,alignItems:`center`,justifyContent:`center`,flexShrink:0},heartImage:{width:52,height:52},title:{...Y.Poppins.medium_Base,flex:1}});V();var N_n=e=>`measures`in e,P_n=()=>Tf.dismiss(),F_n=()=>{let{t:e}=Tq(),{COLORS:t,isDark:n}=J(),{paddingBottomScreenWithTabBar:r}=Z7(),{bottomWithScroll:i}=Q4(),a=N$(),o=F$(),{isInCalculationFlow:s}=Qgn(),{canAddToCalculation:c,addToCalculation:l}=X7(o.params?.cameFromVisualSearch),u=N5(c&&kq),[d,f]=(0,H.useState)(``),[p,m]=(0,H.useState)(!1),[h,g]=(0,H.useState)(null),_=!s&&!o.params?.cameFromVisualSearch,v=d.length>2,y=`categories`;p&&v?y=`searchResults`:p&&(y=`recentFoods`);let{foodCategories:b,isFoodCategoriesError:x}=Y7(),{recentFoods:S,isRecentFoodsLoading:C,isRecentFoodsError:w}=C_n(y===`recentFoods`),{foodSearchResults:T,isFoodSearchLoading:E,isFoodSearchError:D}=_fn(d);(0,H.useLayoutEffect)(()=>{a.setOptions({headerTransparent:!0,header:()=>(0,W.jsx)(F5,{title:e(`food_library_sheet_navigation`),LeftButton:c?(0,W.jsx)(U5,{}):void 0,color:t.bgPrimary,skipTopInset:c&&kq,overlay:!0})})},[a,e,c,t]);let O=(0,H.useCallback)(()=>{m(!0)},[]),k=(0,H.useCallback)(()=>{f(``),g(null),m(!1)},[]),A=(0,H.useCallback)(()=>{if(u8(l8.FoodLibraryScanFoodPress),!c7.getState().privacyNoticeAccepted){a.navigate(Q.VisualSearchIntro);return}a.navigate(Q.VisualSearch)},[a]),ee=(0,H.useCallback)(()=>{a.navigate(Q.PersonalFood,{cameFromVisualSearch:o.params?.cameFromVisualSearch})},[a,o.params]),te=(0,H.useCallback)(({item:e})=>{if(N_n(e))return(0,W.jsx)(n_n,{item:e,expandable:c,isExpanded:h===e.id,onExpand:()=>g(e.id),onPress:()=>{e.source===`curated`?a.navigate(Q.CuratedFoodItem,{foodId:e.id,categoryId:e.categoryId,cameFromVisualSearch:o.params?.cameFromVisualSearch}):a.navigate(Q.PersonalFoodItem,{foodId:e.id,cameFromVisualSearch:o.params?.cameFromVisualSearch})},onAddToCalculation:l,testID:`food-search-item-${e.id}`});let t=()=>{a.navigate(Q.FoodSubcategories,{categoryId:e.id,cameFromVisualSearch:o.params?.cameFromVisualSearch})},r=e.color.light;return n&&(r=e.color.dark),(0,W.jsx)(w_n,{onPress:t,title:e.title,description:e.description,imageUrl:e.icon,color:r})},[c,a,o.params,l,h,n]),ne=T;y===`categories`?ne=b:y===`recentFoods`&&(ne=S);let re=(0,H.useMemo)(()=>{let t=(0,W.jsx)(Q7,{icon:(0,W.jsx)(s9t,{}),message:e(`food_offline_state_default`)});return y===`categories`?x?t:null:y===`recentFoods`?w?t:C?(0,W.jsx)(x2,{}):null:D?t:E?(0,W.jsx)(x2,{}):(0,W.jsx)(Q7,{icon:(0,W.jsx)(t9t,{}),message:e(`food_empty_state_no_food`)})},[y,x,w,C,D,E,e]),ie=(0,H.useCallback)(e=>(0,W.jsx)(Z2t,{...e,bottomOffset:16}),[]),j=(0,H.useMemo)(()=>[o9.contentContainer,{paddingTop:u,paddingBottom:c?i:r}],[u,c,i,r]),ae=(0,W.jsxs)(B,{style:o9.listHeader,children:[(0,W.jsx)(A_n,{showScanButton:_,isSearchActive:p,onSearch:f,onClearSearch:k,onSearchFocus:O,onScanFoodPress:A}),y===`categories`&&(0,W.jsx)(M_n,{onPress:ee}),y===`recentFoods`&&S.length>0&&(0,W.jsxs)(B,{style:o9.recentTitleRow,children:[(0,W.jsx)(l9t,{width:16,height:16}),(0,W.jsx)(Z,{style:[o9.recentTitle,{color:t.labelPrimary}],children:e(`food_library_frequent_title`)})]})]});return(0,W.jsxs)(B,{style:[o9.screen,{backgroundColor:t.bgPrimary}],children:[(0,W.jsx)(z4.default,{colors:[t.bgPrimary,c3(t.bgPrimary,0)],style:o9.gradient,pointerEvents:`none`}),(0,W.jsx)(Wc,{style:o9.list,data:ne,keyExtractor:e=>e.id,renderItem:te,ListHeaderComponent:ae,ListEmptyComponent:re,contentContainerStyle:j,keyboardDismissMode:Oq?`none`:`on-drag`,keyboardShouldPersistTaps:`handled`,onScroll:Oq?P_n:void 0,renderScrollComponent:ie,scrollEventThrottle:16})]})},o9=R.create({screen:{flex:1},gradient:{position:`absolute`,top:0,left:0,right:0,height:`50%`},contentContainer:{gap:8,flexGrow:1,paddingHorizontal:16},listHeader:{gap:8},recentTitleRow:{flexDirection:`row`,alignItems:`center`,gap:8},recentTitle:{...Y.Poppins.medium_SM},list:{flex:1}});V();var I_n=()=>{let e=F$(),t=N$(),{categoryId:n,cameFromVisualSearch:r}=e.params,{canAddToCalculation:i}=X7(r),{COLORS:a,isDark:o}=J(),{bottomWithScroll:s}=Q4(),{paddingBottomScreenWithTabBar:c}=Z7(),l=N5(i&&kq),{foodCategories:u}=Y7(),d=u.find(e=>e.id===n),f=o?d?.color.dark:d?.color.light;(0,H.useLayoutEffect)(()=>{t.setOptions({header:()=>(0,W.jsx)(F5,{title:d?.title,LeftButton:(0,W.jsx)(H5,{}),color:f,skipTopInset:i&&kq,overlay:!0})})},[t,d,f,i]);let p=(0,H.useCallback)((e,n)=>{t.navigate(Q.CuratedFood,{categoryId:n,subcategoryId:e,cameFromVisualSearch:r})},[t,r]),m=(0,H.useCallback)(({item:e})=>(0,W.jsx)(w_n,{onPress:()=>p(e.id,d?.id),title:e.title,imageUrl:e.icon,color:f??a.bgPrimary}),[a,d,f,p]);return(0,W.jsxs)(B,{style:[s9.screen,{backgroundColor:a.bgPrimary}],children:[f&&(0,W.jsx)(z4.default,{colors:[f,c3(f,0)],style:s9.gradient,pointerEvents:`none`}),(0,W.jsx)(Wc,{data:d?.subcategories??[],keyExtractor:e=>e.id,renderItem:m,style:s9.list,contentContainerStyle:[s9.contentContainer,{paddingTop:l+8,paddingBottom:i?s:c}],scrollEventThrottle:16})]})},s9=R.create({screen:{flex:1},list:{flex:1},gradient:{position:`absolute`,top:0,left:0,right:0,height:`50%`},contentContainer:{gap:8,paddingHorizontal:16,flexGrow:1}});V();var L_n=()=>{let{COLORS:e}=J(),{t}=Tq(),n=N$(),{params:r}=F$(),{canAddToCalculation:i,addToCalculation:a}=X7(r?.cameFromVisualSearch),o=N5(i&&kq),{bottomWithScroll:s}=Q4(),{paddingBottomScreenWithTabBar:c}=Z7(),{personalFoods:l,isPersonalFoodsLoading:u}=ffn(),d=l.length===0;(0,H.useLayoutEffect)(()=>{n.setOptions({header:()=>(0,W.jsx)(F5,{title:t(`food_myFood_title`),LeftButton:(0,W.jsx)(H5,{}),color:e.bgMyFoodCategory,skipTopInset:i&&kq,overlay:!0})})},[n,e,i,t]);let f=(0,H.useCallback)(()=>{n.navigate(Q.CreateFood)},[n]),[p,m]=(0,H.useState)(null),h=(0,H.useCallback)(({item:e})=>(0,W.jsx)(n_n,{item:e,expandable:i,isExpanded:p===e.id,onExpand:()=>m(e.id),onPress:()=>{n.navigate(Q.PersonalFoodItem,{foodId:e.id,cameFromVisualSearch:r?.cameFromVisualSearch})},onAddToCalculation:a,testID:`personal-food-item-${e.id}`}),[i,n,r?.cameFromVisualSearch,a,p]),g=(0,H.useCallback)(e=>(0,W.jsx)(Z2t,{...e,bottomOffset:16}),[]);return(0,W.jsxs)(B,{style:[c9.screen,{backgroundColor:e.bgPrimary}],children:[(0,W.jsx)(z4.default,{colors:[e.bgMyFoodCategory,c3(e.bgMyFoodCategory,0)],style:c9.gradient,pointerEvents:`none`}),u?(0,W.jsx)(x2,{}):(0,W.jsx)(Wc,{data:l,keyExtractor:e=>e.id,renderItem:h,style:c9.list,contentContainerStyle:[c9.contentContainer,d?{justifyContent:`center`,paddingTop:o+8,paddingBottom:i?o+8:c}:{paddingTop:o+8,paddingBottom:i?s:c}],scrollEventThrottle:16,keyboardShouldPersistTaps:`handled`,renderScrollComponent:g,ListEmptyComponent:(0,W.jsx)(B,{children:(0,W.jsx)(Q7,{icon:(0,W.jsx)(t9t,{}),message:t(`food_myFood_empty_state_default`)})}),ListFooterComponent:(0,W.jsx)(U4,{title:t(`food_button_createFood`),onPress:f,type:H4.Secondary})})]})},c9=R.create({screen:{flex:1},gradient:{position:`absolute`,top:0,left:0,right:0,height:`50%`},list:{flex:1},contentContainer:{flexGrow:1,gap:8,paddingHorizontal:16}});V();var R_n=()=>{let{t:e}=Tq(),t=N$(),{params:n}=F$(),{COLORS:r}=J(),{topInsideModal:i}=Q4(),{canAddToCalculation:a,addToCalculation:o}=X7(n.cameFromVisualSearch),s=s_n(),c=(0,H.useCallback)(()=>{s([{name:Q.PersonalFood}])},[s]),l=[l9.headerRow,{paddingTop:i}],{foodIntakeItems:u}=L5(),{food:d,isFoodLoading:f,isFoodError:p}=hfn(n.foodId),[m,h]=(0,H.useState)(()=>{let e=u.find(e=>e.foodItem.id===n.foodId);return e?e.amount.toString():c7.getState().extraFoodItems.find(e=>e.foodItem.id===n.foodId)?.amount.toString()??null}),g=d?.source===`personal`?d:null,_=$5(g?g.imageId:null);(0,H.useEffect)(()=>{g||f||p||t.goBack()},[g,f,p,t]);let v=(0,H.useCallback)(()=>{g&&t.navigate(Q.CreateFood,{personalFoodId:g.id})},[t,g]),y=(0,H.useMemo)(()=>g?C8(Number(m||0),g.measures[0].gramsPerUnit,g.nutritionPer100g.carbohydrates.value):0,[g,m]),b=(0,H.useCallback)(()=>{g&&o(g,Number(m)||0)},[g,m,o]);if(!g)return(0,W.jsxs)(B,{style:l9.screen,children:[(0,W.jsxs)(B,{style:l9.gradient,children:[(0,W.jsx)(z4.default,{colors:[r.bgMyFoodCategory,c3(r.bgMyFoodCategory,0)],style:R.absoluteFill,pointerEvents:`none`}),(0,W.jsx)(B,{style:l,children:(0,W.jsx)(U5,{})})]}),p?(0,W.jsx)(Q7,{icon:(0,W.jsx)(s9t,{}),message:e(`food_offline_state_default`)}):(0,W.jsx)(x2,{})]});let x=`${Math.round(g.nutritionPer100g.carbohydrates.value*10)/10} carbs / 100${g.nutritionPer100g.carbohydrates.unit}`;return(0,W.jsxs)(B,{style:l9.screen,children:[(0,W.jsxs)(B,{style:l9.gradient,children:[(0,W.jsx)(z4.default,{colors:[r.bgMyFoodCategory,c3(r.bgMyFoodCategory,0)],style:R.absoluteFill,pointerEvents:`none`}),(0,W.jsxs)(B,{style:l,children:[(0,W.jsx)(U5,{}),(0,W.jsx)(sfn,{onPress:v})]}),(0,W.jsx)(Z,{style:[l9.title,a&&l9.titleInCalculation,{color:r.labelPrimary}],numberOfLines:2,children:g.title}),a?(0,W.jsx)(B,{style:l9.inputCardSection,children:(0,W.jsx)(h_n,{amount:m||``,onChangeAmount:h,unit:g.measures[0].unit,carbs:y,onAdd:b,testID:`personal-food-item-input`})}):(0,W.jsxs)(B,{style:l9.carbsContainer,children:[(0,W.jsx)(u_n,{totalAmount:100,carbsValue:g.nutritionPer100g.carbohydrates.value,carbsUnit:g.nutritionPer100g.carbohydrates.unit}),(0,W.jsx)(Z,{style:[l9.carbsLabel,{color:r.labelPrimary}],children:x})]})]}),(0,W.jsxs)(B,{style:l9.section,children:[(0,W.jsxs)(B,{style:l9.categoryRow,children:[(0,W.jsx)(Z,{style:[l9.categorySectionTitle,{color:r.labelSecondary}],children:e(`food_library_info_category`)}),(0,W.jsx)(d_n,{title:e(`food_segment_button_my_food`),color:r.bgMyFoodCategory,onPress:c})]}),(0,W.jsx)(B,{style:[l9.divider,{backgroundColor:r.border}]}),a&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(B,{style:l9.carbsInfoRow,children:[(0,W.jsx)(Z,{style:[l9.carbsInfoLabel,{color:r.labelPrimary}],children:x}),(0,W.jsx)(u_n,{size:`small`,totalAmount:100,carbsValue:g.nutritionPer100g.carbohydrates.value,carbsUnit:g.nutritionPer100g.carbohydrates.unit})]}),(0,W.jsx)(B,{style:[l9.divider,{backgroundColor:r.border}]})]}),(!!g.description||!!_)&&(0,W.jsxs)(B,{style:l9.notesRow,children:[!!g.description&&(0,W.jsx)(Z,{style:[l9.description,{color:r.labelSecondary}],children:g.description}),!!_&&(0,W.jsx)(Zu,{source:{uri:_},style:l9.foodImage,resizeMode:`cover`})]})]})]})},l9=R.create({screen:{flex:1},gradient:{alignItems:`center`},headerRow:{flexDirection:`row`,justifyContent:`space-between`,alignSelf:`stretch`,paddingHorizontal:16,paddingBottom:10,marginBottom:20},title:{...Y.Poppins.medium_2XL,textAlign:`center`,marginBottom:32,paddingHorizontal:16},titleInCalculation:{marginBottom:22},inputCardSection:{alignSelf:`stretch`,paddingHorizontal:16},carbsContainer:{alignItems:`center`},carbsLabel:{...Y.Poppins.regular_Base,marginTop:12},notesRow:{flexDirection:`row`,alignItems:`center`,paddingHorizontal:16,gap:8},description:{...Y.Poppins.regular_SM,flex:1},foodImage:{width:64,height:64,borderRadius:8},section:{paddingHorizontal:16,marginTop:32,gap:16},categoryRow:{flexDirection:`row`,alignItems:`center`,paddingHorizontal:16},categorySectionTitle:{...Y.Poppins.regular_SM,marginRight:7},divider:{height:1},carbsInfoRow:{flexDirection:`row`,alignItems:`center`,justifyContent:`space-between`,paddingHorizontal:16},carbsInfoLabel:{...Y.Poppins.regular_Base,flex:1}}),{Group:z_n,Navigator:B_n,Screen:u9}=j5();function V_n(){return(0,W.jsxs)(B_n,{screenOptions:{...K5,header:()=>null,...$8},children:[(0,W.jsx)(u9,{name:Q.FoodAndDrink,component:F_n}),(0,W.jsx)(u9,{name:Q.FoodSubcategories,component:I_n,options:{headerTransparent:!0}}),(0,W.jsx)(u9,{name:Q.PersonalFood,component:L_n,options:{headerTransparent:!0}}),(0,W.jsx)(u9,{name:Q.CuratedFood,component:r_n,options:{headerTransparent:!0}}),(0,W.jsxs)(z_n,{screenOptions:{...Jsn,headerShown:!1,gestureEnabled:!1},children:[(0,W.jsx)(u9,{name:Q.PersonalFoodItem,component:R_n}),(0,W.jsx)(u9,{name:Q.CuratedFoodItem,component:x_n})]})]})}var{Navigator:H_n,Screen:d9}=j5();function U_n(){let{COLORS:e}=J();return(0,W.jsxs)(H_n,{id:`NewCalculationStack`,screenOptions:{headerShown:!1,...$8},children:[(0,W.jsx)(d9,{name:Q.Calculation,component:Fmn,options:{headerShown:!0,cardStyle:{flex:1}}}),(0,W.jsx)(d9,{name:Q.LoadingRecommendation,component:Wgn}),(0,W.jsx)(d9,{name:Q.Recommendation,component:qgn,options:{...K5,headerStyle:{backgroundColor:e.bgSheet},headerShown:!1}}),(0,W.jsx)(d9,{name:Q.LeavingRecommendation,component:Lmn}),(0,W.jsx)(d9,{name:Q.FoodLibrary,component:V_n,options:{...lfn,...ncn,headerShown:!1,gestureEnabled:!1}})]})}var W_n=X.Milliseconds.Minute*20,G_n=()=>{let{pinCode:e,settingsUnlockedTimestamp:t,setSettingsUnlockedTimestamp:n}=E3(),r=(0,H.useMemo)(()=>t===null||Date.now()-t>W_n,[t]);V$((0,H.useCallback)(()=>{if(t===null)return;let e=W_n-(Date.now()-t);if(e<=0)return;let r=setTimeout(()=>n(null),e);return()=>clearTimeout(r)},[t,n]));let i=(0,H.useCallback)(()=>{n(Date.now())},[n]),a=(0,H.useCallback)(()=>{n(null)},[n]);return{areSettingsLocked:r,isPINSet:!!e,unlockSettings:i,lockSettings:a}};V();var K_n=()=>{let{t:e}=Tq(),{COLORS:t}=J();return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Z,{style:[f9.header,f9.firstHeaderSpacing],testID:`activity-info-title`,children:e(`physical_activity_modal_activity_insulin_title`)}),(0,W.jsx)(Z,{style:[{color:t.labelSecondary},f9.spacing],children:e(`physical_activity_modal_activity_insulin_body`)}),(0,W.jsx)(Z,{style:f9.header,children:e(`physical_activity_modal_adjust_insulin_title`)}),(0,W.jsx)(Z,{style:[{color:t.labelSecondary},f9.spacing],children:e(`physical_activity_modal_adjust_insulin_body`)})]})},f9=R.create({header:{...Y.Poppins.semiBold_2XL,marginBottom:8},firstHeaderSpacing:{marginTop:32},spacing:{marginBottom:32}});V();var p9=({text:e,learnMoreText:t,learnMoreOnPress:n})=>{let{t:r}=Tq(),{COLORS:i}=J();return(0,W.jsxs)(B,{style:[m9.card,{backgroundColor:i.bgSecondary}],children:[(0,W.jsx)(g9t,{}),(0,W.jsxs)(B,{style:m9.rightContainer,children:[(0,W.jsx)(Z,{style:[m9.contactText,{color:i.labelPrimary}],children:e??r(`warning_HCP`)}),t!==void 0&&n!==void 0&&(0,W.jsx)(Yf,{onPress:n,style:m9.learnMoreContainer,children:(0,W.jsx)(Z,{style:[m9.learnMoreText,{color:i.textLink}],children:t})})]})]})},m9=R.create({card:{borderRadius:16,paddingHorizontal:16,paddingVertical:12,flexDirection:`row`,gap:8},rightContainer:{flex:1,gap:8},learnMoreContainer:{flexDirection:`row`,alignItems:`center`,gap:4},contactText:{flexShrink:1,...Y.Poppins.medium_SM},learnMoreText:{flexShrink:1,...Y.Poppins.semiBold_SM}});V();var h9=4,q_n=({onFinish:e,ref:t})=>{let{COLORS:n}=J(),r=(0,H.useRef)(Array.from({length:h9},()=>H.createRef())),[i,a]=(0,H.useState)(()=>Array.from({length:h9},()=>``)),[o,s]=(0,H.useState)(0),[c,l]=(0,H.useState)(null);(0,H.useImperativeHandle)(t,()=>({resetDigits(){a(Array.from({length:h9},()=>``)),s(0),l(null),r.current[0].current?.focus()},displayError(e){l(e)}}),[r]);let u=(0,H.useCallback)((e,t)=>{let n=e.replace(/[^0-9]/g,``),o=[...i];o[t]=n,a(o),l(null),n&&t<r.current.length-1&&r.current[t+1].current?.focus(),!e&&t!==0&&r.current[t-1].current?.focus()},[i,r]),d=(0,H.useCallback)(e=>{i[e]===``&&e!==0&&r.current[e-1].current?.focus()},[i,r]);return(0,H.useEffect)(()=>{let t=i.join(``);t.length===h9&&e(t)},[i,e]),(0,W.jsxs)(B,{children:[(0,W.jsx)(B,{style:J_n.inputContainer,children:r.current.map((e,t)=>(0,W.jsx)(Lp,{ref:e,testID:`pin-digit-${t}`,value:i[t],autoFocus:t===0&&kq,keyboardType:`number-pad`,maxLength:1,onChangeText:e=>u(e,t),onKeyPress:e=>{e.nativeEvent.key===`Backspace`&&d(t)},onFocus:()=>s(t),onBlur:()=>s(null),style:[J_n.input,{borderColor:c===null?o===t?n.borderActivationCodeFocus:n.borderActivationCode:n.borderActivationCodeDanger,backgroundColor:n.bgTertiary,color:n.labelPrimary}]},t))}),c!==null&&(0,W.jsx)(Z,{style:[J_n.error,{color:n.textDanger}],children:c})]})},J_n=R.create({inputContainer:{flexDirection:`row`,gap:8,justifyContent:`center`},input:{...Y.Poppins.medium_2XL,lineHeight:z.select({ios:0,default:Y.Poppins.regular_Base.lineHeight}),width:49,height:55,borderRadius:8,padding:0,textAlign:`center`,textAlignVertical:`center`,borderWidth:2},error:{...Y.Poppins.regular_SM,textAlign:`center`,marginTop:8}});V();var Y_n=()=>(0,W.jsx)(B,{style:X_n.animationContainer,children:(0,W.jsx)(g2,{autoPlay:!0,source:_2.LEAVING_RECOMMENDATION,style:X_n.animation,loop:!0})}),X_n=R.create({animationContainer:{justifyContent:`center`,alignItems:`center`},animation:{width:75,height:75}});V(),YQ();var Z_n=1600,Q_n=({isVisible:e,onClose:t,onForgotPIN:n,onModalHide:r,onModalHideWithSuccess:i})=>{let{COLORS:a}=J(),{t:o}=(0,Z_t.useTranslation)(),{pinCode:s}=E3(),[c,l]=(0,H.useState)(`enter_pin`),[u,d]=H.useState(!1),f=(0,H.useRef)(null),p=(0,H.useRef)(null),{height:m}=N2t(),h=fQ(!1),g=fQ(0),_=mQ(()=>({paddingBottom:h.value?g.value:-m.value}));(0,H.useEffect)(()=>{e&&(h.value=!1)},[e,h]),(0,H.useEffect)(()=>(p.current&&=(clearTimeout(p.current),null),c===`success`&&(p.current=setTimeout(()=>{d(!0)},Z_n)),()=>{p.current&&=(clearTimeout(p.current),null)}),[c]);let v=(0,H.useCallback)(()=>{g.value=-m.value,h.value=!0,Tf.dismiss(),t()},[t,h,g,m]),y=(0,H.useCallback)(()=>{l(`enter_pin`),d(!1),c===`success`?i():r?.()},[i,r,c]);(0,H.useEffect)(()=>{c===`success`&&u&&v()},[u,c,v]);let b=(0,H.useCallback)(e=>{c===`enter_pin`&&(e===s?l(`success`):f.current?.displayError(o(`pin_modal_error_invalid`)))},[c,s,o]),x=(0,H.useCallback)(()=>{g.value=-m.value,h.value=!0,Tf.dismiss(),n()},[n,h,g,m]);return(0,W.jsxs)(u3,{testID:`validate_pin_code_modal`,isVisible:e,onModalHide:y,onModalShow:()=>f.current?.resetDigits(),containerStyle:{backgroundColor:a.bgSheet},children:[(0,W.jsx)(B,{style:$_n.header,children:(0,W.jsx)(U5,{onPress:v})}),(0,W.jsx)(Z,{style:$_n.title,children:o(`pin_modal_header_enter`)}),(0,W.jsxs)(JQ.View,{style:[$_n.content,_],children:[c===`success`?(0,W.jsx)(Y_n,{}):(0,W.jsx)(q_n,{onFinish:b,ref:f}),(0,W.jsx)(U4,{title:o(`pin_modal_button_forgot`),onPress:x,type:H4.Plain})]})]})},$_n=R.create({title:{...Y.Poppins.bold_2XL,marginBottom:6,textAlign:`center`},header:{alignItems:`flex-start`,paddingTop:16,marginBottom:10},content:{paddingTop:10}});V(),YQ();var evn=1600,tvn=({isVisible:e,onClose:t,onModalHideWithSuccess:n})=>{let{COLORS:r}=J(),{t:i}=Tq(),[a,o]=(0,H.useState)(`enter_pin`),[s,c]=(0,H.useState)(``),[l,u]=H.useState(!1),d=(0,H.useRef)(null),f=(0,H.useRef)(null),{height:p}=N2t(),m=fQ(!1),h=fQ(0),g=mQ(()=>({paddingBottom:m.value?h.value:-p.value}));(0,H.useEffect)(()=>{e&&(m.value=!1)},[e,m]),(0,H.useEffect)(()=>(f.current&&=(clearTimeout(f.current),null),a===`success`&&(f.current=setTimeout(()=>{u(!0)},evn)),()=>{f.current&&=(clearTimeout(f.current),null)}),[a]);let _=(0,H.useCallback)(()=>{h.value=-p.value,m.value=!0,Tf.dismiss(),t()},[t,m,h,p]),v=(0,H.useCallback)(()=>{o(`enter_pin`),u(!1),a===`success`&&n(s)},[n,s,a]);(0,H.useEffect)(()=>{a===`success`&&l&&_()},[l,a,_]);let y=(0,H.useCallback)(e=>{a===`enter_pin`?(c(e),d.current?.resetDigits(),o(`repeat_pin`)):a===`repeat_pin`&&(e===s?o(`success`):d.current?.displayError(i(`pin_modal_error_noMatch`)))},[a,s,i]);return(0,W.jsxs)(u3,{testID:`pin_code_modal`,isVisible:e,onModalHide:v,onModalShow:()=>d.current?.resetDigits(),containerStyle:{backgroundColor:r.bgSheet},children:[(0,W.jsx)(B,{style:g9.header,children:(0,W.jsx)(U5,{onPress:_})}),(0,W.jsx)(Z,{style:g9.title,children:i(a===`enter_pin`?`pin_modal_header_enter`:`pin_modal_header_repeat`)}),(0,W.jsxs)(JQ.View,{style:[g9.content,g],children:[a===`success`&&(0,W.jsx)(B,{style:g9.animationContainer,children:(0,W.jsx)(g2,{autoPlay:!0,source:_2.LEAVING_RECOMMENDATION,style:g9.animation,loop:!0})}),a!==`success`&&(0,W.jsx)(q_n,{onFinish:y,ref:d})]})]})},g9=R.create({title:{...Y.Poppins.bold_2XL,marginBottom:6,textAlign:`center`},header:{alignItems:`flex-start`,paddingTop:16,marginBottom:10},content:{paddingTop:10},animationContainer:{justifyContent:`center`,alignItems:`center`},animation:{width:75,height:75}}),nvn=()=>{let{setPINCode:e,isElevatedAuthConfirmed:t,setIsElevatedAuthConfirmed:n}=E3(),[r,i]=(0,H.useState)(!1);return V$((0,H.useCallback)(()=>{t&&(n(!1),i(!0))},[t,n])),(0,W.jsx)(tvn,{isVisible:r,onClose:()=>i(!1),onModalHideWithSuccess:(0,H.useCallback)(t=>{e(t)},[e])})},rvn=({isVisible:e,onModalHide:t,onEnterPIN:n,onCancel:r})=>{let{t:i}=Tq();return(0,W.jsx)(u3,{isVisible:e,title:i(`settings_locked_modal_header`),onModalHide:t,icon:()=>(0,W.jsx)(i9t,{width:96,height:96}),buttons:[{title:i(`settings_locked_modal_button_enter`),type:H4.Primary,onPress:n},{title:i(`button_cancel`),type:H4.Secondary,onPress:r}]})};V();function _9({columnDisposition:e,disabled:t=!1,testID:n,children:r,style:i}){let{COLORS:a}=J();return(0,W.jsx)(B,{testID:n,style:[ivn.row,t&&ivn.disabledRow,{backgroundColor:a.bgTableOdd},i],children:H.Children.map(r,(n,r)=>H.isValidElement(n)?H.cloneElement(n,{disabled:t,cellRatio:e?e[r]:void 0}):null)})}var ivn=R.create({row:{flexDirection:`row`,justifyContent:`space-between`},disabledRow:{opacity:.5}});V();function v9({index:e,columnDisposition:t,disabled:n=!1,testID:r,children:i,style:a}){let{COLORS:o}=J(),s=(0,H.useCallback)(e=>e===void 0?o.bgTableEven:e%2?o.bgTableOdd:o.bgTableEven,[o]);return(0,W.jsx)(B,{testID:r,style:[avn.row,{backgroundColor:s(e)},a],children:H.Children.map(i,(e,r)=>H.isValidElement(e)?H.cloneElement(e,{disabled:n,cellRatio:t?t[r]:void 0}):null)})}var avn=R.create({row:{flexDirection:`row`,justifyContent:`space-between`}});V();function y9({columnDisposition:e,disabled:t=!1,testID:n,children:r,style:i}){let{COLORS:a}=J();return(0,W.jsx)(B,{testID:n,style:[ovn.table,{backgroundColor:a.bgSecondary,borderWidth:1,borderColor:a.divider},t&&{backgroundColor:a.bgButtonSecondaryDangerDisabled},i],children:(()=>{let n=0;return H.Children.map(r,r=>{if(H.isValidElement(r)){if(r.type===_9){let n=r;return H.cloneElement(n,{disabled:n.props.disabled??t,columnDisposition:e})}if(r.type===v9){let i=r,a=H.cloneElement(i,{disabled:i.props.disabled??t,index:n,columnDisposition:e});return n+=1,a}return H.cloneElement(r)}return null})})()})}var ovn=R.create({table:{borderRadius:16,overflow:`hidden`}});V();function b9({disabled:e=!1,onPress:t,testID:n,accessibilityLabel:r,accessibilityValue:i,cellRatio:a,children:o,style:s}){let{COLORS:c}=J();return(0,W.jsx)(Yf,{disabled:!t||e,onPress:t,style:[svn.cell,{flex:a??1,borderColor:c.divider},s],testID:n,accessibilityRole:`button`,accessibilityHint:`Double-tap to set value`,accessibilityState:{disabled:e},accessibilityLabel:r,accessibilityValue:{text:i},children:H.Children.map(o,t=>{if(H.isValidElement(t)){let n=t;if(e){let e=n.props.style,t=Array.isArray(e)?[...e,{color:c.textTableSecondary}]:[e,{color:c.textTableSecondary}];return H.cloneElement(n,{...n.props,style:t})}else return H.cloneElement(n)}return null})})}var svn=R.create({cell:{justifyContent:`center`,alignItems:`center`,borderTopWidth:1,borderLeftWidth:1,paddingVertical:8}});V();function x9({testID:e,cellRatio:t,children:n,style:r,accessibilityLabel:i,accessibilityValue:a,disabled:o=!1}){let{COLORS:s}=J();return(0,W.jsx)(B,{style:[cvn.cell,{flex:t??1,borderColor:s.divider},r],testID:e,accessible:!0,accessibilityRole:`header`,accessibilityState:{disabled:o},accessibilityLabel:i,accessibilityValue:{text:a},children:n})}var cvn=R.create({cell:{justifyContent:`space-between`,alignItems:`center`,borderTopWidth:1,borderLeftWidth:1,paddingVertical:8}});V();var lvn=[X.ActivityIntensity.light,X.ActivityIntensity.moderate,X.ActivityIntensity.hard],uvn=[X.ActivityReductionIntervals.fromZero,X.ActivityReductionIntervals.fromThirty,X.ActivityReductionIntervals.fromFortysix,X.ActivityReductionIntervals.fromSixtyone],dvn={[X.ActivityReductionIntervals.fromZero]:`0-29`,[X.ActivityReductionIntervals.fromThirty]:`30-45`,[X.ActivityReductionIntervals.fromFortysix]:`46-60`,[X.ActivityReductionIntervals.fromSixtyone]:`61-120`},fvn=e=>Math.round((1-e)*100),pvn=e=>e==null?`-`:`${fvn(e).toString()} %`,mvn=e=>Math.round((1-e/100)*100)/100;function hvn(){let{t:e}=Tq(),t=N$(),{COLORS:n}=J(),{modalStoreActions:r}=z5(),{bottomWithScroll:i}=Q4(),a=N5(),[o,s]=(0,H.useState)(!1),[c,l]=(0,H.useState)(!1),[u,d]=(0,H.useState)(!1),[f,p]=(0,H.useState)(null),[m,h]=(0,H.useState)(null),[g,_]=(0,H.useState)(void 0),{glucoseUnit:v,activity:y,created:b}=k8;if(v===void 0)throw Error(`[ActivitySettings::render] glucoseUnit is not defined`);if(y===void 0)throw Error(`[ActivitySettings::render] activity is not defined`);let{target:x,post:S,hard:C,light:w,moderate:T}=y,E=(0,H.useMemo)(()=>B8(x,X.BloodGlucoseUnit.MMOL_L,v),[v,x]),{text:D}=(0,H.useMemo)(()=>L8(v),[v]),O=(0,H.useMemo)(()=>({light:w,moderate:T,hard:C}),[w,T,C]),k=(0,H.useMemo)(()=>({post:S}),[S]),A=(0,H.useMemo)(()=>[{title:e(`table_activity_duration`),maxFontSizeMultiplier:C2.s1},{title:R8.light(),maxFontSizeMultiplier:C2.s1},{title:R8.moderate(),maxFontSizeMultiplier:C2.s1},{title:R8.hard(),maxFontSizeMultiplier:C2.s1}],[e]),[ee,te]=(0,H.useState)(!1),[ne,re]=(0,H.useState)(!1),{areSettingsLocked:ie,isPINSet:j,lockSettings:ae,unlockSettings:oe}=G_n(),[se,M]=(0,H.useState)(!1),[ce,N]=(0,H.useState)(!1),P=(0,H.useCallback)(()=>{ie?te(!0):ae()},[ie,ae]);(0,H.useEffect)(()=>{t.setOptions({header:()=>(0,W.jsx)(F5,{title:e(`physical_activity_navigation`),LeftButton:(0,W.jsx)(H5,{}),RightButton:j?(0,W.jsx)(cfn,{onPress:P,isLocked:ie}):void 0,overlay:!0})})},[t,ie,j,P,e]);let le=(0,H.useCallback)(async()=>{let e={...w8(),target:x,post:S},{updatedAt:t,...n}=y;s3(n,e)||_(await k8.postUserSettings({activity:{...e,updatedAt:new Date().toISOString()}}))},[y,S,x]),ue=(0,H.useCallback)(async()=>{let e={hard:C,moderate:T,light:w,target:x,post:w8().post},{updatedAt:t,...n}=y;s3(n,e)||_(await k8.postUserSettings({activity:{...e,updatedAt:new Date().toISOString()}}))},[y,C,w,T,x]),de=(0,H.useCallback)((e,t)=>{p({interval:t,intensity:e}),s(!0)},[s,p]),fe=(0,H.useCallback)(()=>{p(null),s(!0)},[]),pe=(0,H.useCallback)(async e=>{if(f===null)throw Error(`[ActivitySettings::updateActivity] pressedTableCell is null`);if(mvn(e)!==y[f.intensity][f.interval]){let t=JSON.parse(JSON.stringify(y));t[f.intensity][f.interval]=mvn(e),t.updatedAt=new Date().toISOString(),_(await k8.postUserSettings({activity:t}))}},[y,f]),me=(0,H.useCallback)(async e=>{let t=z8(e,v,X.BloodGlucoseUnit.MMOL_L);if(t!==y.target){let e=JSON.parse(JSON.stringify(y));e.target=t,e.updatedAt=new Date().toISOString(),_(await k8.postUserSettings({activity:e}))}},[y,v]),he=(0,H.useCallback)(async e=>{f?await pe(e):await me(e),s(!1)},[f,pe,me]),ge=(0,H.useMemo)(()=>f===null?v===X.BloodGlucoseUnit.MMOL_L?Yan:Xan:a3(0,75),[f,v]),F=(0,H.useMemo)(()=>{if(f===null){let e=B8(x,X.BloodGlucoseUnit.MMOL_L,v);return ge.findIndex(t=>t===e)}let e=y[f.intensity][f.interval];return e===0?0:e?fvn(e):75},[f,y,x,v,ge]),_e=async()=>{m===`after`?await ue():await le(),l(!1)},I=()=>{h(`during`),l(!0)},ve=()=>{h(`after`),l(!0)},ye=(0,H.useCallback)(()=>{g===!1&&r.set({showSyncErrorModal:!0}),_(void 0)},[g,r]),be=(0,H.useCallback)(()=>{se&&(re(!0),M(!1))},[se,re,M]),xe=(0,H.useCallback)(()=>{M(!0),te(!1)},[M,te]),L=(0,H.useCallback)(()=>{oe()},[oe]),Se=(0,H.useCallback)(e=>j&&ie?(...e)=>te(!0):(...t)=>e(...t),[ie,j]),Ce=(0,H.useCallback)(()=>{ce&&(N(!1),setTimeout(()=>{t.navigate(Q.ChangePINCode)},500))},[ce,t]),we=y.updatedAt??b;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(fs,{testID:`settings-activity-scroll`,style:S9.scrollView,contentContainerStyle:[S9.scrollViewContent,{paddingBottom:i,paddingTop:a+16}],children:[(0,W.jsx)(Z,{style:[S9.updatedAtText,{color:n.labelSecondary}],children:e(`settings_lastEdited`,{date:we?I8(we,`d MMM yyyy`):``})}),(0,W.jsx)(p9,{text:e(`physical_activity_hcp_card_body`),learnMoreText:e(`physical_activity_hcp_card_button`),learnMoreOnPress:()=>{d(!0)}}),(0,W.jsxs)(y9,{children:[(0,W.jsxs)(B,{style:[S9.tableDescripContainer,{borderBottomColor:n.divider}],children:[(0,W.jsx)(Z,{style:[S9.title,{color:n.labelPrimary}],accessibilityRole:`header`,children:e(`physical_activity_target_title`)}),(0,W.jsx)(Z,{style:[S9.subtitle,{color:n.labelSecondary}],children:e(`physical_activity_target_body`)})]}),(0,W.jsx)(Y4,{title:e(`target_activity_input`),value:`${E} ${D}`,style:{backgroundColor:n.bgSecondary},testID:`activity-target`,onPress:Se(fe),valueStyle:{color:n.labelBrand}})]}),(0,W.jsxs)(y9,{columnDisposition:[1,1,1,1],children:[(0,W.jsxs)(B,{style:[S9.tableDescripContainer,{borderBottomColor:n.divider}],children:[(0,W.jsx)(Z,{style:[S9.title,{color:n.labelPrimary}],accessibilityRole:`header`,children:e(`target_activity_reduction_title`)}),(0,W.jsx)(Z,{style:[S9.subtitle,{color:n.labelSecondary}],children:e(`target_activity_reduction_body`)})]}),(0,W.jsx)(_9,{children:A.map((e,t)=>(0,W.jsx)(x9,{style:[t===0&&S9.tableFirstCell,S9.noTopBorder],children:(0,W.jsx)(Z,{style:[S9.tableHeaderTitle,{color:n.labelPrimary}],maxFontSizeMultiplier:e.maxFontSizeMultiplier,children:e.title})},e.title))}),uvn.map(t=>(0,W.jsxs)(v9,{children:[(0,W.jsxs)(b9,{style:S9.tableFirstCell,children:[(0,W.jsx)(Z,{style:[S9.tableInterval,{color:n.labelPrimary}],children:dvn[t]}),(0,W.jsx)(Z,{style:[S9.minutes,{color:n.textTableSecondary}],children:e(`activity_settings_table_min`)})]}),lvn.map(e=>(0,W.jsx)(b9,{testID:`settings-activity-${e}-${t}`,onPress:Se(()=>{de(e,t)}),children:(0,W.jsx)(Z,{style:[S9.tablePercentage,{color:n.textTableHighlight}],children:pvn(O[e][t])})},`${t}-${e}`))]},t)),(0,W.jsx)(Yf,{style:[S9.resetContainer,{backgroundColor:n.bgButtonSecondaryDanger,borderColor:n.divider}],onPress:Se(I),testID:`restore-default-activity-settings-during`,children:(0,W.jsx)(Z,{style:[S9.resetText,{color:n.textButtonSecondaryDanger}],children:e(`button_reset_default`)})})]}),(0,W.jsxs)(y9,{children:[(0,W.jsxs)(B,{style:[S9.tableDescripContainer,{borderBottomWidth:0}],children:[(0,W.jsx)(Z,{style:[S9.title,{color:n.labelPrimary}],accessibilityRole:`header`,children:e(`target_activity_reduction_after_title`)}),(0,W.jsx)(Z,{style:[S9.subtitle,{color:n.labelSecondary}],children:e(`target_activity_reduction_after_body`)})]}),uvn.map(t=>(0,W.jsxs)(v9,{children:[(0,W.jsxs)(b9,{style:[S9.tableFirstCell,S9.noLeftBorder],children:[(0,W.jsx)(Z,{style:S9.tableInterval,children:dvn[t]}),(0,W.jsx)(Z,{style:[S9.minutes,{color:n.textTableSecondary}],children:e(`activity_settings_table_min`)})]}),(0,W.jsx)(b9,{testID:`settings-activity-post-${t}`,onPress:Se(()=>{de(`post`,t)}),children:(0,W.jsx)(Z,{style:[S9.tablePercentage,{color:n.textTableHighlight}],children:pvn(k.post[t])})})]},`post-${t}`)),(0,W.jsx)(Yf,{style:[S9.resetContainer,{backgroundColor:n.bgButtonSecondaryDanger,borderColor:n.divider}],onPress:Se(ve),testID:`restore-default-activity-settings-after`,children:(0,W.jsx)(Z,{style:[S9.resetText,{color:n.textButtonSecondaryDanger}],children:e(`button_reset_default`)})})]})]}),(0,W.jsx)(Q5,{initialScrollIndex:F,isVisible:o,onCancel:()=>{s(!1)},onConfirm:he,items:ge,onModalHide:ye,testID:`activity-wheel-picker`}),(0,W.jsx)(u3,{title:e(`physical_activity_modal_reset_title `),isVisible:c,onModalHide:ye,buttons:[{title:e(`button_reset`),type:H4.Error,onPress:_e},{title:e(`button_cancel`),type:H4.Secondary,onPress:()=>{l(!1)}}]}),(0,W.jsx)(u3,{isVisible:u,enableScroll:!0,buttons:[{title:e(`button_close`),onPress:()=>{d(!1)},style:S9.activityInfoModalButton}],children:(0,W.jsx)(K_n,{})}),(0,W.jsx)(t7,{onModalHide:()=>{_(void 0)}}),(0,W.jsx)(rvn,{isVisible:ee,onModalHide:be,onEnterPIN:xe,onCancel:()=>te(!1)}),(0,W.jsx)(Q_n,{isVisible:ne,onClose:()=>re(!1),onModalHide:Ce,onForgotPIN:()=>{N(!0),re(!1)},onModalHideWithSuccess:L}),(0,W.jsx)(nvn,{})]})}var gvn=f7(hvn),S9=R.create({scrollView:{paddingHorizontal:16},scrollViewContent:{flexGrow:1,gap:32,paddingTop:32},updatedAtText:{...Y.Poppins.regular_SM,textAlign:`center`},tableDescripContainer:{padding:16,borderBottomWidth:1},title:{...Y.Poppins.semiBold_Base,marginBottom:8},subtitle:{...Y.Poppins.regular_SM},tableFirstCell:{paddingLeft:16,paddingVertical:12,borderLeftWidth:0},resetText:{...Y.Poppins.semiBold_Base,textAlign:`center`},resetContainer:{alignItems:`center`,padding:16,borderTopWidth:1},tableHeaderTitle:{...Y.Poppins.medium_SM},minutes:{...Y.Poppins.regular_XS},tableInterval:{...Y.Poppins.medium_Base},tablePercentage:{...Y.Poppins.medium_Base},activityInfoModalButton:{marginTop:32},noTopBorder:{borderTopWidth:0,paddingVertical:16},noLeftBorder:{borderLeftWidth:0}});function C9(e,t){return+e3(e)>+e3(t)}function _vn(e,t,n){return K7(e,-t,n)}function vvn(e,t){let n=e3(e,t?.in);return n.setMinutes(0,0,0),n}function yvn(e,t,n){let[r,i]=_8(n?.in,e,t);return+vvn(r)==+vvn(i)}V();var w9=Array.from({length:60},(e,t)=>t.toString().padStart(2,`0`));function bvn({isVisible:e,initialValue:t,min:n,max:r,onCancel:i,onConfirm:a,onModalHide:o}){let{COLORS:s}=J(),{width:c}=em(),l=(0,H.useRef)(null),u=(0,H.useRef)(null),d=(0,H.useMemo)(()=>{let e=[],t=r?q7(`59`,`mm`,new Date(r)):q7(`23:59`,`HH:mm`,new Date),i=n?q7(`00`,`mm`,new Date(n)):q7(`00:00`,`HH:mm`,new Date);for(;R7(i,t)||yvn(i,t);)e.push(i),i=Yon(i,1);return e},[r,n]),f=(0,H.useMemo)(()=>d.map(e=>e.getHours().toString().padStart(2,`0`),[]),[d]),[p,m]=(0,H.useState)(t),h=W3t(e);(0,H.useEffect)(()=>{!h&&e&&m(t)},[h,e,t]);let g=(0,H.useMemo)(()=>d.findIndex(e=>e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()&&e.getHours()===t.getHours()),[d,t]),_=(0,H.useMemo)(()=>{let[,e]=I8(t,`HH:mm`).split(`:`);return w9.indexOf(e)},[t]),v=(0,H.useMemo)(()=>d.findIndex(e=>e.getFullYear()===p.getFullYear()&&e.getMonth()===p.getMonth()&&e.getDate()===p.getDate()&&e.getHours()===p.getHours()),[d,p]),y=(0,H.useMemo)(()=>{let[,e]=I8(p,`HH:mm`).split(`:`);return w9.indexOf(e)},[p]),b=(0,H.useMemo)(()=>n?0:null,[n]),x=(0,H.useMemo)(()=>r?d.length-1:null,[r,d]),S=(0,H.useMemo)(()=>{if(!n)return null;let[,e]=I8(n,`HH:mm`).split(`:`);return w9.indexOf(e)},[n]),C=(0,H.useMemo)(()=>{if(!r)return null;let[,e]=I8(r,`HH:mm`).split(`:`);return w9.indexOf(e)},[r]),w=(0,H.useCallback)(()=>{a(p)},[a,p]),T=(0,H.useCallback)(()=>{m(t),i()},[i,t]),E=(0,H.useCallback)((e,i)=>{if(e<0||i<0||e>=d.length||i>=w9.length)return;let a=`${d[e].getHours()}:${w9[i]}`;if(!n||!r){m(q7(a,`HH:mm`,new Date(t)));return}let o=d[e];m(q7(a,`HH:mm`,new Date(o)))},[n,r,d,t]),D=(0,H.useCallback)(e=>{u.current?.scrollToIndex(e)},[]),O=(0,H.useCallback)(e=>{if(x===null||b===null||C===null||S===null){E(e,y);return}e===b&&y<S?(E(e,S),D(S)):e===x&&y>C?(E(e,C),D(C)):E(e,y)},[x,b,C,S,E,y,D]),k=(0,H.useCallback)(e=>{if(x===null||b===null||C===null||S===null){E(v,e);return}v===b&&e<S?(E(v,S),D(S)):v===x&&e>C?(E(v,C),D(C)):E(v,e)},[E,x,C,b,S,D,v]);return(0,W.jsx)(u3,{isVisible:e,containerStyle:{backgroundColor:s.bgTransparent},onModalHide:o,children:(0,W.jsxs)(B,{children:[(0,W.jsxs)(B,{style:T9.pickersContainer,children:[(0,W.jsx)(Z5,{testID:`hours_wheel_picker`,ref:l,initialScrollIndex:g,options:f,onChange:O,containerStyle:[T9.itemContainerLeft,{width:(c-32)/2}],selectedIndicatorStyle:[T9.selectedIndicatorLeft,{width:(c-32)/2-10}],itemStyle:T9.itemLeft},`hours-wheel-picker`),(0,W.jsx)(Z5,{testID:`minutes_wheel_picker`,ref:u,initialScrollIndex:_,options:w9,onChange:k,containerStyle:[T9.itemContainerRight,{width:(c-32)/2}],selectedIndicatorStyle:[T9.selectedIndicatorRight,{width:(c-32)/2-10}],itemStyle:T9.itemRight},`minutes-wheel-picker`)]}),(0,W.jsxs)(B,{style:T9.buttonContainer,children:[(0,W.jsx)(X5,{onPress:w}),(0,W.jsx)(Y5,{onPress:T})]})]})})}var xvn=H.memo(bvn),T9=R.create({buttonContainer:{gap:8},pickersContainer:{flexDirection:`row`,borderTopLeftRadius:13,borderTopRightRadius:13,overflow:`hidden`},itemContainerLeft:{borderTopRightRadius:0,paddingLeft:16},itemContainerRight:{borderTopLeftRadius:0,paddingRight:16},itemLeft:{alignSelf:`flex-end`,marginRight:16},itemRight:{alignSelf:`flex-start`,marginLeft:16},selectedIndicatorRight:{alignSelf:`flex-start`,borderTopLeftRadius:0,borderBottomLeftRadius:0},selectedIndicatorLeft:{alignSelf:`flex-end`,borderTopRightRadius:0,borderBottomRightRadius:0}});V();var Svn=(e,t)=>({startTime:e.startTime,target:B8(e.target,X.BloodGlucoseUnit.MMOL_L,t)}),Cvn=(e,t)=>e.map(e=>Svn(e,t)),wvn=(e,t)=>{let n=e.startTime,r=parseFloat(e.target);return r=z8(r,t,X.BloodGlucoseUnit.MMOL_L),{startTime:n,target:r}},Tvn=(e,t)=>e.map(e=>wvn(e,t));function Evn(){let{t:e}=Tq(),{COLORS:t}=J(),{modalStoreActions:n}=z5(),{bottomWithScroll:r}=Q4(),i=N$(),a=N5(),[o,s]=(0,H.useState)(),[c,l]=(0,H.useState)(void 0),[u,d]=(0,H.useState)(!1),[f,p]=(0,H.useState)(!1),[m,h]=(0,H.useState)(!1),[g,_]=(0,H.useState)(),[v,y]=(0,H.useState)(!1),[b,x]=(0,H.useState)(!1),S=k8.glucoseUnit;if(S===void 0)throw Error(`[GlucoseSettings::render] glucoseUnit is undefined.`);let{glucoseLevelTargets:C,created:w}=k8;if(C===void 0)throw Error(`[GlucoseSettings::render] parameters from userSettings must be defined and non-null.`);let T=C.targetBGLIntervals;if(!T)throw Error(`[GlucoseSettings::render] parameters from userSettings must be defined and non-null.`);let E=C.overallTargetBGL;if(!E)throw Error(`[GlucoseSettings::render] parameters from userSettings must be defined and non-null.`);let D=C.use===X.Usage.Overall,O=Cvn(T,S),k=Svn(E,S),{areSettingsLocked:A,isPINSet:ee,lockSettings:te,unlockSettings:ne}=G_n(),[re,ie]=(0,H.useState)(!1),[j,ae]=(0,H.useState)(!1),oe=(0,H.useCallback)(()=>{A?y(!0):te()},[A,te]);(0,H.useEffect)(()=>{i.setOptions({header:()=>(0,W.jsx)(F5,{title:e(`glucose_navigation`),LeftButton:(0,W.jsx)(H5,{}),RightButton:ee?(0,W.jsx)(cfn,{onPress:oe,isLocked:A}):void 0,overlay:!0})})},[i,A,ee,oe,e]);let se=(0,H.useCallback)(e=>{p(!0),_(e)},[]),M=(0,H.useCallback)(async()=>{let e=non(),t=ron(),n={...C,targetBGLIntervals:e},r={...C,overallTargetBGL:t},i=D?r:n;if(D?!s3(C.overallTargetBGL,t):!s3(C.targetBGLIntervals,e)){let e={glucoseLevelTargets:{...i,updatedAt:new Date().toISOString()}};l(await k8.postUserSettings(e))}h(!1)},[C,D]),ce=(0,H.useCallback)(async e=>{if(e!==parseFloat(k.target)){let t={...k};t.target=e.toString();let n=wvn(t,S),r={glucoseLevelTargets:{...C,updatedAt:new Date().toISOString(),overallTargetBGL:n}};l(await k8.postUserSettings(r))}},[S,k,C]),N=(0,H.useCallback)(async e=>{if(g!==void 0&&e!==parseFloat(O[g].target)){let t=[...O],n={...t[g]};n.target=e.toString(),t[g]=n;let r=Tvn(t,S),i={glucoseLevelTargets:{...C,updatedAt:new Date().toISOString(),targetBGLIntervals:r}};l(await k8.postUserSettings(i))}},[g,O,S,C]),P=(0,H.useCallback)(async e=>{D?await ce(e):await N(e),p(!1)},[D,ce,N]),le=(0,H.useCallback)(async()=>{let e=!D,t={glucoseLevelTargets:{...C,use:e?X.Usage.Overall:X.Usage.Intervals,updatedAt:new Date().toISOString()}},r=await k8.postUserSettings(t);n.set({showSyncErrorModal:!r})},[D,C,n]),ue=(0,H.useMemo)(()=>L8(S).text,[S]),de=(0,H.useMemo)(()=>{let{min:e,max:t}=S===X.BloodGlucoseUnit.MMOL_L?aon():oon();return S===X.BloodGlucoseUnit.MG_DL?a3(e,t):o3(e,t)},[S]),fe=(0,H.useMemo)(()=>g===void 0?0:D?de.indexOf(k.target):de.indexOf(O[g].target),[g,D,de,O,k.target]),pe=(0,H.useCallback)(e=>{let t=O[(e-1+O.length)%O.length].startTime,n=O[(e+1+O.length)%O.length].startTime,r=O[e].startTime,i=q7(r,`HH:mm`,new Date),a=q7(t,`HH:mm`,new Date),o=q7(n,`HH:mm`,new Date);R7(i,a)&&R7(i,o)?s({current:i,min:t3(_vn(a,1),1),max:n3(o,1)}):C9(i,a)&&C9(i,o)?s({current:i,min:t3(a,1),max:n3(K7(o,1),1)}):s({current:i,min:t3(a,1),max:n3(o,1)}),d(!0),_(e)},[O]),me=(0,H.useCallback)(async e=>{if(g===void 0)return;let t=I8(e,`HH:mm`);if(t!==O[g].startTime){let e=[...O],n={...e[g]};n.startTime=t,e[g]=n;let r=Tvn(e,S),i={glucoseLevelTargets:{...C,targetBGLIntervals:r,updatedAt:new Date().toISOString()}};l(await k8.postUserSettings(i))}d(!1)},[g,O,S,C]),he=(0,H.useCallback)(()=>{d(!1)},[]),ge=(0,H.useCallback)(()=>{p(!1)},[]),F=(0,H.useCallback)(()=>{c===!1&&n.set({showSyncErrorModal:!0}),l(void 0)},[n,c]),_e=(0,H.useCallback)(()=>{re&&(x(!0),ie(!1))},[re,x,ie]),I=(0,H.useCallback)(()=>{ie(!0),y(!1)},[ie,y]),ve=(0,H.useCallback)(()=>{i.navigate(Q.GlucoseUnit)},[i]),ye=(0,H.useCallback)(()=>{ne()},[ne]),be=(0,H.useCallback)(e=>ee&&A?(...e)=>y(!0):(...t)=>e(...t),[A,ee]),xe=(0,H.useCallback)(()=>{j&&(ae(!1),setTimeout(()=>{i.navigate(Q.ChangePINCode)},500))},[j,i]),L=C.updatedAt??w;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(fs,{testID:`settings-glucose-scrollview`,style:E9.scrollView,contentContainerStyle:[E9.scrollViewContent,{paddingBottom:r,paddingTop:a+16}],children:[(0,W.jsx)(Z,{style:[E9.updatedAtText,{color:t.labelSecondary}],children:e(`settings_lastEdited`,{date:L?I8(L,`d MMM yyyy`):``})}),(0,W.jsx)(p9,{}),(0,W.jsx)(Y4,{title:e(`glucose_input`),value:ue,testID:`glucose-change`,onPress:be(ve),renderRightSlot:()=>(0,W.jsx)(K4,{})}),(0,W.jsxs)(y9,{columnDisposition:[1,2],children:[(0,W.jsx)(f3,{title:e(`fixed_input_title`),message:e(`fixed_input_body`),value:D,testID:`settings-glucose-overall-switch`,onValueChange:be(le),style:E9.switchContainer}),(0,W.jsxs)(_9,{disabled:!D,testID:`settings-glucose-overall-header`,children:[(0,W.jsx)(x9,{style:E9.tableFirstCell,testID:`settings-glucose-overall-header-time`,children:(0,W.jsx)(Z,{style:[E9.headerTitle,{color:t.textTableActive}],maxFontSizeMultiplier:C2.s2,children:e(`table_fixed_time`)})}),(0,W.jsxs)(x9,{testID:`settings-glucose-overall-header-target`,children:[(0,W.jsx)(Z,{style:[E9.headerTitle,{color:t.textTableActive}],maxFontSizeMultiplier:C2.s2,children:e(`table_fixed_target`)}),(0,W.jsx)(Z,{style:[E9.headerSubtitle,{color:t.textTableSecondary}],children:ue})]})]}),(0,W.jsxs)(v9,{disabled:!D,children:[(0,W.jsx)(b9,{style:E9.tableFirstCell,children:(0,W.jsx)(Z,{style:[E9.subtitle,{color:t.textTableActive}],children:e(`table_fixed_all_day `)})}),(0,W.jsx)(b9,{onPress:be(()=>se(0)),children:(0,W.jsx)(Z,{style:[E9.fixedValueTitle,{color:t.textTableHighlight}],testID:`settings-glucose-overall-all-day-target`,children:k.target})})]}),(0,W.jsx)(Yf,{style:[E9.resetContainer,{borderColor:t.divider}],disabled:!D,onPress:be(()=>h(!0)),children:(0,W.jsx)(Z,{style:[E9.resetText,D?{color:t.textButtonSecondaryDanger}:{color:t.textButtonSecondaryDangerDisabled}],children:e(`button_reset_default`)})})]}),(0,W.jsxs)(y9,{columnDisposition:[1,2],children:[(0,W.jsx)(f3,{title:e(`table_variable_title`),message:e(`table_variable_body`),value:!D,testID:`daily-interval-switch`,onValueChange:be(le),style:E9.switchContainer}),(0,W.jsxs)(_9,{disabled:D,testID:`settings-glucose-variable-header`,children:[(0,W.jsxs)(x9,{style:E9.tableFirstCell,testID:`settings-glucose-variable-header-time`,children:[(0,W.jsx)(Z,{style:[E9.headerTitle,{color:t.textTableActive}],maxFontSizeMultiplier:C2.s2,children:e(`table_variable_time`)}),(0,W.jsx)(Z,{style:[E9.headerSubtitle,{color:t.textTableSecondary}],children:e(`table_variable_time_unit`)})]}),(0,W.jsxs)(x9,{testID:`settings-glucose-variable-header-target`,children:[(0,W.jsx)(Z,{style:[E9.headerTitle,{color:t.textTableActive}],maxFontSizeMultiplier:C2.s2,children:e(`table_fixed_target`)}),(0,W.jsx)(Z,{style:[E9.headerSubtitle,{color:t.textTableSecondary}],children:ue})]})]}),O.map((e,n)=>(0,W.jsxs)(v9,{disabled:D,children:[(0,W.jsxs)(b9,{style:E9.tableFirstCell,onPress:be(()=>{pe(n)}),children:[(0,W.jsx)(Z,{style:[E9.title,{color:t.textTableHighlight}],children:e.startTime}),(0,W.jsx)(Z,{style:[E9.subtitle,{color:t.textTableSecondary}],children:_vt[Object.keys(Dq)[n]]()})]}),(0,W.jsx)(b9,{onPress:be(()=>{se(n)}),children:(0,W.jsx)(Z,{style:[E9.title,{color:t.textTableHighlight}],testID:`settings-glucose-variable-target-${Object.keys(Dq)[n].toLowerCase()}`,children:e.target})})]},e.startTime)),(0,W.jsx)(Yf,{style:[E9.resetContainer,{borderColor:t.divider}],disabled:D,onPress:be(()=>{h(!0)}),children:(0,W.jsx)(Z,{style:[E9.resetText,D?{color:t.textButtonSecondaryDangerDisabled}:{color:t.textButtonSecondaryDanger}],children:e(`button_reset_default`)})})]})]}),(0,W.jsx)(Q5,{isVisible:f,items:de,onConfirm:P,onCancel:ge,initialScrollIndex:fe,onModalHide:F,testID:`settings-glucose-target-wheel-picker`}),(0,W.jsx)(xvn,{isVisible:u,initialValue:o?.current??new Date,min:o?.min,max:o?.max,onConfirm:me,onCancel:he,onModalHide:F}),(0,W.jsx)(u3,{isVisible:m,title:e(`physical_activity_modal_reset_title `),onModalHide:F,buttons:[{title:e(`button_reset`),type:H4.Error,onPress:M},{title:e(`button_cancel`),type:H4.Secondary,onPress:()=>{h(!1)}}]}),(0,W.jsx)(t7,{onModalHide:()=>{l(void 0)}}),(0,W.jsx)(rvn,{isVisible:v,onModalHide:_e,onEnterPIN:I,onCancel:()=>y(!1)}),(0,W.jsx)(Q_n,{isVisible:b,onClose:()=>x(!1),onModalHide:xe,onForgotPIN:()=>{ae(!0),x(!1)},onModalHideWithSuccess:ye}),(0,W.jsx)(nvn,{})]})}var Dvn=f7(Evn),E9=R.create({scrollView:{paddingHorizontal:16},scrollViewContent:{flexGrow:1,gap:32},updatedAtText:{...Y.Poppins.regular_SM,textAlign:`center`},tableFirstCell:{alignItems:`flex-start`,paddingLeft:16,borderLeftWidth:0},resetContainer:{alignItems:`center`,padding:16,borderTopWidth:1},resetText:{...Y.Poppins.semiBold_Base,textAlign:`center`},headerTitle:{...Y.Poppins.medium_SM},headerSubtitle:{...Y.Poppins.medium_XS},title:{...Y.Poppins.medium_Base},fixedValueTitle:{...Y.Poppins.medium_Base,paddingVertical:8},subtitle:{...Y.Poppins.regular_XS},switchContainer:{borderBottomLeftRadius:0,borderBottomRightRadius:0}});V();var Ovn=e=>{let{t}=Tq(),{COLORS:n}=J(),{glucoseUnit:r,isError:i,onPressMGDL:a,onPressMMOLL:o}=e,s=r===X.BloodGlucoseUnit.MMOL_L,c=r===X.BloodGlucoseUnit.MG_DL;return(0,W.jsxs)(B,{style:D9.unitsContainer,children:[(0,W.jsxs)(wp,{testID:`mmoll-button-${s}`,onPress:o,style:({pressed:e})=>[D9.unitButton,{backgroundColor:s?n.bgSegmentPrimary:n.bgSegmentContainer,borderColor:s?n.bgSegmentPrimary:n.buttonBorder,opacity:e?.5:1},i&&{borderColor:n.borderInputDanger}],accessibilityRole:`button`,accessibilityState:{selected:s},children:[(0,W.jsx)(Z,{style:[D9.unitText,{color:s?n.textLabelActive:n.textLabelInactive}],children:t(`glucose_unit_mmol/l`)}),(0,W.jsx)(Z,{style:[D9.exampleText,{color:s?n.textLabelActive:n.textLabelInactive}],children:t(`example`)}),(0,W.jsx)(Z,{style:[D9.unitExampleText,{color:s?n.textLabelActive:n.textLabelInactive}],maxFontSizeMultiplier:C2.s2,children:t(`glucose_unit_example_mmol/L`)})]}),(0,W.jsxs)(wp,{testID:`mgdl-button-${c}`,onPress:a,style:({pressed:e})=>[D9.unitButton,{backgroundColor:c?n.bgSegmentPrimary:n.bgSegmentContainer,borderColor:c?n.bgSegmentPrimary:n.buttonBorder,opacity:e?.5:1},i&&{borderColor:n.borderInputDanger}],accessibilityRole:`button`,accessibilityState:{selected:c},children:[(0,W.jsx)(Z,{style:[D9.unitText,{color:c?n.textLabelActive:n.textLabelInactive}],children:t(`glucose_unit_mg/dl`)}),(0,W.jsx)(Z,{style:[D9.exampleText,{color:c?n.textLabelActive:n.textLabelInactive}],children:t(`example`)}),(0,W.jsx)(Z,{style:[D9.unitExampleText,{color:c?n.textLabelActive:n.textLabelInactive}],maxFontSizeMultiplier:C2.s2,children:t(`glucose_unit_example_mg/dl`)})]})]})},D9=R.create({unitsContainer:{flexDirection:`row`,justifyContent:`space-between`,gap:12},unitButton:{flex:1,paddingHorizontal:14,paddingVertical:10,borderRadius:16,borderWidth:2},unitText:{...Y.Poppins.medium_Base,marginBottom:8},exampleText:{...Y.Poppins.medium_XS,marginBottom:4},unitExampleText:{...Y.Poppins.regular_XS}});V();var kvn=()=>{let{modalStoreActions:e}=z5(),t=N5(),n=(0,H.useCallback)(async t=>{if(t===k8.glucoseUnit)return;let n=k8.glucoseLevelTargets,r=await k8.postUserSettings({bloodGlucoseUnits:t,...n&&{glucoseLevelTargets:{...n,updatedAt:new Date().toISOString()}}});e.set({showSyncErrorModal:!r})},[e]);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(B,{style:[Avn.container,{paddingTop:t+16}],children:(0,W.jsx)(Ovn,{onPressMMOLL:()=>n(X.BloodGlucoseUnit.MMOL_L),onPressMGDL:()=>n(X.BloodGlucoseUnit.MG_DL),glucoseUnit:k8.glucoseUnit})}),(0,W.jsx)(t7,{})]})},Avn=R.create({container:{paddingHorizontal:16}}),jvn=f7(kvn);V();var Mvn=()=>{let{t:e}=Tq(),{COLORS:t}=J(),n=N$(),{bottomWithScroll:r}=Q4(),i=N5();return(0,W.jsxs)(fs,{contentContainerStyle:[O9.scrollView,{paddingBottom:r,paddingTop:i+16}],testID:`legal-page-scrollview`,children:[(0,W.jsx)(Z,{style:O9.title,children:e(`legal_title`)}),(0,W.jsxs)(B,{style:O9.section,children:[(0,W.jsx)(o9t,{testID:`manufacturer-symbol`,color:t.bgPrimary}),(0,W.jsx)(Z,{style:[O9.textContainer,{color:t.labelSecondary}],children:cin})]}),(0,W.jsxs)(B,{style:O9.section,children:[(0,W.jsx)(a9t,{testID:`manual-icon`}),(0,W.jsx)(Z,{testID:`manual-button`,style:[O9.manualText,{color:t.textLink}],onPress:()=>{u8(l8.SettingsIFU),n.navigate(Q.IFU)},children:e(`legal_IFU`)})]}),(0,W.jsxs)(B,{style:O9.section,children:[(0,W.jsx)(d9t,{testID:`SN-symbol`}),(0,W.jsx)(Z,{style:[O9.textContainer,{color:t.labelSecondary}],children:c8})]}),(0,W.jsxs)(B,{style:O9.section,children:[(0,W.jsx)(q7t,{testID:`ce-logo`}),(0,W.jsx)(Z,{style:[O9.alignTop,{color:t.labelSecondary}],children:e(`legal_ce_mark_text`)})]}),(0,W.jsxs)(B,{style:O9.section,children:[(0,W.jsx)(o9t,{color:t.labelPrimary}),(0,W.jsxs)(B,{style:O9.textContainer,children:[(0,W.jsx)(Z,{style:[O9.sectionTitle,{color:t.labelSecondary}],children:e(`legal_company_name`)}),(0,W.jsx)(Z,{style:{color:t.labelSecondary},children:e(`legal_company_adress`)}),(0,W.jsx)(Z,{style:{color:t.labelSecondary},children:e(`legal_company_country`)}),(0,W.jsx)(Z,{style:{color:t.labelSecondary},children:e(`legal_company_email`)}),(0,W.jsx)(Z,{style:{color:t.labelSecondary},children:e(`legal_company_cvr_vat`)})]})]}),(0,W.jsxs)(B,{style:[O9.section,O9.udiSection],children:[(0,W.jsx)(f9t,{testID:`udi-logo`,style:O9.udiLogo}),(0,W.jsxs)(Z,{style:[O9.textContainer,O9.udiText,{color:t.labelSecondary}],children:[(0,W.jsx)(Z,{style:{color:t.labelSecondary},children:`(01)${uin}(10)`}),(0,W.jsx)(Z,{style:{color:t.labelSecondary},children:`${c8}(8012)${c8}`})]})]}),(0,W.jsxs)(B,{style:O9.sectionColumn,children:[(0,W.jsx)(p9t,{testID:`uk-rep-logo`,style:O9.repIcon}),(0,W.jsx)(Z,{style:{color:t.labelSecondary},children:e(`legal_ukrep`)})]}),Oq?null:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Z,{style:[O9.sectionTitle,{color:t.labelSecondary}],children:e(`more_legal_novo_nordisk_disclaimer_title`)}),(0,W.jsx)(Z,{style:{color:t.labelSecondary},children:e(`more_legal_novo_nordisk_disclaimer_text`)})]})]})},O9=R.create({scrollView:{paddingTop:32,paddingHorizontal:16},title:{...Y.Poppins.regular_SM,textAlign:`center`,marginBottom:32},section:{flexDirection:`row`,marginBottom:32},sectionTitle:{...Y.Poppins.medium_Base},textContainer:{flex:1,marginLeft:20,alignSelf:`center`},alignTop:{flex:1,marginLeft:20,alignSelf:`flex-start`},sectionColumn:{marginBottom:32},repIcon:{marginBottom:12},manualText:{...Y.Poppins.medium_Base,marginLeft:20,alignSelf:`center`},udiSection:{flexWrap:`wrap`,marginBottom:20},udiLogo:{marginRight:20,marginBottom:12},udiText:{marginLeft:0,marginBottom:12,display:`flex`,flexWrap:`wrap`}});V();var Nvn=()=>{let e=new Date().getFullYear();return[...Array(12).keys()].map(t=>I8(new Date(e,t),`MMM`))},Pvn=()=>{let e=1900,t=new Date().getFullYear()-e+1;return Array.from({length:t},(t,n)=>(n+e).toString())},Fvn=(e,t)=>wpn(new Date(e,t)),Ivn=Nvn(),Lvn=Array.from({length:31},(e,t)=>(t+1).toString().padStart(2,`0`)),Rvn=Pvn();function zvn({isVisible:e,initialValue:t,onCancel:n,onConfirm:r,onModalHide:i}){let{COLORS:a}=J(),{width:o}=em(),s=(0,H.useRef)(null),c=(0,H.useRef)(null),l=(0,H.useRef)(null),[u,d]=(0,H.useState)(t);(0,H.useEffect)(()=>{e&&d(e=>e.getTime()===t.getTime()?e:new Date(t))},[t,e]);let f=(0,H.useMemo)(()=>t.getDate()-1,[t]),p=(0,H.useMemo)(()=>t.getMonth(),[t]),m=(0,H.useMemo)(()=>{let e=t.getFullYear();return Rvn.indexOf(e.toString())},[t]),h=(0,H.useMemo)(()=>u.getDate()-1,[u]),g=(0,H.useMemo)(()=>u.getMonth(),[u]),_=(0,H.useMemo)(()=>u.getFullYear(),[u]),v=(0,H.useCallback)(()=>{r(u)},[r,u]),y=(0,H.useCallback)(()=>{d(t),n()},[n,t]),b=(0,H.useCallback)(e=>{let t=Fvn(_,e)-1;d(new Date(_,e,Math.min(h,t)+1)),h>t&&s.current?.scrollToIndex(t)},[h,_]),x=(0,H.useCallback)(e=>{let t=Fvn(_,g)-1;d(new Date(_,g,Math.min(e,t)+1)),e>t&&s.current?.scrollToIndex(t)},[g,_]),S=(0,H.useCallback)(e=>{let t=parseInt(Rvn[e],10),n=Fvn(t,g)-1;d(new Date(t,g,Math.min(h,n)+1)),h>n&&s.current?.scrollToIndex(n)},[h,g]);return(0,W.jsx)(u3,{isVisible:e,containerStyle:{backgroundColor:a.bgTransparent},onModalHide:i,children:(0,W.jsxs)(B,{children:[(0,W.jsxs)(B,{style:k9.pickersContainer,children:[(0,W.jsx)(Z5,{ref:c,initialScrollIndex:p,options:Ivn,onChange:b,containerStyle:[k9.itemContainerLeft,{width:(o-32)/3}],selectedIndicatorStyle:[k9.selectedIndicatorLeft,{width:(o-32)/3-10}],itemStyle:k9.itemLeft,testID:`months-wheel-picker`},`months-wheel-picker`),(0,W.jsx)(Z5,{ref:s,initialScrollIndex:f,options:Lvn,onChange:x,containerStyle:[k9.itemContainerCenter,{width:(o-32)/3}],selectedIndicatorStyle:[k9.selectedIndicatorCenter,{width:(o-32)/3}],itemStyle:k9.itemCenter,testID:`days-wheel-picker`},`days-wheel-picker`),(0,W.jsx)(Z5,{ref:l,initialScrollIndex:m,options:Rvn,onChange:S,containerStyle:[k9.itemContainerRight,{width:(o-32)/3}],selectedIndicatorStyle:[k9.selectedIndicatorRight,{width:(o-32)/3-10}],itemStyle:k9.itemRight,testID:`years-wheel-picker`},`years-wheel-picker`)]}),(0,W.jsxs)(B,{style:k9.buttonContainer,children:[(0,W.jsx)(X5,{onPress:v}),(0,W.jsx)(Y5,{onPress:y})]})]})})}var Bvn=H.memo(zvn),k9=R.create({buttonContainer:{gap:8},pickersContainer:{flexDirection:`row`,borderTopLeftRadius:13,borderTopRightRadius:13,overflow:`hidden`},itemContainerLeft:{borderTopRightRadius:0,paddingLeft:8},itemContainerCenter:{borderTopLeftRadius:0,borderTopRightRadius:0},itemContainerRight:{borderTopLeftRadius:0,paddingRight:8},itemLeft:{alignSelf:`flex-end`},itemCenter:{alignSelf:`center`},itemRight:{alignSelf:`flex-start`},selectedIndicatorRight:{alignSelf:`flex-start`,borderTopLeftRadius:0,borderBottomLeftRadius:0},selectedIndicatorCenter:{alignSelf:`center`,borderRadius:0},selectedIndicatorLeft:{alignSelf:`flex-end`,borderTopRightRadius:0,borderBottomRightRadius:0}}),Vvn=a3(0,220),Hvn=a3(0,300),Uvn=f7(({isVisible:e,onCancel:t,onModalHide:n})=>{let{t:r}=Tq(),{isOnboardingFinished:i}=E3(),{biologicalSex:a}=s7(),{setSetupCalculatorStoreValues:o}=o7(),{modalStoreActions:s}=z5(),c=i?k8.biologicalSex:a,[l,u]=(0,H.useState)(void 0),d=!k8.biologicalSex,f=+!!d,p=(0,H.useMemo)(()=>{switch(c){case X.BiologicalSex.Male:return 0;case X.BiologicalSex.Female:return 1;case X.BiologicalSex.Unspecified:return 2;default:return 0}},[c]),m=(0,H.useCallback)(async(e,n)=>{if(d&&n===0){o({biologicalSex:void 0}),t();return}let r=n-f,a=X.BiologicalSex.Male;if(r===1&&(a=X.BiologicalSex.Female),r===2&&(a=X.BiologicalSex.Unspecified),c===a){t();return}i?u(await k8.postUserSettings({biologicalSex:a})):o({biologicalSex:a}),t()},[c,i,d,f,t,o]),h=(0,H.useCallback)(()=>{l===!1?s.set({showSyncErrorModal:!0}):n&&n(),u(void 0)},[s,l,n]);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Q5,{isVisible:e,items:d?[`-`,r(`biological_sex_male`),r(`biological_sex_female`),r(`biological_sex_no_answer`)]:[r(`biological_sex_male`),r(`biological_sex_female`),r(`biological_sex_no_answer`)],onConfirm:m,onCancel:t,initialScrollIndex:p,onModalHide:h,testID:`biological_sex_wheel_picker`}),(0,W.jsx)(t7,{})]})}),Wvn=f7(({isVisible:e,onCancel:t,onModalHide:n})=>{let{t:r}=Tq(),{modalStoreActions:i}=z5(),a=k8.diabetesType,[o,s]=(0,H.useState)(!1),[c,l]=(0,H.useState)(void 0),u=(0,H.useMemo)(()=>a===X.DiabetesType.Type1?0:1,[a]),d=(0,H.useCallback)(async(e,n)=>{let r=n===0?X.DiabetesType.Type1:X.DiabetesType.Type2;if(a===r){t();return}l(await k8.postUserSettings({diabetesType:r})),t()},[a,t]),f=(0,H.useCallback)(()=>{s(!1)},[]),p=(0,H.useCallback)(()=>{c===!1?i.set({showSyncErrorModal:!0}):c&&a===X.DiabetesType.Type2?s(!0):n&&n(),l(void 0)},[i,c,a,n]);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Q5,{isVisible:e,items:[r(`type_of_diabetes_type1`),r(`type_of_diabetes_type2`)],onConfirm:d,onCancel:t,initialScrollIndex:u,onModalHide:p,testID:`diabetes_type_wheel_picker`}),(0,W.jsx)(u3,{title:r(`modal_diabetes2_title`),isVisible:o,message:r(`modal_diabetes2_body`),onModalHide:n,buttons:[{title:r(`button_close`),onPress:f}]}),(0,W.jsx)(t7,{})]})});V(),Z0();function Gvn(){let{t:e}=Tq(),{COLORS:t,isDark:n,effectiveColorScheme:r}=J(),{bottom:i}=W0(),{modalStoreActions:a}=z5(),[o,s]=(0,H.useState)(!1),[c,l]=(0,H.useState)(!1),[u,d]=(0,H.useState)(!1),[f,p]=(0,H.useState)(!1),[m,h]=(0,H.useState)(!1),[g,_]=(0,H.useState)(void 0),{birthDate:v,diabetesType:y,biologicalSex:b,weightKg:x,heightCm:S}=k8;if(y===void 0)throw Error(`[AboutSection::render] diatbetesType must be defined.`);let C=(0,H.useMemo)(()=>v?new Date(v):void 0,[v]),w=(0,H.useMemo)(()=>y===X.DiabetesType.Type1?`type_of_diabetes_type1`:`type_of_diabetes_type2`,[y]),T=(0,H.useCallback)(async e=>{e!==S&&_(await k8.postUserSettings({height:e})),d(!1)},[S]),E=(0,H.useCallback)(async e=>{e!==x&&_(await k8.postUserSettings({weight:e})),p(!1)},[x]),D=(0,H.useMemo)(()=>{if(S===void 0)return 0;let e=Math.round(S*10)/10;return Vvn.indexOf(e.toString())},[S]),O=(0,H.useMemo)(()=>{if(x===void 0)return 0;let e=Math.round(x*10)/10;return Hvn.indexOf(e.toString())},[x]),k=async e=>{e.toISOString()!==v&&_(await k8.postUserSettings({birthday:e.toISOString()})),h(!1)},A=(0,H.useCallback)(()=>{g===!1&&a.set({showSyncErrorModal:!0}),_(void 0)},[a,g]),ee=(0,H.useCallback)(()=>{A()},[A]);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(B,{children:(0,W.jsxs)(Y4.Container,{children:[(0,W.jsx)(Y4,{title:e(`my_profile_birth`),value:C?C.toLocaleDateString():`-`,testID:`date-of-birth`,onPress:()=>{h(!0)}}),(0,W.jsx)(Y4,{title:e(`my_profile_diabetes_type`),value:e(w),testID:`diabetes-type`,onPress:()=>{s(!0)}}),(0,W.jsx)(Y4,{title:e(`my_profile_sex`),testID:`biologicalSex`,value:b?vvt[b]():`-`,onPress:()=>{l(!0)}}),(0,W.jsx)(Y4,{title:e(`my_profile_height`),value:`${S??`-`} cm`,testID:`height`,onPress:()=>{d(!0)}}),(0,W.jsx)(Y4,{title:e(`my_profile_weight`),value:`${x??`-`} kg`,testID:`weight`,onPress:()=>{p(!0)}})]})}),kq?(0,W.jsx)(Zpn,{testID:`birthday-date-picker`,display:`spinner`,minimumDate:new Date(1900,0,1),maximumDate:new Date,date:C,isVisible:m,onConfirm:k,onCancel:()=>{h(!1)},customConfirmButtonIOS:emn,customCancelButtonIOS:tmn,pickerContainerStyleIOS:{backgroundColor:t.iosKeyboardPicker},modalStyleIOS:{paddingBottom:i},themeVariant:r,isDarkModeEnabled:n,onHide:ee,pickerStyleIOS:{alignSelf:`center`}}):(0,W.jsx)(Bvn,{isVisible:m,initialValue:C??new Date,onConfirm:k,onCancel:()=>{h(!1)},onModalHide:ee}),(0,W.jsx)(Wvn,{isVisible:o,onCancel:()=>{s(!1)},onModalHide:A}),(0,W.jsx)(Uvn,{isVisible:c,onCancel:()=>{l(!1)},onModalHide:A}),(0,W.jsx)(Q5,{isVisible:u,items:Vvn,onConfirm:T,onCancel:()=>{d(!1)},initialScrollIndex:D,onModalHide:A,testID:`height_wheel_picker`}),(0,W.jsx)(Q5,{isVisible:f,items:Hvn,onConfirm:E,onCancel:()=>{p(!1)},initialScrollIndex:O,onModalHide:A,testID:`weight_wheel_picker`}),(0,W.jsx)(t7,{onModalHide:()=>{_(void 0)}})]})}var Kvn=f7(Gvn);V();function qvn(){let{t:e}=Tq();return(0,W.jsxs)(fs,{testID:`profile-screen-scroll`,style:Jvn.scrollView,contentContainerStyle:Jvn.contentContainer,children:[(0,W.jsx)(Y4,{title:e(`my_profile_account`),testID:`first-name`,renderRightSlot:()=>(0,W.jsx)(K4,{}),onPress:()=>{window.location.href=`/account`}}),(0,W.jsx)(Kvn,{})]})}var Jvn=R.create({scrollView:{paddingHorizontal:16},contentContainer:{paddingVertical:32,flexGrow:1,gap:24}});V(),new Of(yi.RNDeviceInfo);var Yvn=c({getBaseOs:()=>gyn,getBatteryLevel:()=>fyn,getBatteryLevelSync:()=>pyn,getFreeDiskStorage:()=>yyn,getFreeDiskStorageSync:()=>byn,getInstallReferrer:()=>oyn,getInstallReferrerSync:()=>Qvn,getMaxMemory:()=>xyn,getMaxMemorySync:()=>Zvn,getPowerState:()=>wyn,getPowerStateSync:()=>Tyn,getTotalDiskCapacity:()=>_yn,getTotalDiskCapacitySync:()=>vyn,getTotalMemory:()=>Cyn,getTotalMemorySync:()=>nyn,getUsedMemory:()=>Syn,getUsedMemorySync:()=>ryn,getUserAgent:()=>syn,getUserAgentSync:()=>eyn,isAirplaneMode:()=>hyn,isAirplaneModeSync:()=>$vn,isBatteryCharging:()=>cyn,isBatteryChargingSync:()=>lyn,isCameraPresent:()=>uyn,isCameraPresentSync:()=>dyn,isLocationEnabled:()=>myn,isLocationEnabledSync:()=>tyn}),A9,j9,Xvn,M9,N9,Zvn,Qvn,$vn,eyn,tyn,nyn,ryn,iyn,ayn,oyn,syn,cyn,lyn,uyn,dyn,fyn,pyn,myn,hyn,gyn,_yn,vyn,yyn,byn,xyn,Syn,Cyn,wyn,Tyn,Eyn=o((()=>{V(),A9=new Of(yi.RNDeviceInfo),j9=!1,Xvn=-1,M9={},N9=e=>{let{level:t,charging:n,chargingtime:r,dischargingtime:i}=e;return{batteryLevel:t,lowPowerMode:!1,batteryState:t===1?`full`:n?`charging`:`unplugged`,chargingtime:r,dischargingtime:i}},Zvn=()=>window.performance&&window.performance.memory?window.performance.memory.jsHeapSizeLimit:-1,Qvn=()=>document.referrer,$vn=()=>!!navigator.onLine,eyn=()=>window.navigator.userAgent,tyn=()=>!!navigator.geolocation,nyn=()=>navigator.deviceMemory?navigator.deviceMemory*1e9:-1,ryn=()=>window.performance&&window.performance.memory?window.performance.memory.usedJSHeapSize:-1,iyn=()=>{typeof navigator>`u`||!navigator.getBattery||navigator.getBattery().then(e=>{j9=e.charging,e.addEventListener(`chargingchange`,()=>{let{charging:t}=e;j9=t,M9=N9(e),A9.emit(`RNDeviceInfo_powerStateDidChange`,M9)}),e.addEventListener(`levelchange`,()=>{let{level:t}=e;Xvn=t,M9=N9(e),A9.emit(`RNDeviceInfo_batteryLevelDidChange`,t),t<.2&&A9.emit(`RNDeviceInfo_batteryLevelIsLow`,t)})})},ayn=()=>{let e=window.navigator.userAgent,t=window.navigator.platform,n=[`Macintosh`,`MacIntel`,`MacPPC`,`Mac68K`],r=[`Win32`,`Win64`,`Windows`,`WinCE`],i=[`iPhone`,`iPad`,`iPod`],a=t;return n.indexOf(t)===-1?i.indexOf(t)===-1?r.indexOf(t)===-1?/Android/.test(e)?a=`Android`:!a&&/Linux/.test(t)&&(a=`Linux`):a=`Windows`:a=`iOS`:a=`Mac OS`,a},iyn(),oyn=async()=>Qvn(),syn=async()=>eyn(),cyn=async()=>navigator.getBattery?navigator.getBattery().then(e=>e.charging):!1,lyn=()=>j9,uyn=async()=>navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices?navigator.mediaDevices.enumerateDevices().then(e=>!!e.find(e=>e.kind===`videoinput`)):!1,dyn=()=>(console.log(`[react-native-device-info] isCameraPresentSync not supported - please use isCameraPresent`),!1),fyn=async()=>navigator.getBattery?navigator.getBattery().then(e=>e.level):-1,pyn=()=>Xvn,myn=async()=>tyn(),hyn=async()=>$vn(),gyn=async()=>ayn(),_yn=async()=>navigator.storage&&navigator.storage.estimate?navigator.storage.estimate().then(({quota:e})=>e):-1,vyn=()=>(console.log(`[react-native-device-info] getTotalDiskCapacitySync not supported - please use getTotalDiskCapacity`),-1),yyn=async()=>navigator.storage&&navigator.storage.estimate?navigator.storage.estimate().then(({quota:e,usage:t})=>e-t):-1,byn=()=>(console.log(`[react-native-device-info] getFreeDiskStorageSync not supported - please use getFreeDiskStorage`),-1),xyn=async()=>Zvn(),Syn=async()=>ryn(),Cyn=async()=>nyn(),wyn=async()=>navigator.getBattery?navigator.getBattery().then(e=>N9(e)):{},Tyn=()=>M9}));V();var Dyn=yi.RNDeviceInfo;if((z.OS===`web`||z.OS===`dom`)&&(Dyn=(Eyn(),d(Yvn))),!Dyn&&(z.OS===`android`||z.OS===`ios`||z.OS===`web`||z.OS===`dom`))throw Error("react-native-device-info: NativeModule.RNDeviceInfo is null. To fix this issue try these steps:\n • For react-native <= 0.59: Run `react-native link react-native-device-info` in the project root.\n • Rebuild and re-run the app.\n • If you are using CocoaPods on iOS, run `pod install` in the `ios` directory and then rebuild and re-run the app. You may also need to re-open Xcode to get the new pods.\n If none of these fix the issue, please open an issue on the Github repository: https://github.com/react-native-device-info/react-native-device-info");var $=Dyn;V();var P9={};function Oyn(e,t,n){let r={};return e.filter(e=>z.OS==e).forEach(e=>r[e]=t),z.select({...r,default:n})}function kyn({getter:e,supportedPlatforms:t,defaultValue:n,memoKey:r}){if(r&&P9[r]!=null)return P9[r];{let i=Oyn(t,e,()=>n)();return r&&(P9[r]=i),i}}async function Ayn({getter:e,supportedPlatforms:t,defaultValue:n,memoKey:r}){if(r&&P9[r]!=null)return P9[r];{let i=await Oyn(t,e,()=>Promise.resolve(n))();return r&&(P9[r]=i),i}}function F9({syncGetter:e,...t}){return[(...e)=>Ayn({...t,getter:()=>t.getter(...e)}),(...n)=>kyn({...t,getter:()=>e(...n)})]}V();var[jyn,Myn]=F9({memoKey:`uniqueId`,supportedPlatforms:[`android`,`ios`,`windows`],getter:()=>$.getUniqueId(),syncGetter:()=>$.getUniqueIdSync(),defaultValue:`unknown`}),[Nyn,Pyn]=F9({memoKey:`instanceId`,supportedPlatforms:[`android`],getter:()=>$.getInstanceId(),syncGetter:()=>$.getInstanceIdSync(),defaultValue:`unknown`}),[Fyn,Iyn]=F9({memoKey:`serialNumber`,supportedPlatforms:[`android`,`windows`],getter:()=>$.getSerialNumber(),syncGetter:()=>$.getSerialNumberSync(),defaultValue:`unknown`}),[Lyn,Ryn]=F9({memoKey:`androidId`,supportedPlatforms:[`android`],getter:()=>$.getAndroidId(),syncGetter:()=>$.getAndroidIdSync(),defaultValue:`unknown`}),[zyn,Byn]=F9({supportedPlatforms:[`android`,`ios`,`windows`],getter:()=>$.getIpAddress(),syncGetter:()=>$.getIpAddressSync(),defaultValue:`unknown`}),[Vyn,Hyn]=F9({supportedPlatforms:[`android`,`windows`,`web`],getter:()=>$.isCameraPresent(),syncGetter:()=>$.isCameraPresentSync(),defaultValue:!1}),[Uyn,Wyn]=F9({memoKey:`manufacturer`,supportedPlatforms:[`android`,`ios`,`windows`],getter:()=>z.OS==`ios`?Promise.resolve(`Apple`):$.getSystemManufacturer(),syncGetter:()=>z.OS==`ios`?`Apple`:$.getSystemManufacturerSync(),defaultValue:`unknown`}),Gyn=()=>kyn({defaultValue:`unknown`,supportedPlatforms:[`ios`,`android`,`windows`],memoKey:`systemName`,getter:()=>z.select({ios:$.systemName,android:`Android`,windows:`Windows`,default:`unknown`})}),Kyn=()=>kyn({defaultValue:`unknown`,getter:()=>$.systemVersion,supportedPlatforms:[`android`,`ios`,`windows`],memoKey:`systemVersion`}),[qyn,Jyn]=F9({memoKey:`buildId`,supportedPlatforms:[`android`,`ios`,`windows`],getter:()=>$.getBuildId(),syncGetter:()=>$.getBuildIdSync(),defaultValue:`unknown`}),[Yyn,Xyn]=F9({memoKey:`apiLevel`,supportedPlatforms:[`android`],getter:()=>$.getApiLevel(),syncGetter:()=>$.getApiLevelSync(),defaultValue:-1}),[Zyn,Qyn]=F9({memoKey:`installerPackageName`,supportedPlatforms:[`android`,`windows`,`ios`],getter:()=>$.getInstallerPackageName(),syncGetter:()=>$.getInstallerPackageNameSync(),defaultValue:`unknown`}),[$yn,ebn]=F9({supportedPlatforms:[`android`,`ios`,`windows`],getter:()=>$.getDeviceName(),syncGetter:()=>$.getDeviceNameSync(),defaultValue:`unknown`}),[tbn,nbn]=F9({supportedPlatforms:[`android`,`ios`,`windows`,`web`],getter:()=>$.getUsedMemory(),syncGetter:()=>$.getUsedMemorySync(),defaultValue:-1}),[rbn,ibn]=F9({supportedPlatforms:[`android`,`ios`,`windows`],getter:()=>$.getFontScale(),syncGetter:()=>$.getFontScaleSync(),defaultValue:-1}),[abn,obn]=F9({memoKey:`bootloader`,supportedPlatforms:[`android`],getter:()=>$.getBootloader(),syncGetter:()=>$.getBootloaderSync(),defaultValue:`unknown`}),[sbn,cbn]=F9({getter:()=>$.getDevice(),syncGetter:()=>$.getDeviceSync(),defaultValue:`unknown`,memoKey:`device`,supportedPlatforms:[`android`]}),[lbn,ubn]=F9({memoKey:`display`,supportedPlatforms:[`android`],getter:()=>$.getDisplay(),syncGetter:()=>$.getDisplaySync(),defaultValue:`unknown`}),[dbn,fbn]=F9({memoKey:`fingerprint`,supportedPlatforms:[`android`],getter:()=>$.getFingerprint(),syncGetter:()=>$.getFingerprintSync(),defaultValue:`unknown`}),[pbn,mbn]=F9({memoKey:`hardware`,supportedPlatforms:[`android`],getter:()=>$.getHardware(),syncGetter:()=>$.getHardwareSync(),defaultValue:`unknown`}),[hbn,gbn]=F9({memoKey:`host`,supportedPlatforms:[`android`,`windows`],getter:()=>$.getHost(),syncGetter:()=>$.getHostSync(),defaultValue:`unknown`}),[_bn,vbn]=F9({memoKey:`hostNames`,supportedPlatforms:[`windows`],getter:()=>$.getHostNames(),syncGetter:()=>$.getHostNamesSync(),defaultValue:[]}),[ybn,bbn]=F9({memoKey:`product`,supportedPlatforms:[`android`],getter:()=>$.getProduct(),syncGetter:()=>$.getProductSync(),defaultValue:`unknown`}),[xbn,Sbn]=F9({memoKey:`tags`,supportedPlatforms:[`android`],getter:()=>$.getTags(),syncGetter:()=>$.getTagsSync(),defaultValue:`unknown`}),[Cbn,wbn]=F9({memoKey:`type`,supportedPlatforms:[`android`],getter:()=>$.getType(),syncGetter:()=>$.getTypeSync(),defaultValue:`unknown`}),[Tbn,Ebn]=F9({memoKey:`baseOs`,supportedPlatforms:[`android`,`web`,`windows`],getter:()=>$.getBaseOs(),syncGetter:()=>$.getBaseOsSync(),defaultValue:`unknown`}),[Dbn,Obn]=F9({memoKey:`previewSdkInt`,supportedPlatforms:[`android`],getter:()=>$.getPreviewSdkInt(),syncGetter:()=>$.getPreviewSdkIntSync(),defaultValue:-1}),[kbn,Abn]=F9({memoKey:`securityPatch`,supportedPlatforms:[`android`],getter:()=>$.getSecurityPatch(),syncGetter:()=>$.getSecurityPatchSync(),defaultValue:`unknown`}),[jbn,Mbn]=F9({memoKey:`codeName`,supportedPlatforms:[`android`],getter:()=>$.getCodename(),syncGetter:()=>$.getCodenameSync(),defaultValue:`unknown`}),[Nbn,Pbn]=F9({memoKey:`incremental`,supportedPlatforms:[`android`],getter:()=>$.getIncremental(),syncGetter:()=>$.getIncrementalSync(),defaultValue:`unknown`}),[Fbn,Ibn]=F9({memoKey:`emulator`,supportedPlatforms:[`android`,`ios`,`windows`],getter:()=>$.isEmulator(),syncGetter:()=>$.isEmulatorSync(),defaultValue:!1}),[Lbn,Rbn]=F9({supportedPlatforms:[`android`,`ios`,`windows`],getter:()=>$.isPinOrFingerprintSet(),syncGetter:()=>$.isPinOrFingerprintSetSync(),defaultValue:!1}),[zbn,Bbn]=F9({supportedPlatforms:[`android`],getter:()=>$.hasGms(),syncGetter:()=>$.hasGmsSync(),defaultValue:!1}),[Vbn,Hbn]=F9({supportedPlatforms:[`android`],getter:()=>$.hasHms(),syncGetter:()=>$.hasHmsSync(),defaultValue:!1}),[Ubn,Wbn]=F9({memoKey:`firstInstallTime`,supportedPlatforms:[`android`,`ios`,`windows`],getter:()=>$.getFirstInstallTime(),syncGetter:()=>$.getFirstInstallTimeSync(),defaultValue:-1}),[Gbn,Kbn]=F9({memoKey:`installReferrer`,supportedPlatforms:[`android`,`windows`,`web`],getter:()=>$.getInstallReferrer(),syncGetter:()=>$.getInstallReferrerSync(),defaultValue:`unknown`}),[qbn,Jbn]=F9({memoKey:`lastUpdateTime`,supportedPlatforms:[`android`],getter:()=>$.getLastUpdateTime(),syncGetter:()=>$.getLastUpdateTimeSync(),defaultValue:-1}),[Ybn,Xbn]=F9({memoKey:`startupTime`,supportedPlatforms:[`android`,`ios`],getter:()=>$.getStartupTime(),syncGetter:()=>$.getStartupTimeSync(),defaultValue:-1}),[Zbn,Qbn]=F9({supportedPlatforms:[`android`,`ios`],getter:()=>$.getCarrier(),syncGetter:()=>$.getCarrierSync(),defaultValue:`unknown`}),[$bn,exn]=F9({memoKey:`totalMemory`,supportedPlatforms:[`android`,`ios`,`windows`,`web`],getter:()=>$.getTotalMemory(),syncGetter:()=>$.getTotalMemorySync(),defaultValue:-1}),[txn,nxn]=F9({memoKey:`maxMemory`,supportedPlatforms:[`android`,`windows`,`web`],getter:()=>$.getMaxMemory(),syncGetter:()=>$.getMaxMemorySync(),defaultValue:-1}),[rxn,ixn]=F9({supportedPlatforms:[`android`,`ios`,`windows`,`web`],getter:()=>$.getTotalDiskCapacity(),syncGetter:()=>$.getTotalDiskCapacitySync(),defaultValue:-1}),[axn,oxn]=F9({supportedPlatforms:[`android`,`ios`,`windows`,`web`],getter:(e=`total`)=>z.OS===`ios`?$.getFreeDiskStorage(e):$.getFreeDiskStorage(),syncGetter:(e=`total`)=>z.OS===`ios`?$.getFreeDiskStorageSync(e):$.getFreeDiskStorageSync(),defaultValue:-1}),[sxn,cxn]=F9({supportedPlatforms:[`android`,`ios`,`windows`,`web`],getter:()=>$.getBatteryLevel(),syncGetter:()=>$.getBatteryLevelSync(),defaultValue:-1}),[lxn,uxn]=F9({supportedPlatforms:[`ios`,`android`,`windows`,`web`],getter:()=>$.getPowerState(),syncGetter:()=>$.getPowerStateSync(),defaultValue:{}}),[dxn,fxn]=F9({supportedPlatforms:[`android`,`ios`,`windows`,`web`],getter:()=>$.isBatteryCharging(),syncGetter:()=>$.isBatteryChargingSync(),defaultValue:!1}),[pxn,mxn]=F9({supportedPlatforms:[`android`,`web`],getter:()=>$.isAirplaneMode(),syncGetter:()=>$.isAirplaneModeSync(),defaultValue:!1}),[hxn,gxn]=F9({memoKey:`_supportedAbis`,supportedPlatforms:[`android`,`ios`,`windows`],getter:()=>$.getSupportedAbis(),syncGetter:()=>$.getSupportedAbisSync(),defaultValue:[]}),[_xn,vxn]=F9({memoKey:`_supported32BitAbis`,supportedPlatforms:[`android`],getter:()=>$.getSupported32BitAbis(),syncGetter:()=>$.getSupported32BitAbisSync(),defaultValue:[]}),[yxn,bxn]=F9({memoKey:`_supported64BitAbis`,supportedPlatforms:[`android`],getter:()=>$.getSupported64BitAbis(),syncGetter:()=>$.getSupported64BitAbisSync(),defaultValue:[]}),[xxn,Sxn]=F9({supportedPlatforms:[`android`],getter:()=>$.getSystemAvailableFeatures(),syncGetter:()=>$.getSystemAvailableFeaturesSync(),defaultValue:[]}),[Cxn,wxn]=F9({supportedPlatforms:[`android`,`ios`,`web`],getter:()=>$.isLocationEnabled(),syncGetter:()=>$.isLocationEnabledSync(),defaultValue:!1}),[Txn,Exn]=F9({supportedPlatforms:[`android`,`ios`],getter:()=>$.isHeadphonesConnected(),syncGetter:()=>$.isHeadphonesConnectedSync(),defaultValue:!1}),[Dxn,Oxn]=F9({supportedPlatforms:[`android`,`ios`],getter:()=>$.isWiredHeadphonesConnected(),syncGetter:()=>$.isWiredHeadphonesConnectedSync(),defaultValue:!1}),[kxn,Axn]=F9({supportedPlatforms:[`android`,`ios`],getter:()=>$.isBluetoothHeadphonesConnected(),syncGetter:()=>$.isBluetoothHeadphonesConnectedSync(),defaultValue:!1}),[jxn,Mxn]=F9({supportedPlatforms:[`windows`],getter:()=>$.isMouseConnected(),syncGetter:()=>$.isMouseConnectedSync(),defaultValue:!1}),[Nxn,Pxn]=F9({supportedPlatforms:[`windows`],getter:()=>$.isKeyboardConnected(),syncGetter:()=>$.isKeyboardConnectedSync(),defaultValue:!1}),[Fxn,Ixn]=F9({supportedPlatforms:[`android`],getter:()=>$.getSupportedMediaTypeList(),syncGetter:()=>$.getSupportedMediaTypeListSync(),defaultValue:[]}),[Lxn,Rxn]=F9({supportedPlatforms:[`android`,`ios`],getter:()=>$.getAvailableLocationProviders(),syncGetter:()=>$.getAvailableLocationProvidersSync(),defaultValue:{}}),[zxn,Bxn]=F9({supportedPlatforms:[`ios`],getter:()=>$.getBrightness(),syncGetter:()=>$.getBrightnessSync(),defaultValue:-1});new Of(yi.RNDeviceInfo),V();var Vxn=()=>{let{t:e}=Tq(),{COLORS:t}=J(),{navigate:n}=N$(),r=(0,H.useCallback)(async()=>{if(Oq)n(Q.SupportContact);else{let e=`App version: ${c8}\n${Gyn()} version: ${Kyn()}`;await Lre.openURL(`mailto:support@hedia.com?subject=Hedia support&body=${e}`)}},[n]);return(0,W.jsxs)(fs,{contentContainerStyle:Hxn.wrapper,children:[(0,W.jsx)(Z,{style:[Hxn.title,{color:t.labelPrimary}],children:e(`support_title`)}),(0,W.jsxs)(B,{style:Hxn.buttons,children:[(0,W.jsx)(U4,{title:e(`button_email`),onPress:r,testID:`send_email_button`}),(0,W.jsx)(U4,{title:e(`button_support_page`),onPress:()=>{n(Q.SupportWebView)},testID:`open_support_page_button`,type:H4.Secondary}),(0,W.jsx)(U4,{title:e(`button_instructions`),onPress:()=>{u8(l8.SettingsIFU),n(Q.IFU)},testID:`open_ifu_page_button`,type:H4.Secondary})]})]})},Hxn=R.create({wrapper:{flex:1,justifyContent:`center`,paddingHorizontal:16},title:{...Y.Poppins.bold_2XL,marginBottom:48,textAlign:`center`},buttons:{gap:16}});V();var Uxn=()=>{let{t:e}=Tq(),{COLORS:t}=J(),{colorScheme:n,setColorScheme:r}=L3t(),i=N5(),{bottomWithScroll:a}=Q4(),o=(0,H.useCallback)(e=>{let t=`colorScheme-${e.toLowerCase()}`;return v2[e]===n?`${t}-selected`:t},[n]),s=(0,H.useCallback)(e=>{r(v2[e])},[r]);return(0,W.jsxs)(fs,{contentContainerStyle:[I9.scrollView,{paddingTop:i+16,paddingBottom:a}],children:[(0,W.jsxs)(Y4.Container,{children:[(0,W.jsx)(Y4,{title:e(`theme_system`),renderRightSlot:()=>(0,W.jsx)(B,{style:I9.checkmarkContainer,children:v2.System===n?(0,W.jsx)(G4,{width:24,height:24}):null}),onPress:()=>{s(`System`)},testID:o(`System`),displayType:J4.ListItem}),(0,W.jsx)(Y4,{title:e(`theme_dark`),renderRightSlot:()=>(0,W.jsx)(B,{style:I9.checkmarkContainer,children:v2.Dark===n?(0,W.jsx)(G4,{width:24,height:24}):null}),onPress:()=>{s(`Dark`)},testID:o(`Dark`),displayType:J4.ListItem}),(0,W.jsx)(Y4,{title:e(`theme_light`),renderRightSlot:()=>(0,W.jsx)(B,{style:I9.checkmarkContainer,children:v2.Light===n?(0,W.jsx)(G4,{width:24,height:24}):null}),onPress:()=>{s(`Light`)},testID:o(`Light`),displayType:J4.ListItem})]}),(0,W.jsx)(Z,{style:[I9.description,{color:t.labelSecondary}],testID:`settings-colorScheme-hint`,children:e(`theme_subtitle`)})]})},I9=R.create({scrollView:{paddingHorizontal:16,flexGrow:1},checkmarkContainer:{width:24,height:24},description:{...Y.Poppins.regular_SM,margin:16}}),Wxn=`urn:hedia:acr:elevated`,Gxn=60*X.Milliseconds.Minute,Kxn=e=>{if(e?.authenticationContextClassReference!==Wxn)return!1;let t=Date.parse(e.authenticationTime),n=Date.now()-t;return!(!Number.isFinite(t)||n<0||n>Gxn)};V();var qxn=()=>{let{COLORS:e}=J(),{fontScale:t}=em(),n=t.toFixed(3);return(0,W.jsxs)(B,{style:{backgroundColor:e.textWarning,borderRadius:16,padding:8},children:[(0,W.jsx)(Z,{style:[Jxn.text,{color:e.bgPrimary}],children:`Font scale: ${n}`}),(0,W.jsx)(Z,{style:[Jxn.textBold,{color:e.bgPrimary}],children:bq.HEDIA_SERVER_BASE_URL})]})},Jxn=R.create({text:{...Y.Poppins.regular_Base,textAlign:`center`},textBold:{...Y.Poppins.semiBold_Base,textAlign:`center`}});V();function Yxn(){let{t:e}=Tq(),{COLORS:t}=J(),n=N$(),[r,i]=(0,H.useState)(!0),a=(0,H.useCallback)(()=>{u8(l8.SettingsProfile),n.navigate(Q.Profile)},[n]),o=(0,H.useCallback)(()=>{u8(l8.SettingsGlucose),n.navigate(Q.GlucoseSettings)},[n]),s=(0,H.useCallback)(()=>{u8(l8.SettingsInsulin),n.navigate(Q.InsulinSettingsStack,{screen:Q.InsulinSettings})},[n]),c=(0,H.useCallback)(()=>{u8(l8.SettingsActivity),n.navigate(Q.ActivitySettings)},[n]),l=(0,H.useCallback)(()=>{u8(l8.SettingsSupport),n.navigate(Q.Support)},[n]),u=(0,H.useCallback)(()=>{u8(l8.SettingsLegal),n.navigate(Q.Legal)},[n]);return(0,W.jsxs)(fs,{testID:`scroll-settings`,style:L9.scrollView,contentContainerStyle:L9.scrollViewContentContainer,contentInsetAdjustmentBehavior:`automatic`,children:[(0,W.jsx)(Y4,{title:e(`settings_card_my_profile`),testID:`edit-profile-button`,renderRightSlot:()=>(0,W.jsx)(K4,{}),onPress:a}),(0,W.jsxs)(Y4.Container,{children:[(0,W.jsx)(Y4,{title:e(`settings_card_glucose`),testID:`settings-glucose`,onPress:o,renderRightSlot:()=>(0,W.jsx)(K4,{})}),(0,W.jsx)(Y4,{title:e(`settings_card_insulin_settings`),testID:`settings-insulin`,onPress:s,renderRightSlot:()=>(0,W.jsx)(K4,{})}),(0,W.jsx)(Y4,{title:e(`settings_card_physical_activity`),testID:`settings-activity`,onPress:c,renderRightSlot:()=>(0,W.jsx)(K4,{})})]}),(0,W.jsxs)(Y4.Container,{children:[(0,W.jsx)(Y4,{title:e(`settings_support`),testID:`settings-support`,onPress:l,renderRightSlot:()=>(0,W.jsx)(K4,{})}),(0,W.jsx)(Y4,{title:e(`settings_card_legal`),testID:`settings-legal`,onPress:u,renderRightSlot:()=>(0,W.jsx)(K4,{})})]}),(0,W.jsx)(Yf,{onPress:()=>{i(!r)},style:L9.versionContainer,children:(0,W.jsx)(Z,{style:[L9.versionText,{color:t.labelSecondary}],children:r?c8:`(${lin})`})}),bq.IS_PRODUCTION!==`true`&&(0,W.jsx)(B,{children:(0,W.jsx)(qxn,{})})]})}var L9=R.create({scrollView:{flex:1,paddingHorizontal:16},scrollViewContentContainer:{paddingVertical:32,flexGrow:1,gap:24},versionContainer:{alignItems:`center`,marginTop:`auto`},versionText:{...Y.Poppins.regular_Base}});V();function Xxn(){let{COLORS:e}=J();return(0,W.jsx)(B,{style:[Zxn.separator,{backgroundColor:e.divider}]})}var Zxn=R.create({separator:{height:1}}),R9=o3(X.CONSTANTS.INSULIN_TO_CARBS_RATIO_MIN,X.CONSTANTS.INSULIN_TO_CARBS_RATIO_MAX),z9=function(e){return e.DividendNumber=`109`,e.ExampleInsulinSensitivity=`2.2`,e}({}),Qxn=function(e){return e.DividendNumber=`1960`,e.ExampleInsulinSensitivity=`39.2`,e}({}),$xn=o3(X.CONSTANTS.INSULIN_SENSITIVITY_MIN,X.CONSTANTS.INSULIN_SENSITIVITY_MAX),eSn=a3(5,393);V();var tSn=({onPress:e,isVisible:t})=>{let{t:n}=Tq(),{COLORS:r}=J();return(0,W.jsxs)(u3,{isVisible:t,title:n(`insulin_settings_modal_carb_ratio_title`),enableScroll:!0,buttons:[{title:n(`button_close`),onPress:e,testID:`close-button`}],children:[(0,W.jsx)(Z,{testID:`insulin_settings_modal_carb_ratio_body`,style:[nSn.bodyText,{color:r.labelSecondary}],children:n(`insulin_settings_modal_carb_ratio_body`)}),(0,W.jsx)(Z,{testID:`insulin_settings_modal_carb_ratio_example`,style:{color:r.labelSecondary},children:n(`insulin_settings_modal_carb_example_body`)})]})},nSn=R.create({bodyText:{marginTop:12,marginBottom:16}});V();var rSn=({glucoseUnit:e,onPress:t,isVisible:n})=>{let{t:r}=Tq(),{COLORS:i}=J(),{text:a}=L8(e),o=e===X.BloodGlucoseUnit.MMOL_L?z9.DividendNumber:Qxn.DividendNumber,s=e===X.BloodGlucoseUnit.MMOL_L?z9.ExampleInsulinSensitivity:Qxn.ExampleInsulinSensitivity;return(0,W.jsxs)(u3,{title:r(`modal_insulin_seneitivity_title`),isVisible:n,enableScroll:!0,buttons:[{title:r(`button_close`),onPress:t,testID:`close-button`}],children:[(0,W.jsx)(Z,{testID:`insulin_sensitivity_modal_body`,style:[iSn.bodyText,{color:i.labelSecondary}],children:r(`insulin_sensitivity_modal_body`,{dividerNumber:o})}),(0,W.jsx)(Z,{testID:`insulin_sensitivity_modal_example`,style:{color:i.labelSecondary},children:r(`insulin_sensitivity_modal_example`,{dividerNumber:o,displayResult:s,displayUnit:a})})]})},iSn=R.create({bodyText:{marginTop:12,marginBottom:16}});V();var aSn=()=>{let{t:e}=Tq(),{bloodGlucoseUnits:t}=s7(),n=k8.glucoseUnit??t;if(n===void 0)throw Error(`[HelpCalculatingSection::render] glucoseUnit must be defined.`);let[r,i]=(0,H.useState)(!1),[a,o]=(0,H.useState)(!1),s=n===X.BloodGlucoseUnit.MMOL_L?z9.DividendNumber:Qxn.DividendNumber;return(0,W.jsxs)(B,{children:[(0,W.jsx)(d3,{title:e(`insulin_settings_learn_more_title`)}),(0,W.jsxs)(Y4.Container,{children:[(0,W.jsx)(Y4,{testID:`info-insulin-carbs-ratio`,title:e(`insulin_settings_learn_more_carb_ratio`),onPress:()=>{o(!0)},displayType:J4.ListItem}),(0,W.jsx)(Y4,{testID:`info-insulin-sensitivity-${s}`,title:e(`insulin_settings_learn_more_sensitivity`),onPress:()=>{i(!0)},displayType:J4.ListItem})]}),(0,W.jsx)(rSn,{onPress:()=>{i(!1)},glucoseUnit:n,isVisible:r}),(0,W.jsx)(tSn,{onPress:()=>{o(!1)},isVisible:a})]})};V();var oSn=({withLockedSettings:e})=>{let{t}=Tq(),{COLORS:n}=J(),{modalStoreActions:r}=z5(),{glucoseUnit:i,treatmentParameters:a}=k8;if(i===void 0)throw Error(`[DailyInsulinTable::render] glucoseUnit is undefined.`);if(a===void 0)throw Error(`[DailyInsulinTable::render] parameters from userSettings must be defined and non-null.`);let o=a.use,[s,c]=(0,H.useState)(!1),[l,u]=(0,H.useState)(!1),[d,f]=(0,H.useState)(void 0),[p,m]=(0,H.useState)(0),[h,g]=(0,H.useState)(!1),[_,v]=(0,H.useState)(),y=(0,H.useCallback)(async e=>{let t=z8(e,i,X.BloodGlucoseUnit.MMOL_L);if(t!==a.parameterIntervals[p].insulinSensitivity){let e={...a,parameterIntervals:a.parameterIntervals.map((e,n)=>n===p?{...e,insulinSensitivity:t}:e),updatedAt:new Date().toISOString()};f(await k8.postUserSettings({parameters:e}))}c(!1)},[i,a,p]),b=(0,H.useCallback)(async e=>{let t=Number(e.toFixed(1));if(t!==a.parameterIntervals[p].carbohydrateRatio){let e={...a,parameterIntervals:a.parameterIntervals.map((e,n)=>n===p?{...e,carbohydrateRatio:t}:e),updatedAt:new Date().toISOString()};f(await k8.postUserSettings({parameters:e}))}u(!1)},[a,p]),{text:x}=L8(i),S=(0,H.useMemo)(()=>[{title:t(`table_variable_insulin_time`),subtitle:t(`table_variable_time_unit`),scale:C2.s2},{title:t(`table_variable_insulin_sensitivity`),subtitle:t(`table_variable_insulin_sensitivity_unit`,{displayUnit:x}),scale:C2.s2},{title:t(`table_variable_insulin_carb`),subtitle:t(`table_variable_insulin_carb_unit`),scale:C2.s2}],[x,t]),C=(0,H.useMemo)(()=>i===X.BloodGlucoseUnit.MG_DL?eSn:$xn,[i]),w=(0,H.useMemo)(()=>{let e=a.parameterIntervals[p].insulinSensitivity,t=B8(e,X.BloodGlucoseUnit.MMOL_L,i);return C.findIndex(e=>e===t)},[C,i,a.parameterIntervals,p]),T=(0,H.useMemo)(()=>{let e=a.parameterIntervals[p].carbohydrateRatio.toFixed(1);return R9.findIndex(t=>t===e)},[a.parameterIntervals,p]),E=e=>{let t=a.parameterIntervals[(e-1+a.parameterIntervals.length)%a.parameterIntervals.length].startTime,n=a.parameterIntervals[(e+1+a.parameterIntervals.length)%a.parameterIntervals.length].startTime,r=a.parameterIntervals[e].startTime,i=q7(r,`HH:mm`,new Date),o=q7(t,`HH:mm`,new Date),s=q7(n,`HH:mm`,new Date);R7(i,o)&&R7(i,s)?v({current:i,min:t3(q7(t,`HH:mm`,_vn(new Date,1)),1),max:n3(s,1)}):C9(i,o)&&C9(i,s)?v({current:i,min:t3(o,1),max:n3(q7(n,`HH:mm`,K7(new Date,1)),1)}):v({current:i,min:t3(o,1),max:n3(s,1)}),m(e),g(!0)},D=e=>{m(e),c(!0)},O=e=>{m(e),u(!0)},k=(0,H.useCallback)(async e=>{let t=I8(e,`HH:mm`);if(t!==a.parameterIntervals[p].startTime){let e=[...a.parameterIntervals],n={...e[p]};n.startTime=t,e[p]=n,f(await k8.postUserSettings({parameters:{...a,parameterIntervals:e,updatedAt:new Date().toISOString()}}))}g(!1)},[a,p]),A=(0,H.useCallback)(()=>{g(!1)},[]),ee=(0,H.useCallback)(async e=>{let t={...a,use:e?X.Usage.Intervals:X.Usage.Overall,updatedAt:new Date().toISOString()},n=await k8.postUserSettings({parameters:t});r.set({showSyncErrorModal:!n})},[a,r]),te=(0,H.useCallback)(()=>{d===!1&&r.set({showSyncErrorModal:!0}),f(void 0)},[r,d]);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(y9,{columnDisposition:[2,3,3],children:[(0,W.jsx)(f3,{testID:`daily-interval-switch`,title:t(`variable_insulin_settings_title`),message:t(`variable_insulin_settings_body`),value:o===X.Usage.Intervals,onValueChange:e(ee),style:B9.switchContainer}),(0,W.jsx)(_9,{disabled:o!==X.Usage.Intervals,children:S.map((e,t)=>(0,W.jsxs)(x9,{style:t===0&&B9.firstTableCell,children:[(0,W.jsx)(Z,{maxFontSizeMultiplier:e.scale,style:[B9.tableHeaderTitle,{color:n.labelPrimary},t!==0&&B9.tableHeaderTitleWithMargin],children:e.title}),(0,W.jsx)(Z,{style:[B9.tableSubtitle,{color:n.textTableSecondary}],children:e.subtitle})]},e.title))}),Object.keys(Dq).map((t,r)=>(0,W.jsxs)(v9,{disabled:o!==X.Usage.Intervals,children:[(0,W.jsxs)(b9,{onPress:e(()=>{E(r)}),style:B9.firstTableCell,children:[(0,W.jsx)(Z,{maxFontSizeMultiplier:C2.s2,style:[B9.tableTitle,{color:n.textTableHighlight}],children:a.parameterIntervals[r].startTime}),(0,W.jsx)(Z,{style:[B9.tableSubtitle,{color:n.textTableSecondary}],children:_vt[t]()})]}),(0,W.jsx)(b9,{testID:`${t.toLowerCase()}-insulin`,onPress:e(()=>{D(r)}),children:(0,W.jsx)(Z,{maxFontSizeMultiplier:C2.s2,style:[B9.tableText,{color:n.textTableHighlight}],children:B8(a.parameterIntervals[r].insulinSensitivity,X.BloodGlucoseUnit.MMOL_L,i)})}),(0,W.jsx)(b9,{testID:`${t.toLowerCase()}-carbs`,onPress:e(()=>{O(r)}),children:(0,W.jsx)(Z,{maxFontSizeMultiplier:C2.s2,style:[B9.tableText,{color:n.textTableHighlight}],children:a.parameterIntervals[r].carbohydrateRatio.toFixed(1)})})]},t))]}),(0,W.jsx)(xvn,{isVisible:h,initialValue:_?.current??new Date,min:_?.min,max:_?.max,onConfirm:k,onCancel:A,onModalHide:te}),(0,W.jsx)(Q5,{isVisible:s,items:C,initialScrollIndex:w,onConfirm:y,onCancel:()=>{c(!1)},onModalHide:te,testID:`insulin_sensitivity_picker`}),(0,W.jsx)(Q5,{isVisible:l,items:R9,initialScrollIndex:T,onConfirm:b,onCancel:()=>{u(!1)},onModalHide:te,testID:`insulin_to_carb_ratio_picker`})]})},B9=R.create({switchContainer:{borderBottomLeftRadius:0,borderBottomRightRadius:0},firstTableCell:{paddingLeft:16,alignItems:`flex-start`,justifyContent:`space-between`,borderLeftWidth:0},tableHeaderTitle:{...Y.Poppins.medium_SM,textAlign:`center`},tableHeaderTitleWithMargin:{marginHorizontal:8},tableTitle:{...Y.Poppins.medium_Base},tableSubtitle:{...Y.Poppins.regular_XS},tableText:{...Y.Poppins.medium_Base}}),sSn=f7(oSn);V();var cSn={Lantus:()=>wq(`long-acting_insulin_option1`),Basaglar:()=>wq(`long-acting_insulin_option2`),Tuojeo:()=>wq(`long-acting_insulin_option3`),Levemir:()=>wq(`long-acting_insulin_option4`),Tresiba:()=>wq(`long-acting_insulin_option5`),Other:()=>wq(`long-acting_insulin_option6`),None:()=>wq(`long-acting_insulin_option7`)},lSn=()=>{let{modalStoreActions:e}=z5(),t=N5(),{longActingInsulin:n,treatmentParameters:r}=k8,i=(0,H.useCallback)(async t=>{t!==n&&(await k8.postUserSettings({longActingInsulin:X.LongActingInsulin[t],parameters:r?{...r,updatedAt:new Date().toISOString()}:void 0})||e.set({showSyncErrorModal:!0}))},[n,r,e]);return(0,W.jsxs)(fs,{testID:`scroll`,contentContainerStyle:[uSn.scrollView,{paddingTop:t+16}],children:[(0,W.jsx)(Y4.Container,{children:Object.keys(X.LongActingInsulin).map(e=>(0,W.jsx)(Y4,{title:cSn[e](),renderRightSlot:()=>(0,W.jsx)(B,{style:uSn.checkmarkContainer,children:X.LongActingInsulin[e]===n?(0,W.jsx)(G4,{width:24,height:24}):null}),onPress:()=>i(e),displayType:J4.ListItem,testID:`treatment-${e.match(/[A-Z][a-z]+/g)?.join(`-`).toLowerCase()}`},e))}),(0,W.jsx)(t7,{})]})},uSn=R.create({scrollView:{paddingVertical:32,paddingHorizontal:16,flexGrow:1},checkmarkContainer:{width:24,height:24}}),dSn=f7(lSn);V();var fSn={Novorapid:()=>wq(`rapid-acting_insulin_option1`),Fiasp:()=>wq(`rapid-acting_insulin_option2`),Humalog:()=>wq(`rapid-acting_insulin_option3`),Apidra:()=>wq(`rapid-acting_insulin_option4`),Other:()=>wq(`rapid-acting_insulin_option5`),None:()=>wq(`rapid-acting_insulin_option6`)},pSn=()=>{let{modalStoreActions:e}=z5(),t=N5(),{fastActingInsulin:n,treatmentParameters:r}=k8,i=(0,H.useCallback)(async t=>{t!==n&&(await k8.postUserSettings({fastActingInsulin:X.FastActingInsulin[t],parameters:r?{...r,updatedAt:new Date().toISOString()}:void 0})||e.set({showSyncErrorModal:!0}))},[n,r,e]);return(0,W.jsxs)(fs,{testID:`scroll`,contentContainerStyle:[mSn.scrollView,{paddingTop:t+16}],children:[(0,W.jsx)(Y4.Container,{children:Object.keys(X.FastActingInsulin).map(e=>(0,W.jsx)(Y4,{title:fSn[e](),renderRightSlot:()=>(0,W.jsx)(B,{style:mSn.checkmarkContainer,children:X.FastActingInsulin[e]===n?(0,W.jsx)(G4,{width:24,height:24}):null}),onPress:()=>i(e),displayType:J4.ListItem,testID:`treatment-${e.match(/[A-Z][a-z]+/g)?.join(`-`).toLowerCase()}`},e))}),(0,W.jsx)(t7,{})]})},mSn=R.create({scrollView:{paddingVertical:32,paddingHorizontal:16,flexGrow:1},checkmarkContainer:{width:24,height:24}}),hSn=f7(pSn);V();var V9={PenHalf:()=>wq(`treatment_type_option1`),PenWhole:()=>wq(`treatment_type_option2`),Pump:()=>wq(`treatment_type_option3`)},gSn=()=>{let{modalStoreActions:e}=z5(),t=N5(),{injectionMethod:n,treatmentParameters:r}=k8,i=(0,H.useCallback)(async t=>{t!==n&&(await k8.postUserSettings({treatmentType:X.InjectionMethod[t],parameters:r?{...r,updatedAt:new Date().toISOString()}:void 0})||e.set({showSyncErrorModal:!0}))},[n,r,e]);return(0,W.jsxs)(fs,{testID:`scroll`,contentContainerStyle:[{..._Sn.scrollView,paddingTop:t+16}],children:[(0,W.jsx)(Y4.Container,{children:Object.keys(X.InjectionMethod).map(e=>(0,W.jsx)(Y4,{title:V9[e](),renderRightSlot:()=>(0,W.jsx)(B,{style:_Sn.checkmarkContainer,children:X.InjectionMethod[e]===n?(0,W.jsx)(G4,{width:24,height:24}):null}),onPress:()=>i(e),testID:`treatment-${e.match(/[A-Z][a-z]+/g)?.join(`-`).toLowerCase()}`,displayType:J4.ListItem},e))}),(0,W.jsx)(t7,{})]})},_Sn=R.create({scrollView:{paddingVertical:32,paddingHorizontal:16,flexGrow:1},checkmarkContainer:{width:24,height:24}}),vSn=f7(gSn);V();function ySn({withLockedSettings:e}){let{t}=Tq(),n=N$(),{injectionMethod:r,fastActingInsulin:i,longActingInsulin:a}=k8;if(r===void 0)throw Error(`[TreatmentSection::render] injectionMethod must be defined and non-null.`);let o=(0,H.useMemo)(()=>V9[K9t(X.InjectionMethod,r)](),[r]),s=(0,H.useMemo)(()=>i?fSn[i]():`-`,[i]),c=(0,H.useMemo)(()=>a?cSn[a]():`-`,[a]);return(0,W.jsxs)(B,{children:[(0,W.jsx)(Y4,{title:t(`my_profile_treatment_type`),value:o,testID:`treatment-type`,onPress:e(()=>{n.navigate(Q.TreatmentType)}),renderRightSlot:()=>(0,W.jsx)(K4,{}),style:{marginBottom:24}}),(0,W.jsxs)(Y4.Container,{children:[(0,W.jsx)(Y4,{title:t(`my_profile_rapid-acting_insulin`),value:s,testID:`fast-acting-insulin`,onPress:e(()=>{n.navigate(Q.RapidActingInsulin)}),renderRightSlot:()=>(0,W.jsx)(K4,{})}),(0,W.jsx)(Y4,{title:t(`my_profile_long-acting_insulin`),value:c,testID:`long-acting-insulin`,onPress:e(()=>{n.navigate(Q.LongActingInsulin)}),renderRightSlot:()=>(0,W.jsx)(K4,{})})]})]})}var bSn=f7(ySn);V();var{MMOL_L:H9}=X.BloodGlucoseUnit,xSn=()=>{let e=N$(),{t}=Tq(),{COLORS:n}=J(),{modalStoreActions:r}=z5(),{bottomWithScroll:i}=Q4(),a=N5(),{glucoseUnit:o,treatmentParameters:s,created:c}=k8;if(o===void 0)throw Error(`[InsulinSettings::render] glucoseUnit is undefined.`);if(s===void 0)throw Error(`[InsulinSettings::render] parameters from userSettings must be defined and non-null.`);let l=s.use===X.Usage.Overall,{text:u}=L8(o),{carbohydrateRatio:d,insulinSensitivity:f}=s.overallParameters,[p,m]=(0,H.useState)(!1),[h,g]=(0,H.useState)(!1),[_,v]=(0,H.useState)(void 0),[y,b]=(0,H.useState)(!1),[x,S]=(0,H.useState)(!1),{areSettingsLocked:C,isPINSet:w,lockSettings:T,unlockSettings:E}=G_n(),[D,O]=(0,H.useState)(!1),[k,A]=(0,H.useState)(!1),ee=(0,H.useCallback)(()=>{C?b(!0):T()},[C,T]);(0,H.useEffect)(()=>{e.setOptions({header:()=>(0,W.jsx)(F5,{title:t(`insulin_settings_navigation`),LeftButton:(0,W.jsx)(H5,{}),RightButton:w?(0,W.jsx)(cfn,{onPress:ee,isLocked:C}):void 0,overlay:!0})})},[e,C,w,ee,t]);let te=(0,H.useMemo)(()=>o===H9?$xn:eSn,[o]),ne=()=>{m(!0)},re=()=>{g(!0)},ie=(0,H.useCallback)(async e=>{let t=z8(e,o,H9);if(t!==s.overallParameters.insulinSensitivity){let e={...s,overallParameters:{...s.overallParameters,insulinSensitivity:t},updatedAt:new Date().toISOString()};v(await k8.postUserSettings({parameters:e}))}m(!1)},[o,s]),j=(0,H.useCallback)(async e=>{let t=Number(e.toFixed(1));if(t!==s.overallParameters.carbohydrateRatio){let e={...s,overallParameters:{...s.overallParameters,carbohydrateRatio:t},updatedAt:new Date().toISOString()};v(await k8.postUserSettings({parameters:e}))}g(!1)},[s]),ae=(0,H.useMemo)(()=>{let e=B8(f,H9,o);return te.findIndex(t=>t===e)},[te,o,f]),oe=(0,H.useMemo)(()=>R9.findIndex(e=>e===d.toFixed(1)),[d]),se=(0,H.useCallback)(()=>{_===!1&&r.set({showSyncErrorModal:!0}),v(void 0)},[r,_]),M=(0,H.useCallback)(async e=>{let t={...s,use:e?X.Usage.Overall:X.Usage.Intervals,updatedAt:new Date().toISOString()},n=await k8.postUserSettings({parameters:t});r.set({showSyncErrorModal:!n})},[s,r]),ce=(0,H.useCallback)(()=>{D&&(S(!0),O(!1))},[D,S,O]),N=(0,H.useCallback)(()=>{O(!0),b(!1)},[O,b]),P=(0,H.useCallback)(()=>{E()},[E]),le=(0,H.useCallback)(e=>w&&C?(...e)=>b(!0):(...t)=>e(...t),[C,w]),ue=(0,H.useCallback)(()=>{k&&(A(!1),setTimeout(()=>{e.navigate(Q.ChangePINCode)},500))},[k,e]),de=s.updatedAt??c;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(fs,{testID:`scroll`,contentContainerStyle:[U9.scrollView,{paddingBottom:i,paddingTop:a+16}],children:[(0,W.jsx)(Z,{style:[U9.updatedAtText,{color:n.labelSecondary}],children:t(`settings_lastEdited`,{date:de?I8(de,`d MMM yyyy`):``})}),(0,W.jsx)(bSn,{withLockedSettings:le}),(0,W.jsx)(B,{style:U9.spacing}),(0,W.jsx)(p9,{}),(0,W.jsx)(B,{style:U9.spacing}),(0,W.jsxs)(Y4.Container,{containerStyle:{backgroundColor:n.bgSecondary,borderColor:n.divider,borderWidth:1},children:[(0,W.jsx)(f3,{testID:`insulin-settings-overall-switch`,title:t(`fixed_insulin_settings_title`),message:t(`fixed_insulin_settings_body`),value:l,onValueChange:le(M),style:U9.switchContainer}),(0,W.jsx)(Xxn,{}),(0,W.jsx)(Y4,{title:t(`fixed_insulin_settings_carb_ratio_title`),value:`${d.toFixed(1)} ${t(`fixed_insulin_settings_carb_ratio_unit`)}`,testID:`carbohydrate-ratio`,onPress:le(()=>l?re():void 0),containerStyle:l?U9.active:U9.inactive,valueStyle:l?{color:n.textTableHighlight}:{color:n.labelSecondary}}),(0,W.jsx)(Y4,{title:t(`fixed_insulin_settings_sensitivity_title`),value:`${B8(f,H9,o)} ${t(`fixed_insulin_settings_sensitivity_unit`,{displayUnit:u})}`,testID:`insulin-sensitivity`,onPress:le(()=>l?ne():void 0),containerStyle:l?U9.active:U9.inactive,valueStyle:l?{color:n.textTableHighlight}:{color:n.labelSecondary}})]}),(0,W.jsx)(B,{style:U9.spacing}),(0,W.jsx)(sSn,{withLockedSettings:le}),(0,W.jsx)(B,{style:U9.spacing}),(0,W.jsx)(aSn,{})]}),(0,W.jsx)(Q5,{isVisible:p,items:te,initialScrollIndex:ae,onConfirm:ie,onCancel:()=>{m(!1)},onModalHide:se,testID:`insulin_sensitivity_picker`}),(0,W.jsx)(Q5,{isVisible:h,items:R9,initialScrollIndex:oe,onConfirm:j,onCancel:()=>{g(!1)},onModalHide:se,testID:`insulin_to_carb_ratio_picker`}),(0,W.jsx)(t7,{onModalHide:()=>{v(void 0)}}),(0,W.jsx)(rvn,{isVisible:y,onModalHide:ce,onEnterPIN:N,onCancel:()=>b(!1)}),(0,W.jsx)(Q_n,{isVisible:x,onClose:()=>S(!1),onModalHide:ue,onForgotPIN:()=>{A(!0),S(!1)},onModalHideWithSuccess:P}),(0,W.jsx)(nvn,{})]})},U9=R.create({scrollView:{paddingTop:32,paddingHorizontal:16,flexGrow:1},spacing:{height:32},updatedAtText:{...Y.Poppins.regular_SM,textAlign:`center`,marginBottom:24},active:{opacity:1},inactive:{opacity:.5},switchContainer:{borderBottomLeftRadius:0,borderBottomRightRadius:0}}),SSn=f7(xSn),{Navigator:CSn,Screen:W9}=j5(),wSn=()=>{let{t:e}=Tq();return(0,W.jsxs)(CSn,{screenOptions:{...K5,...$8},children:[(0,W.jsx)(W9,{name:Q.InsulinSettings,component:SSn,options:{header:()=>(0,W.jsx)(F5,{LeftButton:(0,W.jsx)(H5,{}),title:e(`insulin_settings_navigation`),overlay:!0})}}),(0,W.jsx)(W9,{name:Q.TreatmentType,component:vSn,options:{header:()=>(0,W.jsx)(F5,{LeftButton:(0,W.jsx)(H5,{}),title:e(`treatment_type_navigation`),overlay:!0})}}),(0,W.jsx)(W9,{name:Q.RapidActingInsulin,component:hSn,options:{header:()=>(0,W.jsx)(F5,{LeftButton:(0,W.jsx)(H5,{}),title:e(`rapid-acting_insulin_navigation`),overlay:!0})}}),(0,W.jsx)(W9,{name:Q.LongActingInsulin,component:dSn,options:{header:()=>(0,W.jsx)(F5,{LeftButton:(0,W.jsx)(H5,{}),title:e(`long-acting_insulin_navigation`),overlay:!0})}})]})};V();var{Navigator:TSn,Screen:G9}=j5(),ESn=()=>{let{t:e}=Tq(),{COLORS:t}=J(),n=N$(),[r,i]=(0,H.useState)(!1),a=(0,H.useCallback)(()=>{if(n.canGoBack()){n.goBack();return}n.navigate(Q.NewCalculationStack,{screen:Q.Calculation})},[n]),o=(0,H.useCallback)(async()=>{i(!1);try{Kxn(await Fen())?i(!0):window.location.href=`/reauthenticate?path=/app/settings`}catch{n.reset({index:0,routes:[{name:Q.NewCalculationStack,params:{screen:Q.Calculation}}]})}},[n]);return V$((0,H.useCallback)(()=>{o();let e=Sf.currentState,t=Sf.addEventListener(`change`,t=>{let n=t===`active`&&e!==`active`;e=t,n&&o()});return()=>t.remove()},[o])),r?(0,W.jsxs)(TSn,{screenOptions:{...K5,...$8,headerStyle:{backgroundColor:t.bgNavigationBar}},children:[(0,W.jsx)(G9,{name:Q.Settings,component:Yxn,options:{header:()=>(0,W.jsx)(F5,{LeftButton:(0,W.jsx)(U5,{onPress:a}),title:e(`settings_navigation`)})}}),(0,W.jsx)(G9,{name:Q.Profile,component:qvn,options:{header:()=>(0,W.jsx)(F5,{LeftButton:(0,W.jsx)(H5,{}),title:e(`my_profile_navigation`)})}}),(0,W.jsx)(G9,{name:Q.GlucoseSettings,component:Dvn,options:{header:()=>(0,W.jsx)(F5,{LeftButton:(0,W.jsx)(H5,{}),title:e(`glucose_navigation`),overlay:!0})}}),(0,W.jsx)(G9,{name:Q.GlucoseUnit,component:jvn,options:{header:()=>(0,W.jsx)(F5,{LeftButton:(0,W.jsx)(H5,{}),title:e(`glucose_unit_navigation`),overlay:!0})}}),(0,W.jsx)(G9,{name:Q.ActivitySettings,component:gvn,options:{header:()=>(0,W.jsx)(F5,{LeftButton:(0,W.jsx)(H5,{}),title:e(`physical_activity_navigation`),overlay:!0})}}),(0,W.jsx)(G9,{name:Q.InsulinSettingsStack,component:wSn,options:{headerShown:!1}}),(0,W.jsx)(G9,{name:Q.Theme,component:Uxn,options:{header:()=>(0,W.jsx)(F5,{LeftButton:(0,W.jsx)(H5,{}),title:e(`navigation_title_theme`),overlay:!0})}}),(0,W.jsx)(G9,{name:Q.Support,component:Vxn,options:{header:()=>(0,W.jsx)(F5,{LeftButton:(0,W.jsx)(H5,{}),title:e(`support_navigation`)})}}),(0,W.jsx)(G9,{name:Q.Legal,component:Mvn,options:{header:()=>(0,W.jsx)(F5,{LeftButton:(0,W.jsx)(H5,{}),title:e(`legal_navigation`),overlay:!0})}})]}):(0,W.jsx)(x2,{})};V();function DSn(){return(0,W.jsx)(Xfn,{style:OSn.iframe,uri:`https://www.hedia.com/contact#contactsupport`})}var OSn=R.create({iframe:{flex:1}}),{Navigator:kSn,Screen:K9,Group:ASn}=j5(),jSn=()=>{let{t:e}=Tq();return(0,W.jsxs)(kSn,{children:[(0,W.jsxs)(ASn,{screenOptions:{headerShown:!1},children:[(0,W.jsx)(K9,{name:Q.NewCalculationStack,component:U_n}),(0,W.jsx)(K9,{name:Q.SettingsStack,component:ESn})]}),(0,W.jsxs)(ASn,{screenOptions:{...lfn},children:[(0,W.jsx)(K9,{name:Q.CreateFood,component:Yfn}),(0,W.jsx)(K9,{name:Q.IFU,component:Qfn,options:{header:()=>(0,W.jsx)(F5,{LeftButton:(0,W.jsx)(U5,{}),title:e(`IFU_navigation`)})}}),(0,W.jsx)(K9,{name:Q.SupportWebView,component:ipn,options:{header:()=>(0,W.jsx)(F5,{LeftButton:(0,W.jsx)(U5,{}),title:e(`support_navigation`)})}}),(0,W.jsx)(K9,{name:Q.SupportContact,component:DSn,options:{header:()=>(0,W.jsx)(F5,{LeftButton:(0,W.jsx)(U5,{}),title:e(`support_navigation`)})}})]})]})};V();var MSn=({title:e,subtitle:t,stepChecked:n,onAnimationFinished:r})=>{let{t:i}=Tq(),{COLORS:a}=J();return(0,H.useEffect)(()=>{r?.()},[r]),(0,W.jsxs)(fs,{contentContainerStyle:q9.container,style:{backgroundColor:a.bgPrimary},children:[(0,W.jsx)(Z,{style:q9.title,children:e}),(0,W.jsx)(Z,{style:[q9.subtitle,{color:a.labelSecondary}],children:t}),(0,W.jsxs)(B,{style:q9.stepsWrapper,children:[(0,W.jsxs)(B,{style:q9.stepContainer,children:[(0,W.jsx)(Z,{style:[q9.text,n===1||n===2||n===3?{color:a.labelPrimary}:{color:a.labelSecondary}],children:` 1. `+i(`overview1`)}),(n===1||n===2||n===3)&&(0,W.jsx)(G4,{width:24,height:24,color:a.labelPrimary})]}),(0,W.jsxs)(B,{style:q9.stepContainer,children:[(0,W.jsx)(Z,{style:[q9.text,n===2||n===3?{color:a.labelPrimary}:{color:a.labelSecondary}],children:`2. `+i(`overview2`)}),(n===2||n===3)&&(0,W.jsx)(G4,{width:24,height:24,color:a.labelPrimary})]}),(0,W.jsxs)(B,{style:q9.stepContainer,children:[(0,W.jsx)(Z,{style:[q9.text,n===3?{color:a.labelPrimary}:{color:a.labelSecondary}],children:`3. `+i(`overview3`)}),n===3&&(0,W.jsx)(G4,{width:24,height:24,color:a.labelPrimary})]})]})]})},q9=R.create({container:{flex:1,justifyContent:`center`,paddingHorizontal:16},title:{...Y.Poppins.bold_4XL,paddingHorizontal:16,marginBottom:2},subtitle:{...Y.Poppins.regular_Base,paddingHorizontal:16,marginBottom:32},stepsWrapper:{padding:16,gap:8},stepContainer:{flexDirection:`row`,alignItems:`center`,gap:8},text:{marginBottom:8}}),NSn=()=>{let{t:e}=Tq(),{setIsOnboardingFinished:t}=E3(),n=(0,H.useCallback)(()=>{setTimeout(()=>{t(!0)},1e3)},[t]);return(0,W.jsx)(MSn,{title:e(`guide_end_title`),subtitle:e(`guide_end_body`),stepChecked:3,onAnimationFinished:n})};V();var J9=({currentStep:e,text:t,onPress:n,inactive:r,isBackVisible:i=!0,onBackPress:a})=>{let{t:o}=Tq(),{COLORS:s}=J(),{goBack:c}=N$();return(0,W.jsx)(lpn,{children:(0,W.jsxs)(B,{style:[PSn.buttonsWrapper,{borderColor:s.bgTransparent}],children:[i&&(0,W.jsx)(U4,{title:o(`button_back`),onPress:a||c,testID:`back${e}`,style:PSn.button,type:H4.Secondary}),(0,W.jsx)(U4,{title:t??o(`button_next`),onPress:n,inactive:r,testID:`next${e}`,style:PSn.button})]})})},PSn=R.create({buttonsWrapper:{flexDirection:`row`,paddingTop:16,gap:8,borderWidth:1},button:{flex:1}});V();var FSn=()=>{let{t:e}=Tq(),{COLORS:t}=J(),{top:n}=Q4(),{navigate:r}=N$(),i=(0,H.useCallback)(()=>{r(I5.QuickGuideStack,{screen:I5.QuickGuide}),u8(l8.QuickGuideStartPress)},[r]);return(0,W.jsxs)(B,{style:{flex:1,backgroundColor:t.bgSecondary,paddingTop:n},children:[(0,W.jsx)(MSn,{title:e(`guide_quick_guide_title`),subtitle:e(`guide_quick_guide_body`),stepChecked:2}),(0,W.jsx)(J9,{currentStep:1,isBackVisible:!1,onPress:i,text:e(`button_start`)})]})},ISn=`/assets/webp/1_EN.webp`,LSn=`/assets/webp/2_EN.webp`,RSn=`/assets/webp/3_EN.webp`,zSn=`/assets/webp/4_EN2.webp`,BSn=`/assets/webp/1_EN2.webp`,VSn=`/assets/webp/2_EN2.webp`,HSn=`/assets/webp/3_EN2.webp`,USn=`/assets/webp/4_EN.webp`;V();var WSn=()=>{let{t:e}=Tq(),t=N$(),{COLORS:n,isDark:r}=J(),i=(0,H.useRef)(null),[a,o]=(0,H.useState)(2),[s,c]=(0,H.useState)(0),{width:l}=em(),u=(0,H.useMemo)(()=>[{title:e(`guide_recent_insulin_title`),body:e(`guide_recent_insulin_body`),image:r?ISn:BSn},{title:e(`web_guide_no_import_title`),body:e(`web_guide_no_import_body`),image:r?LSn:VSn},{title:e(`guide_glucose_title`),body:e(`guide_glucose_body`),image:r?RSn:HSn},{title:e(`guide_recommendation_title`),body:e(`guide_recommendation_body`),image:r?zSn:USn}],[r,e]),d=(0,H.useCallback)(e=>{switch(e-1){case 1:return l8.QuickGuideBackPressStep1;case 2:return l8.QuickGuideBackPressStep2;case 3:return l8.QuickGuideBackPressStep3;case 4:return l8.QuickGuideBackPressStep4;default:throw Error(`[QuickGuide::getTrackingEventBackPress] Invalid step`)}},[]),f=(0,H.useCallback)(e=>{switch(e-1){case 1:return l8.QuickGuideNextPressStep1;case 2:return l8.QuickGuideNextPressStep2;case 3:return l8.QuickGuideNextPressStep3;default:throw Error(`[QuickGuide::getTrackingEventNextPress] Invalid step`)}},[]),p=(0,H.useCallback)(()=>{if(s===u.length-1)u8(l8.QuickGuideFinishPress),t.navigate(I5.QuickGuideAllSet);else{let e=s+1;i.current?.scrollToIndex({index:e,animated:!0}),o(a+1),c(e),u8(f(a))}},[s,a,f,t,u.length]),m=(0,H.useCallback)(()=>{if(s===0)t.navigate(I5.QuickGuideStart);else{let e=s-1;i.current?.scrollToIndex({index:e,animated:!0}),o(a-1),c(e)}u8(d(a))},[s,a,d,t]);return(0,W.jsxs)(B,{style:{flex:1,backgroundColor:n.bgSecondary},children:[(0,W.jsx)(Wc,{ref:i,data:u,initialNumToRender:1,scrollEnabled:!1,horizontal:!0,showsHorizontalScrollIndicator:!1,renderItem:({item:e,index:t})=>(0,W.jsxs)(B,{style:[Y9.container,{width:l,backgroundColor:n.bgPrimary}],children:[(0,W.jsx)(Zu,{source:e.image,style:[Y9.image,{bottom:t===0?64:0,width:t===1?`55%`:`100%`,height:t===1?`55%`:`60%`}],resizeMode:`contain`}),(0,W.jsxs)(B,{style:Y9.contentContainer,children:[(0,W.jsx)(Z,{style:Y9.title,maxFontSizeMultiplier:C2.s2,children:e.title}),(0,W.jsx)(Z,{style:[Y9.body,{color:n.labelSecondary}],maxFontSizeMultiplier:C2.s2,children:e.body})]})]})}),(0,W.jsx)(J9,{currentStep:a,onPress:p,onBackPress:m,text:s===u.length-1?e(`button_complete`):e(`button_next`)})]})},Y9=R.create({container:{alignItems:`center`,justifyContent:`flex-end`},image:{width:`100%`,height:`60%`,marginTop:64},contentContainer:{minHeight:`25%`,paddingTop:12,marginBottom:84},title:{...Y.Poppins.semiBold_2XL,marginBottom:2,paddingHorizontal:16,textAlign:`center`},body:{...Y.Poppins.regular_Base,paddingHorizontal:Ru.getFontScale()>C2.s0?16:32,textAlign:`center`}}),{Navigator:GSn,Screen:KSn}=j5(),qSn=()=>(0,W.jsxs)(GSn,{screenOptions:{...K5,headerShown:!1},children:[(0,W.jsx)(KSn,{name:I5.QuickGuideStart,component:FSn}),(0,W.jsx)(KSn,{name:I5.QuickGuide,component:WSn}),(0,W.jsx)(KSn,{name:I5.QuickGuideAllSet,component:NSn})]});V();function JSn({onOptionSelect:e,setNextEnabled:t,ref:n}){let{t:r}=Tq(),{COLORS:i}=J(),{width:a}=em(),o=N5(),[s,c]=(0,H.useState)(null),l=(0,H.useCallback)(n=>{c(n),e(n),t(!0)},[e,t]);return(0,H.useImperativeHandle)(n,()=>({onBackPress(){u8(l8.SetupOptionsBackPress)},onNextPressed:()=>s===null?(t(!1),{transitionAllowed:!1}):(u8(l8.SetupOptionsNextPress),t(!0),{transitionAllowed:!0}),validateData(){return{isValid:s!==null}}}),[s,t]),(0,W.jsxs)(fs,{contentContainerStyle:[X9.container,{width:a,paddingTop:o+16}],style:{backgroundColor:i.bgPrimary},children:[(0,W.jsx)(Z,{style:[X9.header,{color:i.labelPrimary}],children:r(`insulin_settings_title`)}),(0,W.jsxs)(B,{style:X9.buttonsContainer,children:[(0,W.jsx)(U4,{title:r(`insulin_settings_button_yes`),testID:`insulin_settings_yes`,onPress:()=>{l(`yes`)},type:s===`yes`?H4.Primary:H4.Secondary,style:X9.button}),(0,W.jsx)(U4,{title:r(`insulin_settings_button_no`),testID:`insulin_settings_no`,onPress:()=>{l(`no`)},type:s===`no`?H4.Primary:H4.Secondary,style:X9.button})]})]})}var X9=R.create({container:{flex:1,paddingHorizontal:16,paddingTop:32},header:{...Y.Poppins.bold_2XL,paddingHorizontal:16,marginBottom:24},buttonsContainer:{flexDirection:`row`,marginBottom:24,gap:12},button:{flex:1}});function YSn(e,t){let n=e3(e)-+e3(t);return n<0?-1:n>0?1:n}function XSn(e,t,n){let[r,i]=_8(n?.in,e,t);return r.getFullYear()-i.getFullYear()}function ZSn(e,t,n){let[r,i]=_8(n?.in,e,t),a=YSn(r,i),o=Math.abs(XSn(r,i));r.setFullYear(1584),i.setFullYear(1584);let s=a*(o-+(YSn(r,i)===-a));return s===0?0:s}V(),Z0();function QSn({setNextEnabled:e,ref:t}){let{t:n}=Tq(),{COLORS:r,isDark:i,effectiveColorScheme:a}=J(),{width:o}=em(),{bottom:s}=W0(),{bottomWithFooterButton:c}=Q4(),l=N5(),{birthday:u,biologicalSex:d,diabetesType:f,bloodGlucoseUnits:p}=s7(),{setSetupCalculatorStoreValues:m}=o7(),[h,g]=(0,H.useState)(!1),[_,v]=(0,H.useState)(!1),[y,b]=(0,H.useState)(!1),[x,S]=(0,H.useState)(``),[C,w]=(0,H.useState)(``),[T,E]=(0,H.useState)(!1),D=(0,H.useCallback)(e=>{let t=new Date(e);t.setHours(0,0,0,0);let r=new Date;r.setHours(0,0,0,0);let i=ZSn(r,t)>=18;m({birthday:t.toISOString()}),S(``),w(i?``:n(`setup_birthday_hint_under18`))},[m,n]),O=(0,H.useCallback)(e=>{D(e),g(!1)},[D]),k=(0,H.useCallback)(()=>{m({diabetesType:X.DiabetesType.Type2}),v(!0)},[m]),A=(0,H.useCallback)(()=>!!(u&&d&&f&&p),[u,p,f,d]);return(0,H.useEffect)(()=>{e(A())},[e,A]),(0,H.useImperativeHandle)(t,()=>({onBackPress(){u8(l8.SetupGeneralBackPress)},onNextPressed:()=>(E(!0),!u&&S(n(`birthday_error`)),A()?(e(!0),u8(l8.SetupGeneralNextPress),{transitionAllowed:!0}):(e(!1),{transitionAllowed:!1})),validateData(){return{isValid:A()}}}),[u,n,A,e]),(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(fs,{testID:`step_2`,contentContainerStyle:[Z9.container,{width:o,paddingTop:l+16,paddingBottom:c}],style:{backgroundColor:r.bgPrimary},children:[(0,W.jsx)(Y4,{testID:`birthday`,title:n(`general_input_birthday`),renderRightSlot:()=>(0,W.jsx)(B,{style:[Z9.pillButton,{backgroundColor:r.bgPill}],children:(0,W.jsx)(Z,{style:[Z9.pillText,{color:h?r.textLink:r.labelPrimary}],children:u?I8(new Date(u),`dd-MM-yyyy`):`DD-MM-YYYY`})}),errorMessage:x,warningMessage:C,containerStyle:Z9.wrapper,style:Z9.customRow,onPress:()=>{g(!0)}}),(0,W.jsx)(B,{style:Z9.wrapper,children:(0,W.jsx)(B4,{isAnimated:T&&!d,children:(0,W.jsx)(Y4,{title:n(`my_profile_sex`),testID:`biological-sex`,value:d?vvt[d]():`-`,onPress:()=>{b(!0)},errorMessage:T&&!d?n(`diabetes_error`):void 0})})}),(0,W.jsxs)(B,{style:Z9.wrapper,children:[(0,W.jsx)(d3,{title:n(`type_of_diabetes_title`)}),(0,W.jsx)(B4,{isAnimated:T&&!f,message:n(`diabetes_error`),children:(0,W.jsxs)(B,{style:[Z9.row,{backgroundColor:r.bgSegmentContainer,borderColor:r.buttonBorder}],children:[(0,W.jsx)(S9t,{title:n(`type_of_diabetes_type1`),isActive:f===X.DiabetesType.Type1,testID:`type-1`,onPress:()=>{m({diabetesType:X.DiabetesType.Type1})},isError:T&&!f}),!f&&(0,W.jsx)(B,{style:[Z9.separator,{backgroundColor:r.divider}]}),(0,W.jsx)(S9t,{title:n(`type_of_diabetes_type2`),isActive:f===X.DiabetesType.Type2,testID:`type-2`,onPress:k,isError:T&&!f})]})})]}),(0,W.jsxs)(B,{style:Z9.wrapper,children:[(0,W.jsx)(d3,{title:n(`glucose_unit_title`)}),(0,W.jsx)(B4,{isAnimated:T&&!p,message:n(`glucose_unit_error`),children:(0,W.jsx)(Ovn,{glucoseUnit:p,onPressMMOLL:()=>{m({bloodGlucoseUnits:X.BloodGlucoseUnit.MMOL_L})},onPressMGDL:()=>{m({bloodGlucoseUnits:X.BloodGlucoseUnit.MG_DL})},isError:T&&!p})})]})]}),kq?(0,W.jsx)(Zpn,{testID:`birthday-date-picker`,display:`spinner`,date:u?new Date(u):new Date,isVisible:h,onConfirm:O,onCancel:()=>{g(!1)},customConfirmButtonIOS:emn,customCancelButtonIOS:tmn,pickerContainerStyleIOS:{backgroundColor:r.iosKeyboardPicker},modalStyleIOS:{paddingBottom:s},themeVariant:a,isDarkModeEnabled:i,pickerStyleIOS:Z9.alignCenter,minimumDate:new Date(1900,0,1),maximumDate:new Date(2100,0,1)}):(0,W.jsx)(Bvn,{isVisible:h,initialValue:u?new Date(u):new Date,onConfirm:O,onCancel:()=>{g(!1)}}),(0,W.jsx)(u3,{isVisible:_,title:n(`modal_diabetes2_title`),message:n(`modal_diabetes2_body`),buttons:[{title:n(`button_close`),testID:`type2-modal-understood-button`,onPress:()=>{v(!1)}}]}),(0,W.jsx)(Uvn,{isVisible:y,onCancel:()=>{b(!1)}})]})}var Z9=R.create({container:{paddingHorizontal:16},wrapper:{marginBottom:24},row:{flexDirection:`row`,padding:2,borderRadius:16,borderWidth:1},alignCenter:{alignSelf:`center`},separator:{width:1,height:24,alignSelf:`center`},customRow:{paddingVertical:8},pillButton:{borderRadius:16},pillText:{...Y.Poppins.regular_SM,paddingHorizontal:8,paddingVertical:6}});V();function $Sn({setNextEnabled:e,ref:t}){let{COLORS:n}=J(),{t:r}=Tq(),{width:i}=em(),a=N5(),{parameters:o,treatmentType:s}=s7(),{setSetupCalculatorStoreValues:c}=o7(),[l,u]=(0,H.useState)(!1);(0,H.useEffect)(()=>{o||c({parameters:O8(0,0,X.Usage.Overall)})},[o,c]),(0,H.useEffect)(()=>{e(!!s)},[e,s]);let d=(0,H.useCallback)(e=>{c({treatmentType:X.InjectionMethod[e]})},[c]);return(0,H.useImperativeHandle)(t,()=>({onBackPress(){u8(l8.SetupTreatmentBackPress)},onNextPressed:()=>(u(!0),s?(e(!0),u8(l8.SetupTreatmentNextPress),{transitionAllowed:!0}):(e(!1),{transitionAllowed:!1})),validateData(){return{isValid:!!s}}}),[e,s]),(0,W.jsxs)(B,{testID:`step_3`,style:[eCn.container,{width:i,backgroundColor:n.bgPrimary,paddingTop:a+16}],children:[(0,W.jsx)(d3,{title:r(`treatment_units_title`)}),(0,W.jsx)(B4,{isAnimated:l&&!s,message:r(`treatment_type_input_error`),children:(0,W.jsx)(Y4.Container,{children:Object.keys(X.InjectionMethod).map(e=>(0,W.jsx)(Y4,{title:V9[e](),renderRightSlot:()=>(0,W.jsx)(B,{style:eCn.checkmarkContainer,children:X.InjectionMethod[e]===s?(0,W.jsx)(G4,{width:24,height:24}):null}),onPress:()=>{d(e)},testID:`treatment-${e.match(/[A-Z][a-z]+/g)?.join(`-`).toLowerCase()}`,displayType:J4.ListItem},e))})})]})}var eCn=R.create({container:{paddingHorizontal:16,paddingVertical:32},checkmarkContainer:{width:24,height:24}}),tCn=a3(5,350);V();function nCn({setNextEnabled:e,ref:t}){let{t:n}=Tq(),{COLORS:r}=J(),{width:i}=em(),a=N5(),{bottomWithFooterButton:o}=Q4(),{bloodGlucoseUnits:s,parameters:c}=s7();if(!s||!c)throw Error(`[Step4::render] are not defined`);let l=xpn(),{setSetupCalculatorStoreValues:u,setTotalDailyDosage:d}=o7(),[f,p]=(0,H.useState)(!1),[m,h]=(0,H.useState)(void 0),g=(0,H.useMemo)(()=>l?{carbohydrateRatio:parseFloat((500/l).toFixed(1)),insulinSensitivityMMOLL:Number(z9.DividendNumber)/l}:{carbohydrateRatio:0,insulinSensitivityMMOLL:0},[l]);(0,H.useEffect)(()=>{let{carbohydrateRatio:e,insulinSensitivityMMOLL:t}=g;u({parameters:O8(t,e,X.Usage.Overall)})},[s,g,u]);let _=(0,H.useMemo)(()=>l?tCn.findIndex(e=>e===l.toString()):tCn.findIndex(e=>e===`50`),[l]);(0,H.useImperativeHandle)(t,()=>({onBackPress(){u8(l8.SetupTDDBackPress)},onNextPressed:()=>l?(u8(l8.SetupTDDNextPress),e(!0),{transitionAllowed:!0}):(h(n(`insulin_settings_input_error`,{inputTypeTranslated:n(`daily_insulin_dosage_input`)})),e(!1),{transitionAllowed:!1}),validateData(){return{isValid:!!l}}}),[e,l,n]);let v=(0,H.useCallback)(t=>{d(t),p(!1),h(void 0),e(!0)},[e,d]),{text:y}=(0,H.useMemo)(()=>L8(s),[s]),b=(0,H.useMemo)(()=>`${B8(c.overallParameters.insulinSensitivity,X.BloodGlucoseUnit.MMOL_L,s)} ${n(`fixed_insulin_settings_sensitivity_unit`,{displayUnit:y})}`,[c,y,n,s]),x=(0,H.useMemo)(()=>c.overallParameters.carbohydrateRatio+` `+n(`insulin_helper_carb_ratio_unit`),[c,n]);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(fs,{contentContainerStyle:[Q9.container,{width:i,paddingTop:a+16,paddingBottom:o}],style:{backgroundColor:r.bgPrimary},children:[(0,W.jsxs)(B,{children:[(0,W.jsx)(d3,{title:n(`daily_insulin_dosage_title`)}),(0,W.jsx)(Z,{style:[Q9.subheader,{color:r.labelSecondary}],children:n(`daily_insulin_dosage_body`)}),(0,W.jsx)(B4,{isAnimated:!!m,children:(0,W.jsx)(Y4,{testID:`daily_insulin_dosage`,title:n(`daily_insulin_dosage_input`),value:`${l??`-`} ${n(l===1?`unit`:`units`)}`,valueStyle:{color:r.labelBrand},onPress:()=>{p(!0)},errorMessage:m})})]}),!!l&&(0,W.jsxs)(B,{style:[Q9.explanation,{backgroundColor:r.bgSecondary}],children:[(0,W.jsx)(Z,{style:[Q9.description,{color:r.labelPrimary,borderBottomColor:r.divider}],children:n(`insulin_helper_body`)}),(0,W.jsxs)(B,{style:Q9.row,children:[(0,W.jsx)(Z,{style:[Q9.textSemiBold,{color:r.labelPrimary}],children:n(`insulin_helper_carb_ratio_input`)}),(0,W.jsx)(Z,{style:[Q9.textSemiBold,{color:r.labelSecondary}],children:x})]}),(0,W.jsx)(Xxn,{}),(0,W.jsxs)(B,{style:Q9.row,children:[(0,W.jsx)(Z,{style:[Q9.textSemiBold,{color:r.labelPrimary}],children:n(`insulin_helper_insulin_sensitivity_input`)}),(0,W.jsx)(Z,{style:[Q9.textSemiBold,{color:r.labelSecondary}],children:b})]})]}),(0,W.jsx)(p9,{}),(0,W.jsx)(B,{children:(0,W.jsx)(aSn,{})})]}),(0,W.jsx)(Q5,{testID:`daily_insulin_dosage_picker`,onCancel:()=>{p(!1)},onConfirm:v,initialScrollIndex:_,isVisible:f,items:tCn})]})}var Q9=R.create({container:{paddingVertical:32,paddingHorizontal:16,gap:24},subheader:{...Y.Poppins.regular_SM,marginBottom:8},explanation:{borderRadius:8,paddingBottom:0},row:{flexDirection:`row`,justifyContent:`space-between`},description:{...Y.Poppins.regular_SM,padding:16,borderBottomWidth:1},textSemiBold:{...Y.Poppins.medium_SM,padding:16}});V();function rCn({setNextEnabled:e,ref:t}){let{t:n}=Tq(),{COLORS:r}=J(),{width:i}=em(),a=N5(),{bottomWithFooterButton:o}=Q4(),{bloodGlucoseUnits:s,parameters:c}=s7();if(!c||!s)throw Error(`[Step5::render] setupCalculatorStoreValues are not defined`);let{setSetupCalculatorStoreValues:l,setTotalDailyDosage:u}=o7(),[d,f]=(0,H.useState)(void 0),[p,m]=(0,H.useState)(void 0),[h,g]=(0,H.useState)(!1),[_,v]=(0,H.useState)(!1),{text:y}=(0,H.useMemo)(()=>L8(s),[s]),{carbohydrateRatio:b,insulinSensitivity:x}=(0,H.useMemo)(()=>c.overallParameters,[c]),S=(0,H.useCallback)(e=>n(`insulin_settings_input_error`,{inputTypeTranslated:n(e===`IS`?`insulin_sensitivity_input`:`insulin-to-carb_ratio_input`)}),[n]);(0,H.useEffect)(()=>{e(!!(x&&b))},[b,x,e]),(0,H.useImperativeHandle)(t,()=>({onBackPress(){u8(l8.SetupInsulinBackPress)},onNextPressed:()=>!b&&!x?(m(S(`ICR`)),f(S(`IS`)),e(!1),{transitionAllowed:!1}):b?x?(m(void 0),f(void 0),u(null),e(!0),u8(l8.SetupInsulinNextPress),{transitionAllowed:!0}):(e(!1),f(S(`IS`)),{transitionAllowed:!1}):(m(S(`ICR`)),e(!1),{transitionAllowed:!1}),validateData(){return{isValid:!!(b&&x)}}}),[b,x,u,e,S]);let C=(0,H.useCallback)(e=>{let t=z8(e,s,X.BloodGlucoseUnit.MMOL_L);l({parameters:{...c,overallParameters:{...c.overallParameters,insulinSensitivity:t}}}),u(null),f(void 0),g(!1)},[s,c,l,u]),w=(0,H.useCallback)(e=>{let t=Number(e.toFixed(1));c.overallParameters.carbohydrateRatio=t,l({parameters:{...c,overallParameters:{...c.overallParameters,carbohydrateRatio:t}}}),u(null),m(void 0),v(!1)},[c,l,u]),T=(0,H.useMemo)(()=>s===X.BloodGlucoseUnit.MMOL_L?$xn:eSn,[s]),E=(0,H.useMemo)(()=>{let e=s===X.BloodGlucoseUnit.MMOL_L?2 .toFixed(1):`36`;if(x===0)return T.findIndex(t=>t===e);let t=B8(x,X.BloodGlucoseUnit.MMOL_L,s);return T.findIndex(e=>e===t)},[T,s,x]),D=(0,H.useMemo)(()=>b===0?R9.findIndex(e=>e===10 .toFixed(1)):R9.findIndex(e=>e===b.toFixed(1)),[b]),O=(0,H.useMemo)(()=>{let e=B8(x,X.BloodGlucoseUnit.MMOL_L,s);return`${x?e:`-`} ${n(`fixed_insulin_settings_sensitivity_unit`,{displayUnit:y})}`},[x,s,y,n]);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(fs,{contentContainerStyle:[iCn.contentContainer,{width:i,paddingTop:a+16,paddingBottom:o}],style:{backgroundColor:r.bgPrimary},children:[(0,W.jsxs)(B,{children:[(0,W.jsx)(d3,{title:n(`insulin-to-carb_ratio_title`)}),(0,W.jsx)(B4,{isAnimated:!!p,children:(0,W.jsx)(Y4,{title:n(`insulin-to-carb_ratio_input`),value:`${b||`-`} ${n(`fixed_insulin_settings_carb_ratio_unit`)}`,valueStyle:{color:r.labelBrand},testID:`carb_ratio`,onPress:()=>{v(!0)},errorMessage:p})})]}),(0,W.jsxs)(B,{children:[(0,W.jsx)(d3,{title:n(`insulin_sensitivity_title`)}),(0,W.jsx)(B4,{isAnimated:!!d,children:(0,W.jsx)(Y4,{title:n(`insulin_sensitivity_input`),value:O,valueStyle:{color:r.labelBrand},testID:`insulin_sensitivity`,onPress:()=>{g(!0)},errorMessage:d})})]}),(0,W.jsx)(p9,{}),(0,W.jsx)(aSn,{})]}),(0,W.jsx)(Q5,{testID:`insulin_sensitivity_picker`,isVisible:h,items:T,initialScrollIndex:E,onConfirm:C,onCancel:()=>{g(!1)}}),(0,W.jsx)(Q5,{testID:`insulin_to_carb_ratio_picker`,isVisible:_,items:R9,initialScrollIndex:D,onConfirm:w,onCancel:()=>{v(!1)}})]})}var iCn=R.create({contentContainer:{paddingTop:32,paddingHorizontal:16,gap:24}});V();function aCn({setNextEnabled:e,ref:t}){let{t:n}=Tq(),{COLORS:r}=J(),{width:i}=em(),a=N5(),{bottomWithFooterButton:o}=Q4(),{bloodGlucoseUnits:s,parameters:c,treatmentType:l,diabetesType:u,birthday:d,biologicalSex:f}=s7(),p=xpn(),{modalStoreActions:m}=z5(),h=(0,H.useCallback)(async()=>{if(s===void 0)throw Error(`[Step6::setUserSettings] bloodGlucoseUnits from userSettingsManager is undefined.`);if(u===void 0)throw Error(`[Step6::setUserSettings] diabetesType from userSettingsManager is undefined.`);if(c===void 0)throw Error(`[Step6::setUserSettings] parameters from newUserSettingsManager is undefined.`);if(d===void 0)throw Error(`[Step6::setUserSettings] birthday from newUserSettingsManager is undefined.`);if(f===void 0)throw Error(`[Step6::setUserSettings] biologicalSex from newUserSettingsManager is undefined.`);let{carbohydrateRatio:e,insulinSensitivity:t}=c.overallParameters,n=O8(t,e,X.Usage.Overall);return k8.postUserSettings({parameters:n,activity:w8(),notifications:lon(),glucoseLevelTargets:ion(),bloodGlucoseUnits:s,treatmentType:l,diabetesType:u,birthday:d,biologicalSex:f})},[d,s,u,f,c,l]);(0,H.useImperativeHandle)(t,()=>({onBackPress(){u8(l8.SetupSummaryBackPress)},onNextPressed:async()=>{u8(l8.SetupSummaryFinishPress);let t=await h();return t?e(!0):m.set({showSyncErrorModal:!0}),{transitionAllowed:t}},validateData(){return{isValid:!0}}}),[e,m,h]);let g=(0,H.useMemo)(()=>{if(s===void 0)throw Error(`[Step6::generalTreatmentItems] bloodGlucoseUnits is undefined`);if(l===void 0)throw Error(`[Step6::generalTreatmentItems] treatmentType is undefined`);if(u===void 0)throw Error(`[Step6::generalTreatmentItems] diabetesType is undefined`);let{text:e}=L8(s),t=K9t(X.InjectionMethod,l),r=u===X.DiabetesType.Type1?`type_of_diabetes_type1`:`type_of_diabetes_type2`;return[{label:n(`summary_setup_input_diabetes_type`),value:n(r),testID:`diabetes-type-result`},{label:n(`summary_setup_input_treatment_type`),value:V9[t](),testID:`treatment-type-result`},{label:n(`summary_setup_input_glucose_unit`),value:e,testID:`glucose-result`}]},[s,u,l,n]),_=(0,H.useMemo)(()=>{if(s===void 0)throw Error(`[Step6::insulinFactorsItems] bloodGlucoseUnits is undefined`);let{text:e}=L8(s),{carbohydrateRatio:t,insulinSensitivity:r}=c?.overallParameters??{};if(t===void 0||r===void 0)throw Error(`[Step6::insulinFactorsItems] carbohydrateRatio or insulinSensitivity is undefined`);return[p?{label:n(`summary_setup_input_daily_dose_input`),value:p.toFixed(0),unit:n(`units`),testID:`total-daily-insulin-result`}:null,{label:n(`summary_setup_input_insulin-to-carb_input`),value:`${t}`,unit:n(`summary_setup_insulin-to-carb_unit`),testID:`carb-ratio-result`},{label:n(`summary_setup_input_insulin_sensitivity_input`),value:B8(r,X.BloodGlucoseUnit.MMOL_L,s),unit:n(`summary_setup_insulin_sensitivity_unit`,{displayUnit:e}),testID:`insulin-sensitivity-result`}].filter(e=>e!==null)},[s,c?.overallParameters,n,p]);return(0,W.jsxs)(fs,{testID:`scroll`,contentContainerStyle:[oCn.scrollContent,{width:i,paddingTop:a+16,paddingBottom:o}],style:{backgroundColor:r.bgPrimary},children:[(0,W.jsx)(p9,{}),(0,W.jsx)(B,{style:oCn.spacer}),(0,W.jsx)(d3,{title:n(`summary_setup_general_title`)}),(0,W.jsx)(Y4.Container,{children:g.map(({testID:e,label:t,value:n,unit:i})=>(0,W.jsx)(Y4,{testID:e,title:t,displayStyle:b9t.List,displayType:J4.ListItem,titleStyle:{color:r.labelPrimary},valueStyle:{color:r.labelSecondary},value:`${n} ${i??``}`},e))}),(0,W.jsx)(B,{style:oCn.spacer}),(0,W.jsx)(d3,{title:n(`summary_setup_insuling_settings_title`)}),(0,W.jsx)(Y4.Container,{children:_.map(({testID:e,label:t,value:n,unit:i})=>(0,W.jsx)(Y4,{testID:e,title:t,displayStyle:b9t.List,displayType:J4.ListItem,titleStyle:{color:r.labelPrimary},valueStyle:{color:r.labelSecondary},value:`${n} ${i??``}`},e))}),(0,W.jsx)(t7,{})]})}var oCn=R.create({scrollContent:{paddingHorizontal:16},spacer:{height:24}});V();var sCn=()=>{let{t:e}=Tq(),{COLORS:t}=J(),{width:n}=em(),{clear:r}=o7(),{setHasCompletedSetupFlow:i,setIsPinSetupShouldBeShown:a}=E3(),o=N$(),[s,c]=(0,H.useState)(2),[l,u]=(0,H.useState)(0),[d,f]=(0,H.useState)(0),[p,m]=(0,H.useState)(!1),[h,g]=(0,H.useState)(!1),_=(0,H.useRef)(null),v=(0,H.useRef)(null);(0,H.useEffect)(()=>{r()},[r]);let y=(0,H.useCallback)(e=>{m(e)},[]),b=(0,H.useCallback)(e=>{g(e===`yes`)},[]),x=(0,H.useMemo)(()=>[{title:e(`general_navigation`),stepNumber:2,renderComponent:e=>(0,W.jsx)(QSn,{ref:e,setNextEnabled:y})},{title:e(`treatment_navigation`),stepNumber:3,renderComponent:e=>(0,W.jsx)($Sn,{ref:e,setNextEnabled:y})},{title:e(`insulin_settings_navigation`),stepNumber:4,renderComponent:e=>(0,W.jsx)(JSn,{ref:e,onOptionSelect:b,setNextEnabled:y})},{title:e(`insulin_settings_navigation`),stepNumber:4,renderComponent:e=>h?(0,W.jsx)(rCn,{ref:e,setNextEnabled:y}):(0,W.jsx)(nCn,{ref:e,setNextEnabled:y})},{title:e(`summary_setup_navigation`),stepNumber:5,renderComponent:e=>(0,W.jsx)(aCn,{ref:e,setNextEnabled:y})}],[b,y,h,e]);(0,H.useEffect)(()=>{o.setOptions({headerTransparent:!0,header:()=>(0,W.jsx)(F5,{title:x[l].title,overlay:!0})})},[l,o,x]),(0,H.useEffect)(()=>{if(!v.current)return;let{isValid:e}=v.current.validateData();m(e)},[l,x]);let S=(0,H.useCallback)(async()=>{if(!v.current)return;let{transitionAllowed:e}=await v.current.onNextPressed();if(e)if(l===x.length-1){Oq||a(!0),i(!0);let e=Oq?{name:I5.QuickGuideStack}:{name:I5.PINCodeSetup,params:{comingFrom:I5.Setup}};o.dispatch(x$({index:0,routes:[e]}))}else{let e=l+1;_.current?.scrollToIndex({index:e,animated:!0}),c(x[e].stepNumber),u(e),f(t=>Math.max(t,e))}},[l,x,o,i,a]),C=(0,H.useCallback)(()=>{if(v.current?.onBackPress(),l===0)o.goBack();else{let e=l-1;_.current?.scrollToIndex({index:e,animated:!0}),c(x[e].stepNumber),u(e),f(t=>Math.max(t,e))}},[l,o,x]);return V$((0,H.useCallback)(()=>{let e=Cf.addEventListener(`hardwareBackPress`,()=>(C(),!0));return()=>{e.remove()}},[C])),(0,W.jsxs)(B,{style:[cCn.container,{backgroundColor:t.bgSecondary}],children:[(0,W.jsx)(Wc,{ref:_,data:x,renderItem:({item:e,index:t})=>t<=d?e.renderComponent(t===l?v:null):(0,W.jsx)(B,{style:{width:n}}),scrollEnabled:!1,horizontal:!0,initialNumToRender:1,showsHorizontalScrollIndicator:!1}),(0,W.jsx)(J9,{currentStep:s,onPress:S,onBackPress:C,inactive:!p,text:l===x.length-1?e(`button_complete`):e(`button_next`)})]})},cCn=R.create({container:{flex:1}});V();var lCn=({isVisible:e,onCancelPress:t,onContinuePress:n,onModalHide:r})=>{let{t:i}=Tq(),{COLORS:a}=J(),[o,s]=(0,H.useState)([!1,!1]),[c,l]=(0,H.useState)(!1),u=(0,H.useMemo)(()=>o.every(Boolean),[o]);(0,H.useEffect)(()=>{e&&(s([!1,!1]),l(!1))},[e]);let d=(0,H.useCallback)(e=>{s(t=>t.map((t,n)=>n===e?!t:t))},[]),f=(0,H.useCallback)(()=>{c&&u&&r()},[u,c,r]),p=(0,H.useCallback)(()=>{l(!0),n()},[n]);return(0,W.jsxs)(u3,{testID:`restrictions_modal`,isVisible:e,enableScroll:!0,onModalHide:f,containerStyle:{backgroundColor:a.bgModal},buttons:[{testID:`restrictions_continue_button`,title:i(`welcome_modal_button_confirm`),onPress:p,disabled:!u},{testID:`restrictions_cancel_button`,title:i(`button_cancel`),type:H4.Secondary,onPress:t}],children:[(0,W.jsx)(Z,{style:$9.title,children:i(`welcome_modal_title`)}),(0,W.jsx)(Z,{style:[$9.subtitle,{color:a.labelSecondary}],children:i(`welcome_modal_body`)}),(0,W.jsxs)(wp,{testID:`restrictions_checkmark_1`,onPress:()=>{d(0)},style:({pressed:e})=>[{opacity:e?.5:1},$9.checkmarkContainer],children:[o[0]?(0,W.jsx)(Y7t,{}):(0,W.jsx)(J7t,{}),(0,W.jsxs)(B,{style:$9.checkmarkTextContainer,children:[(0,W.jsx)(Z,{style:$9.checkmarkTitle,children:i(`welcome_modal_pregnancy_title`)}),(0,W.jsx)(Z,{style:[$9.checkmarkSubtitle,{color:a.labelSecondary}],children:i(`welcome_modal_pregnancy_body`)})]})]}),(0,W.jsx)(B,{style:[$9.separatorLine,{backgroundColor:a.divider}]}),(0,W.jsxs)(wp,{testID:`restrictions_checkmark_2`,onPress:()=>{d(1)},style:({pressed:e})=>[{opacity:e?.5:1},$9.checkmarkContainer],children:[o[1]?(0,W.jsx)(Y7t,{}):(0,W.jsx)(J7t,{}),(0,W.jsxs)(B,{style:$9.checkmarkTextContainer,children:[(0,W.jsx)(Z,{style:$9.checkmarkTitle,children:i(`welcome_modal_gestational_title`)}),(0,W.jsx)(Z,{style:[$9.checkmarkSubtitle,{color:a.labelSecondary}],children:i(`welcome_modal_gestational_body`)})]})]})]})},$9=R.create({title:{...Y.Poppins.bold_2XL,marginTop:32,marginBottom:8},subtitle:{...Y.Poppins.regular_Base,marginBottom:16},checkmarkContainer:{paddingVertical:16,flexDirection:`row`,justifyContent:`space-between`},checkmarkTextContainer:{flex:1,marginLeft:8},checkmarkTitle:{...Y.Poppins.semiBold_Base,marginBottom:2},checkmarkSubtitle:{...Y.Poppins.regular_SM},separatorLine:{width:`100%`,height:1}});V();var uCn=()=>{let{t:e}=Tq(),{navigate:t}=N$(),{clear:n}=o7(),{COLORS:r}=J(),[i,a]=(0,H.useState)(!1);(0,H.useEffect)(()=>{n()},[n]);let o=(0,H.useCallback)(()=>{a(!0),u8(l8.SetupIntroStartPress)},[]);return(0,W.jsxs)(B,{style:[dCn.container,{backgroundColor:r.bgSecondary}],children:[(0,W.jsx)(MSn,{title:e(`setup_account_title`),subtitle:e(`setup_account_body`),stepChecked:1}),(0,W.jsx)(J9,{currentStep:1,isBackVisible:!1,onPress:o,text:e(`button_start`)}),(0,W.jsx)(lCn,{isVisible:i,onCancelPress:()=>{a(!1)},onContinuePress:()=>{a(!1)},onModalHide:()=>{t(I5.Setup)}})]})},dCn=R.create({container:{flex:1}}),{Navigator:fCn,Screen:pCn}=j5(),mCn=()=>{let{t:e}=Tq();return(0,W.jsxs)(fCn,{screenOptions:{...K5},children:[(0,W.jsx)(pCn,{name:I5.SetupStart,component:uCn,options:{header:()=>(0,W.jsx)(F5,{title:e(`setup_account_navigation`),overlay:!0})}}),(0,W.jsx)(pCn,{name:I5.Setup,component:sCn,options:{header:()=>(0,W.jsx)(F5,{title:e(`general_navigation`),overlay:!0})}})]})},{Navigator:hCn,Screen:gCn}=j5(),_Cn=()=>{let{hasCompletedSetupFlow:e}=E3(),t=H.useMemo(()=>e?I5.QuickGuideStack:I5.SetupBolusCalculator,[e]);return(0,W.jsxs)(hCn,{initialRouteName:t,screenOptions:{...K5,headerShown:!1},children:[(0,W.jsx)(gCn,{name:I5.SetupBolusCalculator,component:mCn}),(0,W.jsx)(gCn,{name:I5.QuickGuideStack,component:qSn})]},t)},vCn=()=>{let{isOnboardingFinished:e,setIsOnboardingFinished:t}=E3(),[n,r]=H.useState(!1),i=(0,H.useCallback)(async()=>{if(await q8.syncAll(),!k8.uuid){if(bq.IS_PRODUCTION===`true`)throw window.location.href=`/redirect?status=error`,Error(`[App::syncData] User settings not found`);k8.updateMockUserSettings()}t(a8t(X.BloodGlucoseUnit).safeParse(k8.glucoseUnit).success)},[t]);return(0,H.useEffect)(()=>{i().catch(console.error).finally(()=>{r(!0)})},[i]),!n||e===void 0?(0,W.jsx)(x2,{}):e?(0,W.jsx)(jSn,{}):(0,W.jsx)(_Cn,{})},yCn={prefixes:[],config:{path:`app`,screens:{SetupBolusCalculator:{path:`setup-bolus-calculator`,screens:{SetupStart:`setup-start`,Setup:`setup`}},QuickGuideStack:{path:`quick-guide`,screens:{QuickGuideStart:`quick-guide-start`,QuickGuide:`quick-guide`,QuickGuideAllSet:`quick-guide-all-set`}},NewCalculationStack:{path:`new-calculation`,screens:{Calculation:``,LoadingRecommendation:{path:`loading`},Recommendation:{path:`recommendation`},LeavingRecommendation:{path:`leaving`}}},IFU:`ifu`,SettingsStack:{path:`settings`,screens:{Settings:``,ProfileStack:`profile`,GlucoseSettings:`glucose`,ActivitySettings:`activity`,InsulinSettingsStack:{path:`insulin-settings`,screens:{InsulinSettings:``,TreatmentType:`treatment-type`,RapidActingInsulin:`rapid-acting-insulin`,LongActingInsulin:`long-acting-insulin`}},IFU:`ifu`,Legal:`legal`,GlucoseUnit:`glucose-unit`}}}}};Z0();var bCn=yWt(),xCn=document.querySelector(`meta[name="sentry-environment"]`)?.content;bq.SENTRY_ENABLED===`true`&&W1t({dsn:bq.SENTRY_DSN,environment:xCn||bq.SENTRY_ENVIRONMENT,release:`hedia-web@3.9.0+1237`,dist:`1237`,beforeSend:(e,t)=>{let n=e.exception?.values?.[0],r=[n?.type,n?.value].filter(Boolean).join(`: `);if(r.includes(gvt.NetworkErrorFailure)||r.includes(gvt.NetworkErrorTimeout)||bq.IS_PRODUCTION===`false`&&r.includes(gvt.TranslationError))return null;if(t.originalException instanceof w2){let{statusCode:n,method:r,url:i,responseBody:a}=t.originalException;e.tags={...e.tags,"http.status":String(n),"http.method":r},e.contexts={...e.contexts,response:{status:n,url:i,method:r,body:a}}}return e.user&&(delete e.user.email,delete e.user.ip_address,delete e.user.username,delete e.user.geo),e}});var SCn=()=>(0,W.jsx)(q3t,{children:(0,W.jsx)(sSt,{children:(0,W.jsx)(S4t,{children:(0,W.jsx)(C2t,{children:(0,W.jsx)(z0t,{client:B4t,children:(0,W.jsx)(PKt,{theme:Z3t(),ref:bCn,linking:yCn,children:(0,W.jsx)(LUt,{children:(0,W.jsx)(vCn,{})})})})})})})}),CCn=u(y());Svt(),CCn.createRoot(document.getElementById(`root`)).render((0,W.jsx)(SCn,{}));
|
|
902
|
+
`)};t(),document.head.contains(e)||document.head.appendChild(e),window.addEventListener(`resize`,t),o=()=>{window.removeEventListener(`resize`,t)}}else document.getElementById(i)?.remove();return a(e===t.width&&n===t.height),o},[t.height,t.width]),(0,W.jsx)(B,{...r,pointerEvents:`box-none`,style:[e&&i?fdn.page:fdn.card,n]})}var fdn=R.create({page:{minHeight:`100%`},card:{flex:1,overflow:`hidden`}});V();var pdn=.3,mdn=1,E5=0,hdn=z.OS!==`web`,gdn=e=>{if(e){let t=R.flatten(e);return`opacity`in t&&t.opacity!=null}return!1},_dn=({closing:e,layout:t,gestureDirection:n,direction:r,preloaded:i})=>!e&&!i?0:p5(t,n,r===`rtl`),vdn=({style:e})=>e?(0,W.jsx)(lf.View,{pointerEvents:`none`,style:[D5.overlay,e]}):null;function ydn({shadowEnabled:e=!1,gestureEnabled:t=!0,gestureVelocityImpact:n=pdn,overlay:r=vdn,animated:i,interpolationIndex:a,opening:o,closing:s,next:c,current:l,gesture:u,layout:d,insets:f,direction:p,pageOverflowEnabled:m,gestureDirection:h,onOpen:g,onClose:_,onTransition:v,onGestureBegin:y,onGestureCanceled:b,onGestureEnd:x,children:S,overlayEnabled:C,gestureResponseDistance:w,transitionSpec:T,preloaded:E,styleInterpolator:D,containerStyle:O,contentStyle:k}){let A=H.useRef(!1),ee=H.useRef(void 0),te=H.useRef(void 0),ne=H.useRef(void 0),re=H.useRef(void 0),ie=H.useRef(void 0),[j]=H.useState(()=>new lf.Value(E5)),[ae]=H.useState(()=>new lf.Value(f5(h,p===`rtl`))),[oe]=H.useState(()=>({width:new lf.Value(d.width),height:new lf.Value(d.height)})),[se]=H.useState(()=>new lf.Value(E5)),M=T$(()=>{te.current===void 0&&(te.current=Ts.createInteractionHandle())}),ce=T$(()=>{te.current!==void 0&&(Ts.clearInteractionHandle(te.current),te.current=void 0)}),N=T$(({closing:e,velocity:t})=>{let n=_dn({closing:e,layout:d,gestureDirection:h,direction:p,preloaded:E});ee.current=n,j.setValue(e?mdn:E5);let r=e?T.close:T.open,a=r.animation===`spring`?lf.spring:lf.timing;clearTimeout(re.current),ne.current!==void 0&&cancelAnimationFrame(ne.current),v?.({closing:e,gesture:t!==void 0});let o=()=>{e?_():g(),ne.current=requestAnimationFrame(()=>{de()})};i?(M(),a(u,{...r.config,velocity:t,toValue:n,useNativeDriver:hdn,isInteraction:!1}).start(({finished:e})=>{ce(),clearTimeout(re.current),e&&o()})):o()}),P=T$(({nativeEvent:e})=>{switch(e.state){case d5.ACTIVE:clearTimeout(re.current),clearTimeout(ie.current),se.setValue(mdn),M(),y?.();break;case d5.CANCELLED:case d5.FAILED:se.setValue(E5),ce(),N({closing:s,velocity:h===`vertical`||h===`vertical-inverted`?e.velocityY:e.velocityX}),b?.();break;case d5.END:{se.setValue(E5);let t,r,i;h===`vertical`||h===`vertical-inverted`?(t=d.height,r=e.translationY,i=e.velocityY):(t=d.width,r=e.translationX,i=e.velocityX);let a=(r+i*n)*f5(h,p===`rtl`)>t/2?i!==0||r!==0:s;N({closing:a,velocity:i}),a&&(re.current=setTimeout(()=>{_(),ie.current=setTimeout(()=>{de()},32)},16)),x?.();break}}});H.useLayoutEffect(()=>{oe.width.setValue(d.width),oe.height.setValue(d.height),ae.setValue(f5(h,p===`rtl`))},[h,p,ae,oe.width,oe.height,d.width,d.height]);let le=H.useRef(null);H.useEffect(()=>()=>{ce(),ne.current&&cancelAnimationFrame(ne.current),clearTimeout(re.current),clearTimeout(ie.current)},[]);let ue=H.useRef(void 0),de=T$(()=>{if(clearTimeout(re.current),clearTimeout(ie.current),!A.current)clearTimeout(ue.current),ue.current=setTimeout(()=>{A.current=!0,N({closing:s})},0);else{let e=le.current?.opening,t=le.current?_dn(le.current):null,n=_dn({closing:s,layout:d,gestureDirection:h,direction:p,preloaded:E});t!==n||ee.current!==n?N({closing:s}):typeof e==`boolean`&&o&&!e&&(u.setValue(p5(d,h,p===`rtl`)),N({closing:s}))}});H.useEffect(()=>{E||(de(),le.current={opening:o,closing:s,layout:d,gestureDirection:h,direction:p,preloaded:E})},[N,s,p,u,h,d,o,E,de]);let fe=H.useMemo(()=>({index:a,current:{progress:l},next:c&&{progress:c},closing:j,swiping:se,inverted:ae,layouts:{screen:d},insets:{top:f.top,right:f.right,bottom:f.bottom,left:f.left}}),[a,l,c,j,se,ae,d,f.top,f.right,f.bottom,f.left]),{containerStyle:pe,cardStyle:me,overlayStyle:he,shadowStyle:ge}=H.useMemo(()=>D(fe),[D,fe]),F=H.useMemo(()=>t?lf.event([{nativeEvent:h===`vertical`||h===`vertical-inverted`?{translationY:u}:{translationX:u}}],{useNativeDriver:hdn}):void 0,[u,h,t]),{backgroundColor:_e}=R.flatten(k||{}),I=typeof _e==`string`?(0,o5.default)(_e).alpha()===0:!1;return(0,W.jsxs)(odn.Provider,{value:fe,children:[z.OS===`web`?null:(0,W.jsx)(lf.View,{style:{opacity:l},collapsable:!1}),C?(0,W.jsx)(B,{pointerEvents:`box-none`,style:R.absoluteFill,children:r({style:he})}):null,(0,W.jsx)(lf.View,{pointerEvents:`box-none`,style:[D5.container,pe,O],children:(0,W.jsx)(uln,{enabled:d.width!==0&&t,onGestureEvent:F,onHandlerStateChange:P,...ldn({layout:d,direction:p,gestureDirection:h,gestureResponseDistance:w}),children:(0,W.jsxs)(lf.View,{pointerEvents:`box-none`,needsOffscreenAlphaCompositing:gdn(me),style:[D5.container,me],children:[e&&ge&&!I?(0,W.jsx)(lf.View,{pointerEvents:`none`,style:[D5.shadow,h===`horizontal`?[D5.shadowHorizontal,D5.shadowStart]:h===`horizontal-inverted`?[D5.shadowHorizontal,D5.shadowEnd]:h===`vertical`?[D5.shadowVertical,D5.shadowTop]:[D5.shadowVertical,D5.shadowBottom],{backgroundColor:_e},ge]}):null,(0,W.jsx)(ddn,{enabled:m,layout:d,style:k,children:S})]})})})]})}var D5=R.create({container:{flex:1},overlay:{flex:1,backgroundColor:`#000`},shadow:{position:`absolute`},shadowHorizontal:{top:0,bottom:0,width:3,...udn({offset:{width:-1,height:1},radius:5,opacity:.3})},shadowStart:{start:0},shadowEnd:{end:0},shadowVertical:{start:0,end:0,height:3,...udn({offset:{width:1,height:-1},radius:5,opacity:.3})},shadowTop:{top:0},shadowBottom:{bottom:0}});V();var bdn=H.forwardRef(({focused:e,active:t,animated:n,isNextScreenTransparent:r,detachCurrentScreen:i,children:a},o)=>{let[s,c]=H.useState(!1);H.useImperativeHandle(o,()=>({setInert:c}),[]);let l=!n&&r===!1&&i!==!1&&!e;return(0,W.jsx)(B,{"aria-hidden":!e,pointerEvents:(n?s:!e)?`none`:`box-none`,style:[R.absoluteFill,{overflow:t?void 0:`hidden`,display:z.OS!==`web`&&l?`none`:`flex`,visibility:l?`hidden`:`visible`}],collapsable:!1,children:a})});bdn.displayName=`CardA11yWrapper`,V();var xdn=.1;function Sdn({interpolationIndex:e,index:t,active:n,opening:r,closing:i,gesture:a,focused:o,modal:s,getPreviousScene:c,getFocusedRoute:l,hasAbsoluteFloatHeader:u,headerHeight:d,onHeaderHeightChange:f,isParentHeaderShown:p,isNextScreenTransparent:m,detachCurrentScreen:h,layout:g,onCloseRoute:_,onOpenRoute:v,onGestureCancel:y,onGestureEnd:b,onGestureStart:x,onTransitionEnd:S,onTransitionStart:C,preloaded:w,renderHeader:T,safeAreaInsetBottom:E,safeAreaInsetLeft:D,safeAreaInsetRight:O,safeAreaInsetTop:k,scene:A}){let ee=H.useRef(null),{direction:te}=K$(),ne=H.useContext(nln),{options:re}=A.descriptor,{onPageChangeStart:ie,onPageChangeCancel:j,onPageChangeConfirm:ae}=adn({enabled:o&&re.keyboardHandlingEnabled!==!1,focused:o}),oe=()=>{let{route:e}=A.descriptor;S({route:e},!1),v({route:e})},se=()=>{let{route:e}=A.descriptor;S({route:e},!0),_({route:e})},M=()=>{let{route:e}=A.descriptor;ie(),x({route:e})},ce=()=>{let{route:e}=A.descriptor;j(),y({route:e})},N=()=>{let{route:e}=A.descriptor;b({route:e})},P=({closing:e,gesture:t})=>{ee.current?.setInert(e);let{route:r}=A.descriptor;ae?.({gesture:t,active:n,closing:e}),C?.({route:r},e)},le={top:k,right:O,bottom:E,left:D},{colors:ue}=B$();H.useEffect(()=>{let e=A.progress.next?.addListener?.(({value:e})=>{ee.current?.setInert(e>xdn)});return()=>{e&&A.progress.next?.removeListener?.(e)}},[A.progress.next]);let{presentation:de,animation:fe,cardOverlay:pe,cardOverlayEnabled:me,cardShadowEnabled:he,cardStyle:ge,cardStyleInterpolator:F,gestureDirection:_e,gestureEnabled:I,gestureResponseDistance:ve,gestureVelocityImpact:ye,headerMode:be,headerShown:xe,headerTransparent:L,transitionSpec:Se}=A.descriptor.options,{buildHref:Ce}=RKt(),we=c({route:A.descriptor.route}),Te,Ee;if(we){let{options:e,route:t}=we.descriptor;Te=Ecn(e,t.name),Ee=Ce(t.name,t.params)}let De=we!=null,Oe=H.useMemo(()=>{if(De)return{href:Ee,title:Te}},[De,Te,Ee]),ke=fe!==`none`;return(0,W.jsx)(bdn,{ref:ee,focused:o,active:n,animated:ke,isNextScreenTransparent:m,detachCurrentScreen:h,children:(0,W.jsx)(ydn,{animated:ke,interpolationIndex:e,gestureDirection:_e,layout:g,insets:le,direction:te,gesture:a,current:A.progress.current,next:A.progress.next,opening:r,closing:i,onOpen:oe,onClose:se,overlay:pe,overlayEnabled:me,shadowEnabled:he,onTransition:P,onGestureBegin:M,onGestureCanceled:ce,onGestureEnd:N,gestureEnabled:t===0?!1:I,gestureResponseDistance:ve,gestureVelocityImpact:ye,transitionSpec:Se,styleInterpolator:F,pageOverflowEnabled:be!==`float`&&de!==`modal`,preloaded:w,containerStyle:u&&be!==`screen`?{marginTop:d}:null,contentStyle:[{backgroundColor:de===`transparentModal`?`transparent`:ue.background},ge],children:(0,W.jsx)(B,{style:wdn.container,children:(0,W.jsxs)(lln.Provider,{value:s,children:[be===`float`?null:T({mode:`screen`,layout:g,scenes:[we,A],getPreviousScene:c,getFocusedRoute:l,onContentHeightChange:f,style:[wdn.header,L?{minHeight:d}:null]}),(0,W.jsx)(B,{style:wdn.scene,children:(0,W.jsx)(tln.Provider,{value:Oe,children:(0,W.jsx)(l5.Provider,{value:p||xe!==!1,children:(0,W.jsx)(nln.Provider,{value:xe===!1?ne??0:d,children:A.descriptor.render()})})})})]})})})})}var Cdn=H.memo(Sdn),wdn=R.create({container:{flex:1},header:{zIndex:1},scene:{flex:1}});V();var Tdn={default:e5,fade:tcn,fade_from_bottom:Xsn,fade_from_right:$sn,none:e5,reveal_from_bottom:Zsn,scale_from_center:Qsn,slide_from_left:rcn,slide_from_right:$8,slide_from_bottom:z.select({ios:Jsn,default:ecn})},Edn=1e-5,O5=0,Ddn=1,Odn=2,kdn=Object.freeze({options:{}}),Adn=(e,t)=>{let{cardStyleInterpolator:n}=e[t].descriptor.options,r=0;for(let i=t-1;i>=0&&e[i]?.descriptor.options.cardStyleInterpolator===n;i--)r++;return r},k5=e=>e===Esn||e.name===`forModalPresentationIOS`,jdn=(e,t,n)=>{if(n)return!0;let{cardStyleInterpolator:r}=e.descriptor.options;return k5(r)&&t!==0},Mdn=(e,t,n,r,i,a)=>e.reduce((o,s,c)=>{let{headerStatusBarHeight:l=n?0:t.top,headerStyle:u}=s.descriptor.options,d=R.flatten(u||{}),f=`height`in d&&typeof d.height==`number`?d.height:a[s.route.key],p=jdn(s,Adn(e,c),r);return o[s.route.key]=typeof f==`number`?f:Tcn(i,p,l),o},{}),Ndn=(e,t,n)=>{if(t?.gestureDirection)return p5(e,t.gestureDirection,n);let r=t?.presentation===`modal`?ncn.gestureDirection:e5.gestureDirection;return p5(e,t?.animation?Tdn[t?.animation]?.gestureDirection:r,n)},Pdn=(e,t,n,r)=>{let i=Ndn({width:Math.max(1,t.width),height:Math.max(1,t.height)},n,r);return i>0?e.interpolate({inputRange:[0,i],outputRange:[1,0]}):e.interpolate({inputRange:[i,0],outputRange:[0,1]})};function Fdn(e){let t=z.OS!==`web`&&z.OS!==`windows`&&z.OS!==`macos`;return e??(t?`default`:`none`)}function Idn(e){return Fdn(e)!==`none`}var Ldn=class extends H.Component{static getDerivedStateFromProps(e,t){if(e.routes===t.routes&&e.descriptors===t.descriptors)return null;let n=[...e.routes,...e.state.preloadedRoutes].reduce((n,r)=>{let i=e.descriptors[r.key]||e.preloadedDescriptors[r.key],{animation:a}=i?.options||{};return n[r.key]=t.gestures[r.key]||new lf.Value(e.openingRouteKeys.includes(r.key)&&Idn(a)||e.state.preloadedRoutes.includes(r)?Ndn(t.layout,i?.options,e.direction===`rtl`):0),n},{}),r=vln([...e.routes,...e.state.preloadedRoutes],{...e.descriptors,...e.preloadedDescriptors}),i=[...e.routes,...e.state.preloadedRoutes].map((i,a,o)=>{let s=e.state.preloadedRoutes.includes(i),c=s?void 0:o[a-1],l=s?void 0:o[a+1],u=t.scenes[a],d=n[i.key],f=c?n[c.key]:void 0,p=l?n[l.key]:void 0,m=(s?e.preloadedDescriptors:e.descriptors)[i.key]||t.descriptors[i.key]||(u?u.descriptor:kdn),h=l&&(e.descriptors[l?.key]||t.descriptors[l?.key])?.options,g=c&&(e.descriptors[c?.key]||t.descriptors[c?.key])?.options,_=a!==o.length-1&&h&&h?.presentation!==`transparentModal`?h:m.options,v=r.includes(i.key),y=Fdn(_.animation),b=Idn(y),x=y==="default"?_.presentation===`transparentModal`?tcn:_.presentation===`modal`||v?ncn:e5:Tdn[y],{gestureEnabled:S=z.OS===`ios`&&b,gestureDirection:C=x.gestureDirection,transitionSpec:w=x.transitionSpec,cardStyleInterpolator:T=b?x.cardStyleInterpolator:Nsn,headerStyleInterpolator:E=x.headerStyleInterpolator,cardOverlayEnabled:D=z.OS!==`ios`&&_.presentation!==`transparentModal`||k5(T)}=_,O=m.options.headerMode??(!(_.presentation===`modal`||_.presentation===`transparentModal`||h?.presentation===`modal`||h?.presentation===`transparentModal`||k5(T))&&z.OS===`ios`&&m.options.header===void 0?`float`:`screen`),k=e.direction===`rtl`,A={route:i,descriptor:{...m,options:{...m.options,animation:y,cardOverlayEnabled:D,cardStyleInterpolator:T,gestureDirection:C,gestureEnabled:S,headerStyleInterpolator:E,transitionSpec:w,headerMode:O}},progress:{current:Pdn(d,t.layout,m.options,k),next:p&&h?.presentation!==`transparentModal`?Pdn(p,t.layout,h,k):void 0,previous:f?Pdn(f,t.layout,g,k):void 0},__memo:[t.layout,m,h,g,d,p,f]};return u&&A.__memo.every((e,t)=>u.__memo[t]===e)?u:A}),a=t.activeStates;if(e.routes.length!==t.routes.length){let n=1;for(let t=e.routes.length-1;t>=0;t--){let{options:r}=i[t].descriptor,{detachPreviousScreen:a=r.presentation===`transparentModal`?!1:k5(r.cardStyleInterpolator)?t!==_ln(i,e=>{let{cardStyleInterpolator:t}=e.descriptor.options;return t===Esn||t?.name===`forModalPresentationIOS`}):!0}=r;if(a===!1)n++;else if(t<=e.routes.length-2)break}a=e.routes.map((e,r,a)=>{let o,s=t.activeStates[r],c=r>=a.length-n;if(s===O5&&!c)o=O5;else{let e=i[a.length-1],t=r===a.length-1?Odn:c?Ddn:O5;o=e?e.progress.current.interpolate({inputRange:[0,1-Edn,1],outputRange:[1,1,t],extrapolate:`clamp`}):Ddn}return o})}return{routes:e.routes,scenes:i,gestures:n,descriptors:e.descriptors,activeStates:a,headerHeights:Mdn(i,e.insets,e.isParentHeaderShown,e.isParentModal,t.layout,t.headerHeights)}}constructor(e){super(e),this.state={routes:[],scenes:[],gestures:{},layout:sln.initialMetrics.frame,descriptors:this.props.descriptors,activeStates:[],headerHeights:{}}}handleLayout=e=>{let{height:t,width:n}=e.nativeEvent.layout,r={width:n,height:t};this.setState((e,i)=>t===e.layout.height&&n===e.layout.width?null:{layout:r,headerHeights:Mdn(e.scenes,i.insets,i.isParentHeaderShown,i.isParentModal,r,e.headerHeights)})};handleHeaderLayout=({route:e,height:t})=>{this.setState(({headerHeights:n})=>n[e.key]===t?null:{headerHeights:{...n,[e.key]:t}})};getFocusedRoute=()=>{let{state:e}=this.props;return e.routes[e.index]};getPreviousScene=({route:e})=>{let{getPreviousRoute:t}=this.props,{scenes:n}=this.state,r=t({route:e});if(r)return n.find(e=>e.descriptor.route.key===r.key)};render(){let{insets:e,state:t,routes:n,openingRouteKeys:r,closingRouteKeys:i,onOpenRoute:a,onCloseRoute:o,renderHeader:s,isParentHeaderShown:c,isParentModal:l,onTransitionStart:u,onTransitionEnd:d,onGestureStart:f,onGestureEnd:p,onGestureCancel:m,detachInactiveScreens:h=z.OS===`web`||z.OS===`android`||z.OS===`ios`}=this.props,{scenes:g,layout:_,gestures:v,activeStates:y,headerHeights:b}=this.state,x=t.routes[t.index],S=b[x.key],C=this.state.scenes.slice(-2).some(e=>{let{headerMode:t,headerTransparent:n,headerShown:r=!0}=e.descriptor.options??{};return!!(n||r===!1||t===`screen`)});return(0,W.jsxs)(B,{style:A5.container,children:[s({mode:`float`,layout:_,scenes:g,getPreviousScene:this.getPreviousScene,getFocusedRoute:this.getFocusedRoute,onContentHeightChange:this.handleHeaderLayout,style:[A5.floating,C&&[{height:S},A5.absolute]]}),(0,W.jsx)(rdn,{enabled:h,style:A5.container,onLayout:this.handleLayout,children:[...n,...t.preloadedRoutes].map((S,w)=>{let T=x.key===S.key,E=v[S.key],D=g[w],O=t.preloadedRoutes.includes(S)&&!n.includes(S);if(t.preloadedRoutes.includes(S)&&n.includes(S)&&w>=n.length)return null;let{headerShown:k=!0,headerTransparent:A,freezeOnBlur:ee,autoHideHomeIndicator:te}=D.descriptor.options,ne=e.top,re=e.right,ie=e.bottom,j=e.left,ae=k===!1?0:b[S.key],oe=Adn(g,w),se=jdn(D,oe,l),M=g[w+1]?.descriptor.options.presentation===`transparentModal`,ce=g[w+1]?.descriptor.options.detachPreviousScreen!==!1,N=O?O5:y[w];return(0,W.jsx)(idn,{style:[R.absoluteFill],enabled:h,active:N,freezeOnBlur:ee,shouldFreeze:N===O5&&!O,homeIndicatorHidden:te,pointerEvents:`box-none`,children:(0,W.jsx)(Cdn,{index:w,interpolationIndex:oe,modal:se,active:w===n.length-1,focused:T,opening:r.includes(S.key),closing:i.includes(S.key),layout:_,gesture:E,scene:D,safeAreaInsetTop:ne,safeAreaInsetRight:re,safeAreaInsetBottom:ie,safeAreaInsetLeft:j,onGestureStart:f,onGestureCancel:m,onGestureEnd:p,headerHeight:ae,isParentHeaderShown:c,onHeaderHeightChange:this.handleHeaderLayout,getPreviousScene:this.getPreviousScene,getFocusedRoute:this.getFocusedRoute,hasAbsoluteFloatHeader:C&&!A,renderHeader:s,onOpenRoute:a,onCloseRoute:o,onTransitionStart:u,onTransitionEnd:d,isNextScreenTransparent:M,detachCurrentScreen:ce,preloaded:O})},S.key)})})]})}},A5=R.create({container:{flex:1},absolute:{position:`absolute`,top:0,start:0,end:0},floating:{zIndex:1}});V(),Z0();var Rdn=dln??B,zdn=(e,t)=>e.length===t.length&&e.every((e,n)=>Object.is(e,t[n])),Bdn=class extends H.Component{static getDerivedStateFromProps(e,t){let n=[...e.state.routes,...e.state.preloadedRoutes],r=t.previousState?[...t.previousState.routes,...t.previousState.preloadedRoutes]:[];if(zdn(n.map(e=>e.key),r.map(e=>e.key))&&t.routes.length){let i=t.routes.filter(n=>t.closingRouteKeys.includes(n.key)&&!e.state.routes.some(e=>e.key===n.key)),a=t.routes.filter(n=>t.replacingRouteKeys.includes(n.key)&&!e.state.routes.some(e=>e.key===n.key)),o=e.state.routes.slice();if(a.length&&o.splice(o.length-1,0,...a),i.length&&o.push(...i),!zdn(n,r)){let e=n.reduce((e,t)=>(e[t.key]=t,e),{});o=o.map(t=>e[t.key]||t)}let s=[...o,...e.state.preloadedRoutes].reduce((n,r)=>(n[r.key]=e.descriptors[r.key]||t.descriptors[r.key],n),{});return{routes:o,previousState:e.state,descriptors:s}}let i=e.state.index<e.state.routes.length-1?e.state.routes.slice(0,e.state.index+1):e.state.routes,{openingRouteKeys:a,closingRouteKeys:o,replacingRouteKeys:s}=t;o=o.filter(e=>!i.some(t=>t.key===e)),s=s.filter(e=>!i.some(t=>t.key===e));let c=t.previousState?t.previousState.routes[t.previousState.index]:void 0,l=i[i.length-1],u=n=>Idn((e.descriptors[n]||t.descriptors[n])?.options.animation),d=n=>(e.descriptors[n]||t.descriptors[n]).options.animationTypeForReplace??`push`;if(c&&c.key!==l.key){if(r.some(e=>e.key===l.key)&&!i.some(e=>e.key===c.key))u(c.key)&&!o.includes(c.key)&&(o=[...o,c.key],a=a.filter(e=>e!==c.key),s=s.filter(e=>e!==c.key),i=[...i,c]);else if(u(l.key)&&!a.includes(l.key)&&(a=[...a,l.key],o=o.filter(e=>e!==l.key),s=s.filter(e=>e!==l.key),!i.some(e=>e.key===c.key)))if(a=a.filter(e=>e!==c.key),d(l.key)===`pop`)o=[...o,c.key],a=a.filter(e=>e!==l.key),i=[...i,c];else{s=[...s,c.key],o=o.filter(e=>e!==c.key),i=i.slice(),i.splice(i.length-1,0,c);let e=t.routes.filter(e=>s.includes(e.key)&&!i.some(t=>t.key===e.key));e.length&&i.splice(i.length-2,0,...e)}}else (s.length||o.length)&&(i=i.slice(),i.splice(i.length-1,0,...t.routes.filter(({key:e})=>u(e)?s.includes(e)||o.includes(e):!1)));if(!i.length)throw Error(`There should always be at least one route in the navigation state.`);let f=[...i,...e.state.preloadedRoutes].reduce((n,r)=>(n[r.key]=e.descriptors[r.key]||t.descriptors[r.key],n),{});return{routes:i,previousState:e.state,openingRouteKeys:a,closingRouteKeys:o,replacingRouteKeys:s,descriptors:f}}state={routes:[],previousState:void 0,openingRouteKeys:[],closingRouteKeys:[],replacingRouteKeys:[],descriptors:{}};getPreviousRoute=({route:e})=>{let{closingRouteKeys:t,replacingRouteKeys:n}=this.state,r=this.state.routes.filter(r=>r.key===e.key||!t.includes(r.key)&&!n.includes(r.key));return r[r.findIndex(t=>t.key===e.key)-1]};renderHeader=e=>(0,W.jsx)(hln,{...e});handleOpenRoute=({route:e})=>{let{state:t,navigation:n}=this.props,{closingRouteKeys:r,replacingRouteKeys:i}=this.state;r.some(t=>t===e.key)&&i.every(t=>t!==e.key)&&t.routeNames.includes(e.name)&&!t.routes.some(t=>t.key===e.key)?n.dispatch(t=>{let n=[...t.routes.filter(t=>t.key!==e.key),e];return x$({...t,routes:n,index:n.length-1})}):this.setState(t=>{let n=t.routes.findIndex(t=>t.key===e.key),r=new Set(t.routes.slice(0,n).filter(e=>t.replacingRouteKeys.includes(e.key)).map(e=>e.key));return{routes:t.routes.filter(e=>!r.has(e.key)),openingRouteKeys:t.openingRouteKeys.filter(t=>t!==e.key),closingRouteKeys:t.closingRouteKeys.filter(t=>t!==e.key),replacingRouteKeys:t.replacingRouteKeys.filter(e=>!r.has(e))}})};handleCloseRoute=({route:e})=>{let{state:t,navigation:n}=this.props;t.routes.some(t=>t.key===e.key)?n.dispatch({...w$.pop(),source:e.key,target:t.key}):this.setState(t=>({routes:t.routes.filter(t=>t.key!==e.key),openingRouteKeys:t.openingRouteKeys.filter(t=>t!==e.key),closingRouteKeys:t.closingRouteKeys.filter(t=>t!==e.key)}))};handleTransitionStart=({route:e},t)=>this.props.navigation.emit({type:`transitionStart`,data:{closing:t},target:e.key});handleTransitionEnd=({route:e},t)=>this.props.navigation.emit({type:`transitionEnd`,data:{closing:t},target:e.key});handleGestureStart=({route:e})=>{this.props.navigation.emit({type:`gestureStart`,target:e.key})};handleGestureEnd=({route:e})=>{this.props.navigation.emit({type:`gestureEnd`,target:e.key})};handleGestureCancel=({route:e})=>{this.props.navigation.emit({type:`gestureCancel`,target:e.key})};render(){let{state:e,descriptors:t,...n}=this.props,{routes:r,descriptors:i,openingRouteKeys:a,closingRouteKeys:o}=this.state,s=e.preloadedRoutes.reduce((e,t)=>(e[t.key]=e[t.key]||this.props.describe(t,!0),e),{});return(0,W.jsx)(Rdn,{style:Vdn.container,children:(0,W.jsx)(sln,{children:(0,W.jsx)(K0.Consumer,{children:t=>(0,W.jsx)(lln.Consumer,{children:c=>(0,W.jsx)(l5.Consumer,{children:l=>(0,W.jsx)(Ldn,{insets:t,isParentHeaderShown:l,isParentModal:c,getPreviousRoute:this.getPreviousRoute,routes:r,openingRouteKeys:a,closingRouteKeys:o,onOpenRoute:this.handleOpenRoute,onCloseRoute:this.handleCloseRoute,onTransitionStart:this.handleTransitionStart,onTransitionEnd:this.handleTransitionEnd,renderHeader:this.renderHeader,state:e,descriptors:i,onGestureStart:this.handleGestureStart,onGestureEnd:this.handleGestureEnd,onGestureCancel:this.handleGestureCancel,preloadedDescriptors:s,...n})})})})})})}},Vdn=R.create({container:{flex:1}});function Hdn({id:e,initialRouteName:t,UNSTABLE_routeNamesChangeBehavior:n,children:r,layout:i,screenListeners:a,screenOptions:o,screenLayout:s,UNSTABLE_router:c,...l}){let{direction:u}=K$(),{state:d,describe:f,descriptors:p,navigation:m,NavigationContent:h}=yKt(gWt,{id:e,initialRouteName:t,UNSTABLE_routeNamesChangeBehavior:n,children:r,layout:i,screenListeners:a,screenOptions:o,screenLayout:s,UNSTABLE_router:c});return H.useEffect(()=>m.addListener?.(`tabPress`,e=>{let t=m.isFocused();requestAnimationFrame(()=>{d.index>0&&t&&!e.defaultPrevented&&m.dispatch({...w$.popToTop(),target:d.key})})}),[m,d.index,d.key]),(0,W.jsx)(h,{children:(0,W.jsx)(Bdn,{...l,direction:u,state:d,describe:f,descriptors:p,navigation:m})})}function j5(e){return XWt(Hdn)(e)}V();var Udn={blurredTopClearBottom:`linear-gradient(to bottom, #000 0%, #000 50%, transparent 100%)`,blurredBottomClearTop:`linear-gradient(to top, #000 0%, #000 50%, transparent 100%)`,blurredCenterClearTopAndBottom:`linear-gradient(to bottom, transparent 0%, #000 50%, transparent 100%)`},Wdn=`blur(5px)`,Gdn=({direction:e,style:t})=>{let n=Udn[e];return(0,W.jsx)(B,{style:[t,{backdropFilter:Wdn,WebkitBackdropFilter:Wdn,maskImage:n,WebkitMaskImage:n}],pointerEvents:`none`})};V();var Kdn=50,M5=44,qdn=44,Jdn=10,Ydn=54,Xdn=6;function N5(e=!1){let{top:t}=Q4();return(e?16:t)+Ydn}var Zdn=(0,H.memo)(function({title:e,LeftButton:t,RightButton:n,BottomContent:r,hasHeaderRow:i,style:a}){let[o,s]=(0,H.useState)(M5),[c,l]=(0,H.useState)(M5),{COLORS:u}=J(),d=(0,H.useMemo)(()=>Math.max(o,c,M5),[o,c]),f=(0,H.useCallback)(e=>{let t=Math.round(e.nativeEvent.layout.width);t&&t!==o&&s(t)},[o]),p=(0,H.useCallback)(e=>{let t=Math.round(e.nativeEvent.layout.width);t&&t!==c&&l(t)},[c]);return(0,W.jsxs)(B,{style:a,children:[i&&(0,W.jsxs)(B,{style:P5.headerRow,children:[(0,W.jsx)(B,{style:[P5.sideContainer,{minWidth:d}],onLayout:f,children:t??(0,W.jsx)(B,{style:{minWidth:d}})}),e?(0,W.jsx)(Z,{style:[P5.headerTitle,{color:u.textNavigationBar}],numberOfLines:1,allowFontScaling:!1,children:e}):(0,W.jsx)(B,{style:P5.placeHolderTitle}),(0,W.jsx)(B,{style:[P5.sideContainer,{minWidth:d}],onLayout:p,children:n??(0,W.jsx)(B,{style:{minWidth:d}})})]}),r]})});function Qdn({title:e,LeftButton:t,RightButton:n,BottomContent:r,extraBlurSize:i=0,skipTopInset:a=!1,color:o,overlay:s=!1}){let{COLORS:c}=J(),{top:l}=Q4(),u=a?16:l,d=o??c.bgPrimary,f=c3(d,0),p=e!==void 0||t!==void 0||n!==void 0,m=r&&p?Kdn+i:0+i,h=(0,H.useMemo)(()=>({backdrop:{height:u+Ydn+Xdn+m},container:{marginTop:u}}),[u,m]),g=Oq&&s?P5.overlay:void 0;return kq||Oq?(0,W.jsxs)(B,{style:g,children:[(0,W.jsxs)(B,{style:{pointerEvents:`none`},children:[(0,W.jsx)(z4.default,{colors:[d,f],style:[P5.gradient,h.backdrop]}),(0,W.jsx)(Gdn,{direction:`blurredTopClearBottom`,style:[P5.blur,h.backdrop],fallbackColor:d})]}),(0,W.jsx)(Zdn,{title:e,LeftButton:t,RightButton:n,BottomContent:r,style:h.container,hasHeaderRow:p})]}):(0,W.jsxs)(B,{children:[(0,W.jsx)(z4.default,{colors:[d,f],style:[P5.gradient,h.backdrop,{pointerEvents:`none`}]}),(0,W.jsx)(Zdn,{title:e,LeftButton:t,RightButton:n,BottomContent:r,style:h.container,hasHeaderRow:p})]})}var P5=R.create({headerRow:{flexDirection:`row`,alignItems:`center`,paddingHorizontal:16,justifyContent:`space-between`,paddingBottom:Jdn},sideContainer:{minWidth:M5,minHeight:qdn,alignItems:`center`},gradient:{position:`absolute`,top:0,left:0,right:0},blur:{position:`absolute`,top:0,left:0,right:0},overlay:{position:`absolute`,top:0,left:0,right:0},headerTitle:{...Y.Poppins.medium_Base,flex:1,textAlign:`center`,paddingHorizontal:16},placeHolderTitle:{flex:1}}),F5=(0,H.memo)(Qdn),Q=function(e){return e.MainBottomTabs=`MainBottomTabs`,e.SettingsStack=`SettingsStack`,e.Calculation=`Calculation`,e.VisualSearchIntro=`VisualSearchIntro`,e.VisualSearchPrivacyNoticeWebView=`VisualSearchPrivacyNoticeWebView`,e.VisualSearchEducation=`VisualSearchEducation`,e.VisualSearch=`VisualSearch`,e.FoodLibrary=`FoodLibrary`,e.LoadingRecommendation=`LoadingRecommendation`,e.Recommendation=`Recommendation`,e.LeavingRecommendation=`LeavingRecommendation`,e.DashboardTab=`DashboardTab`,e.LogbooksTab=`LogbooksTab`,e.FoodTab=`FoodTab`,e.Dashboard=`Dashboard`,e.ActiveInsulinChart=`ActiveInsulinChart`,e.MyDay=`MyDay`,e.GlucoseBGM=`GlucoseBGM`,e.GlucoseCGM=`GlucoseCGM`,e.CarbohydrateChart=`CarbohydrateChart`,e.RapidInsulinChart=`RapidInsulinChart`,e.TimeInRange=`TimeInRange`,e.FoodAndDrink=`FoodAndDrink`,e.FoodSubcategories=`FoodSubcategories`,e.CuratedFood=`CuratedFood`,e.PersonalFood=`PersonalFood`,e.PersonalFoodItem=`PersonalFoodItem`,e.CuratedFoodItem=`CuratedFoodItem`,e.Settings=`Settings`,e.ProfileStack=`ProfileStack`,e.GlucoseSettings=`GlucoseSettings`,e.ActivitySettings=`ActivitySettings`,e.InsulinSettingsStack=`InsulinSettingsStack`,e.Notifications=`Notifications`,e.AppleHealth=`AppleHealth`,e.Theme=`Theme`,e.SetupGlucoseMeters=`SetupGlucoseMeters`,e.IFU=`IFU`,e.Support=`Support`,e.SupportWebView=`SupportWebView`,e.SupportContact=`SupportContact`,e.Legal=`Legal`,e.GlucoseUnit=`GlucoseUnit`,e.ChangePINCode=`ChangePINCode`,e.Profile=`Profile`,e.AccountWebView=`AccountWebView`,e.PINCode=`PINCode`,e.InsulinSettings=`InsulinSettings`,e.TreatmentType=`TreatmentType`,e.RapidActingInsulin=`RapidActingInsulin`,e.LongActingInsulin=`LongActingInsulin`,e.NovoPenSetupScreen1=`NovoPenSetupScreen1`,e.NovoPenSetupScreen2=`NovoPenSetupScreen2`,e.NovoPenSetupScreen3=`NovoPenSetupScreen3`,e.NovoPenSetupScreen4=`NovoPenSetupScreen4`,e.SmartPenSetupStack=`SmartPenSetupStack`,e.SmartPenSetupScreen1=`SmartPenSetupScreen1`,e.SmartPenSetupScreen2=`SmartPenSetupScreen2`,e.RenameSmartPen=`RenameSmartPen`,e.NewCalculationStack=`NewCalculationStack`,e.CreateLogbook=`CreateLogbook`,e.CreateFood=`CreateFood`,e.RecommendationLogbook=`RecommendationLogbook`,e.LicensingStatusWebView=`LicensingStatusWebView`,e.SetupCGMWebview=`SetupCGMWebview`,e.SetupForecastWebview=`SetupForecastWebview`,e.NovoPenSetupStack=`NovoPenSetupStack`,e.RecommendationDev=`RecommendationDev`,e}({}),I5=function(e){return e.SetupBolusCalculator=`SetupBolusCalculator`,e.QuickGuideStack=`QuickGuideStack`,e.PINCodeSetup=`PINCodeSetup`,e.SetupStart=`SetupStart`,e.Setup=`Setup`,e.QuickGuideStart=`QuickGuideStart`,e.QuickGuide=`QuickGuide`,e.QuickGuideAllSet=`QuickGuideAllSet`,e}({}),$dn=async e=>{let t=`${bq.HEDIA_SERVER_BASE_URL}/api/v3/data/objects`,n=await d8(t,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:JSON.stringify(e)});return await T2(n,X.StatusCode.CREATED,t,X.HTTPRequestMethod.POST),await n.json()},efn=e=>{let t=e.reduce((e,t)=>e+C8(t.amount,t.foodItem.measures[0].gramsPerUnit,t.foodItem.nutritionPer100g.carbohydrates.value),0);return Math.round(t)},tfn={foodIntakeItems:[],visualSearchIds:[],foodIntakeCarbsAmount:0,manualCarbsInput:0},L5=gq()((e,t)=>({...tfn,setManualCarbsInput:t=>{e({manualCarbsInput:Math.round(t)})},addVisualSearchId:t=>{e(e=>({visualSearchIds:[...e.visualSearchIds,t]}))},addFoodIntakeItem:t=>{e(e=>{let n=e.foodIntakeItems.findIndex(e=>e.foodItem.id===t.foodItem.id),r;r=n===-1?[...e.foodIntakeItems,t]:e.foodIntakeItems.map((e,r)=>r===n?t:e);let i=efn(r);return{foodIntakeItems:r,foodIntakeCarbsAmount:i}})},removeFoodIntakeItem:(t,n)=>{e(e=>{let r=e.foodIntakeItems.filter(({foodItem:e})=>!(n===`id`?e.id===t:e.title===t));return{foodIntakeItems:r,foodIntakeCarbsAmount:efn(r)}})},saveCarbohydrates:async e=>{let{foodIntakeItems:n,foodIntakeCarbsAmount:r,manualCarbsInput:i,visualSearchIds:a}=t();if(!n.length&&!i)return null;let o=e.toISOString(),s=n.map(e=>({type:`referenced`,foodId:e.foodItem.id,quantity:{unit:e.foodItem.measures[0].unit,value:e.amount*e.foodItem.measures[0].gramsPerUnit}})),c=i>0?[{type:`standalone`,nutritionPerItem:{carbohydrates:{unit:`g`,value:i}},title:null}]:[],l=await qan({startDate:o,endDate:o,visualSearchIds:a,items:[...s,...c]});try{return{sampleId:(await $dn({type:`carbohydrates`,startDate:o,endDate:o,quantity:{unit:`g`,value:r+i},metadata:{foodIntakeId:l.id}})).id,foodIntakeId:l.id}}catch(e){throw await Jan(l.id).catch(console.error),e}},clear:()=>{e(tfn)}})),nfn={availableGlucoseReadings:[],selectedReadingId:null},R5=gq()((e,t)=>({...nfn,glucoseStoreActions:{set:t=>{e(e=>({...e,...t}))},addAvailableGlucoseReading:t=>{e(e=>{let n=e.availableGlucoseReadings.findIndex(e=>e.id===t.id||e.source===t.source);if(n!==-1){let r=[...e.availableGlucoseReadings];return r[n]=t,{...e,availableGlucoseReadings:r}}return{...e,availableGlucoseReadings:[...e.availableGlucoseReadings,t]}})},setAvailableGlucoseReadings:t=>{e(e=>({...e,availableGlucoseReadings:t}))},setSelectedReadingId:t=>{e(e=>({...e,selectedReadingId:t}))},removeReadingsByDeviceName:t=>{e(e=>{let n=e.availableGlucoseReadings.filter(e=>!(`deviceName`in e)||e.deviceName!==t),r=e.availableGlucoseReadings.find(t=>t.id===e.selectedReadingId),i=r&&`deviceName`in r&&r.deviceName===t?null:e.selectedReadingId;return{...e,availableGlucoseReadings:n,selectedReadingId:i}})},getReadingById:e=>e===null?null:t().availableGlucoseReadings.find(t=>t.id===e)??null,clear:()=>{e(nfn)}}})),rfn={isGoToSettingsPressed:!1,isNoBGModalVisible:!1,showCalculationInfoModal:!1,showDiscardCalculationModal:!1,showDiscardSmartPenSetupModal:!1,showSyncErrorModal:!1},z5=gq()(e=>({...rfn,modalStoreActions:{set:t=>{e(e=>({...e,...t}))},clear:()=>{e(rfn)}}})),ifn={noteId:null,noteBody:``,displayImageUri:null},B5=gq()(e=>({...ifn,noteStoreActions:{set:t=>{e(e=>({...e,...t}))},clear:()=>{e(ifn)}}}));V();var V5={top:10,bottom:10,left:20,right:20},H5=({onPress:e}={})=>{let{goBack:t}=N$(),{COLORS:n}=J();return(0,W.jsx)(wp,{onPress:e??t,testID:`header-back-button`,style:({pressed:e})=>[G5.button,{opacity:e?.5:1,backgroundColor:n.bgBtnSecondary,borderColor:n.border}],hitSlop:V5,children:(0,W.jsx)(X7t,{height:28,width:28})})},U5=({onPress:e})=>{let{pop:t}=N$(),{COLORS:n}=J();return(0,W.jsx)(wp,{onPress:e??(()=>t()),testID:`header-close-button`,style:({pressed:e})=>[G5.button,{opacity:e?.5:1,backgroundColor:n.bgBtnSecondary,borderColor:n.border}],hitSlop:V5,children:(0,W.jsx)(Q7t,{height:28,width:28})})},afn=({style:e})=>{let{navigate:t}=N$(),{COLORS:n}=J(),r=(0,H.useRef)(0);return(0,W.jsx)(wp,{onPress:(0,H.useCallback)(()=>{let e=Date.now();e-r.current<500||(r.current=e,u8(l8.SettingsTabPress),Oq?(L5.getState().clear(),R5.getState().glucoseStoreActions.clear(),B5.getState().noteStoreActions.clear(),t(Q.SettingsStack,{screen:Q.Settings})):t(Q.SettingsStack))},[t]),testID:`header-settings-button`,style:({pressed:t})=>[G5.button,{opacity:t?.5:1,backgroundColor:n.bgBtnSecondary,borderColor:n.border},e],hitSlop:V5,children:(0,W.jsx)(h9t,{})})},ofn=({onPress:e,testID:t=`header-info-button`,style:n})=>{let{COLORS:r}=J(),{modalStoreActions:i}=z5();return(0,W.jsx)(wp,{onPress:e??(()=>i.set({showCalculationInfoModal:!0})),testID:t,style:({pressed:e})=>[G5.button,{opacity:e?.5:1,backgroundColor:r.bgBtnSecondary,borderColor:r.border},n],hitSlop:V5,children:(0,W.jsx)(n9t,{height:28,width:28})})},W5=({onPress:e,disabled:t=!1})=>{let{COLORS:n}=J();return(0,W.jsx)(wp,{testID:`header-confirm-button`,style:({pressed:e})=>[G5.button,{opacity:e||t?.5:1,backgroundColor:n.bgBrand,borderWidth:0}],onPress:e,disabled:t,hitSlop:V5,children:(0,W.jsx)(G4,{height:28,width:28,color:n.iconButtonPrimary})})},sfn=({onPress:e})=>{let{COLORS:t}=J();return(0,W.jsx)(wp,{testID:`header-edit-button`,onPress:e,style:({pressed:e})=>[G5.button,{opacity:e?.5:1,backgroundColor:t.bgBtnSecondary,borderColor:t.border}],hitSlop:V5,children:(0,W.jsx)(e9t,{height:28,width:28})})},cfn=({onPress:e,isLocked:t})=>{let{COLORS:n}=J();return(0,W.jsx)(wp,{testID:`header-lock-button`,onPress:e,style:({pressed:e})=>[G5.button,{opacity:e?.5:1,backgroundColor:n.bgBtnSecondary,borderColor:n.border}],hitSlop:V5,children:t?(0,W.jsx)(i9t,{height:28,width:28}):(0,W.jsx)(m9t,{height:28,width:28})})},G5=R.create({button:{padding:8,borderRadius:22,borderWidth:1}});({...Y.Poppins.medium_Base});var K5={cardStyle:{flex:1},headerShown:!0,headerLeft:()=>(0,W.jsx)(H5,{}),headerTitleStyle:{...Y.Poppins.medium_Base},headerTitleAlign:`center`,headerTitleAllowFontScaling:!1,title:``},lfn={...K5,animation:`slide_from_bottom`,presentation:`modal`,headerLeft:()=>(0,W.jsx)(U5,{}),headerLeftContainerStyle:{flex:1},headerTitleContainerStyle:{flex:3,alignItems:`center`},headerRightContainerStyle:{flex:1}},ufn=async e=>{let t=`${bq.ASSET_BASE_URL}/api/v1/assets/${e}`,n=await d8(t,{method:`GET`,headers:{Accept:`application/json`}});return await T2(n,X.StatusCode.OK,t),n.json()},dfn=async e=>{let t=`${bq.ASSET_BASE_URL}/api/v1/assets/${e}`;await T2(await d8(t,{method:`DELETE`}),X.StatusCode.NO_CONTENT,t,X.HTTPRequestMethod.DELETE)},q5=[`foods`,`personal`],ffn=()=>{let{data:e=[],isLoading:t,isError:n,refetch:r}=b0({queryKey:q5,queryFn:Ran,staleTime:1e3*60*5,networkMode:`offlineFirst`,retry:3});return{personalFoods:e,isPersonalFoodsLoading:t,isPersonalFoodsError:n,refetchPersonalFoods:r}},pfn=()=>{let e=y0(),{mutateAsync:t,isPending:n,isError:r,error:i}=$0t({mutationFn:Gan,onSuccess:()=>{e.invalidateQueries({queryKey:q5})}});return{createPersonalFood:t,isCreatingPersonalFood:n,createPersonalFoodError:r?i:null}},mfn=e=>[`foods`,`item`,e],hfn=e=>{let{data:t=null,isLoading:n,isError:r,refetch:i}=b0({queryKey:mfn(e),queryFn:()=>Han(e),staleTime:1e3*60*5,networkMode:`offlineFirst`,retry:3});return{food:t,isFoodLoading:n,isFoodError:r,refetchFood:i}},J5=[`foods`,`search`],gfn=e=>[...J5,e],_fn=e=>{let{data:t=[],isLoading:n,isError:r,refetch:i}=b0({queryKey:gfn(e),queryFn:()=>Van(e),enabled:e.length>2,staleTime:1e3*60*5,networkMode:`offlineFirst`,retry:3});return{foodSearchResults:t,isFoodSearchLoading:n,isFoodSearchError:r,refetchFoodSearch:i}},vfn=()=>{let e=y0(),{mutateAsync:t,isPending:n}=$0t({mutationFn:e=>Wan(e),onSuccess:(t,n)=>{e.setQueryData(q5,e=>e?.filter(e=>e.id!==n)),e.setQueriesData({queryKey:J5},e=>e?.filter(e=>e.id!==n)),e.setQueryData(mfn(n),null),e.invalidateQueries({queryKey:q5}),e.invalidateQueries({queryKey:J5})}});return{deletePersonalFood:t,isDeletingPersonalFood:n}},yfn=()=>{let e=y0(),{mutateAsync:t,isPending:n}=$0t({mutationFn:({foodId:e,request:t})=>Uan(e,t),onSuccess:t=>{e.setQueryData(mfn(t.id),t),e.setQueryData(q5,e=>e?.map(e=>e.id===t.id?t:e)),e.setQueriesData({queryKey:J5},e=>e?.map(e=>e.id===t.id?t:e)),e.invalidateQueries({queryKey:q5}),e.invalidateQueries({queryKey:J5})}});return{updatePersonalFood:t,isUpdatingPersonalFood:n}};V();var bfn={outlineStyle:`none`};function xfn({value:e,onChangeText:t,imageUri:n,containerStyle:r,testID:i,autoFocus:a,maxLength:o=1024}){let{COLORS:s}=J(),{t:c}=Tq(),l=(0,H.useRef)(null);return(0,H.useEffect)(()=>{if(!a)return;let e=setTimeout(()=>{l.current?.focus()},300);return()=>{clearTimeout(e)}},[a]),(0,W.jsxs)(B,{style:[Sfn.container,{backgroundColor:s.bgInputActive},r],testID:i,children:[(0,W.jsx)(Lp,{ref:l,value:e,onChangeText:t,placeholder:c(`notes_placeholder`),placeholderTextColor:s.labelTertiary,multiline:!0,maxLength:o,style:[Sfn.input,{color:s.labelPrimary},bfn],cursorColor:s.iconBrand,testID:`${i}-input`}),!!n&&(0,W.jsx)(Zu,{source:{uri:n},style:Sfn.image,resizeMode:`cover`,testID:`${i}-image`})]})}var Sfn=R.create({container:{borderRadius:16,padding:16,minHeight:160},input:{...Y.Poppins.regular_Base,flex:1,marginBottom:16,textAlignVertical:`top`,maxHeight:300},image:{width:`100%`,height:234,borderRadius:12,marginTop:12}});V();function Cfn({onPress:e}){let{t}=Tq(),{COLORS:n}=J();return(0,W.jsx)(wp,{accessibilityRole:`button`,style:[wfn.button,{backgroundColor:n.iosKeyboardPicker}],onPress:e,testID:`wheel-picker-modal-cancel`,children:(0,W.jsx)(_d,{maxFontSizeMultiplier:C2.s3,style:[wfn.buttonText,{color:n.textKeyboardButtons}],children:t(`button_cancel`)})})}var wfn=R.create({button:{borderRadius:13},buttonText:{fontSize:17,fontWeight:`600`,paddingHorizontal:16,paddingVertical:15,textAlign:`center`}}),Y5=H.memo(Cfn);V();function Tfn({onPress:e}){let{t}=Tq(),{COLORS:n}=J();return(0,W.jsx)(wp,{accessibilityRole:`button`,style:[Efn.button,{backgroundColor:n.iosKeyboardPicker}],onPress:e,testID:`wheel-picker-modal-confirm`,children:(0,W.jsx)(_d,{maxFontSizeMultiplier:C2.s3,style:[Efn.buttonText,{color:n.textKeyboardButtons}],children:t(`button_confirm`)})})}var Efn=R.create({button:{borderBottomLeftRadius:13,borderBottomRightRadius:13},buttonText:{fontSize:17,fontWeight:`400`,paddingHorizontal:16,paddingVertical:15,textAlign:`center`}}),X5=H.memo(Tfn),Dfn=c({HapticFeedbackTypes:()=>kfn,default:()=>Afn,triggerHaptic:()=>Ofn});function Ofn(e=`selection`,t){}var kfn,Afn,jfn=o((()=>{kfn=function(e){return e.selection=`selection`,e.impactLight=`impactLight`,e.impactMedium=`impactMedium`,e.impactHeavy=`impactHeavy`,e.rigid=`rigid`,e.soft=`soft`,e.notificationSuccess=`notificationSuccess`,e.notificationWarning=`notificationWarning`,e.notificationError=`notificationError`,e.clockTick=`clockTick`,e.contextClick=`contextClick`,e.keyboardPress=`keyboardPress`,e.keyboardRelease=`keyboardRelease`,e.keyboardTap=`keyboardTap`,e.longPress=`longPress`,e.textHandleMove=`textHandleMove`,e.virtualKey=`virtualKey`,e.virtualKeyRelease=`virtualKeyRelease`,e.effectClick=`effectClick`,e.effectDoubleClick=`effectDoubleClick`,e.effectHeavyClick=`effectHeavyClick`,e.effectTick=`effectTick`,e}({}),Afn={trigger:(e,t)=>{}}}));jfn(),V();var Mfn=22,Nfn=26;function Pfn({textStyle:e,style:t,height:n,fontScale:r,option:i,onItemPress:a}){let{COLORS:o}=J();return(0,W.jsx)(B,{style:[Ffn.item,t,{height:n}],children:(0,W.jsx)(wp,{style:Ffn.itemPressable,onPress:a,children:(0,W.jsx)(_d,{allowFontScaling:!1,style:[e,Ffn.itemText,{fontSize:Mfn*r,lineHeight:Nfn*r,color:o.labelPrimary}],children:i})})})}var Ffn=R.create({item:{alignItems:`center`,justifyContent:`center`,zIndex:100},itemPressable:{width:`100%`},itemText:{textAlign:`center`,fontWeight:`400`}}),Ifn=H.memo(Pfn);V();function Lfn({itemHeight:e,visibleRest:t}){let{COLORS:n}=J(),r=e*t;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(z4.default,{colors:[n.iosKeyboardPicker+`FF`,n.iosKeyboardPicker+`4D`],style:[Rfn.mask,{top:0,height:r}]}),(0,W.jsx)(z4.default,{colors:[n.iosKeyboardPicker+`4D`,n.iosKeyboardPicker+`FF`],style:[Rfn.mask,{bottom:0,height:r}]})]})}var Rfn=R.create({mask:{position:`absolute`,left:0,right:0,pointerEvents:`none`}}),zfn=(0,H.memo)(Lfn);V();function Bfn({testID:e,initialScrollIndex:t,options:n,onChange:r,selectedIndicatorStyle:i={},containerStyle:a={},itemStyle:o={},itemTextStyle:s={},itemHeight:c=36,visibleRest:l=3,decelerationRate:u=`normal`,containerProps:d={},flatListProps:f={},accessibilityLabel:p,ref:m}){let{t:h}=Tq(),{COLORS:g}=J(),{width:_,fontScale:v}=em(),y=Math.min(v,C2.s3),b=Math.round(c*y),x=(1+l*2)*b,S=(0,H.useRef)(null),C=(0,H.useRef)(null);(0,H.useImperativeHandle)(m,()=>({scrollToIndex(e){S.current?.scrollToIndex({index:e,animated:!0})}}),[]);let[w]=(0,H.useState)(new lf.Value(0)),T=(0,H.useMemo)(()=>{let e=[...n];for(let t=0;t<l;t++)e.unshift(null),e.push(null);return e},[n,l]),E=(0,H.useMemo)(()=>[...Array(T.length)].map((e,t)=>t*b),[T,b]),D=(0,H.useCallback)(e=>{Oq||C.current!==e&&(C.current=e)},[]),O=(0,H.useCallback)(e=>{let t=e.nativeEvent.contentOffset.y,i=Math.min(n.length-1,Math.max(0,Math.round(t/b)));D(i),Oq&&(r(i),S.current?.scrollToIndex({index:i,animated:!0}))},[D,b,r,n.length]),k=U3t((...e)=>{let t=e[0];O(t)},100),A=(0,H.useCallback)(e=>{let t=e.nativeEvent.contentOffset.y,i=Math.min(b*(n.length-1),Math.max(t,0)),a=Math.floor(Math.floor(i)/b);Math.floor(i%b)>b/2&&a++,r(a)},[b,r,n.length]);return(0,W.jsxs)(B,{accessible:!0,accessibilityHint:h(`wheelpicker_accessibility_label`),accessibilityLabel:p,accessibilityRole:`adjustable`,style:[Vfn.container,{backgroundColor:g.iosKeyboardPicker,height:x,width:_},a],...d,children:[(0,W.jsx)(B,{style:[Vfn.selectedIndicator,{backgroundColor:g.iosSelectorKeyboard},{transform:[{translateY:-b/2}],height:b,width:_-32-20},i]}),(0,W.jsx)(lf.FlatList,{...f,testID:e,ref:S,showsVerticalScrollIndicator:!1,removeClippedSubviews:yvt,onScroll:lf.event([{nativeEvent:{contentOffset:{y:w}}}],{useNativeDriver:!Oq,listener:Oq?k:O}),scrollEventThrottle:16,initialScrollIndex:t,onMomentumScrollEnd:A,snapToInterval:b,snapToOffsets:E,decelerationRate:u,getItemLayout:(e,t)=>({length:b,offset:b*t,index:t}),data:T,keyExtractor:(e,t)=>t.toString(),windowSize:31,initialNumToRender:l*2+1,maxToRenderPerBatch:12,updateCellsBatchingPeriod:50,renderItem:({item:e,index:t})=>(0,W.jsx)(Ifn,{option:e,style:o,textStyle:s,height:b,fontScale:y,onItemPress:()=>{let e=Math.max(0,Math.min(t-l,n.length-1));S.current?.scrollToIndex({index:e,animated:!0})}},`option-${t}`)}),(0,W.jsx)(zfn,{itemHeight:b,visibleRest:l})]})}var Vfn=R.create({container:{borderTopLeftRadius:13,borderTopRightRadius:13,alignSelf:`center`},selectedIndicator:{position:`absolute`,borderRadius:7,top:`50%`,alignSelf:`center`}}),Z5=H.memo(Bfn);V();function Hfn({items:e,isVisible:t,onCancel:n,onConfirm:r,onModalHide:i,initialScrollIndex:a,accessibilityLabel:o,testID:s}){let{COLORS:c}=J(),[l,u]=(0,H.useState)(a),{width:d}=em();(0,H.useEffect)(()=>{u(a)},[a]);let f=(0,H.useCallback)(e=>{u(e)},[]),p=(0,H.useCallback)(()=>{r(parseFloat(e[l]),l)},[e,r,l]),m=(0,H.useCallback)(()=>{u(a),n()},[a,n]);return(0,W.jsx)(u3,{isVisible:t,containerStyle:{backgroundColor:c.bgTransparent},onModalHide:i,children:(0,W.jsxs)(B,{children:[(0,W.jsx)(B,{style:Ufn.pickersContainer,children:(0,W.jsx)(Z5,{testID:s,initialScrollIndex:a,options:e,onChange:f,accessibilityLabel:o,containerStyle:{width:d-32}})}),(0,W.jsxs)(B,{style:Ufn.buttonContainer,children:[(0,W.jsx)(X5,{onPress:p}),(0,W.jsx)(Y5,{onPress:m})]})]})})}var Q5=H.memo(Hfn),Ufn=R.create({pickersContainer:{flexDirection:`row`,borderTopLeftRadius:13,borderTopRightRadius:13,overflow:`hidden`},buttonContainer:{gap:8}});function $5(e){let t=y0(),[n,r]=(0,H.useState)(null);return(0,H.useEffect)(()=>{if(!e){r(null);return}(async()=>{r((await t.fetchQuery({queryKey:[`asset`,e],queryFn:()=>ufn(e),staleTime:X.Milliseconds.Minute*5})).downloadUrl)})().catch(console.error)},[e,t]),n}V();var Wfn=({isLiquid:e,setSelected:t})=>{let{COLORS:n}=J();return(0,W.jsxs)(B,{style:[e7.container,{backgroundColor:n.bgSegmentContainer,borderColor:n.buttonBorder}],children:[(0,W.jsx)(wp,{style:[e7.segment,!e&&{backgroundColor:n.bgSegmentPrimary}],onPress:()=>{t(!1)},testID:`food-type-food-${e}`,children:(0,W.jsx)(Z,{style:[e7.value,{color:e?n.textLabelInactive:n.textLabelActive}],maxFontSizeMultiplier:C2.s0,children:`g`})}),(0,W.jsx)(wp,{style:[e7.segment,e&&{backgroundColor:n.bgSegmentPrimary}],onPress:()=>{t(!0)},testID:`food-type-drink-${e}`,children:(0,W.jsx)(Z,{style:[e7.value,{color:e?n.textLabelActive:n.textLabelInactive}],maxFontSizeMultiplier:C2.s0,children:`ml`})})]})},e7=R.create({container:{flexDirection:`row`,justifyContent:`center`,alignItems:`center`,borderRadius:32,padding:4,borderWidth:1},segment:{flex:1,flexDirection:`row`,justifyContent:`center`,alignItems:`center`,paddingVertical:4,paddingHorizontal:10,borderRadius:16},value:{...Y.Poppins.medium_Base}}),t7=({onModalHide:e})=>{let{t}=Tq(),n=WWt(),{showSyncErrorModal:r,modalStoreActions:i}=z5();return(0,W.jsx)(u3,{isVisible:r&&n,onModalHide:e,onModalShow:()=>{u8(l8.ErrorOffline)},title:t(`glucose_modal_changes_title`),message:t(`glucose_modal_changes_body`),buttons:[{title:t(`glucose_modal_changes_button_confirm`),onPress:()=>{i.set({showSyncErrorModal:!1})}}]})};V();var Gfn={title:``,carbohydrates:null,measure:`g`,description:``},Kfn=e=>e?{title:e.title,carbohydrates:e.nutritionPer100g.carbohydrates.value,measure:e.measures[0]?.unit,description:e.description??``}:Gfn,qfn=a3(0,100),Jfn=`create-food`,Yfn=()=>{let{t:e}=Tq(),{COLORS:t}=J(),{createPersonalFood:n,isCreatingPersonalFood:r}=pfn(),{updatePersonalFood:i,isUpdatingPersonalFood:a}=yfn(),{deletePersonalFood:o,isDeletingPersonalFood:s}=vfn(),{removeFoodIntakeItem:c}=L5(),l=F$(),u=l.params?.personalFoodId,{personalFoods:d}=ffn(),f=u?d.find(e=>e.id===u):void 0,{modalStoreActions:p}=z5(),m=N$(),h=N5(),{bottomWithScroll:g}=Q4(),[_,v]=(0,H.useState)(()=>Kfn(f)),y=(0,H.useRef)(_),b=(0,H.useRef)(!!f);(0,H.useEffect)(()=>{if(b.current||!f||(b.current=!0,_!==y.current))return;let e=Kfn(f);y.current=e,v(e)},[f,_]);let[x,S]=(0,H.useState)(!1),[C,w]=(0,H.useState)(0),[T,E]=(0,H.useState)(!1),[D,O]=(0,H.useState)(!1),k=(0,H.useRef)(!1),[A,ee]=(0,H.useState)(!1),te=(0,H.useRef)(!1),ne=$5(f?.imageId??null),re=_.title.trim().length>0&&_.carbohydrates!==null,ie=T||r||a||s,j=y.current,ae=_.title!==j.title||_.carbohydrates!==j.carbohydrates||_.measure!==j.measure||_.description!==j.description,oe=(0,H.useCallback)(()=>{if(!ae){m.pop();return}ee(!0)},[ae,m]);(0,H.useEffect)(()=>{let r=async()=>{E(!0);try{if(u)if(_.carbohydrates!==j.carbohydrates||_.measure!==j.measure){let e=await n({title:_.title.trim(),description:_.description.trim()||null,imageId:f?.imageId??null,measures:[{unit:_.measure,gramsPerUnit:1}],nutritionPer100g:{carbohydrates:{unit:`g`,value:_.carbohydrates??0}}});try{await o(u)}catch(t){throw await o(e.id).catch(console.error),t}c(u,`id`)}else await i({foodId:u,request:{title:_.title.trim(),description:_.description.trim()||null}});else await n({title:_.title.trim(),description:_.description.trim()||null,measures:[{unit:_.measure,gramsPerUnit:1}],nutritionPer100g:{carbohydrates:{unit:`g`,value:_.carbohydrates??0}}});m.getState().routes.some(({key:e})=>e===l.key)&&m.pop(),u8(l8.FoodLibraryCreatePress)}catch{p.set({showSyncErrorModal:!0})}finally{E(!1)}};m.setOptions({headerTransparent:!0,gestureEnabled:!1,header:()=>(0,W.jsx)(F5,{title:_.title||e(`add_food_segment_food`),LeftButton:(0,W.jsx)(U5,{onPress:oe}),RightButton:ie?(0,W.jsx)(Pf,{size:`small`,color:t.iconBrand,style:n7.activityIndicator}):(0,W.jsx)(W5,{onPress:r,disabled:!ae||!re}),overlay:!0})})},[re,ae,m,_,p,ie,t.iconBrand,n,i,o,c,j.carbohydrates,j.measure,f?.imageId,u,l.key,oe,e]);let se=(0,H.useCallback)(()=>{Tf.dismiss(),w(Math.max(0,_.carbohydrates??0)),S(!0)},[_.carbohydrates]),M=(0,H.useCallback)(e=>{v(t=>({...t,carbohydrates:e})),S(!1)},[]),ce=(0,H.useCallback)(e=>{v(t=>({...t,description:e}))},[]),N=(0,H.useCallback)(()=>{te.current=!0,ee(!1)},[]),P=(0,H.useCallback)(()=>{te.current&&(te.current=!1,m.pop())},[m]),le=(0,H.useCallback)(()=>{k.current=!0,O(!1)},[]),ue=(0,H.useCallback)(async()=>{if(!(!k.current||!f)){k.current=!1;try{f.imageId&&await dfn(f.imageId).catch(console.error),await o(f.id),c(f.id,`id`),m.getState().routes.some(({key:e})=>e===l.key)&&m.pop()}catch{p.set({showSyncErrorModal:!0})}}},[f,o,c,m,l.key,p]);return(0,W.jsxs)(fs,{testID:`${Jfn}-scroll`,keyboardDismissMode:`on-drag`,keyboardShouldPersistTaps:`always`,contentContainerStyle:{paddingTop:h+8,paddingBottom:g},style:{backgroundColor:t.bgSheet},children:[(0,W.jsxs)(B,{style:n7.container,children:[(0,W.jsxs)(B,{style:n7.mandatorySection,children:[(0,W.jsx)(T9t,{value:_.title,placeholder:_.measure===`mL`?e(`food_add_library_input_drink_name`):e(`food_add_library_input_name`),onChangeText:e=>v(t=>({...t,title:e})),maxLength:255,testID:`${Jfn}-name`,autoFocus:!u}),(0,W.jsx)(Y4,{title:e(`food_add_library_item_carbs`),onPress:se,renderRightSlot:()=>(0,W.jsxs)(Z,{style:[n7.rightSlot,{color:t.labelPrimary}],testID:`${Jfn}-carbohydrates`,children:[_.carbohydrates??`-`,` / 100g`]})})]}),(0,W.jsxs)(B,{style:n7.measurementSection,children:[(0,W.jsx)(Z,{style:[n7.measurementQuestion,{color:t.labelPrimary}],children:e(`food_unitToggle_title`)}),(0,W.jsx)(Wfn,{isLiquid:_.measure===`mL`,setSelected:e=>{v(t=>({...t,measure:e?`mL`:`g`}))}})]}),(0,W.jsx)(xfn,{value:_.description,onChangeText:ce,maxLength:255,imageUri:ne,testID:`create-food-notes`}),!!f&&(0,W.jsx)(U4,{type:H4.ErrorSecondary,title:e(`button_delete_food`),testID:`delete_food_button`,disabled:ie,onPress:()=>O(!0),style:n7.deleteButton})]}),(0,W.jsx)(Q5,{isVisible:x,items:qfn,initialScrollIndex:C,onCancel:()=>S(!1),onConfirm:M,testID:`create-food-wheel-picker`}),(0,W.jsx)(u3,{isVisible:A,title:e(`logbook_personal_modal_discard_title`),onModalHide:P,buttons:[{title:e(`button_discard_changes`),type:H4.Error,testID:`discard-button`,onPress:N},{title:e(`button_keep_editing`),type:H4.Secondary,testID:`keep-button`,onPress:()=>ee(!1)}]}),(0,W.jsx)(u3,{isVisible:D,title:e(`food_modal_delete_food_title`),onModalHide:ue,buttons:[{title:e(`button_delete_food`),type:H4.Error,testID:`delete_modal_delete_button`,onPress:le},{title:e(`button_cancel`),type:H4.Secondary,testID:`delete_modal_cancel_button`,onPress:()=>O(!1)}]}),(0,W.jsx)(t7,{})]})},n7=R.create({container:{flex:1,paddingHorizontal:16,gap:16},mandatorySection:{gap:8},measurementSection:{gap:10},measurementQuestion:{...Y.Poppins.regular_SM},rightSlot:{...Y.Poppins.regular_Base,marginRight:8},deleteButton:{marginTop:8},activityIndicator:{width:44,height:44}});function Xfn({uri:e,style:t,onLoadEnd:n}){let r=(0,H.useRef)(null);return(0,H.useEffect)(()=>{let e=r.current;if(!(!n||!e))return e.addEventListener(`load`,n),()=>{e.removeEventListener(`load`,n)}},[r,n]),(0,W.jsx)(`iframe`,{ref:r,src:e,style:t})}function Zfn(){let{language:e}=Cq.getState();return`https://pdf.hedia.io/IFU/${e}/Hedia-IFU-${c8}`}V();var Qfn=()=>(0,W.jsx)(Xfn,{style:$fn.iframe,uri:Zfn()}),$fn=R.create({iframe:{flex:1}}),epn=s(((e,t)=>{function n(e){return e&&e.__esModule?e:{default:e}}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports})),tpn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.default=(V(),d(tm)).StyleSheet.create({container:{flex:1,overflow:`hidden`},loadingOrErrorView:{position:`absolute`,flex:1,justifyContent:`center`,alignItems:`center`,height:`100%`,width:`100%`,backgroundColor:`white`},loadingProgressBar:{height:20},errorText:{fontSize:14,textAlign:`center`,marginBottom:2},errorTextTitle:{fontSize:15,fontWeight:`500`,marginBottom:10},webView:{backgroundColor:`#ffffff`},flexStart:{alignSelf:`flex-start`},colorRed:{color:`red`}})})),npn=u(s((e=>{var t=epn();Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.WebView=void 0,t(p());var n=(V(),d(tm)),r=t(tpn()),i=LJ();e.default=e.WebView=function(){return(0,i.jsx)(n.View,{style:r.default.flexStart,children:(0,i.jsx)(n.Text,{style:r.default.colorRed,children:`React Native WebView does not support this platform.`})})}}))());V(),YQ(),Z0();function rpn({ref:e,url:t,testID:n,incognito:r=!0,onNavigationStateChange:i,onLoadError:a,onShouldStartLoadWithRequest:o,originWhitelist:s,spinnerSize:c=15,style:l}){let{t:u}=Tq(),{COLORS:d,effectiveColorScheme:f}=J(),{bottom:p}=W0(),[m,h]=(0,H.useState)(!1),[g,_]=(0,H.useState)(null),[v,y]=(0,H.useState)(null),b=(0,H.useMemo)(()=>`document.cookie = "theme=${f}; path=/; SameSite=Lax";`,[f]);return t?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(npn.default,{ref:e,source:{uri:t},testID:n,incognito:r,startInLoadingState:!0,renderLoading:()=>(0,W.jsx)(B,{style:r7.centerContainer,children:(0,W.jsx)(g2,{source:_2.LOADING_SPINNER,autoPlay:!0,style:{height:`${c}%`}})}),setSupportMultipleWindows:!1,onHttpError:e=>{let{url:t,statusCode:r}=e.nativeEvent;if(console.error(`WebViewLoader onHttpError: `,n,t.split(/[?#]/)[0],r),a){a();return}h(!0),_(u(`global_modal_swr_title`)),y(u(`global_modal_swr_body`))},onError:e=>{let{url:t,description:r}=e.nativeEvent;if(console.error(`WebViewLoader onError: `,n,t.split(/[?#]/)[0],r),a){a();return}h(!0),r.includes(`ERR_INTERNET_DISCONNECTED`)?(_(u(`settings_modal_no_internet_title`)),y(u(`settings_modal_no_internet_body`))):(_(u(`global_modal_swr_title`)),y(u(`global_modal_swr_body`)))},injectedJavaScriptBeforeContentLoaded:b,onNavigationStateChange:i,onShouldStartLoadWithRequest:o,originWhitelist:s,style:{backgroundColor:d.bgPrimary},containerStyle:[r7.container,{backgroundColor:d.bgPrimary,paddingBottom:p},l]}),m&&(0,W.jsxs)(JQ.View,{entering:BQ.duration(300).delay(2e3),style:r7.centerContainer,children:[(0,W.jsx)(Z,{style:[r7.errorTitle,{color:d.labelPrimary}],children:g}),(0,W.jsx)(Z,{style:[r7.errorSubtitle,{color:d.labelSecondary}],children:v})]})]}):null}var r7=R.create({container:{height:`100%`},centerContainer:{height:`100%`,justifyContent:`center`,marginHorizontal:16},errorTitle:{...Y.Poppins.semiBold_2XL,textAlign:`center`},errorSubtitle:{...Y.Poppins.regular_Base,textAlign:`center`}});V();function ipn(){let e=rln();return Oq?(0,W.jsx)(Xfn,{style:apn.iframe,uri:`https://www.hedia.com/support/partner`}):(0,W.jsx)(rpn,{url:`https://www.hedia.com/support/native`,testID:`support-webview`,style:{paddingTop:e}})}var apn=R.create({iframe:{flex:1}}),opn=()=>({min:X.CONSTANTS.CARBOHYDRATES_INPUT_MIN,max:X.CONSTANTS.CARBOHYDRATES_INPUT_MAX});a3(X.CONSTANTS.CARBOHYDRATES_INPUT_MIN,X.CONSTANTS.CARBOHYDRATES_INPUT_MAX),V();function spn({children:e,offset:t=47}){let{COLORS:n}=J(),{bottom:r}=Q4();return(0,W.jsxs)(B,{children:[(0,W.jsx)(z4.default,{colors:[c3(n.bgPrimary,0),n.bgPrimary],style:[cpn.gradient,{height:r+t+16}],pointerEvents:`none`}),(0,W.jsx)(B,{style:[{paddingBottom:r},cpn.contentContainer],children:e})]})}var cpn=R.create({gradient:{position:`absolute`,bottom:0,left:0,right:0},contentContainer:{position:`absolute`,bottom:0,left:0,right:0,marginHorizontal:16}}),lpn=(0,H.memo)(spn);V();var upn=()=>{let{t:e}=Tq(),{COLORS:t}=J(),{showCalculationInfoModal:n,modalStoreActions:r}=z5(),i=(0,H.useMemo)(()=>[{testID:`close-button`,title:e(`button_close`),onPress:()=>{r.set({showCalculationInfoModal:!1})}}],[r,e]);return(0,W.jsxs)(u3,{testID:`calculation_info_modal`,isVisible:n,title:e(`calcflow_modal_info_title`),buttons:i,enableScroll:!0,containerStyle:i7.modal,children:[(0,W.jsx)(Z,{style:[i7.header,{color:t.labelPrimary}],children:e(`calcflow_modal_info_insulin_title`)}),(0,W.jsx)(Z,{style:[i7.text,{color:t.labelSecondary}],children:e(`calcflow_modal_info_insulin_body`)}),(0,W.jsx)(Z,{style:[i7.header,{color:t.labelPrimary}],children:e(`calcflow_modal_info_glucose_title`)}),(0,W.jsx)(Z,{style:[i7.text,{color:t.labelSecondary}],children:e(`calcflow_modal_info_glucose_body`)}),(0,W.jsx)(Z,{style:[i7.header,{color:t.labelPrimary}],children:e(`calcflow_modal_info_carbohydrates_title`)}),(0,W.jsx)(Z,{style:[i7.text,{color:t.labelSecondary}],children:e(`calcflow_modal_info_carbohydrates_body`)}),(0,W.jsx)(Z,{style:[i7.header,{color:t.labelPrimary}],children:e(`calcflow_modal_info_activity_title`)}),(0,W.jsx)(Z,{style:[i7.text,{color:t.labelSecondary}],children:e(`calcflow_modal_info_activity_body`)}),(0,W.jsx)(Z,{style:[i7.header,{color:t.labelPrimary}],children:e(`calcflow_modal_info_notes_title`)}),(0,W.jsx)(Z,{style:[i7.text,{color:t.labelSecondary}],children:e(`calcflow_modal_info_notes_body`)}),(0,W.jsx)(Z,{style:[i7.header,{color:t.labelPrimary}],children:e(`calcflow_modal_info_calculate_title`)}),(0,W.jsx)(Z,{style:[i7.text,{color:t.labelSecondary}],children:e(`calcflow_modal_info_calculate_body`)})]},`calculation_info_modal`)},i7=R.create({modal:{maxHeight:`92%`},header:{...Y.Poppins.semiBold_Base,marginTop:16},text:{...Y.Poppins.regular_Base}}),dpn=async e=>{let t=`${bq.NOTE_BASE_URL}/api/v1/notes`,n=await d8(t,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:JSON.stringify(e)});return await T2(n,X.StatusCode.CREATED,t,X.HTTPRequestMethod.POST),n.json()},fpn=async e=>{let t=`${bq.NOTE_BASE_URL}/api/v1/notes/${e}`,n=await d8(t,{method:`GET`,headers:{Accept:`application/json`}});return await T2(n,X.StatusCode.OK,t),n.json()},ppn=async(e,t)=>{let n=`${bq.NOTE_BASE_URL}/api/v1/notes/${e}`,r=await d8(n,{method:X.HTTPRequestMethod.PATCH,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:JSON.stringify(t)});return await T2(r,X.StatusCode.OK,n,X.HTTPRequestMethod.PATCH),r.json()},mpn=async e=>{let t=`${bq.NOTE_BASE_URL}/api/v1/notes/${e}`;await T2(await d8(t,{method:`DELETE`}),X.StatusCode.NO_CONTENT,t,X.HTTPRequestMethod.DELETE)};function hpn(){let e=y0(),[t,n]=(0,H.useState)(``),[r,i]=(0,H.useState)(!1),[a,o]=(0,H.useState)(!1),s=(0,H.useRef)(null),c=(0,H.useRef)(``),l=(0,H.useRef)(null),u=(0,H.useRef)(t);u.current=t;let d=(0,H.useCallback)(async t=>{if(s.current===null){l.current=t,s.current=t,i(!0),o(!1);try{let r=await e.fetchQuery({queryKey:[`note`,t],queryFn:()=>fpn(t),staleTime:X.Milliseconds.Minute*5});s.current=r.id,c.current=r.body,n(r.body)}catch{s.current=null,o(!0)}finally{i(!1)}}},[e]),f=(0,H.useCallback)(()=>{let e=l.current;e&&d(e).catch(console.error)},[d]);return{noteBody:t,setNoteBody:n,displayImageUri:null,onImageSelected:()=>void 0,onImageRemoved:()=>void 0,loadNote:d,saveNote:(0,H.useCallback)(async()=>{let t=u.current;if(!t.trim())return s.current&&=(await mpn(s.current),e.removeQueries({queryKey:[`note`,s.current]}),null),null;if(s.current&&t===c.current)return s.current;if(s.current){let n=await ppn(s.current,{body:t});return e.setQueryData([`note`,n.id],n),s.current}let n=await dpn({body:t});return s.current=n.id,e.setQueryData([`note`,n.id],n),n.id},[e]),deleteNoteAndAssets:(0,H.useCallback)(async t=>{try{let n=await e.fetchQuery({queryKey:[`note`,t],queryFn:()=>fpn(t),staleTime:X.Milliseconds.Minute*5});for(let t of n.assetIds)await dfn(t).catch(console.error),e.removeQueries({queryKey:[`asset`,t]});await mpn(t),e.removeQueries({queryKey:[`note`,t]})}catch(e){console.error(`[useNotes::deleteNoteAndAssets] Failed:`,e)}},[e]),discardChanges:()=>Promise.resolve(),isLoading:r,loadFailed:a,retryLoad:f,hasNoteContent:(0,H.useMemo)(()=>!a&&t.trim().length>0,[t,a]),isNoteModified:(0,H.useMemo)(()=>t!==c.current,[t])}}var gpn={selectedEventUUID:null,activityDurationSeconds:0},a7=gq()(e=>({...gpn,activityStoreActions:{set:t=>{e(e=>({...e,...t}))},clear:()=>{e(gpn)}}})),_pn={product:`llu.android`,version:`4.16.0`,"cache-control":`no-cache`};r8t({headers:i8t(p4(),p4())});var vpn={headers:_pn,credentials:null,patientId:null,credentialsRetryAt:null};gq()(vq(e=>({...vpn,setHeaders(t){e({headers:t})},setCredentials(t){e({credentials:t})},setCredentialsRetryAt(t){e({credentialsRetryAt:t})},setPatientId(t){e({patientId:t})},clear:()=>{e(vpn)}}),{name:`LIBRE_AUTH_STORE`,storage:_q(Sq)}));var ypn={setupCalculatorSettings:{},totalDailyDosage:null},bpn=gq()(e=>({...ypn,setupCalculatorActions:{setSetupCalculatorStoreValues:t=>{e(e=>({setupCalculatorSettings:{...e.setupCalculatorSettings,...t}}))},setTotalDailyDosage:t=>{e({totalDailyDosage:t})},clear:()=>{e(ypn)}}})),o7=()=>bpn(e=>e.setupCalculatorActions),s7=()=>bpn(e=>e.setupCalculatorSettings),xpn=()=>bpn(e=>e.totalDailyDosage),Spn={privacyNoticeAccepted:!1,extraFoodItems:[],visualSearchId:null},c7=gq()(vq(e=>({...Spn,acceptPrivacyNotice:()=>{e({privacyNoticeAccepted:!0})},addExtraFoodItem:t=>{e(e=>{let n=e.extraFoodItems.findIndex(e=>e.foodItem.id===t.foodItem.id);return n===-1?{extraFoodItems:[...e.extraFoodItems,t]}:{extraFoodItems:e.extraFoodItems.map((e,r)=>r===n?t:e)}})},setVisualSearchId:t=>{e({visualSearchId:t})},clearExtraFoodItems:()=>{e({extraFoodItems:[]})},clearVisualSearchId:()=>{e({visualSearchId:null})},clear:()=>{e(Spn)}}),{name:`VISUAL_SEARCH_STORE`,storage:_q(Sq)})),l7=()=>{L5.getState().clear(),R5.getState().glucoseStoreActions.clear(),a7.getState().activityStoreActions.clear(),B5.getState().noteStoreActions.clear()},Cpn=()=>{let{t:e}=Tq(),{showDiscardCalculationModal:t,modalStoreActions:n,isGoToSettingsPressed:r}=z5(),{deleteNoteAndAssets:i}=hpn(),a=N$(),o=(0,H.useRef)(!1),s=(0,H.useCallback)(()=>{let e=B5.getState().noteId;e&&i(e).catch(console.error),l7(),o.current=!0,n.set({showDiscardCalculationModal:!1})},[i,n]),c=(0,H.useCallback)(()=>{o.current&&(o.current=!1,a.pop()),r&&((yvt||kq)&&a.reset({index:1,routes:[{name:Q.MainBottomTabs},{name:Q.SettingsStack,state:{routes:[{name:Q.Settings},{name:Q.ActivitySettings}],index:1}}]}),n.set({isGoToSettingsPressed:!1}))},[r,n,a]),l=(0,H.useMemo)(()=>[{testID:`discard-button`,title:e(`calcflow_modal_discard_cal_button`),type:H4.Error,onPress:s},{testID:`cancel-button`,title:e(`button_cancel`),type:H4.Secondary,onPress:()=>{n.set({showDiscardCalculationModal:!1,isGoToSettingsPressed:!1})}}],[s,n,e]);return(0,W.jsx)(u3,{testID:`discard_calculation_modal`,isVisible:t,title:e(`calcflow_modal_discard_cal_title`),onModalHide:c,buttons:l},`discard_calculation_modal`)};function wpn(e,t){let n=e3(e,t?.in),r=n.getFullYear(),i=n.getMonth(),a=$4(n,0);return a.setFullYear(r,i+1,0),a.setHours(0,0,0,0),a.getDate()}function Tpn(e,t,n){let r=e3(e,n?.in),i=r.getFullYear(),a=r.getDate(),o=$4(n?.in||e,0);o.setFullYear(i,t,15),o.setHours(0,0,0,0);let s=wpn(o);return r.setMonth(t,Math.min(a,s)),r}function Epn(e,t,n){let r=e3(e,n?.in);return isNaN(+r)?$4(n?.in||e,NaN):(t.year!=null&&r.setFullYear(t.year),t.month!=null&&(r=Tpn(r,t.month)),t.date!=null&&r.setDate(t.date),t.hours!=null&&r.setHours(t.hours),t.minutes!=null&&r.setMinutes(t.minutes),t.seconds!=null&&r.setSeconds(t.seconds),t.milliseconds!=null&&r.setMilliseconds(t.milliseconds),r)}function Dpn(e,t,n){return Yon(e,-t,n)}var u7=function(e){return e.Create=`Create`,e.Edit=`Edit`,e.Delete=`Delete`,e}({});function Opn(){let e=Epn(Dpn(new Date,4),{seconds:0,milliseconds:0});return K8.getLogbooks(e).map(e=>({uuid:e.uuid,time:e.entry_timestamp,insulinValue:e.insulin_entered_units?.toString()??``}))}function kpn(){let[e,t]=(0,H.useState)(Opn),[n,r]=(0,H.useState)(null),[i,a]=(0,H.useState)(!1),[o,s]=(0,H.useState)(`Create`),[c,l]=(0,H.useState)(void 0),u=(0,H.useCallback)(()=>{t(Opn())},[]);return(0,H.useEffect)(()=>{n&&u()},[n,u]),V$((0,H.useCallback)(()=>{u()},[u])),(0,H.useEffect)(()=>{q8.syncAll().catch(console.error).finally(()=>{u()})},[u]),{entries:e,animatedEntryId:n,isInfoModalVisible:i,setIsInfoModalVisible:a,registerInsulinAction:o,editingInsulinEntry:c,refresh:u,handleEditInsulinEntry:(0,H.useCallback)(t=>{let n=e.find(e=>e.uuid===t);n&&(s(`Edit`),l(n))},[e]),handleEntryAnimationFinished:(0,H.useCallback)(()=>{r(null)},[]),handleRegisterInsulinPressed:(0,H.useCallback)(()=>{s(`Create`),l(void 0)},[]),handleRegisterInsulinClose:(0,H.useCallback)(e=>{r(e||`deleted-${Date.now()}`)},[])}}if(!H.useState)throw Error(`mobx-react-lite requires React with Hooks support`);if(!yrn)throw Error(`mobx-react-lite@3 requires mobx at least version 6 to be available`);var d7=_();function Apn(e){e()}function jpn(e){e||=Apn,arn({reactionScheduler:e})}function Mpn(e){return srn(e)}var Npn=!1;function Ppn(){return Npn}var Fpn=1e4,Ipn=1e4,Lpn=function(){function e(e){var t=this;Object.defineProperty(this,"finalize",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"registrations",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"sweepTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sweep",{enumerable:!0,configurable:!0,writable:!0,value:function(e){e===void 0&&(e=Fpn),clearTimeout(t.sweepTimeout),t.sweepTimeout=void 0;var n=Date.now();t.registrations.forEach(function(r,i){n-r.registeredAt>=e&&(t.finalize(r.value),t.registrations.delete(i))}),t.registrations.size>0&&t.scheduleSweep()}}),Object.defineProperty(this,"finalizeAllImmediately",{enumerable:!0,configurable:!0,writable:!0,value:function(){t.sweep(0)}})}return Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){this.registrations.set(n,{value:t,registeredAt:Date.now()}),this.scheduleSweep()}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.registrations.delete(e)}}),Object.defineProperty(e.prototype,"scheduleSweep",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.sweepTimeout===void 0&&(this.sweepTimeout=setTimeout(this.sweep,Ipn))}}),e}(),Rpn=new(typeof FinalizationRegistry<`u`?FinalizationRegistry:Lpn)(function(e){var t;(t=e.reaction)==null||t.dispose(),e.reaction=null}),zpn=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.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),Bpn=s(((e,t)=>{t.exports=zpn()}))();function Vpn(e){e.reaction=new E6(`observer${e.name}`,function(){var t;e.stateVersion=Symbol(),(t=e.onStoreChange)==null||t.call(e)})}function Hpn(e,t){if(t===void 0&&(t=`observed`),Ppn())return e();var n=H.useRef(null);if(!n.current){var r={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:t,subscribe:function(e){return Rpn.unregister(r),r.onStoreChange=e,r.reaction||(Vpn(r),r.stateVersion=Symbol()),function(){var e;r.onStoreChange=null,(e=r.reaction)==null||e.dispose(),r.reaction=null}},getSnapshot:function(){return r.stateVersion}};n.current=r}var i=n.current;i.reaction||(Vpn(i),Rpn.register(n,i,i)),H.useDebugValue(i.reaction,Mpn),(0,Bpn.useSyncExternalStore)(i.subscribe,i.getSnapshot,i.getSnapshot);var a,o;if(i.reaction.track(function(){try{a=e()}catch(e){o=e}}),o)throw o;return a}var Upn=typeof Symbol==`function`&&Symbol.for,Wpn=Object.getOwnPropertyDescriptor(function(){},`name`)?.configurable??!1,Gpn=Upn?Symbol.for(`react.forward_ref`):typeof H.forwardRef==`function`&&(0,H.forwardRef)(function(e){return null}).$$typeof,Kpn=Upn?Symbol.for(`react.memo`):typeof H.memo==`function`&&(0,H.memo)(function(e){return null}).$$typeof;function f7(e,t){if(Kpn&&e.$$typeof===Kpn)throw Error("[mobx-react-lite] You are trying to use `observer` on a function component wrapped in either another `observer` or `React.memo`. The observer already applies 'React.memo' for you.");if(Ppn())return e;var n=t?.forwardRef??!1,r=e,i=e.displayName||e.name;if(Gpn&&e.$$typeof===Gpn&&(n=!0,r=e.render,typeof r!=`function`))throw Error("[mobx-react-lite] `render` property of ForwardRef was not a function");var a=function(e,t){return Hpn(function(){return r(e,t)},i)};return a.displayName=e.displayName,Wpn&&Object.defineProperty(a,"name",{value:e.name,writable:!0,configurable:!0}),e.contextTypes&&(a.contextTypes=e.contextTypes),n&&(a=(0,H.forwardRef)(a)),a=(0,H.memo)(a),Jpn(e,a),a}var qpn={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function Jpn(e,t){Object.keys(e).forEach(function(n){qpn[n]||Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}function Ypn(e){var t=e.children,n=e.render;t&&n&&console.error("MobX Observer: Do not use children and render in the same time in `Observer`");var r=t||n;return typeof r==`function`?Hpn(r):null}Ypn.displayName=`Observer`,jpn(d7.unstable_batchedUpdates),Rpn.finalizeAllImmediately,V();function Xpn(){return H.useEffect(()=>{console.warn(`DateTimePicker is not supported on: ${z.OS}`)},[]),null}var Zpn=Xpn;V();var p7=(e,t)=>{let n=e.indexOf(t);return n===-1?0:n},m7=(e,t)=>{let n=new Date(e);return n.setHours(t,0,0,0),{date:n,formatted:I8(n,`HH:mm`)}},h7=Array.from({length:60},(e,t)=>t.toString().padStart(2,`0`));function Qpn({isVisible:e,initialValue:t,min:n,max:r,onCancel:i,onConfirm:a,onModalHide:o}){let{COLORS:s}=J(),{width:c}=em(),l=(0,H.useRef)(null),u=(0,H.useRef)(null),[d,f]=(0,H.useState)(t),p=(0,H.useMemo)(()=>{if(!n||!r){let e=new Date;return Array.from({length:24},(t,n)=>m7(e,n))}let e=n.getHours(),t=r.getHours(),i=[];if(J9t(n,r)&&n<r&&e<=t)for(let r=e;r<=t;r++)i.push(m7(n,r));else{for(let t=e;t<24;t++)i.push(m7(n,t));for(let e=0;e<=t;e++)i.push(m7(r,e))}return i},[n,r]),m=(0,H.useMemo)(()=>p.map(e=>I8(e.date,`HH`)),[p]),h=(0,H.useMemo)(()=>{let[e]=I8(t,`HH:mm`).split(`:`);return p7(m,e)},[t,m]),g=(0,H.useMemo)(()=>{let[,e]=I8(t,`HH:mm`).split(`:`);return p7(h7,e)},[t]),_=(0,H.useMemo)(()=>{let[e]=I8(d,`HH:mm`).split(`:`);return p7(m,e)},[d,m]),v=(0,H.useMemo)(()=>{let[,e]=I8(d,`HH:mm`).split(`:`);return p7(h7,e)},[d]),y=(0,H.useMemo)(()=>n?p7(m,I8(n,`HH`)):null,[n,m]),b=(0,H.useMemo)(()=>r?p7(m,I8(r,`HH`)):null,[r,m]),x=(0,H.useMemo)(()=>n?parseInt(I8(n,`mm`),10):null,[n]),S=(0,H.useMemo)(()=>r?parseInt(I8(r,`mm`),10):null,[r]),C=(0,H.useCallback)((e,t)=>{let n=e<0||e>=m.length,r=t<0||t>=h7.length;if(n||r)return;let i=p[e].date;f(Epn(i,{minutes:parseInt(h7[t],10),seconds:0,milliseconds:0}))},[m.length,p]),w=(0,H.useCallback)(e=>{u.current?.scrollToIndex(e)},[]),T=(0,H.useCallback)(e=>{if(b===null||y===null||S===null||x===null){C(e,v);return}let t=v;if(e===y&&v<x){t=x,w(x),C(e,t);return}if(e===b&&v>S){t=S,w(S),C(e,t);return}C(e,v)},[b,y,S,x,v,C,w]),E=(0,H.useCallback)(e=>{if(b===null||y===null||S===null||x===null){C(_,e);return}let t=e;if(_===y&&e<x){t=x,w(x),C(_,t);return}if(_===b&&e>S){t=S,w(S),C(_,t);return}C(_,t)},[b,S,y,x,_,C,w]),D=(0,H.useCallback)(()=>{a(d)},[a,d]),O=(0,H.useCallback)(()=>{f(t),i()},[i,t]);return(0,W.jsx)(u3,{isVisible:e,containerStyle:{backgroundColor:s.bgTransparent},onModalHide:o,children:(0,W.jsxs)(B,{children:[(0,W.jsxs)(B,{style:g7.pickersContainer,children:[(0,W.jsx)(Z5,{ref:l,initialScrollIndex:h,options:m,onChange:T,containerStyle:[g7.itemContainerLeft,{width:(c-32)/2}],selectedIndicatorStyle:[g7.selectedIndicatorLeft,{width:(c-32)/2-10}],itemStyle:g7.itemLeft,testID:`hours-wheel-picker`},`hours-wheel-picker`),(0,W.jsx)(Z5,{ref:u,initialScrollIndex:g,options:h7,onChange:E,containerStyle:[g7.itemContainerRight,{width:(c-32)/2}],selectedIndicatorStyle:[g7.selectedIndicatorRight,{width:(c-32)/2-10}],itemStyle:g7.itemRight,testID:`minutes-wheel-picker`},`minutes-wheel-picker`)]}),(0,W.jsxs)(B,{style:g7.buttonContainer,children:[(0,W.jsx)(X5,{onPress:D}),(0,W.jsx)(Y5,{onPress:O})]})]})})}var $pn=H.memo(Qpn),g7=R.create({buttonContainer:{gap:8},pickersContainer:{flexDirection:`row`,borderTopLeftRadius:13,borderTopRightRadius:13,overflow:`hidden`},itemContainerLeft:{borderTopRightRadius:0,paddingLeft:16},itemContainerRight:{borderTopLeftRadius:0,paddingRight:16},itemLeft:{alignSelf:`flex-end`,marginRight:16},itemRight:{alignSelf:`flex-start`,marginLeft:16},selectedIndicatorRight:{alignSelf:`flex-start`,borderTopLeftRadius:0,borderBottomLeftRadius:0},selectedIndicatorLeft:{alignSelf:`flex-end`,borderTopRightRadius:0,borderBottomRightRadius:0}}),emn=({onPress:e})=>(0,W.jsx)(X5,{onPress:e}),tmn=({onPress:e})=>(0,W.jsx)(Y5,{onPress:e}),nmn=.5,rmn=e=>{switch(e){case X.InjectionMethod.PenWhole:return a3(X.CONSTANTS.INSULIN_DOSE_MIN,X.CONSTANTS.INSULIN_DOSE_MAX);case X.InjectionMethod.PenHalf:return q9t(X.CONSTANTS.INSULIN_DOSE_MIN,X.CONSTANTS.INSULIN_DOSE_MAX,nmn);case X.InjectionMethod.Pump:return o3(X.CONSTANTS.INSULIN_DOSE_MIN,X.CONSTANTS.INSULIN_DOSE_MAX);default:throw Error(`[insulin::getInsulinInputSequentialArray] Unsupported injection method!`)}},imn=e=>{switch(e){case X.InjectionMethod.PenWhole:return 0;case X.InjectionMethod.PenHalf:return 1;case X.InjectionMethod.Pump:return 1;default:throw Error(`[insulin::getInsulinInputDecimalPlaces] Unsupported injection method!`)}};V(),Z0();function amn({action:e=u7.Create,insulinEntry:t,onClose:n}){let{t:r}=Tq(),{COLORS:i,isDark:a,effectiveColorScheme:o}=J(),{bottom:s}=W0(),[c,l]=(0,H.useState)(!1),[u,d]=(0,H.useState)(t?.insulinValue),[f,p]=(0,H.useState)(!1),[m,h]=(0,H.useState)(t?.time),[g,_]=(0,H.useState)(),[v,y]=(0,H.useState)(!1),[b,x]=(0,H.useState)(!1),S=(0,H.useRef)(!1),{initialInsulinValue:C,initialDate:w}=(0,H.useMemo)(()=>({initialInsulinValue:t?.insulinValue,initialDate:t?.time}),[t]),T=(0,H.useCallback)(()=>{l(!0)},[]);(0,H.useEffect)(()=>{e===u7.Create&&setTimeout(()=>{T()},300),d(t?.insulinValue),h(t?.time)},[e,T,t]);let E=k8.injectionMethod;if(E===void 0)throw Error(`[RegisterActiveInsulin::render] injectionMethod is undefined`);let D=(0,H.useMemo)(()=>rmn(E),[E]),O=(0,H.useCallback)(async()=>{try{if(!u||!m){console.error(`[RegisterActiveInsulin::handleConfirm] insulinValue or date is undefined`),y(!0);return}let r=e===u7.Create,i=r?dsn({entry_timestamp:m,insulin_entered_units:parseFloat(u)}):{...K8.getLogbookByUUID(t.uuid),entry_timestamp:m,insulin_entered_units:parseFloat(u)};if(!await K8.addLogbook(i,r?void 0:t.uuid)){y(!0);return}n(i.uuid)}catch(e){console.error(`[RegisterActiveInsulin::handleConfirm] Error saving insulin entry:`,e),y(!0)}},[m,u,e,t,n]),k=(0,H.useCallback)(async()=>{try{if(!t)return;await K8.deleteLogbook(t.uuid)?n():y(!0)}catch(e){console.error(`[RegisterActiveInsulin::deleteInsulinEntry] Error deleting insulin entry:`,e),y(!0)}},[t,n]),A=(0,H.useCallback)(()=>{S.current=!0,x(!1)},[]),ee=(0,H.useCallback)(()=>{S.current&&(S.current=!1,k().catch(console.error))},[k]),te=(0,H.useCallback)(()=>{p(!0)},[]),ne=(0,H.useCallback)(e=>{let t=new Date,n=R9t(e,{start:Epn(Dpn(t,4),{seconds:0,milliseconds:0}),end:t})?void 0:r(`error_insulin_intake_hint`);h(e),_(n),p(!1)},[r]),re=(0,H.useCallback)(()=>{p(!1)},[]),ie=(0,H.useCallback)(e=>{d(e.toString()),l(!1)},[]),j=(0,H.useMemo)(()=>{if(!u)return 0;let e=imn(E);return D.findIndex(t=>t===parseFloat(u).toFixed(e))},[u,D,E]);function ae(){return(0,W.jsxs)(B,{style:_7.header,children:[(0,W.jsx)(U5,{onPress:n}),(0,W.jsx)(Z,{style:_7.headerTitle,numberOfLines:1,ellipsizeMode:`middle`,children:r(`register_insulin_title`,{timeFourHour:I8(Dpn(new Date,4),`HH:mm`)})}),(0,W.jsx)(W5,{onPress:O,disabled:!m||!u||!!g||w===m&&C===u})]})}function oe(){return(0,W.jsx)(B,{style:[_7.setTimeButton,{backgroundColor:i.bgPill}],children:(0,W.jsx)(Z,{style:[_7.setTimeText,{color:i.labelPrimary},f&&{color:i.textLink},!!g&&{color:i.textInputDanger}],children:m?I8(m,`HH:mm`):r(`register_insulin_time_button_unit`)})})}return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(ae,{}),(0,W.jsxs)(fs,{contentContainerStyle:_7.contentContainer,children:[(0,W.jsxs)(B,{style:_7.screen,children:[(0,W.jsx)(Y4,{title:r(`register_insulin_input_title`),testID:`insulin-input`,onPress:T,renderRightSlot:()=>(0,W.jsxs)(B,{style:_7.insulinRightSlot,children:[(0,W.jsx)(Z,{style:[_7.insulinText,{color:i.labelPrimary}],children:u}),(0,W.jsx)(Z,{style:[_7.unitsText,{color:i.labelPrimary}],children:r(u&&parseFloat(u)===1?`unit`:`units`)})]}),style:c?{borderColor:i.borderInputFocus}:void 0}),(0,W.jsx)(B4,{isAnimated:!!g,children:(0,W.jsx)(Y4,{renderLeftSlot:()=>(0,W.jsx)(Z,{children:r(`register_insulin_time_input_title`)}),testID:`time-input`,errorMessage:g,onPress:te,renderRightSlot:oe,style:f?{flexWrap:`wrap`,paddingVertical:8,borderColor:i.borderInputFocus}:_7.rowInsulin})})]}),e===u7.Edit&&(0,W.jsx)(U4,{title:r(`button_delete`),onPress:()=>{x(!0)},type:H4.Error})]}),(0,W.jsx)(Q5,{isVisible:c,items:D,onConfirm:ie,onCancel:()=>{l(!1)},initialScrollIndex:j,testID:`insulin-wheel-picker`}),kq?(0,W.jsx)(Zpn,{testID:`date-time-picker`,isVisible:f,display:`spinner`,date:m??new Date,mode:new Date().getHours()>=4?`time`:`datetime`,minimumDate:new Date(1900,0,1),maximumDate:new Date,onConfirm:ne,onCancel:re,customConfirmButtonIOS:emn,customCancelButtonIOS:tmn,pickerContainerStyleIOS:{backgroundColor:i.iosKeyboardPicker},themeVariant:o,isDarkModeEnabled:a,pickerStyleIOS:_7.alignCenter,modalStyleIOS:{paddingBottom:s},is24Hour:!0,locale:`en_GB`}):(0,W.jsx)($pn,{isVisible:f,initialValue:m??new Date,onConfirm:ne,onCancel:re}),(0,W.jsx)(u3,{isVisible:b,onModalHide:ee,title:r(`register_insulin_modal_title`),message:r(`register_insulin_modal_body`),buttons:[{title:r(`button_delete`),testID:`confirm_delete`,type:H4.Error,onPress:A},{title:r(`button_cancel`),type:H4.Secondary,onPress:()=>{x(!1)}}]}),(0,W.jsx)(u3,{isVisible:v,title:r(`glucose_modal_changes_title`),message:r(`glucose_modal_changes_body`),buttons:[{title:r(`glucose_modal_changes_button_confirm`),onPress:()=>{y(!1)}}]})]})}var omn=f7(amn),_7=R.create({header:{width:`100%`,flexDirection:`row`,justifyContent:`space-between`,alignItems:`center`,paddingHorizontal:16,paddingBottom:12},headerTitle:{...Y.Poppins.medium_Base,flex:1,textAlign:`center`,marginHorizontal:8},contentContainer:{flex:1,paddingHorizontal:16,paddingTop:32,paddingBottom:440,gap:24},screen:{gap:16},rowInsulin:{flexWrap:`wrap`,paddingVertical:8},insulinRightSlot:{flexDirection:`row`,flex:1,alignItems:`center`,marginRight:8},setTimeButton:{borderRadius:16,paddingHorizontal:12,paddingVertical:8},setTimeText:{...Y.Poppins.medium_Base},insulinText:{...Y.Poppins.medium_Base,marginRight:4},unitsText:{...Y.Poppins.medium_Base},alignCenter:{alignSelf:`center`}});V();function smn({entriesCount:e,onInfoPress:t}){let{t:n}=Tq(),{COLORS:r}=J(),i=e>0;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(B,{style:v7.iconContainer,children:[(0,W.jsx)(r9t,{}),(0,W.jsx)(wp,{testID:`info-button`,style:v7.infoIconButton,onPress:t,children:(0,W.jsx)(n9t,{height:32,width:32,color:r.iconBrand})})]}),(0,W.jsx)(Z,{style:v7.title,children:n(i?`Recent_insulin_title`:`Recent_insulin_empty_title`)}),(0,W.jsx)(Z,{style:[v7.subtitle,v7.headerSubtitle,{color:r.labelSecondary}],children:n(i?`recent_insulin_body`:`Recent_insulin_empty_body`)})]})}function cmn(){return(0,W.jsx)(B,{style:v7.separatorList})}var v7=R.create({iconContainer:{marginBottom:16},title:{...Y.Poppins.semiBold_2XL,marginBottom:8},subtitle:{...Y.Poppins.regular_SM},headerSubtitle:{marginBottom:48},infoIconButton:{position:`absolute`,right:0},separatorList:{height:8}});V(),Z0();function lmn({onNoInsulinPressed:e}){let{t}=Tq(),{COLORS:n}=J(),{entries:r,animatedEntryId:i,isInfoModalVisible:a,setIsInfoModalVisible:o,registerInsulinAction:s,editingInsulinEntry:c,handleEditInsulinEntry:l,handleEntryAnimationFinished:u,handleRegisterInsulinPressed:d,handleRegisterInsulinClose:f}=kpn(),p=(0,H.useRef)(null),m=(0,H.useCallback)(()=>{u8(l8.RecentInsulinRegisterPress),d(),p.current?.present()},[d]),h=(0,H.useCallback)(e=>{f(e),p.current?.close()},[f]),g=(0,H.useCallback)(e=>{l(e),p.current?.present()},[l]);return(0,W.jsxs)(X0,{edges:[`bottom`],children:[(0,W.jsx)(Wc,{testID:`active_insulin_list`,data:r,keyExtractor:e=>e.uuid,contentContainerStyle:y7.contentContainer,ListHeaderComponent:()=>(0,W.jsx)(smn,{entriesCount:r.length,onInfoPress:()=>{o(!0)}}),ListHeaderComponentStyle:void 0,renderItem:({item:e,index:n})=>{let r=parseFloat(e.insulinValue)===1?t(`unit`):t(`units`);return(0,W.jsx)(I7t,{isAnimated:i===e.uuid,onAnimationFinished:u,children:(0,W.jsx)(Y4,{title:I8(e.time,`HH:mm`),onPress:()=>{g(e.uuid)},testID:`entry-${n}`,renderRightSlot:()=>(0,W.jsxs)(B,{style:y7.rightSlot,children:[(0,W.jsx)(Z,{style:y7.insulinValueText,children:`${e.insulinValue} ${r}`}),(0,W.jsx)(K4,{})]})})})},ItemSeparatorComponent:cmn,ListFooterComponent:()=>(0,W.jsxs)(B,{style:y7.buttonsWrapper,children:[(0,W.jsx)(U4,{title:r.length>0?t(`recent_insulin_button_add`):t(`recent_insulin_empty_button_add`),onPress:m,testID:`register-insulin-button`,type:r.length>0?H4.Secondary:H4.Primary}),(0,W.jsx)(U4,{title:r.length>0?t(`Recent_insulin_button_continue`):t(`recent_insulin_empty_button_continue`),type:r.length>0?H4.Primary:H4.Secondary,onPress:e})]}),ListFooterComponentStyle:y7.footer}),(0,W.jsx)(_$,{ref:p,handleIndicatorStyle:{height:0},backdropComponent:V4,backgroundStyle:{backgroundColor:n.bgSheet,borderRadius:36},stackBehavior:`push`,enablePanDownToClose:!1,children:(0,W.jsx)(y$,{children:(0,W.jsx)(omn,{action:s,insulinEntry:c,onClose:h})})}),(0,W.jsx)(u3,{isVisible:a,onRequestClose:()=>{o(!1)},title:t(`Recent_insulin_modal_title`),message:t(`Recent_insulin_modal_body`),buttons:[{title:t(`button_close`),onPress:()=>{o(!1)}}]},`recent_insulin_info`)]})}var y7=R.create({contentContainer:{paddingHorizontal:16,paddingBottom:16},footer:{paddingTop:48},buttonsWrapper:{gap:8},rightSlot:{flexDirection:`row`,alignItems:`center`},insulinValueText:{...Y.Poppins.regular_Base,marginRight:16}}),b7=()=>R5(e=>e.selectedReadingId&&e.availableGlucoseReadings.find(t=>t.id===e.selectedReadingId)||null),umn=e=>R5(t=>t.availableGlucoseReadings.find(t=>t.source===e)||null),dmn=()=>({fetchLibreCgmData:()=>Promise.resolve()});V();var fmn={top:16,bottom:16,left:16,right:16};function pmn({activity:e,isChecked:t,index:n=0,onEdit:r,toggleActivitySwitch:i}){let{t:a}=Tq(),{COLORS:o}=J();if(!k8.activity)throw Error(`[ActivityCard::render] No settings found!`);if(!k8.glucoseUnit)throw Error(`[ActivityCard::render] No glucose unit found!`);let{activityIntensity:s,durationSeconds:c,startTimestamp:l,type:u,uuid:d}=e;if(!l)throw Error(`[ActivityCard::render] No startTimestamp!`);let f=s?R8[s]():null,p=(0,H.useMemo)(()=>Math.round(c/60),[c]),[m,h]=(0,H.useState)(esn(l,p)),g=(0,H.useMemo)(()=>{try{let e=k8.activity;if(!e)throw Error(`[ActivityCard::reduction] No settings found!`);return((0,b8.getReduction)(p,e,s,new Date(l))*100).toFixed(0)}catch(e){return console.error(`Error calculating reduction for activity`,e),null}},[s,p,l]),_=t?1:.5,v=`activity-${p}-${s}-${u}-${t}`.toLowerCase(),y=`activity-card-${n}`;return(0,H.useEffect)(()=>{let e=()=>setInterval(()=>{h(esn(l,p))},X.Milliseconds.Minute),n=e=>{e&&clearInterval(e)},r=t?e():null;return()=>{n(r)}},[t,l,p]),g===null?null:(0,W.jsxs)(wp,{testID:v,style:[x7.card,{backgroundColor:o.bgSecondary}],onPress:()=>{r(d)},children:[(0,W.jsxs)(B,{style:x7.headerContainer,children:[(0,W.jsxs)(B,{style:x7.left,children:[(0,W.jsxs)(B,{style:[x7.headerContent,{opacity:_}],children:[(0,W.jsx)(W7t,{height:24,width:24,color:o.iconButtonSecondary}),(0,W.jsxs)(Z,{style:x7.header,children:[`${$on(p)} ${a(`activity_card__active_min`)}`,f&&`, `+f]})]}),(0,W.jsxs)(Z,{style:[x7.expiresIn,{color:o.labelSecondary,opacity:_}],children:[a(`activity_card_active_time`),` `,m]})]}),(0,W.jsx)(wp,{onPress:()=>{i(d)},hitSlop:fmn,children:(0,W.jsx)(Np,{testID:`${y}-${t}`,value:t,onValueChange:()=>{i(d)},trackColor:{true:o.bgSliderForeground,false:o.bgSliderBackground},thumbColor:o.toggleKnob,activeThumbColor:o.toggleKnob,activeTrackColor:o.bgSliderForeground})})]}),!!g&&(0,W.jsxs)(B,{style:[x7.reduction,{opacity:_}],children:[(0,W.jsx)(Z,{style:x7.reductionText,children:a(`activity_card_insulinReduction`)}),(0,W.jsx)(Z,{style:x7.reductionValue,children:` ${g}%`})]})]})}var x7=R.create({card:{marginBottom:12,overflow:`hidden`,borderRadius:16,padding:16},headerContainer:{flexDirection:`row`,justifyContent:`space-between`},left:{flex:1},headerContent:{flexDirection:`row`,alignItems:`center`,gap:4},header:{...Y.Poppins.regular_SM},expiresIn:{...Y.Poppins.regular_XS,marginBottom:8},reduction:{flexDirection:`row`,alignItems:`baseline`,justifyContent:`space-between`,gap:8},reductionText:{...Y.Poppins.regular_SM,flexShrink:1},reductionValue:{...Y.Poppins.bold_2XL}});V();var mmn=({selectedActivity:e,onClose:t})=>{let{t:n}=Tq(),{COLORS:r}=J(),{navigate:i}=N$(),{activityStoreActions:a}=a7(),{modalStoreActions:o,isGoToSettingsPressed:s}=z5(),[c,l]=(0,H.useState)(!1),{activity:u}=k8;if(u===void 0)throw Error(`[CreateActivity::render] activitySettings is undefined`);let d=(0,H.useMemo)(()=>({uuid:i3(),startTimestamp:null,deleted:!1,type:null,activityIntensity:null,durationSeconds:0}),[]),f=(0,H.useMemo)(()=>e??d,[d,e]),p=(0,H.useMemo)(()=>f.startTimestamp===null?null:new Date(f.startTimestamp).getTime()+f.durationSeconds*X.Milliseconds.Second>Date.now()?0:1,[f]),[m,h]=(0,H.useState)(f),[g,_]=(0,H.useState)(p),v=(0,H.useMemo)(()=>g===null?!1:g===1?m.durationSeconds>0&&!!m.startTimestamp:m.durationSeconds>0&&!!m.activityIntensity&&!!m.startTimestamp,[m,g]),y=(0,H.useMemo)(()=>!s3(m,f),[m,f]),b=(0,H.useCallback)(async()=>{let n=e?.uuid,r=n?{...m,uuid:i3()}:m;if(await S8.create(r,n)){let e=S8.getEventWithHighestReduction(u);a.set({selectedEventUUID:e?.uuid??r.uuid,activityDurationSeconds:e?.durationSeconds??0}),u8(n?l8.ActivityEditPress:l8.ActivityAddPress),t()}else o.set({showSyncErrorModal:!0})},[m,u,a,o,t,e?.uuid]),x=e=>{h(t=>({...t,...e}))},S=e=>{let t=e*60,n=Date.now()-(g===1?t*X.Milliseconds.Second:0);x({durationSeconds:t,startTimestamp:new Date(n).toISOString()})},C=e=>{x({activityIntensity:X.ActivityIntensity[e]})},w=()=>{_(0),m.durationSeconds!==0&&x({startTimestamp:new Date().toISOString()})},T=()=>{_(1),x({activityIntensity:null}),m.durationSeconds!==0&&x({startTimestamp:new Date(Date.now()-m.durationSeconds*X.Milliseconds.Second).toISOString()})},E=()=>{x({durationSeconds:0,activityIntensity:null})},D=()=>{E(),o.set({isGoToSettingsPressed:!0})},O=()=>{s&&(t(),o.set({showDiscardCalculationModal:!Oq}),Oq&&(i(Q.SettingsStack,{screen:Q.ActivitySettings}),o.set({isGoToSettingsPressed:!1})))},k=(0,H.useMemo)(()=>Math.round(m.durationSeconds/60),[m.durationSeconds]),A=(0,H.useMemo)(()=>{if(!v)return!1;let{activityIntensity:e}=m,{hard:t,light:n,moderate:r,post:i}=u,a=g===0;if(g===1)return k===120?i.fromSixtyone!==null:!0;if(a){if(k===60&&e===X.ActivityIntensity.hard)return t.fromFortysix!==null;if(k===120&&e===X.ActivityIntensity.hard)return t.fromSixtyone!==null;if(k===120&&e===X.ActivityIntensity.moderate)return r.fromSixtyone!==null;if(k===120&&e===X.ActivityIntensity.light)return n.fromSixtyone!==null}return!0},[m,u,g,v,k]);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(GUt,{testID:`create-activity-scroll-view`,style:[S7.container,{backgroundColor:r.bgSheet}],contentContainerStyle:S7.contentContainer,children:[(0,W.jsxs)(B,{style:S7.header,children:[(0,W.jsx)(U5,{onPress:t}),(0,W.jsx)(W5,{onPress:b,disabled:!v||!y})]}),(0,W.jsxs)(B,{style:S7.cardMandatory,children:[(0,W.jsxs)(B,{children:[(0,W.jsx)(Z,{style:[S7.headerTitle,{color:r.labelSecondary}],children:n(`new_activity_when_title`)}),(0,W.jsxs)(B,{style:[S7.segmentContainer,{backgroundColor:r.bgSegmentContainer,borderColor:r.buttonBorder}],children:[(0,W.jsx)(wp,{style:[S7.segment,g===0&&{backgroundColor:r.bgSegmentPrimary}],onPress:w,testID:`starting-now-touchable-${g===0}`,children:(0,W.jsx)(Z,{style:[S7.value,{color:g===0?r.textLabelActive:r.textLabelInactive}],children:n(`new_activity_when_option1`)})}),(0,W.jsx)(B,{style:[S7.borderLeft,{backgroundColor:r.divider}]}),(0,W.jsx)(wp,{style:[S7.segment,g===1&&{backgroundColor:r.bgSegmentPrimary}],onPress:T,testID:`just-finished-now-touchable-${g===1}`,children:(0,W.jsx)(Z,{style:[S7.value,{color:g===1?r.textLabelActive:r.textLabelInactive}],children:n(`new_activity_when_option2`)})})]})]}),(0,W.jsxs)(B,{children:[(0,W.jsx)(Z,{style:[S7.headerTitle,{color:r.labelSecondary}],children:n(`new_activity_duration_title`)}),(0,W.jsxs)(B,{style:[S7.segmentContainer,{backgroundColor:r.bgSegmentContainer,borderColor:r.buttonBorder}],children:[(0,W.jsx)(wp,{style:[S7.segment,k===29&&{backgroundColor:r.bgSegmentPrimary}],onPress:()=>{S(29)},children:(0,W.jsx)(Z,{style:[S7.value,{color:k===29?r.textLabelActive:r.textLabelInactive}],children:`0-29`})}),(0,W.jsx)(B,{style:[S7.borderLeft,{backgroundColor:r.divider}]}),(0,W.jsx)(wp,{style:[S7.segment,k===45&&{backgroundColor:r.bgSegmentPrimary}],onPress:()=>{S(45)},children:(0,W.jsx)(Z,{style:[S7.value,{color:k===45?r.textLabelActive:r.textLabelInactive}],children:`30-45`})}),(0,W.jsx)(B,{style:[S7.borderLeft,{backgroundColor:r.divider}]}),(0,W.jsx)(wp,{style:[S7.segment,k===60&&{backgroundColor:r.bgSegmentPrimary}],onPress:()=>{S(60)},children:(0,W.jsx)(Z,{style:[S7.value,{color:k===60?r.textLabelActive:r.textLabelInactive}],children:`46-60`})}),(0,W.jsx)(B,{style:[S7.borderLeft,{backgroundColor:r.divider}]}),(0,W.jsx)(wp,{style:[S7.segment,k===120&&{backgroundColor:r.bgSegmentPrimary}],onPress:()=>{S(120)},children:(0,W.jsx)(Z,{style:[S7.value,{color:k===120?r.textLabelActive:r.textLabelInactive}],children:`61-120`})})]})]}),(0,W.jsxs)(B,{style:{opacity:g===1?.5:1},children:[(0,W.jsxs)(B,{style:{flexDirection:`row`,justifyContent:`space-between`},children:[(0,W.jsx)(Z,{style:[S7.headerTitle,{color:r.labelSecondary}],children:n(`new_activity_intensity_title`)}),(0,W.jsx)(wp,{onPress:()=>{g!==1&&l(!0)},children:(0,W.jsx)(n9t,{width:24,height:24,color:r.iconBrand})})]}),(0,W.jsxs)(B,{style:[S7.segmentContainer,{backgroundColor:r.bgSegmentContainer,borderColor:r.buttonBorder}],children:[(0,W.jsx)(wp,{style:[S7.segment,m.activityIntensity===X.ActivityIntensity.light&&{backgroundColor:r.bgSegmentPrimary}],onPress:()=>{g!==1&&C(X.ActivityIntensity.light)},testID:`activity-light-touchable-${m.activityIntensity===X.ActivityIntensity.light}`,children:(0,W.jsx)(Z,{style:[S7.value,{color:m.activityIntensity===X.ActivityIntensity.light?r.textLabelActive:r.textLabelInactive}],maxFontSizeMultiplier:C2.s2,children:n(`activity_intensity_1`)})}),(0,W.jsx)(B,{style:[S7.borderLeft,{backgroundColor:r.divider}]}),(0,W.jsx)(wp,{style:[S7.segment,m.activityIntensity===X.ActivityIntensity.moderate&&{backgroundColor:r.bgSegmentPrimary}],onPress:()=>{g!==1&&C(X.ActivityIntensity.moderate)},testID:`activity-moderate-touchable-${m.activityIntensity===X.ActivityIntensity.moderate}`,children:(0,W.jsx)(Z,{style:[S7.value,{color:m.activityIntensity===X.ActivityIntensity.moderate?r.textLabelActive:r.textLabelInactive}],maxFontSizeMultiplier:C2.s2,children:n(`activity_intensity_2`)})}),(0,W.jsx)(B,{style:[S7.borderLeft,{backgroundColor:r.divider}]}),(0,W.jsx)(wp,{style:[S7.segment,m.activityIntensity===X.ActivityIntensity.hard&&{backgroundColor:r.bgSegmentPrimary}],onPress:()=>{g!==1&&C(X.ActivityIntensity.hard)},testID:`activity-hard-touchable-${m.activityIntensity===X.ActivityIntensity.hard}`,children:(0,W.jsx)(Z,{style:[S7.value,{color:m.activityIntensity===X.ActivityIntensity.hard?r.textLabelActive:r.textLabelInactive}],maxFontSizeMultiplier:C2.s2,children:n(`activity_intensity_3`)})})]})]})]})]}),(0,W.jsx)(t7,{}),(0,W.jsx)(u3,{isVisible:!A&&v,title:n(`new_activity_modal_reduction_title`),message:n(`new_activity_modal_reduction_subtitle`),onModalHide:O,buttons:[{title:n(`button_settings`),testID:`settings-button`,onPress:D},{title:n(`button_cancel`),testID:`cancel-button`,onPress:E,type:H4.Secondary}]}),(0,W.jsxs)(u3,{isVisible:c,title:n(`calcflow_activityInfo_modal_title`),buttons:[{title:n(`button_close`),onPress:()=>{l(!1)}}],children:[(0,W.jsx)(Z,{style:S7.intensityDescriptionTitle,children:n(`calcflow_activityInfo_modal_intensity1_title`)}),(0,W.jsx)(Z,{style:[S7.intensityDescriptionText,{color:r.labelSecondary}],children:n(`calcflow_activityInfo_modal_intensity1_body`)}),(0,W.jsx)(Z,{style:S7.intensityDescriptionTitle,children:n(`calcflow_activityInfo_modal_intensity2_title`)}),(0,W.jsx)(Z,{style:[S7.intensityDescriptionText,{color:r.labelSecondary}],children:n(`calcflow_activityInfo_modal_intensity2_body`)}),(0,W.jsx)(Z,{style:S7.intensityDescriptionTitle,children:n(`calcflow_activityInfo_modal_intensity3_title`)}),(0,W.jsx)(Z,{style:[S7.intensityDescriptionText,{color:r.labelSecondary}],children:n(`calcflow_activityInfo_modal_intensity3_body`)})]})]})},S7=R.create({container:{marginHorizontal:16},contentContainer:{paddingBottom:64},header:{flexDirection:`row`,justifyContent:`space-between`,marginBottom:32},cardMandatory:{gap:24},headerTitle:{...Y.Poppins.regular_SM,marginHorizontal:16,marginBottom:8},segmentContainer:{flexDirection:`row`,justifyContent:`center`,alignItems:`center`,borderRadius:16,borderWidth:1,padding:2},segment:{flex:1,flexDirection:`row`,justifyContent:`center`,alignItems:`center`,alignSelf:`stretch`,paddingVertical:4,paddingHorizontal:10,borderRadius:16},borderLeft:{alignSelf:`center`,height:16,width:1},value:{...Y.Poppins.regular_Base},intensityDescriptionTitle:{...Y.Poppins.semiBold_Base,marginTop:16},intensityDescriptionText:{...Y.Poppins.regular_Base}}),hmn=f7(mmn);V();var gmn=()=>{let{t:e}=Tq(),{COLORS:t}=J(),{addListener:n,removeListener:r}=N$(),i=(0,H.useRef)(null),a=(0,H.useRef)(!1),{activity:o}=k8,{selectedEventUUID:s,activityStoreActions:c}=a7(),[l,u]=(0,H.useState)(null),[d,f]=(0,H.useState)([]);(0,H.useEffect)(()=>{if(!a.current){let e=S8.getEventWithHighestReduction(o);c.set({selectedEventUUID:e?.uuid??null,activityDurationSeconds:e?.durationSeconds??0}),a.current=!0}},[o,c]);let p=()=>{f(S8.getActiveEvents())};(0,H.useEffect)(()=>{let e=Sf.addEventListener(`change`,e=>{e===`active`&&p()});return n(`focus`,p),()=>{r(`focus`,p),e.remove()}},[r,n]);let m=(0,H.useCallback)(e=>{let t=S8.getByUUID(e);c.set({selectedEventUUID:s===e?null:e,activityDurationSeconds:s===e?0:t.durationSeconds})},[c,s]),h=()=>{u8(l8.CalculationActivityPress),Tf.dismiss(),i.current?.present()},g=e=>{u(S8.getByUUID(e)),h()};return(0,W.jsxs)(W.Fragment,{children:[d.map((e,t)=>(0,W.jsx)(pmn,{index:t,toggleActivitySwitch:m,isChecked:s===e.uuid,onEdit:g,activity:e},e.uuid)),(0,W.jsxs)(wp,{testID:`add-activity-button`,onPress:h,style:({pressed:e})=>[_mn.smallButton,{backgroundColor:t.bgButtonSecondary,opacity:e?.5:1}],children:[(0,W.jsx)(W7t,{color:t.iconButtonSecondary}),(0,W.jsx)(Z,{style:_mn.buttonText,children:e(`calcflow_activity_button_add`)})]}),(0,W.jsx)(B,{style:{height:24,borderTopWidth:1,borderTopColor:t.divider}}),(0,W.jsx)(_$,{ref:i,handleIndicatorStyle:{height:0},backdropComponent:V4,backgroundStyle:{backgroundColor:t.bgSheet,borderRadius:36},enablePanDownToClose:!1,children:(0,W.jsx)(hmn,{selectedActivity:l,onClose:()=>{u(null),i.current?.close(),p()}})})]})},_mn=R.create({smallButton:{flexDirection:`row`,alignSelf:`flex-start`,alignItems:`center`,borderRadius:16,paddingHorizontal:16,paddingVertical:8,marginBottom:24,gap:8},buttonText:{...Y.Poppins.medium_SM,alignSelf:`center`}});V();var vmn=()=>{let{COLORS:e}=J(),{navigate:t}=N$(),{foodIntakeItems:n,removeFoodIntakeItem:r}=L5(),i=(0,H.useCallback)((e,t)=>{e?r(e,`id`):r(t,`title`)},[r]),a=(0,H.useCallback)(e=>{if(e.source===`curated`){t(Q.FoodLibrary,{screen:Q.CuratedFoodItem,params:{foodId:e.id,categoryId:e.categoryId}});return}t(Q.FoodLibrary,{screen:Q.PersonalFoodItem,params:{foodId:e.id}})},[t]),o=(0,H.useCallback)(({item:t,index:n,itemKey:r})=>{let{measures:o,nutritionPer100g:s,id:c,title:l}=t.foodItem,u=C8(t.amount,o[0].gramsPerUnit,s.carbohydrates.value);return(0,W.jsxs)(B,{style:[C7.pill,{backgroundColor:e.bgPill}],children:[(0,W.jsxs)(wp,{onPress:()=>{a(t.foodItem)},style:({pressed:e})=>[C7.pillContent,{opacity:e?.5:1}],testID:`carbs-item-${n}`,children:[(0,W.jsx)(Z,{numberOfLines:1,ellipsizeMode:`middle`,style:[C7.title,{color:e.labelPrimary}],testID:`carbs-item-${n}-title`,children:l}),(0,W.jsx)(Z,{style:[C7.value,{color:e.labelPrimary}],testID:`carbs-item-${n}-amount`,children:`${u} g`})]}),(0,W.jsx)(wp,{onPress:()=>{i(c,l)},testID:`carbs-item-${n}-remove-icon`,hitSlop:16,children:(0,W.jsx)(Z7t,{width:16,height:16})})]},r)},[e.bgPill,e.labelPrimary,a,i]);return(0,W.jsx)(B,{style:C7.container,children:n.map((e,t)=>o({item:e,index:t,itemKey:e.foodItem.id||`${t}-${e.foodItem.title}`}))})},C7=R.create({container:{flexDirection:`row`,flexWrap:`wrap`,padding:16,gap:8},pill:{flexDirection:`row`,alignItems:`center`,paddingHorizontal:8,paddingVertical:6,borderRadius:16,maxWidth:`100%`},pillContent:{flexDirection:`row`,alignItems:`center`,flexShrink:1},title:{...Y.Poppins.regular_XS,marginRight:2,flexShrink:1},value:{...Y.Poppins.regular_XS,marginRight:2}});V();var ymn=(0,H.forwardRef)(({onFocusChange:e},t)=>{let{t:n}=Tq(),{COLORS:r}=J(),{navigate:i}=N$(),a=(0,H.useRef)(null);(0,H.useImperativeHandle)(t,()=>({blur:()=>a.current?.blur()}));let{foodIntakeItems:o,foodIntakeCarbsAmount:s,manualCarbsInput:c,setManualCarbsInput:l}=L5(),[u,d]=(0,H.useState)(!1),[f,p]=(0,H.useState)(``),m=WWt();(0,H.useEffect)(()=>{m&&!u&&p(c===0?``:c.toString())},[m,u,c]);let h=()=>{a.current?.focus(),d(!0),e?.(!0)},g=()=>{u8(l8.CalculationCarbsPress),h()},_=()=>{d(!1),e?.(!1),l(Number(f)),u8(l8.CalculationManualInput)};return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(B,{style:[w7.carbsSection,{backgroundColor:r.bgListActive,borderColor:u?r.borderInputFocus:r.bgListActive}],children:[(0,W.jsx)(Y4,{testID:`carbs-input`,renderLeftSlot:()=>(0,W.jsxs)(B,{style:w7.inputRow,children:[(0,W.jsx)(G7t,{width:24,height:24,color:r.labelPrimary}),(0,W.jsx)(Z,{testID:`carbs-input-unit`,children:n(`calcflow_carbohydrates_title`)})]}),renderRightSlot:()=>(0,W.jsxs)(B,{style:w7.inputRow,children:[(0,W.jsx)(I4,{testID:`carbs-input-field`,ref:a,value:f,onFocus:g,onBlur:_,onChangeText:p,style:[w7.numberInput,{color:r.labelPrimary}],selectTextOnFocus:!!f&&!u}),(0,W.jsx)(Z,{style:[w7.unit,{color:r.labelPrimary}],children:`g`})]}),onPress:h,containerStyle:{borderBottomLeftRadius:0,borderBottomRightRadius:0},style:{paddingVertical:12,backgroundColor:r.bgListActive}}),o.length>0&&(0,W.jsxs)(B,{style:{borderTopWidth:1,borderTopColor:r.divider},children:[(0,W.jsx)(vmn,{}),(0,W.jsx)(H7t,{}),(0,W.jsxs)(B,{style:[w7.totalContainer,{backgroundColor:r.bgListActive}],children:[(0,W.jsx)(Z,{style:w7.totalTitle,children:n(`calcflow_carbohydrates_total`)}),(0,W.jsxs)(B,{style:w7.totalGramsContainer,children:[(0,W.jsx)(Z,{style:w7.totalValue,testID:`total-carbs-value`,children:s+c}),(0,W.jsx)(Z,{style:w7.totalUnits,testID:`total-carbs-unit`,children:n(`my_food_add_unit`)})]})]})]})]}),(0,W.jsxs)(B,{style:w7.buttonsContainer,children:[(0,W.jsxs)(wp,{testID:`add-food-from-library-button`,onPress:()=>{u8(l8.CalculationFoodLibraryPress),i(Q.FoodLibrary)},style:({pressed:e})=>[w7.smallButton,{backgroundColor:r.bgButtonSecondary,opacity:e?.5:1}],children:[(0,W.jsx)(u9t,{color:r.labelPrimary}),(0,W.jsx)(Z,{style:[w7.title,{color:r.textButtonSecondary}],children:n(`calcflow_button_foodLibrary`)})]}),!Oq&&(0,W.jsx)(aen,{onPress:()=>{if(u8(l8.CalculationScanFoodPress),!c7.getState().privacyNoticeAccepted){i(Q.VisualSearchIntro);return}i(Q.VisualSearch)},text:n(`calcflow_button_scan`),style:w7.scanFoodButton})]}),(0,W.jsx)(B,{style:{height:24,borderTopWidth:1,borderTopColor:r.divider}})]})});ymn.displayName=`Carbs`;var w7=R.create({inputRow:{flexDirection:`row`,justifyContent:`flex-start`,alignItems:`center`,marginRight:8,gap:4},carbsSection:{borderWidth:2,borderRadius:16,marginBottom:12},numberInput:{...Y.Poppins.regular_Base,lineHeight:z.select({ios:0,default:Y.Poppins.regular_Base.lineHeight}),textAlign:`right`,maxWidth:40},totalContainer:{flexDirection:`row`,justifyContent:`space-between`,alignItems:`baseline`,padding:16,paddingTop:8,borderRadius:16},totalTitle:{...Y.Poppins.medium_Base},totalGramsContainer:{flexDirection:`row`,alignItems:`baseline`},totalValue:{...Y.Poppins.bold_2XL},totalUnits:{...Y.Poppins.medium_Base,marginLeft:8},unit:{...Y.Poppins.regular_Base},buttonsContainer:{flexDirection:`row`,justifyContent:`flex-start`,gap:12},smallButton:{flexDirection:`row`,alignItems:`center`,alignSelf:`flex-start`,borderRadius:16,paddingHorizontal:16,paddingVertical:8,marginBottom:24,gap:8},scanFoodButton:{alignSelf:`flex-start`,marginBottom:24},title:{...Y.Poppins.medium_SM,alignSelf:`center`}}),bmn=`hda`,xmn=e=>e.device_name.toLowerCase()===bmn||e.source_name.toLowerCase()===bmn,Smn=e=>({id:e.id,object_id:e.id,user_id:e.userId,type:e.type,quantity:{unit:e.quantity.unit.toLowerCase(),value:e.quantity.value},timestamp:new Date(e.startDate),source_id:e.source.id,device_name:e.device.name,source_name:e.source.name}),Cmn=(e,t=Date.now())=>e.map(Smn).filter(e=>!xmn(e)&&e.timestamp.getTime()<=t).sort((e,t)=>t.timestamp.getTime()-e.timestamp.getTime())[0]??null,wmn=(e,t)=>{let{inputMax:n,inputMin:r}=L8(t);return!isNaN(e)&&e>=r&&e<=n};V();var Tmn=()=>{let{t:e}=Tq(),{COLORS:t}=J(),{glucoseStoreActions:n}=R5(),r=umn(`external`),i=b7()?.source===`external`,{glucoseUnit:a}=k8;if(a===void 0)throw Error(`[Glucose::render] glucoseUnit must be non-undefined.`);let[o,s]=(0,H.useState)(!1),[c,l]=(0,H.useState)(!1);H3t(()=>{r&&s(Date.now()-r.timestamp>X.Milliseconds.Minute*10)},1e3),(0,H.useEffect)(()=>{(async()=>{try{let e=`${bq.HEDIA_SERVER_BASE_URL}/api/v2/samples`,t=await d8(e);await T2(t,X.StatusCode.OK,e);let r=await t.json();if(r.length===0)return;let i=Cmn(r);if(!i)return;let{unit:a,value:o}=i.quantity;if(!wmn(o,a)){n.setSelectedReadingId(null);return}let s={id:i3(),source:`external`,value:o,unit:a,sampleId:i.id,sourceId:i.source_id,sourceName:i.source_name,deviceName:i.device_name,timestamp:i.timestamp.getTime()};n.addAvailableGlucoseReading(s),n.setSelectedReadingId(s.id),fin(i)}catch(e){console.error(`[DevicesSection.web::getSamples]`,e)}})()},[n]);let u=(0,H.useCallback)(()=>{if(bq.IS_PRODUCTION===`true`)return;let e={id:`TEST`,object_id:`TEST`,user_id:`TEST`,type:`blood_glucose`,timestamp:new Date(Date.now()-(Math.random()*4+5)*X.Milliseconds.Minute),source_id:`TEST`,quantity:{unit:X.BloodGlucoseUnit.MMOL_L,value:Math.random()*32.199999999999996+1.1},source_name:`HDA Test Name`,device_name:`HDA Test Device`},t={id:i3(),source:`external`,value:e.quantity.value,unit:e.quantity.unit,timestamp:e.timestamp.getTime(),sampleId:e.id,sourceId:e.source_id,sourceName:e.source_name,deviceName:e.device_name};n.addAvailableGlucoseReading(t),n.setSelectedReadingId(t.id)},[n]);return(0,W.jsxs)(B,{style:T7.container,children:[r?.source===`external`?(0,W.jsx)(wp,{style:[T7.button,{backgroundColor:i?t.bgButtonPrimary:t.bgButtonSecondary}],onPress:()=>{!o&&n.setSelectedReadingId(r.id)},children:(0,W.jsx)(Z,{style:[T7.title,{color:i?t.textButtonPrimary:t.textButtonSecondary}],children:r.deviceName})}):(0,W.jsx)(wp,{style:[T7.button,{backgroundColor:t.bgButtonSecondary}],onPress:()=>{l(!0)},onLongPress:()=>{u()},children:(0,W.jsx)(Z,{style:[T7.title,{color:t.labelPrimary}],children:e(`import_modal_reading_title`)})}),(0,W.jsx)(u3,{isVisible:c,title:e(`import_modal_reading_title`),message:e(`import_modal_reading_body`),buttons:[{testID:`close-button`,title:e(`button_close`),onPress:()=>{l(!1)}}]})]})},T7=R.create({container:{marginTop:12},button:{alignSelf:`flex-start`,paddingVertical:8,paddingHorizontal:16,borderRadius:16},title:{...Y.Poppins.medium_SM}});V();var Emn=e=>e.replace(`,`,`.`),Dmn=300,Omn=(0,H.forwardRef)(({onFocusChange:e},t)=>{let{t:n}=Tq(),{COLORS:r}=J(),i=(0,H.useRef)(null);(0,H.useImperativeHandle)(t,()=>({blur:()=>i.current?.blur()}));let{glucoseUnit:a}=k8;if(a===void 0)throw Error(`[Glucose::render] glucoseUnit must be non-undefined.`);let{decimalPlaces:o,inputMax:s,inputMin:c,text:l}=(0,H.useMemo)(()=>L8(a),[a]),[u,d]=(0,H.useState)(``),[f,p]=(0,H.useState)(!1),m=b7(),{glucoseStoreActions:h,availableGlucoseReadings:g}=R5(),{isNoBGModalVisible:_,modalStoreActions:v}=z5(),[y,b]=(0,H.useState)(!1),[x,S]=(0,H.useState)(!1),[C,w]=(0,H.useState)(`hidden`),[T,E]=(0,H.useState)(`hidden`);V$((0,H.useCallback)(()=>{let e=setInterval(()=>{let e=m?.timestamp;T===`open`||!e||m.source===`cgm`||Date.now()-e>X.Milliseconds.Minute*10&&(E(`open`),d(``))},1e3);return()=>{clearInterval(e)}},[T,m])),(0,H.useEffect)(()=>{d(m===null?``:B8(m.value,m.unit,a))},[m,a]);let D=()=>{u===``||m===null||m.source===`manual`?A():w(`open`)},O=(0,H.useCallback)(e=>{d(Emn(e))},[]),k=(0,H.useCallback)(()=>{u8(l8.CalculationGlucosePress),p(!0),e?.(!0)},[e]),A=(0,H.useCallback)(()=>{i.current?.focus()},[]),ee=(0,H.useCallback)(()=>{if(Oq){A();return}setTimeout(A,Dmn)},[A]),te=(0,H.useCallback)(()=>{d(m&&B8(m.value,m.unit,a)||``)},[a,m]),ne=(0,H.useCallback)(()=>g.find(e=>{let t=B8(e.value,e.unit,a),n=Date.now()-e.timestamp>X.Milliseconds.Minute*10;return t===u&&e.source!==`manual`&&!n}),[g,a,u]),re=(0,H.useCallback)(e=>!isNaN(e)&&e>=c&&e<=s,[s,c]),ie=(0,H.useCallback)(e=>({id:i3(),source:`manual`,value:e,unit:a,timestamp:Date.now()}),[a]),j=(0,H.useCallback)(()=>{if(p(!1),e?.(!1),u===``){h.setSelectedReadingId(null);return}let t=ne();if(t){h.setSelectedReadingId(t.id);return}let n=parseFloat(u);if(!re(n)){S(!0);return}d(n.toFixed(o));let r=ie(n);h.addAvailableGlucoseReading(r),h.setSelectedReadingId(r.id)},[ie,ne,o,h,u,re,e]),ae=()=>{(0,d7.flushSync)(()=>{w(`hidden`),h.setSelectedReadingId(null)}),ee()},oe=()=>{w(`closing`)},se=()=>{w(`hidden`)},M=()=>{u8(l8.ExpiredGlucose),h.setSelectedReadingId(null)},ce=()=>{(0,d7.flushSync)(()=>{E(`hidden`)}),ee()},N=()=>{E(`closing`)},P=()=>{E(`hidden`)},le=()=>{(0,d7.flushSync)(()=>{v.set({isNoBGModalVisible:!1})}),ee()},ue=()=>{b(!0),v.set({isNoBGModalVisible:!1})},de=()=>{b(!1)},fe=m===null||m.source===`manual`;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Y4,{testID:`glucose-input`,renderLeftSlot:()=>{let e=ne(),t;switch(e?.source){case`cgm`:t=n(`from_source`,{source:e.sourceName});break;case`device`:t=n(`from_source`,{source:e.deviceName});break;default:t=n(`calcflow_glucose_title`);break}return(0,W.jsxs)(B,{style:E7.inputRow,children:[(0,W.jsx)($7t,{height:24,width:24,color:r.labelPrimary}),(0,W.jsx)(Z,{testID:`glucose-input-unit`,ellipsizeMode:`tail`,numberOfLines:1,style:E7.sourceText,children:t})]})},renderRightSlot:()=>(0,W.jsxs)(B,{style:E7.rightSlot,children:[(0,W.jsx)(I4,{testID:`glucose-input-field`,ref:i,value:u,inputMode:a===X.BloodGlucoseUnit.MMOL_L?`decimal`:`numeric`,maxLength:a===X.BloodGlucoseUnit.MMOL_L?4:3,editable:fe||f,onChangeText:O,onFocus:k,onBlur:j,style:[E7.numberInput,{color:fe?r.labelPrimary:r.labelBrand,width:a===X.BloodGlucoseUnit.MMOL_L?48:36}],selectTextOnFocus:!!u&&!f}),(0,W.jsx)(Z,{style:[E7.unit,{color:fe?r.labelPrimary:r.labelBrand}],children:l})]}),onPress:D,style:{...E7.groupedRow,...f&&{borderColor:r.borderInputFocus}}}),(0,W.jsx)(Tmn,{glucoseUnit:a,inputRef:i}),(0,W.jsx)(B,{style:[E7.divider,{borderTopColor:r.divider}]}),T!==`hidden`&&(0,W.jsx)(u3,{isVisible:T===`open`,title:n(`calcflow_modal_expired_title`),message:n(`calcflow_modal_expired_body`),icon:()=>(0,W.jsx)($7t,{width:96,height:96,color:r.labelPrimary}),onModalShow:M,onModalHide:P,buttons:[{title:n(`calcflow_modal_expire_button_add`),onPress:ce},{title:n(`button_cancel`),type:H4.Secondary,onPress:N}]}),(0,W.jsx)(u3,{isVisible:x,title:n(`calcflow_modal_glucose_invalid_title`,{min:osn(c,a),max:osn(s,a)}),buttons:[{testID:`close-button`,title:n(`button_close`),onPress:()=>{S(!1),te()}}]}),C!==`hidden`&&(0,W.jsx)(u3,{isVisible:C===`open`,title:n(`calcflow_modal_change_synced_value_title`),onModalHide:se,buttons:[{testID:`change-button`,type:H4.Error,title:n(`calcflow_modal_button_changeValue`),onPress:ae},{testID:`keep-button`,type:H4.Secondary,title:n(`calcflow_modal_button_keepValue`),onPress:oe}]}),(_||y)&&(0,W.jsx)(u3,{isVisible:_,title:n(`calcflow_modal_enter_glucose_title`),message:n(`calcflow_modal_enter_glucose_body`),icon:()=>(0,W.jsx)($7t,{width:96,height:96,color:r.labelPrimary}),onModalHide:de,buttons:[{title:n(`calcflow_modal_enter_glucose_button_add`),onPress:le},{title:n(`button_cancel`),type:H4.Secondary,onPress:ue}]})]})});Omn.displayName=`Glucose`;var E7=R.create({groupedRow:{paddingVertical:12},inputRow:{flexDirection:`row`,justifyContent:`flex-start`,alignItems:`center`,marginRight:8,gap:4},rightSlot:{flexDirection:`row`,alignItems:`center`,marginRight:8,gap:4},sourceText:{flexShrink:1},numberInput:{...Y.Poppins.regular_Base,lineHeight:z.select({ios:0,default:Y.Poppins.regular_Base.lineHeight}),textAlign:`right`,textAlignVertical:`center`},unit:{...Y.Poppins.regular_Base},divider:{marginTop:24,height:24,borderTopWidth:1}});V();function kmn({description:e,assetId:t,imageUri:n,onPress:r,testID:i}){let{COLORS:a}=J(),{t:o}=Tq(),s=$5(n?void 0:t),c=n??s,l=e||o(`notes_placeholder`),u=l===o(`notes_placeholder`);return u&&!c?null:(0,W.jsxs)(wp,{style:({pressed:e})=>[Amn.container,{backgroundColor:a.bgSecondary},e&&r&&{opacity:.9}],onPress:r,disabled:!r,testID:`${i}-button`,children:[(0,W.jsx)(Z,{style:[Amn.text,{color:u?a.labelTertiary:a.labelPrimary}],children:l}),!!c&&(0,W.jsx)(Zu,{source:{uri:c},style:Amn.thumbnail,resizeMode:`cover`,testID:`${i}-thumbnail`})]})}var Amn=R.create({container:{flexDirection:`row`,borderRadius:16,padding:16,gap:12,alignItems:`flex-start`},text:{...Y.Poppins.regular_Base,flex:1},thumbnail:{width:64,height:64,borderRadius:8}});V();var jmn=({onClose:e,onConfirm:t})=>{let{COLORS:n}=J(),{t:r}=Tq(),{noteId:i}=B5(),{noteStoreActions:a}=B5(),[o,s]=(0,H.useState)(!1),[c,l]=(0,H.useState)(!1),{noteBody:u,setNoteBody:d,loadNote:f,saveNote:p,isLoading:m,hasNoteContent:h}=hpn();(0,H.useEffect)(()=>{i&&f(i).catch(console.error)},[i,f]);let g=(0,H.useCallback)(async()=>{s(!0);try{let e=await p();a.set({noteId:e,noteBody:u}),t()}catch{l(!0)}finally{s(!1)}},[p,a,u,t]),_=(0,H.useCallback)(()=>{e()},[e]),v=!h||o;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(B,{style:Mmn.header,children:[(0,W.jsx)(U5,{onPress:_}),o?(0,W.jsx)(Pf,{size:`small`,color:n.iconBrand}):(0,W.jsx)(W5,{onPress:g,disabled:v})]}),m?(0,W.jsx)(B,{style:Mmn.loader,children:(0,W.jsx)(Pf,{size:`large`,color:n.iconBrand})}):(0,W.jsx)(xfn,{value:u,onChangeText:d,testID:`calculation-notes`,autoFocus:!0,containerStyle:Mmn.container}),(0,W.jsx)(u3,{isVisible:c,testID:`note-save-failed-modal`,title:r(`notes_cannotSave_modal_header`),message:r(`notes_cannotSave_modal_body`),buttons:[{title:r(`glucose_modal_changes_button_confirm`),testID:`note-save-failed-confirm-button`,type:H4.Primary,onPress:()=>{l(!1)}}]})]})},Mmn=R.create({header:{flexDirection:`row`,justifyContent:`space-between`,alignItems:`center`,paddingHorizontal:16,paddingBottom:12},loader:{flex:1,justifyContent:`center`,alignItems:`center`,minHeight:200},container:{margin:16}});V();var Nmn=()=>{let{t:e}=Tq(),{COLORS:t}=J(),{noteBody:n,displayImageUri:r}=B5(),i=(0,H.useRef)(null),a=()=>{u8(l8.CalculationNotesPress),Tf.dismiss(),i.current?.present()};return(0,W.jsxs)(W.Fragment,{children:[n.trim()||r?(0,W.jsx)(B,{style:Pmn.noteContainer,children:(0,W.jsx)(kmn,{description:n,imageUri:r,onPress:a,testID:`note-display`})}):(0,W.jsxs)(wp,{testID:`add-notes-button`,onPress:a,style:({pressed:e})=>[Pmn.smallButton,{backgroundColor:t.bgButtonSecondary,opacity:e?.5:1}],children:[(0,W.jsx)(c9t,{height:20,width:20,color:t.labelPrimary}),(0,W.jsx)(Z,{style:[Pmn.title,{color:t.textButtonSecondary}],children:e(`calcflow_notes_button_add`)})]}),(0,W.jsx)(_$,{ref:i,handleIndicatorStyle:{height:0},backdropComponent:V4,backgroundStyle:{backgroundColor:t.bgSheet,borderRadius:36},enablePanDownToClose:!1,enableDynamicSizing:!1,snapPoints:[`85%`],children:(0,W.jsx)(y$,{children:(0,W.jsx)(jmn,{onClose:()=>{Tf.dismiss(),i.current?.dismiss()},onConfirm:()=>{Tf.dismiss(),i.current?.dismiss()}})})})]})},Pmn=R.create({smallButton:{flexDirection:`row`,alignSelf:`flex-start`,alignItems:`center`,borderRadius:16,paddingHorizontal:16,paddingVertical:8,marginBottom:24,gap:8},noteContainer:{marginBottom:24},title:{...Y.Poppins.medium_SM,alignSelf:`center`}});V();var Fmn=()=>{let{t:e}=Tq(),{COLORS:t}=J(),{bottomWithFooterButton:n}=Q4(),r=N5(),i=(0,H.useRef)(null),a=N$(),o=F$(),{modalStoreActions:s}=z5(),{noteId:c}=B5(),{foodIntakeItems:l,manualCarbsInput:u,foodIntakeCarbsAmount:d}=L5(),[f,p]=(0,H.useState)(!1),m=b7(),h=o.params?.errorType??null,g=h===Eq.Sync,_=(0,H.useRef)(!1),v=(0,H.useRef)(!1),y=(0,H.useRef)(null),b=(0,H.useRef)(null),x=(0,H.useCallback)(e=>{_.current=e},[]),S=(0,H.useCallback)(e=>{v.current=e},[]),{fetchLibreCgmData:C}=dmn(),w=(0,H.useCallback)(()=>(u8(l8.AbortCalculationPress),m||u>0||l.length>0||c?s.set({showDiscardCalculationModal:!0}):a.goBack(),!0),[u,a,m,s,l.length,c]);V$((0,H.useCallback)(()=>{if(Oq)return;let e=Cf.addEventListener(`hardwareBackPress`,w);return()=>{e.remove()}},[w])),(0,H.useEffect)(()=>{C()},[C]),(0,H.useLayoutEffect)(()=>{a.setOptions({headerTransparent:!0,header:()=>(0,W.jsx)(F5,{title:e(`calcflow_navigation`),LeftButton:Oq?void 0:(0,W.jsx)(U5,{onPress:w}),RightButton:Oq?(0,W.jsxs)(B,{style:[D7.buttonsWrapper,{backgroundColor:t.bgButtonSecondary,borderColor:t.border}],children:[(0,W.jsx)(ofn,{style:D7.noBorder}),(0,W.jsx)(afn,{style:D7.noBorder})]}):(0,W.jsx)(ofn,{}),overlay:!0})})},[t.bgButtonSecondary,t.border,w,a,e]);let[T,E]=(0,H.useState)(Oq);(0,H.useEffect)(()=>{if(!Oq)return a.addListener(`transitionStart`,({data:e})=>{e.closing||!a.isFocused()||E(!0)})},[a]),(0,H.useEffect)(()=>{if(!T)return;let e=setTimeout(()=>{i.current?.present()},100);return()=>{clearTimeout(e)}},[T]);let D=(0,H.useCallback)(()=>{if(_.current||v.current){y.current?.blur(),b.current?.blur();return}if(m===null){u8(l8.SummaryEmptyGlucose),s.set({isNoBGModalVisible:!0});return}if(d+u>opn().max){p(!0);return}a.navigate(Q.LoadingRecommendation)},[m,a,s,d,u]),O=(0,H.useCallback)(()=>{u8(l8.RecentInsulinContinuePress),i.current?.close()},[]);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(fs,{testID:`calculation-scroll-view`,keyboardShouldPersistTaps:`handled`,contentContainerStyle:[D7.scrollView,{backgroundColor:t.bgPrimary,paddingTop:r+16,paddingBottom:n}],children:[(0,W.jsx)(Omn,{ref:b,onFocusChange:S}),(0,W.jsx)(ymn,{ref:y,onFocusChange:x}),(0,W.jsx)(gmn,{}),(0,W.jsx)(Nmn,{})]}),(0,W.jsx)(lpn,{children:(0,W.jsx)(U4,{type:H4.Primary,testID:`calculate-button`,title:e(`calcflow_button_calculate`),onPress:D,inactive:m===null})}),(0,W.jsx)(_$,{ref:i,handleIndicatorStyle:{height:0},backdropComponent:V4,backgroundStyle:{backgroundColor:t.bgSheet,borderRadius:36},enablePanDownToClose:!1,children:(0,W.jsx)(y$,{children:(0,W.jsx)(lmn,{onNoInsulinPressed:O})})}),(0,W.jsx)(u3,{isVisible:h!==null,title:e(g?`recommendation_no_save_modal_title`:`rejected_input_modal_title`),message:e(g?`recommendation_no_save_modal_body`:`rejected_input_modal_body`),buttons:[{title:e(`button_close`),onPress:()=>{a.navigate(Q.Calculation)}}]}),(0,W.jsx)(u3,{isVisible:f,title:e(`calcflow_carbohydrates_invalid_modal_title`),message:e(`calcflow_carbohydrates_invalid_modal_body`),buttons:[{title:e(`button_close`),onPress:()=>{p(!1)}}]}),(0,W.jsx)(upn,{}),(0,W.jsx)(Cpn,{})]})},D7=R.create({scrollView:{paddingHorizontal:16},buttonsWrapper:{flexDirection:`row`,padding:0,borderRadius:44,borderWidth:1},noBorder:{borderWidth:0}});V();var Imn=1e3;function Lmn(){let e=N$(),t=F$(),[n,r]=(0,H.useState)(!1);return(0,H.useEffect)(()=>{setTimeout(()=>{r(!0)},Imn)},[]),(0,H.useEffect)(()=>{n&&(Oq?(window.location.href=`/redirect?status=success`,xq.clearAll()):e.popTo(Q.MainBottomTabs,{screen:Q.DashboardTab,params:{screen:Q.Dashboard,params:{action:hvt.Saved,logbookEntry:t.params.logbookEntry}}}))},[n,e,t.params.logbookEntry]),(0,W.jsx)(B,{style:Rmn.animationContainer,children:(0,W.jsx)(g2,{autoPlay:!0,source:_2.LEAVING_RECOMMENDATION,style:Rmn.animation,webStyle:Rmn.animation,resizeMode:`cover`,loop:!1})})}var Rmn=R.create({animationContainer:{flex:1,justifyContent:`center`,alignItems:`center`},animation:{width:256,height:256}}),zmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SHARED_COLORS=e.LIGHT_COLORS=e.DARK_COLORS=void 0,e.DARK_COLORS={base100:`#616161`,base200:`#555555`,base300:`#4A4A4A`,base350:`#404040`,base400:`#363636`,base500:`#373739`,base600:`#2A2A2C`,base700:`#1C1C1E`,base800:`#141414`,base900:`#000000`,base100a:`#E9E0FF1A`,base600a:`#2A2A2C99`,base700a:`#1C1C1E80`,base800a:`#14141499`,primary100:`#B5D8FF`,primary200:`#9EC6FF`,primary300:`#87B5FF`,primary400:`#73ADFF`,primary500:`#5F99F9`,primary600:`#4A85F0`,primary700:`#4A73ED`,primary800:`#4A5DEB`,primary900:`#3D4AC6`,primary100a:`#B5D8FF99`,primary300a:`#87B5FF4D`,primary400a:`#73ADFF80`,primary900a:`#3D4AC699`,red50:`#F9E6E9`,red100:`#F9C9CE`,red200:`#EA9797`,red300:`#E07171`,red400:`#EA514E`,red500:`#EF4235`,red600:`#E03834`,red700:`#CF2E2E`,red800:`#C22727`,red900:`#B31B1B`,red300a:`#E0717166`,green50:`#E3F0E4`,green100:`#C4E1C5`,green200:`#A2D2A4`,green300:`#7EC381`,green400:`#64B768`,green500:`#4AAC4E`,green600:`#429D46`,green700:`#378B3B`,green800:`#2D7B31`,green900:`#1A5C1F`,yellow50:`#FAF8E2`,yellow100:`#FAF4C0`,yellow200:`#FAF09A`,yellow300:`#FAEC74`,yellow400:`#FAE956`,yellow500:`#FAE63A`,yellow600:`#F8D434`,yellow700:`#F6BC2C`,yellow800:`#F4A524`,yellow900:`#F07C17`,shadow:`#FFFFFF00`,iosKeyboardPicker:`#282828`,iosSelectorKeyboard:`#5858593D`,gradientQuickGuideBottom:`#000000`,gradientQuickGuideTop:`#0000000D`,graphActiveInsulin:`#66D6FF`,graphActiveInsulinSecondary:`#66D6FF1A`,graphCarbohydrate:`#FFB224`,graphCarbohydrateSecondary:`#E88C2B`,graphGlucoseAverage:`#FF8CD8`,graphPhysicalActivity:`#D7EB98`,graphPhysicalActivitySecondary:`#79A762`,graphRapid:`#66D6FF`,graphRapidSecondary:`#00ACEB`,rectangleRangeGraphMyDay:`#5CE59C33`,graphVeryHighGlucose:`#F07C17`,graphVeryHighGlucoseSecondary:`#F4A524`,graphHighGlucose:`#F6BC2C`,graphHighGlucoseSecondary:`#F8D434`,graphTargetGlucose:`#4AAC4E`,graphTargetGlucoseSecondary:`#64B768`,graphLowGlucose:`#EF4235`,graphLowGlucoseSecondary:`#EA514E`,graphVeryLowGlucose:`#B31B1B`,graphVeryLowGlucoseSecondary:`#C22727`},e.LIGHT_COLORS={base50:`#FFFFFF`,base100:`#F7F7FA`,base200:`#F2F2F7`,base300:`#ECECF1`,base400:`#E0E0E6`,base500:`#CFCFD7`,base600:`#B5B5BD`,base700:`#9999A3`,base800:`#6E6E78`,base900:`#3F3F46`,base100a:`#F7F7FA1A`,base600a:`#B5B5BD99`,base700a:`#9999A3B3`,base900a:`#3F3F4699`,primary100:`#EEF0FE`,primary200:`#D7DBFB`,primary300:`#B6BFF8`,primary400:`#8F9EF4`,primary500:`#4A5DEB`,primary600:`#3F4DD5`,primary700:`#3540B8`,primary800:`#2D359B`,primary900:`#242A7C`,primary100a:`#B5D8FF99`,primary300a:`#87B5FF4D`,primary400a:`#73ADFF80`,primary900a:`#3D4AC699`,red50:`#F9E6E9`,red100:`#FCCBCB`,red200:`#F9A6A7`,red300:`#F47475`,red400:`#EB494B`,red500:`#D82E30`,red600:`#B62325`,red700:`#962021`,red800:`#7D2021`,red900:`#440B0D`,red300a:`#E0717166`,green50:`#E3F0E4`,green100:`#BEF6D2`,green200:`#8DEEAF`,green300:`#59DC86`,green400:`#39C365`,green500:`#2BA250`,green600:`#237F42`,green700:`#1F6437`,green800:`#1A522F`,green900:`#092E17`,yellow50:`#FAF8E2`,yellow100:`#FAF5C5`,yellow200:`#F9ED7D`,yellow300:`#FAE84D`,yellow400:`#FAE84D`,yellow500:`#F7C62F`,yellow600:`#F6B82B`,yellow700:`#F3A425`,yellow800:`#F2941F`,yellow900:`#F0831A`,shadow:`#00000029`,iosKeyboardPicker:`#FFFFFF`,iosSelectorKeyboard:`#F4F4F4`,gradientQuickGuideBottom:`#FFFFFF`,gradientQuickGuideTop:`#FFFFFF0D`,graphActiveInsulin:`#008DFF`,graphActiveInsulinSecondary:`#42ABFF1A`,graphCarbohydrate:`#FF9E38`,graphCarbohydrateSecondary:`#EB892F`,graphGlucoseAverage:`#E539AB`,graphPhysicalActivity:`#5BA400`,graphPhysicalActivitySecondary:`#5DA800`,graphRapid:`#008DFF`,graphRapidSecondary:`#42ABFF`,rectangleRangeGraphMyDay:`#5CE59C33`,graphVeryHighGlucose:`#FF9000`,graphVeryHighGlucoseSecondary:`#F07C00`,graphHighGlucose:`#EAB308`,graphHighGlucoseSecondary:`#F8C62B`,graphTargetGlucose:`#008B4F`,graphTargetGlucoseSecondary:`#089B5C`,graphLowGlucose:`#BC0027`,graphLowGlucoseSecondary:`#DC2626`,graphVeryLowGlucose:`#A30022`,graphVeryLowGlucoseSecondary:`#94001F`},e.SHARED_COLORS={white100:`#FFFFFF0D`,white200:`#FFFFFF1A`,white300:`#FFFFFF33`,white400:`#FFFFFF66`,white500:`#FFFFFF99`,white600:`#FFFFFFCC`,white700:`#FFFFFFE6`,white800:`#FFFFFFF2`,white900:`#FFFFFF`,black100:`#0000000D`,black200:`#0000001A`,black300:`#00000033`,black400:`#0000004D`,black500:`#00000080`,black600:`#000000A6`,black700:`#000000D9`,black800:`#000000F2`,black900:`#000000`,noRisk:`#DFB38F`,lowRisk:`#DB988D`,moderateRisk:`#A76762`,highRisk:`#773751`,iosTextStatusBar:`#FFFFFF`,iosAccentBlue:`#0A84FF`,iosButtonHighlight:`#434343`,iosKeyboard:`#383838BF`,transparent:`transparent`,plusInnerShadow:`#8752F2`,plusOuterShadow:`#6422EE`}})),Bmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DARK_SEMANTIC_COLORS=void 0;var t=zmn(),n={...t.DARK_COLORS,...t.SHARED_COLORS};e.DARK_SEMANTIC_COLORS={bgPrimary:n.base900,bgSecondary:n.base700,bgTertiary:n.base600,bgMultiSheet:n.white300,bgSheet:n.base900,bgModal:n.base700,bgOverlay:n.black500,bgBrand:n.primary800,bgToggle:n.base350,bgSpecial:n.base900,bgTransparent:n.transparent,labelPrimary:n.white900,labelSecondary:n.white500,labelTertiary:n.white400,labelBrand:n.primary500,labelBrandInactive:n.primary400a,bgActivationCode:n.base700,borderActivationCodeDanger:n.red500,borderActivationCodeFocus:n.primary500,textActivationCodeDanger:n.red500,textButtonPrimary:n.white900,textButtonPrimaryDisabled:n.white400,bgButtonPrimary:n.primary800,bgButtonPrimaryDisabled:n.primary900,iconButtonPrimary:n.white900,iconButtonPrimaryDisabled:n.white400,textButtonSecondary:n.white900,textButtonSecondaryDisabled:n.white400,bgButtonSecondary:n.base600,bgButtonSecondaryDisabled:n.base100a,iconButtonSecondary:n.white900,iconButtonSecondaryDisabled:n.white400,textButtonPlain:n.white900,textButtonPlainDisabled:n.white400,iconButtonPlain:n.white900,iconButtonPlainDisabled:n.white400,textButtonPrimaryDanger:n.white900,textButtonPrimaryDangerDisabled:n.white400,bgButtonPrimaryDanger:n.red700,bgButtonPrimaryDangerDisabled:n.red300a,iconButtonPrimaryDanger:n.white900,iconButtonPrimaryDangerDisabled:n.white400,textButtonSecondaryDanger:n.red600,textButtonSecondaryDangerDisabled:n.red300a,bgButtonSecondaryDanger:n.base600,bgButtonSecondaryDangerDisabled:n.base100a,iconButtonSecondaryDanger:n.red600,iconButtonSecondaryDangerDisabled:n.red300a,textLink:n.primary500,buttonBorder:n.shadow,borderAvatar:n.white500,paginationActive:n.primary800,paginationInactive:n.white300,graphDivider:n.white300,borderGraphNow:n.white900,overlay:n.black500,nowOverlay:n.white200,veryHighGlucose:n.yellow900,veryHighGlucoseSecondary:n.yellow800,highGlucose:n.yellow700,highGlucoseSecondary:n.yellow600,targetGlucose:n.green500,targetGlucoseSecondary:n.green400,lowGlucose:n.red500,lowGlucoseSecondary:n.red400,veryLowGlucose:n.red900,veryLowGlucoseSecondary:n.red800,graphGlucoseAverage:n.graphGlucoseAverage,graphDotGlucoseAverage:n.green500,graphDotStrokeGlucoseAverage:n.white900,graphActiveInsulin:n.graphActiveInsulin,graphActiveInsulinSecondary:n.graphActiveInsulinSecondary,strokeDotGraphActiveInsulin:n.white900,graphOverlay:n.base700a,graphRapid:n.graphRapid,graphRapidSecondary:n.graphRapidSecondary,graphCarbohydrate:n.graphCarbohydrate,graphCarbohydrateSecondary:n.graphCarbohydrateSecondary,graphPhysicalActivity:n.graphPhysicalActivity,graphPhysicalActivitySecondary:n.graphPhysicalActivitySecondary,rectangleRangeGraphMyDay:n.rectangleRangeGraphMyDay,bgInputActive:n.base600,bgInputInactive:n.base700,bgInputHover:n.white300,borderInputFocus:n.primary500,borderInputDanger:n.red500,textInputDanger:n.red500,bgSecondaryInputInactive:n.base600,bgSecondaryInputActive:n.base600,bgListActive:n.base600,bgListInactive:n.base700,bgListHover:n.white300,bgListPlainHover:n.white200,bgLogbookManual:n.base600,bgLogbookRecommendation:n.base700,borderListFocused:n.primary500,textListHightlight:n.primary500,iosTextStatusBar:n.white900,iosBGNudge:n.white900,iosKeyboardPicker:n.iosKeyboardPicker,iosSelectorKeyboard:n.iosSelectorKeyboard,iosButtonHighlight:n.iosButtonHighlight,iosKeyboard:n.iosKeyboard,textKeyboardButtons:n.iosAccentBlue,textNavigationBar:n.white900,bgNavigationBar:n.base800,textNavigationBarLabel:n.primary500,iconNavigationBarActive:n.primary500,bgCalculatorActive:n.primary900,bgCalculatorInactive:n.base600,iconActive:n.white900,borderCalculator:n.base600,bgIconBolus:n.primary900,bgNumber:n.white600,textNumber:n.black900,bgSegmentContainer:n.base600,bgSegmentCard:n.base600,bgSegmentPrimary:n.primary800,textLabelActive:n.white900,textLabelInactive:n.white900,bgSliderBackground:n.base500,bgSliderForeground:n.primary600,bgSliderKnob:n.white900,bgSliderCalculator:n.base500,textSlider:n.white900,iconSearch:n.white500,textSearchPlaceholder:n.white500,textSearchText:n.white900,bgSearch:n.white300,bgToastDefault:n.base300,textToastDefault:n.white900,iconToastDefault:n.white900,textTableActive:n.white900,textTableSecondary:n.white500,textTableHighlight:n.primary500,bgTableOdd:n.base600,bgTableEven:n.base700,textCarbRecommendation:n.white900,iconCarbRecommendation:n.white900,bgGradientTop:n.primary700,bgGradientBottom:n.primary600,bgLogbookTop:n.base600,bgGradientOverlayTop:n.black100,bgGradientOverlayBottom:n.black900,divider:n.white200,iconBrand:n.primary500,iconBrandInactive:n.primary400a,iconSuccess:n.green500,iconWarning:n.yellow800,iconDanger:n.red500,textSuccess:n.green500,textWarning:n.yellow800,textDanger:n.red700,textPdf:n.black900,toggleKnob:n.white900,plusInnerShadow:n.plusInnerShadow,plusOuterShadow:n.plusOuterShadow,gradientQuickGuide:[n.gradientQuickGuideTop,n.gradientQuickGuideBottom],gradientActiveInsulin:[n.graphActiveInsulinSecondary,n.graphActiveInsulin],gradientCarbohydrates:[n.graphCarbohydrateSecondary,n.graphCarbohydrate],gradientPhysicalActivity:[n.graphPhysicalActivitySecondary,n.graphPhysicalActivity],gradientRapid:[n.graphRapidSecondary,n.graphRapid],gradientVeryHigh:[n.graphVeryHighGlucose,n.graphVeryHighGlucoseSecondary],gradientHigh:[n.graphHighGlucose,n.graphHighGlucoseSecondary],gradientTarget:[n.graphTargetGlucose,n.graphTargetGlucoseSecondary],gradientLow:[n.graphLowGlucoseSecondary,n.graphLowGlucose],gradientVeryLow:[n.graphVeryLowGlucose,n.graphVeryLowGlucoseSecondary]}})),Vmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LIGHT_SEMANTIC_COLORS=void 0;var t=zmn(),n={...t.LIGHT_COLORS,...t.SHARED_COLORS};e.LIGHT_SEMANTIC_COLORS={bgPrimary:n.base200,bgSecondary:n.base50,bgTertiary:n.base100,bgMultiSheet:n.black300,bgSheet:n.base200,bgModal:n.base100,bgOverlay:n.black500,bgBrand:n.primary500,bgToggle:n.base500,bgSpecial:n.base50,bgTransparent:n.transparent,labelPrimary:n.black900,labelSecondary:n.black500,labelTertiary:n.black400,labelBrand:n.primary600,labelBrandInactive:n.primary400a,bgActivationCode:n.base700,borderActivationCodeDanger:n.red500,borderActivationCodeFocus:n.primary500,textActivationCodeDanger:n.red500,textButtonPrimary:n.white900,textButtonPrimaryDisabled:n.white400,bgButtonPrimary:n.primary500,bgButtonPrimaryDisabled:n.primary400,iconButtonPrimary:n.white900,iconButtonPrimaryDisabled:n.white400,textButtonSecondary:n.black900,textButtonSecondaryDisabled:n.black400,bgButtonSecondary:n.base50,bgButtonSecondaryDisabled:n.base400,iconButtonSecondary:n.black900,iconButtonSecondaryDisabled:n.black400,textButtonPlain:n.black900,textButtonPlainDisabled:n.black400,iconButtonPlain:n.black900,iconButtonPlainDisabled:n.black400,textButtonPrimaryDanger:n.white900,textButtonPrimaryDangerDisabled:n.white400,bgButtonPrimaryDanger:n.red600,bgButtonPrimaryDangerDisabled:n.red800,iconButtonPrimaryDanger:n.white900,iconButtonPrimaryDangerDisabled:n.white400,textButtonSecondaryDanger:n.red500,textButtonSecondaryDangerDisabled:n.red300a,bgButtonSecondaryDanger:n.base50,bgButtonSecondaryDangerDisabled:n.base400,iconButtonSecondaryDanger:n.red500,iconButtonSecondaryDangerDisabled:n.red300a,textLink:n.primary500,buttonBorder:n.base300,borderAvatar:n.white500,paginationActive:n.primary800,paginationInactive:n.black300,graphDivider:n.white200,borderGraphNow:n.black900,overlay:n.white500,nowOverlay:n.white300,veryHighGlucose:n.yellow900,veryHighGlucoseSecondary:n.yellow800,highGlucose:n.yellow700,highGlucoseSecondary:n.yellow600,targetGlucose:n.green600,targetGlucoseSecondary:n.green500,lowGlucose:n.red500,lowGlucoseSecondary:n.red400,veryLowGlucose:n.red700,veryLowGlucoseSecondary:n.red600,graphGlucoseAverage:n.graphGlucoseAverage,graphDotGlucoseAverage:n.green500,graphDotStrokeGlucoseAverage:n.white900,graphActiveInsulin:n.graphActiveInsulin,graphActiveInsulinSecondary:n.graphActiveInsulinSecondary,strokeDotGraphActiveInsulin:n.white900,graphOverlay:n.white900,graphRapid:n.graphRapid,graphRapidSecondary:n.graphRapidSecondary,graphCarbohydrate:n.graphCarbohydrate,graphCarbohydrateSecondary:n.graphCarbohydrateSecondary,graphPhysicalActivity:n.graphPhysicalActivity,graphPhysicalActivitySecondary:n.graphPhysicalActivitySecondary,rectangleRangeGraphMyDay:n.rectangleRangeGraphMyDay,bgInputActive:n.base50,bgInputInactive:n.base400,bgInputHover:n.black100,borderInputFocus:n.primary500,borderInputDanger:n.red500,textInputDanger:n.red500,bgSecondaryInputInactive:n.base200,bgSecondaryInputActive:n.base50,bgListActive:n.base50,bgListInactive:n.base400,bgListHover:n.black100,bgListPlainHover:n.black100,bgLogbookManual:n.primary300a,bgLogbookRecommendation:n.base50,borderListFocused:n.primary500,textListHightlight:n.primary500,iosTextStatusBar:n.black900,iosBGNudge:n.black900,iosKeyboardPicker:n.iosKeyboardPicker,iosSelectorKeyboard:n.iosSelectorKeyboard,iosButtonHighlight:n.white700,iosKeyboard:n.iosKeyboard,textKeyboardButtons:n.iosAccentBlue,textNavigationBar:n.black900,bgNavigationBar:n.base100,textNavigationBarLabel:n.primary500,iconNavigationBarActive:n.primary500,bgCalculatorActive:n.primary500,bgCalculatorInactive:n.white900,iconActive:n.white900,borderCalculator:n.base300,bgIconBolus:n.primary500,bgNumber:n.black500,textNumber:n.white900,bgSegmentContainer:n.base50,bgSegmentCard:n.base100,bgSegmentPrimary:n.primary500,textLabelActive:n.white900,textLabelInactive:n.base900,bgSliderBackground:n.black200,bgSliderForeground:n.primary600,bgSliderKnob:n.primary600,bgSliderCalculator:n.white900,textSlider:n.black900,iconSearch:n.black500,textSearchPlaceholder:n.black500,textSearchText:n.black900,bgSearch:n.base50,bgToastDefault:n.base50,textToastDefault:n.black900,iconToastDefault:n.black900,textTableActive:n.black900,textTableSecondary:n.black500,textTableHighlight:n.primary600,bgTableOdd:n.base200,bgTableEven:n.base50,textCarbRecommendation:n.white900,iconCarbRecommendation:n.white900,bgGradientTop:n.primary700,bgGradientBottom:n.primary600,bgLogbookTop:n.base400,bgGradientOverlayTop:n.black100,bgGradientOverlayBottom:n.black100,divider:n.black200,iconBrand:n.primary600,iconBrandInactive:n.primary400a,iconSuccess:n.green500,iconWarning:n.yellow900,iconDanger:n.red500,textSuccess:n.green500,textWarning:n.yellow900,textDanger:n.red700,textPdf:n.white900,toggleKnob:n.white900,plusInnerShadow:n.plusInnerShadow,plusOuterShadow:n.plusOuterShadow,gradientQuickGuide:[n.gradientQuickGuideTop,n.gradientQuickGuideBottom],gradientActiveInsulin:[n.graphActiveInsulinSecondary,n.graphActiveInsulin],gradientCarbohydrates:[n.graphCarbohydrateSecondary,n.graphCarbohydrate],gradientPhysicalActivity:[n.graphPhysicalActivitySecondary,n.graphPhysicalActivity],gradientRapid:[n.graphRapidSecondary,n.graphRapid],gradientVeryHigh:[n.graphVeryHighGlucose,n.graphVeryHighGlucoseSecondary],gradientHigh:[n.graphHighGlucose,n.graphHighGlucoseSecondary],gradientTarget:[n.graphTargetGlucose,n.graphTargetGlucoseSecondary],gradientLow:[n.graphLowGlucoseSecondary,n.graphLowGlucose],gradientVeryLow:[n.graphVeryLowGlucose,n.graphVeryLowGlucoseSecondary]}})),Hmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TEXT_SCALING=e.FontFamily=e.FONTS=void 0;var t=e.FontFamily=function(e){return e.PoppinsBold=`Poppins-Bold`,e.PoppinsSemiBold=`Poppins-SemiBold`,e.PoppinsMedium=`Poppins-Medium`,e.PoppinsRegular=`Poppins-Regular`,e}({});e.TEXT_SCALING={s0:1,s1:1.118,s2:1.235,s3:1.353},e.FONTS={Poppins:{bold_6XL:{fontFamily:t.PoppinsBold,fontSize:60,lineHeight:72},semiBold_6XL:{fontFamily:t.PoppinsSemiBold,fontSize:60,lineHeight:72},bold_4XL:{fontFamily:t.PoppinsBold,fontSize:36,lineHeight:43},semiBold_4XL:{fontFamily:t.PoppinsSemiBold,fontSize:36,lineHeight:43},bold_2XL:{fontFamily:t.PoppinsBold,fontSize:24,lineHeight:31},semiBold_2XL:{fontFamily:t.PoppinsSemiBold,fontSize:24,lineHeight:31},medium_2XL:{fontFamily:t.PoppinsMedium,fontSize:24,lineHeight:31},bold_Base:{fontFamily:t.PoppinsBold,fontSize:16,lineHeight:24},semiBold_Base:{fontFamily:t.PoppinsSemiBold,fontSize:16,lineHeight:24},medium_Base:{fontFamily:t.PoppinsMedium,fontSize:16,lineHeight:24},regular_Base:{fontFamily:t.PoppinsRegular,fontSize:16,lineHeight:24},bold_SM:{fontFamily:t.PoppinsBold,fontSize:14,lineHeight:21},semiBold_SM:{fontFamily:t.PoppinsSemiBold,fontSize:14,lineHeight:21},medium_SM:{fontFamily:t.PoppinsMedium,fontSize:14,lineHeight:21},regular_SM:{fontFamily:t.PoppinsRegular,fontSize:14,lineHeight:21},bold_XS:{fontFamily:t.PoppinsBold,fontSize:12,lineHeight:18},semiBold_XS:{fontFamily:t.PoppinsSemiBold,fontSize:12,lineHeight:18},medium_XS:{fontFamily:t.PoppinsMedium,fontSize:12,lineHeight:18},regular_XS:{fontFamily:t.PoppinsRegular,fontSize:12,lineHeight:18},bold_XXS:{fontFamily:t.PoppinsBold,fontSize:10,lineHeight:15},semiBold_XXS:{fontFamily:t.PoppinsSemiBold,fontSize:10,lineHeight:15},medium_XXS:{fontFamily:t.PoppinsMedium,fontSize:10,lineHeight:15},regular_XXS:{fontFamily:t.PoppinsRegular,fontSize:10,lineHeight:15}}}})),O7=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ColorScheme=e.COLORS=void 0,Object.defineProperty(e,"FONTS",{enumerable:!0,get:function(){return i.FONTS}}),Object.defineProperty(e,"FontFamily",{enumerable:!0,get:function(){return i.FontFamily}}),Object.defineProperty(e,"TEXT_SCALING",{enumerable:!0,get:function(){return i.TEXT_SCALING}}),e.getColors=o;var t=(V(),d(tm)),n=Bmn(),r=Vmn(),i=Hmn(),a=e.ColorScheme=function(e){return e.Light=`light`,e.Dark=`dark`,e.System=`system`,e}({});function o(e){let i=t.Appearance.getColorScheme();switch(e){case a.Light:return r.LIGHT_SEMANTIC_COLORS;case a.Dark:return n.DARK_SEMANTIC_COLORS;case a.System:return i===`light`?r.LIGHT_SEMANTIC_COLORS:n.DARK_SEMANTIC_COLORS;default:return n.DARK_SEMANTIC_COLORS}}e.COLORS=o()})),k7=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.useSemanticColors=e.ColorSchemeProvider=void 0;var t=a(p()),n=O7(),r=Bmn(),i=LJ();function a(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(a=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}var o=(0,t.createContext)(r.DARK_SEMANTIC_COLORS);e.ColorSchemeProvider=({colorScheme:e,children:r})=>{let a=(0,t.useMemo)(()=>(0,n.getColors)(e),[e]);return(0,i.jsx)(o.Provider,{value:a,children:r})},e.useSemanticColors=()=>(0,t.useContext)(o)})),Umn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,a(p());var t=i((F4(),d(P4))),n=k7(),r=LJ();function i(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(i=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}function a(e){return e&&e.__esModule?e:{default:e}}function o(e){let i=(0,n.useSemanticColors)();return(0,r.jsx)(t.default,{width:24,height:24,viewBox:`0 0 24 24`,...e,children:(0,r.jsx)(t.Path,{d:`M7.668 13.77h0a1.375 1.375 0 00-.758 1.776c.642 1.638 2.097 3.053 4.194 3.297h0a1.36 1.36 0 001.503-1.207h0a1.368 1.368 0 00-1.193-1.517h0c-.962-.111-1.652-.743-1.98-1.582l-.448.176.447-.175a1.352 1.352 0 00-1.765-.768zM12 21.52c-3.177 0-5.476-1.785-6.648-4.133-1.18-2.361-1.197-5.247.157-7.405 2.079-3.033 5.034-5.346 6.234-6.216a.434.434 0 01.514 0c1.2.87 4.155 3.183 6.234 6.216 1.354 2.158 1.336 5.044.157 7.405-1.172 2.348-3.471 4.133-6.648 4.133z`,fill:i.labelPrimary,stroke:i.labelPrimary,strokeWidth:.96})})}e.default=o})),Wmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,a(p());var t=i((F4(),d(P4))),n=k7(),r=LJ();function i(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(i=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}function a(e){return e&&e.__esModule?e:{default:e}}function o(e){let i=(0,n.useSemanticColors)();return(0,r.jsxs)(t.default,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,r.jsx)(t.Mask,{id:`a`,fill:i.labelPrimary,children:(0,r.jsx)(t.Path,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M17.862 4.741a2.493 2.493 0 01-2.49 2.489 2.492 2.492 0 01-2.49-2.489 2.492 2.492 0 012.49-2.491 2.493 2.493 0 012.49 2.491zm1.326 5.237c-1.271.056-2.72.02-3.824-.658-.385-.237-.744-.562-1.125-.907-.211-.191-.422-.382-.64-.562-2.246-1.865-5.681-1.71-7.818.353a1 1 0 101.388 1.439c1.056-1.018 2.637-1.326 3.974-.893-.818 1.14-1.496 2.52-1.013 4.322.225.84.699 1.452 1.118 1.99l.008.011c.404.524.724.94.777 1.469.105 1.04-.42 2.164-.928 3.249l-.253.547a1.002 1.002 0 00.91 1.413 1 1 0 00.912-.588l.243-.525v-.003c.593-1.267 1.265-2.704 1.106-4.292-.111-1.103-.685-1.845-1.19-2.5l-.004-.004c-.347-.447-.646-.834-.767-1.285-.267-.996.079-1.772.767-2.718l.028.024.039.035c.43.39.877.795 1.42 1.129 1.299.798 2.819.972 4.143.972.282 0 .556-.01.817-.02a1 1 0 00.955-1.043c-.024-.552-.511-.971-1.043-.955zm-10.37 4.539c-.533.289-1.12.567-1.81.654-.446.055-.915.052-1.404.046l-.162-.001c-.234-.001-.469-.003-.704.005a1 1 0 00.03 1.999h.029c.24-.008.482-.006.722-.004h.065c.536.007 1.093.01 1.672-.061 1.022-.127 1.845-.516 2.515-.88a1 1 0 00-.954-1.758z`})}),(0,r.jsx)(t.Path,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M17.862 4.741a2.493 2.493 0 01-2.49 2.489 2.492 2.492 0 01-2.49-2.489 2.492 2.492 0 012.49-2.491 2.493 2.493 0 012.49 2.491zm1.326 5.237c-1.271.056-2.72.02-3.824-.658-.385-.237-.744-.562-1.125-.907-.211-.191-.422-.382-.64-.562-2.246-1.865-5.681-1.71-7.818.353a1 1 0 101.388 1.439c1.056-1.018 2.637-1.326 3.974-.893-.818 1.14-1.496 2.52-1.013 4.322.225.84.699 1.452 1.118 1.99l.008.011c.404.524.724.94.777 1.469.105 1.04-.42 2.164-.928 3.249l-.253.547a1.002 1.002 0 00.91 1.413 1 1 0 00.912-.588l.243-.525v-.003c.593-1.267 1.265-2.704 1.106-4.292-.111-1.103-.685-1.845-1.19-2.5l-.004-.004c-.347-.447-.646-.834-.767-1.285-.267-.996.079-1.772.767-2.718l.028.024.039.035c.43.39.877.795 1.42 1.129 1.299.798 2.819.972 4.143.972.282 0 .556-.01.817-.02a1 1 0 00.955-1.043c-.024-.552-.511-.971-1.043-.955zm-10.37 4.539c-.533.289-1.12.567-1.81.654-.446.055-.915.052-1.404.046l-.162-.001c-.234-.001-.469-.003-.704.005a1 1 0 00.03 1.999h.029c.24-.008.482-.006.722-.004h.065c.536.007 1.093.01 1.672-.061 1.022-.127 1.845-.516 2.515-.88a1 1 0 00-.954-1.758z`,fill:i.labelPrimary}),(0,r.jsx)(t.Path,{d:`M15.364 9.32l-.525.851h.001l.524-.851zm3.824.658l-.03-1h-.014l.044 1zm-4.95-1.565l.672-.742-.671.742zm-.64-.562l-.638.769.002.002.637-.771zm-7.817.353l.693.72h.001l-.694-.72zm-.026 1.414l-.72.693v.002l.72-.695zm1.414.025l-.694-.72h-.002l.696.72zm3.974-.893l.812.582.798-1.112-1.302-.422-.308.952zm-1.013 4.322l.965-.26-.965.26zm1.118 1.99l.791-.61-.002-.003-.79.614zm.008.011l-.792.61.792-.61zm.777 1.469l-.995.098v.002l.995-.1zm-.928 3.249l-.906-.424-.002.004.908.42zm-.253.547l-.908-.42-.004.008.912.412zm.499 1.324l-.413.91.004.002.409-.912zm1.323-.5l-.908-.42-.003.008.91.413zm.243-.524l-.906-.424-.002.004.908.42zm0-.003l-.905-.423.906.424zm1.106-4.292l-.995.1.995-.1zm-1.19-2.5l.79-.611-.79.611zm-.004-.004l.79-.612v-.002l-.79.614zm-.767-1.285l-.966.258.966-.258zm.767-2.718l.672-.74-.825-.75-.656.901.809.589zm.028.024l-.65.761.65-.76zm.039.035l-.69.723.008.009.01.008.672-.74zm1.42 1.129l.524-.852-.523.852zm4.96.952l.042.999h.001l-.043-1zm.955-1.043l-1 .043 1-.043zM7.008 15.17l.123.992h.003l-.126-.992zm1.81-.654l-.477-.88.476.88zm-3.214.7l.012-1h-.008l-.004 1zm-.162-.001l-.005 1 .005-1zm-.704.005l.03 1h.002l-.032-1zm-.97 1.028l1-.028v-.001l-1 .029zm1.029.97v1h.03l-.03-1zm.722-.003l-.008 1h.008v-1zm0 0l.008-1H5.52v1zm.065 0l.012-1h-.004l-.008 1zm1.672-.061l.124.992-.124-.992zm2.515-.88l.478.878-.478-.878zm.402-1.356l-.879.476.001.002.879-.478zm5.199-6.689a3.493 3.493 0 003.49-3.489h-2c0 .82-.67 1.489-1.49 1.489v2zm-3.49-3.489a3.492 3.492 0 003.49 3.489v-2c-.82 0-1.49-.669-1.49-1.489h-2zm3.49-3.491a3.492 3.492 0 00-3.49 3.491h2c0-.822.67-1.491 1.49-1.491v-2zm3.49 3.491a3.493 3.493 0 00-3.49-3.491v2c.82 0 1.49.669 1.49 1.491h2zm-4.022 5.43c1.392.856 3.126.861 4.392.806l-.088-1.998c-1.277.056-2.438-.008-3.257-.511l-1.047 1.704zm-1.273-1.017c.365.33.794.723 1.272 1.017l1.049-1.703c-.292-.18-.581-.437-.978-.797l-1.343 1.483zm-.605-.532c.197.163.392.338.606.532l1.342-1.483c-.208-.188-.436-.395-.675-.591l-1.273 1.542zm-6.487.301c1.78-1.718 4.642-1.833 6.485-.303l1.277-1.539c-2.649-2.2-6.657-2.003-9.15.403l1.388 1.44zm0 .001s-.001-.001 0 0v-.001l-.001.002-1.387-1.442a2 2 0 00-.053 2.828l1.441-1.387zm-.002 0h.002c0-.001 0 0 0 0h-.001v-.002l-1.438 1.391a2 2 0 002.828.048l-1.39-1.437zm4.978-1.126c-1.667-.54-3.64-.164-4.976 1.125l1.388 1.44c.774-.747 1.965-.988 2.971-.662l.617-1.903zm-.356 5.015c-.368-1.376.113-2.439.86-3.48L10.33 8.166c-.89 1.24-1.763 2.937-1.166 5.164l1.931-.518zm.942 1.636c-.426-.548-.775-1.015-.942-1.636l-1.931.517c.283 1.06.882 1.816 1.294 2.346l1.58-1.227zm.01.013l-.008-.01-1.583 1.221.008.01 1.583-1.22zm.98 1.98c-.086-.867-.62-1.514-.98-1.98l-1.583 1.222c.449.582.554.765.573.957l1.99-.198zm-1.017 3.773c.25-.532.534-1.138.737-1.75.204-.614.353-1.307.28-2.024l-1.99.201c.033.324-.028.713-.188 1.192-.16.481-.391.98-.65 1.533l1.811.848zm-.25.542l.252-.547-1.815-.84-.253.548 1.815.84zm.003-.006c.001 0 0 0 0 0v-.002 0l-1.823-.823a2.002 2.002 0 00.998 2.646l.825-1.821zm0 0h.001l-.005-.002-.817 1.825c.262.118.542.177.82.177v-2zm0 0v2a2 2 0 001.822-1.176l-1.822-.825zm.246-.533l-.243.525 1.815.84.243-.525-1.815-.84zm.002-.006v.002l1.812.847v-.002l-1.812-.847zm1.017-3.77c.128 1.272-.404 2.461-1.016 3.77l1.811.847c.574-1.226 1.386-2.911 1.195-4.817l-1.99.2zm-.987-1.987c.514.664.908 1.201.987 1.987l1.99-.2c-.143-1.418-.896-2.365-1.395-3.01l-1.582 1.223zm-.004-.005l.004.005 1.582-1.223-.003-.005-1.583 1.223zm-.941-1.637c.183.682.626 1.231.943 1.639l1.58-1.227c-.378-.486-.533-.71-.592-.93l-1.931.518zm.924-3.566c-.743 1.022-1.31 2.123-.924 3.566l1.931-.518c-.147-.55-.023-1.001.61-1.871L12.02 9.247zm1.486-.147a.403.403 0 00-.005-.004l-1.345 1.48.052.045L13.506 9.1zm.08.071c-.036-.034-.07-.063-.08-.071l-1.298 1.521.007.006.001.001-.01-.01 1.38-1.447zm1.254 1c-.453-.278-.834-.62-1.272-1.017l-1.344 1.481c.423.384.934.85 1.57 1.24l1.046-1.704zm3.619.825c-1.259 0-2.556-.17-3.619-.824l-1.047 1.704c1.533.942 3.276 1.12 4.666 1.12v-2zm.774-.02c-.255.011-.513.02-.774.02v2c.302 0 .592-.01.859-.021l-.085-1.998zm-.001 0l.087 1.999a2 2 0 001.91-2.086l-1.997.087zm-.014.001c-.003 0-.003 0 0 .001a.045.045 0 01.014.008c.004.004.004.006.003.003a.044.044 0 01-.003-.013l1.998-.087c-.05-1.13-1.026-1.942-2.073-1.91l.06 1.998zM7.134 16.163c.88-.111 1.602-.464 2.16-.768l-.954-1.757c-.505.274-.957.478-1.457.54l.25 1.985zm-1.543.053c.482.006 1.017.012 1.54-.053l-.245-1.985c-.369.046-.772.045-1.27.039l-.025 2zm-.153 0h.16l.01-2h-.16l-.01 2zm-.668.004c.213-.006.43-.005.667-.004l.01-2c-.23-.001-.483-.003-.74.005l.063 2zm-.002 0l-.058-1.999a2 2 0 00-1.941 2.057l2-.058zm0 0c-.002 0 0 0 0 0-.001-.001-.001-.001 0 0v.001c0 .001 0 .001 0 0l-2 .055a2 2 0 002 1.944v-2zm.029 0h-.03v2h.03v-2zm.73-.004c-.237-.002-.497-.004-.76.004l.06 2c.219-.008.44-.006.684-.004l.016-2zm-.008 0v2-2zm.073 0h-.065l-.015 2h.065l.015-2zm1.541-.054c-.504.063-.997.06-1.537.055l-.023 2c.532.006 1.151.011 1.807-.07l-.247-1.985zm2.161-.766c-.631.343-1.324.662-2.16.766l.246 1.985c1.207-.15 2.16-.609 2.869-.994l-.955-1.757zm.001 0c0 .002 0 .002 0 0v-.001c0-.001 0-.001 0 0v.001h-.002l.957 1.757a2 2 0 00.802-2.712l-1.757.956zm0 0l1.758-.954a2.001 2.001 0 00-2.712-.805l.953 1.759z`,fill:i.labelPrimary,mask:`url(#a)`})]})}e.default=o})),A7=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TIMEOUT_MODAL_TRIGGER=e.TARGET_BGL_MMOL_LIMITS=e.INSULIN_TO_CARBS_RATIO_LIMITS=e.INSULIN_SENSITIVITY_MMOL_LIMITS=e.INSULIN_DOSE_LIMITS=e.CURRENT_BGL_MMOL_LIMITS=e.CARBOHYDRATES_LIMITS=e.BOLUS_SECONDS_PASSED_LIMITS=e.ACTIVITY_TARGET_BGL_MMOL_LIMITS=e.ACTIVITY_SETTINGS_INTERVAL_LIMITS=e.ACTIVITY_POSTPONE_GLUCOSE_MMOLL=e.ACTIVITY_POSTPONE_GLUCOSE_MGDL=e.ACTIVITY_DURATION_MINUTES_LIMITS=void 0;var t=E2();e.ACTIVITY_POSTPONE_GLUCOSE_MMOLL=5,e.ACTIVITY_POSTPONE_GLUCOSE_MGDL=90,e.TIMEOUT_MODAL_TRIGGER=600*1e3,e.CARBOHYDRATES_LIMITS={min:t.CONSTANTS.CARBOHYDRATES_INPUT_MIN,max:t.CONSTANTS.CARBOHYDRATES_INPUT_MAX},e.INSULIN_DOSE_LIMITS={min:t.CONSTANTS.INSULIN_DOSE_MIN,max:t.CONSTANTS.INSULIN_DOSE_MAX},e.BOLUS_SECONDS_PASSED_LIMITS={min:t.CONSTANTS.BOLUS_SECONDS_MIN,max:t.CONSTANTS.BOLUS_SECONDS_MAX},e.ACTIVITY_DURATION_MINUTES_LIMITS={min:t.CONSTANTS.ACTIVITY_DURATION_MIN,max:t.CONSTANTS.ACTIVITY_DURATION_MAX},e.INSULIN_SENSITIVITY_MMOL_LIMITS={min:t.CONSTANTS.INSULIN_SENSITIVITY_MIN,max:t.CONSTANTS.INSULIN_SENSITIVITY_MAX},e.INSULIN_TO_CARBS_RATIO_LIMITS={min:t.CONSTANTS.INSULIN_TO_CARBS_RATIO_MIN,max:t.CONSTANTS.INSULIN_TO_CARBS_RATIO_MAX},e.CURRENT_BGL_MMOL_LIMITS={min:t.CONSTANTS.GLUCOSE_INPUT_MIN_MMOLL,max:t.CONSTANTS.GLUCOSE_INPUT_MAX_MMOLL},e.TARGET_BGL_MMOL_LIMITS={min:t.CONSTANTS.TARGET_GLUCOSE_MIN,max:t.CONSTANTS.TARGET_GLUCOSE_MAX},e.ACTIVITY_TARGET_BGL_MMOL_LIMITS={min:t.CONSTANTS.ACTIVITY_TARGET_GLUCOSE_MIN,max:t.CONSTANTS.ACTIVITY_TARGET_GLUCOSE_MAX},e.ACTIVITY_SETTINGS_INTERVAL_LIMITS={min:t.CONSTANTS.ACTIVITY_REDUCTION_MIN,max:t.CONSTANTS.ACTIVITY_REDUCTION_MAX}})),j7=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.useLanguage=e.LanguageProvider=e.LanguageContext=void 0;var t=i(p()),n=G_t(),r=LJ();function i(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(i=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}var a=e.LanguageContext=(0,t.createContext)(void 0);e.LanguageProvider=({children:e})=>{let{language:i,changeLanguage:o,t:s}=(0,n.useTranslation)(),c=t.default.useMemo(()=>({language:i,changeLanguage:o,t:s}),[i,o,s]);return(0,r.jsx)(a.Provider,{value:c,children:e})},e.useLanguage=()=>{let e=(0,t.useContext)(a);if(!e)throw Error(`useLanguage must be used within a LanguageProvider`);return e}})),M7=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.convertAndFormatBGL=i,e.convertBGL=n,e.createSequentialArrayInteger=e.createSequentialArrayHalf=e.createSequentialArrayDecimal=void 0,e.formatBGL=r,e.formatUnit=void 0;var t=E2();function n(e,n,r){if(n!==t.BloodGlucoseUnit.MG_DL&&n!==t.BloodGlucoseUnit.MMOL_L)throw Error(`Unsupported glucose unit! ${n}`);if(n===r)return e;switch(r){case t.BloodGlucoseUnit.MG_DL:return e*t.CONSTANTS.MGDL_PER_MMOLL_BGL;case t.BloodGlucoseUnit.MMOL_L:return e*t.CONSTANTS.MMOLL_PER_MGDL_BGL;default:throw Error(`Unsupported glucose unit! ${r}`)}}function r(e,n){let r=n===t.BloodGlucoseUnit.MG_DL?0:1;return(Math.round(e*10)/10).toFixed(r)}function i(e,t,i){return r(n(e,t,i),i)}e.formatUnit=e=>`${e.substring(0,e.length-1)}${e.substring(e.length-1,e.length).toUpperCase()}`,e.createSequentialArrayHalf=(e,t)=>Array.from({length:(t-e)/.5+1},(t,n)=>(e+n*.5).toFixed(1)),e.createSequentialArrayInteger=(e,t)=>Array.from({length:t-e+1},(t,n)=>(e+n).toString()),e.createSequentialArrayDecimal=(e,t)=>Array.from({length:(t-e)*10+1},(t,n)=>(e+n/10).toFixed(1))})),Gmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.useDebouncedCallback=m,e.useFontScale=f;var t=p(),n=(V(),d(tm)),r=Hmn(),i=()=>{let e=n.PixelRatio.getFontScale();return Math.min(e>0?e:1,r.TEXT_SCALING.s3)},a=i(),o=new Set,s=[],c=()=>{let e=i();e!==a&&(a=e,o.forEach(e=>e()))},l=e=>(o.size===0&&(s=[n.AppState.addEventListener(`change`,e=>{e===`active`&&c()}),n.Dimensions.addEventListener(`change`,c)]),o.add(e),c(),()=>{o.delete(e),o.size===0&&(s.forEach(e=>e.remove()),s=[])}),u=()=>a;function f(){return(0,t.useSyncExternalStore)(l,u)}function m(e,n){let r=(0,t.useRef)(null),i=(0,t.useRef)(e);return(0,t.useEffect)(()=>{i.current=e},[e]),(0,t.useCallback)((...e)=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{i.current(...e)},n)},[n])}})),N7=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=s(p()),n=(V(),d(tm)),r=Gmn(),i=k7(),a=O7(),o=LJ();function s(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(s=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}function c(e){let s=(0,i.useSemanticColors)(),c=(0,r.useFontScale)(),l=(0,t.useMemo)(()=>{let t=n.StyleSheet.flatten([{...a.FONTS.Poppins.regular_Base,color:s.labelPrimary},e.style]);return typeof t.fontSize==`number`&&(t.fontSize*=c),typeof t.lineHeight==`number`&&(t.lineHeight*=c),t},[s,e.style,c]);return(0,o.jsx)(n.Text,{...e,allowFontScaling:!1,style:l,children:e.children})}e.default=c})),Kmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=g(p()),n=(V(),d(tm)),r=E2(),i=h(Umn()),a=h(Wmn()),o=A7(),s=k7(),c=j7(),l=O7(),u=M7(),f=h(N7()),m=LJ();function h(e){return e&&e.__esModule?e:{default:e}}function g(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(g=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}function _({glucoseReading:e,hasActivity:l,bloodGlucoseUnit:d}){let{t:p}=(0,c.useLanguage)(),h=(0,s.useSemanticColors)(),g=(0,t.useMemo)(()=>(0,u.convertBGL)(e.value,e.unit,r.BloodGlucoseUnit.MMOL_L),[e]),_=(0,t.useMemo)(()=>r.CONSTANTS.LEVEL_TWO_HYPOGLYCEMIA_MIN<=g&&g<r.CONSTANTS.LEVEL_TWO_HYPOGLYCEMIA_MAX?p(`recommendation_suggestions_remeasure_very_low`):r.CONSTANTS.LEVEL_ONE_HYPOGLYCEMIA_MIN<=g&&g<r.CONSTANTS.LEVEL_ONE_HYPOGLYCEMIA_MAX?p(`recommendation_suggestions_remeasure_low`):r.CONSTANTS.SEVERE_HYPOGLYCEMIA_MIN<g&&g<=r.CONSTANTS.SEVERE_HYPERGLYCEMIA_MAX?p(`recommendation_suggestions_measure_ketone`):null,[g,p]),y=(0,t.useMemo)(()=>r.CONSTANTS.LOW_GLUCOSE_MESSAGE_ACTIVITY_MIN<=g&&g<=r.CONSTANTS.LOW_GLUCOSE_MESSAGE_ACTIVITY_MAX?p(`recommendation_suggestions_postpone_activity`,{displayUnit:(0,u.formatUnit)(d),value:d===r.BloodGlucoseUnit.MG_DL?o.ACTIVITY_POSTPONE_GLUCOSE_MGDL.toString():o.ACTIVITY_POSTPONE_GLUCOSE_MMOLL.toString()}):r.CONSTANTS.HIGH_GLUCOSE_MESSAGE_ACTIVITY_MIN<=g&&g<=r.CONSTANTS.HIGH_GLUCOSE_MESSAGE_ACTIVITY_MAX?p(`recommendation_suggestions_reduce_intensity`):null,[g,d,p]);return(0,m.jsxs)(n.View,{style:v.container,children:[_&&(0,m.jsxs)(n.View,{style:v.row,children:[(0,m.jsx)(i.default,{style:v.icon,testID:`blood-icon`}),(0,m.jsx)(f.default,{style:[v.text,{color:h.labelPrimary}],testID:`blood-glucose-message`,children:_})]}),l&&y&&(0,m.jsxs)(n.View,{style:v.row,children:[(0,m.jsx)(a.default,{style:v.icon,testID:`run-icon`}),(0,m.jsx)(f.default,{style:[v.text,{color:h.labelPrimary}],testID:`activity-message`,children:y})]})]})}var v=n.StyleSheet.create({container:{gap:16,flexWrap:`wrap`},text:{...l.FONTS.Poppins.regular_SM,flex:1},row:{flexDirection:`row`,gap:8},icon:{alignSelf:`center`}});e.default=_})),qmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,a(p());var t=i((F4(),d(P4))),n=k7(),r=LJ();function i(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(i=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}function a(e){return e&&e.__esModule?e:{default:e}}function o(e){let i=(0,n.useSemanticColors)();return(0,r.jsx)(t.default,{width:42,height:42,viewBox:`0 0 42 42`,fill:`none`,...e,children:(0,r.jsx)(t.Path,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M14.075 5.202a1.313 1.313 0 011.539-1.04c2.41.468 4.109 1.686 5.178 3.328.874 1.34 1.283 2.895 1.394 4.422a15.383 15.383 0 002.662-.475c1.134-.306 3.85-.727 6.424.425 2.686 1.202 4.946 3.988 5.289 9.548a.988.988 0 01.002.051c.043 5.242-1.626 9.2-3.54 11.88-.955 1.336-1.972 2.359-2.874 3.067a8.58 8.58 0 01-1.27.842c-.347.183-.72.336-1.074.389-1.64.386-3.142.11-4.34-.222-.369-.102-.751-.222-1.087-.327-.188-.06-.361-.114-.509-.158-.473-.141-.768-.202-.961-.202-.203 0-.504.059-.972.19-.152.043-.336.098-.535.158-.328.097-.7.208-1.049.301-1.194.317-2.684.588-4.327.262-.359-.052-.74-.209-1.097-.398-.39-.206-.82-.49-1.271-.844-.903-.709-1.92-1.73-2.873-3.066-1.911-2.678-3.575-6.63-3.533-11.872 0-.017 0-.034.002-.051.343-5.56 2.603-8.346 5.29-9.548 2.574-1.152 5.29-.731 6.423-.425.863.232 1.725.388 2.586.468-.106-1.119-.415-2.148-.96-2.982-.663-1.02-1.735-1.845-3.478-2.183a1.312 1.312 0 01-1.039-1.538zm.98 12.966a1.313 1.313 0 00-1.126-2.371c-1.911.908-3.296 2.796-3.584 4.894a1.312 1.312 0 102.6.358 3.85 3.85 0 012.11-2.881z`,fill:i.graphCarbohydrateSecondary})})}e.default=o})),Jmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,i(p());var t=(F4(),d(P4)),n=k7(),r=LJ();function i(e){return e&&e.__esModule?e:{default:e}}e.default=e=>{let i=(0,n.useSemanticColors)();return(0,r.jsxs)(t.Svg,{width:24,height:25,viewBox:`0 0 24 25`,fill:`none`,...e,children:[(0,r.jsx)(t.Path,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M3.99312 4.2711C4.97691 3.21491 6.37794 2.62354 8.03206 2.62354H11.6091C12.0233 2.62354 12.3591 2.95933 12.3591 3.37354C12.3591 3.78775 12.0233 4.12354 11.6091 4.12354H8.03206C6.75004 4.12354 5.76199 4.57281 5.09074 5.29347C4.414 6.02002 4.00391 7.08289 4.00391 8.39968V16.3464C4.00391 17.6647 4.4124 18.7277 5.08783 19.4539C5.75756 20.1739 6.74517 20.6235 8.03206 20.6235H16.467C17.7555 20.6235 18.7433 20.1738 19.4128 19.4539C20.088 18.7278 20.4961 17.6649 20.4961 16.3464V12.7654C20.4961 12.3512 20.8319 12.0154 21.2461 12.0154C21.6603 12.0154 21.9961 12.3512 21.9961 12.7654V16.3464C21.9961 17.9738 21.4886 19.4244 20.5112 20.4754C19.5281 21.5326 18.1263 22.1235 16.467 22.1235H8.03206C6.37405 22.1235 4.97259 21.5324 3.98947 20.4754C3.01204 19.4245 2.50391 17.974 2.50391 16.3464V8.39968C2.50391 6.77158 3.01482 5.32139 3.99312 4.2711Z`,fill:e?.color??i.labelPrimary}),(0,r.jsx)(t.Path,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M17.4779 4.79025L11.947 10.8273C11.6292 11.1844 11.4306 11.6319 11.3786 12.1085L11.2367 13.4178C11.1888 13.8615 11.5777 14.2282 12.0174 14.1548C12.0173 14.1548 12.0175 14.1547 12.0174 14.1548L13.2872 13.9418C13.8024 13.8552 14.2724 13.5962 14.6197 13.2079L14.6257 13.2012L20.1012 7.2259L20.1038 7.2231C20.4768 6.82017 20.4526 6.1918 20.0494 5.81853L18.8817 4.73742C18.8817 4.73738 18.8818 4.73746 18.8817 4.73742C18.4788 4.36513 17.8501 4.38948 17.4779 4.79025ZM16.376 3.77252C17.311 2.76233 18.8891 2.70159 19.8999 3.63592L21.0684 4.71777C21.0683 4.71776 21.0684 4.71779 21.0684 4.71777C22.0786 5.65306 22.1405 7.22926 21.206 8.24047C21.2055 8.24101 21.205 8.24155 21.2045 8.24209L15.7346 14.2114C15.1602 14.8521 14.3846 15.2784 13.5359 15.4211L12.2655 15.6341C10.8457 15.8717 9.59091 14.6883 9.74532 13.2569L9.88736 11.9465C9.97332 11.1584 10.3028 10.4163 10.8313 9.82475L10.8376 9.81777L16.3734 3.77534L16.376 3.77252Z`,fill:e?.color??i.labelPrimary})]})}})),Ymn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,i(p());var t=(V(),d(tm)),n=k7(),r=LJ();function i(e){return e&&e.__esModule?e:{default:e}}var a=()=>{let e=(0,n.useSemanticColors)();return(0,r.jsx)(t.View,{style:[o.container,{backgroundColor:e.bgOverlay}],testID:`backdrop`})},o=t.StyleSheet.create({container:{position:`absolute`,top:0,left:0,right:0,bottom:0}});e.default=a})),Xmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.CheckmarkCircleFilledHeight=void 0,i(p());var t=r((F4(),d(P4))),n=LJ();function r(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,i=new WeakMap;return(r=function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?r(o,t,a):o[t]=e[t]);return o})(e,t)}function i(e){return e&&e.__esModule?e:{default:e}}e.CheckmarkCircleFilledHeight=140;function a(e){return(0,n.jsxs)(t.default,{width:128,height:128,viewBox:`0 0 128 128`,fill:`none`,...e,children:[(0,n.jsx)(t.Circle,{cx:64,cy:64,r:63,fill:`#4A5DEB`,stroke:`#4A73ED`,strokeWidth:2}),(0,n.jsx)(t.Path,{d:`M43 67C43 67 54 78.5 55.5 79C57 79.5 85.5 49 85.5 49`,stroke:`white`,strokeWidth:5.33333,strokeLinecap:`round`})]})}e.default=a})),Zmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,o(p());var t=(V(),d(tm)),n=a(Xmn()),r=k7(),i=LJ();function a(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(a=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}function o(e){return e&&e.__esModule?e:{default:e}}var s=()=>{let e=(0,r.useSemanticColors)(),{height:a}=(0,t.useWindowDimensions)();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.default,{style:[c.checkmark,{top:(a-n.CheckmarkCircleFilledHeight)/2}],testID:`timeout-modal-checkmark`}),(0,i.jsx)(t.View,{style:[c.container,{backgroundColor:e.bgOverlay}],testID:`backdrop-checkmark`})]})},c=t.StyleSheet.create({checkmark:{alignSelf:`center`,position:`absolute`},container:{position:`absolute`,top:0,left:0,right:0,bottom:0}});e.default=s})),P7=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=l(p()),n=(V(),d(tm)),r=(Z0(),d(z4t)),i=k7(),a=c(Ymn()),o=c(Zmn()),s=LJ();function c(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(l=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}var u=300;function f({testID:e,isVisible:c,onModalHide:l,onModalShow:d,onRequestClose:f,containerStyle:p,children:h,checkmark:g}){let{height:_}=(0,n.useWindowDimensions)(),{bottom:v}=(0,r.useSafeAreaInsets)(),y=(0,i.useSemanticColors)(),[b,x]=(0,t.useState)(0),[S,C]=(0,t.useState)(!1),w=(0,t.useRef)(new n.Animated.Value(_)).current;(0,t.useEffect)(()=>{S||w.setValue(_)},[S,_,w]);let T=(0,t.useCallback)(()=>{n.Animated.timing(w,{toValue:0,duration:u,easing:n.Easing.out(n.Easing.cubic),useNativeDriver:n.Platform.OS!==`web`}).start(({finished:e})=>{e&&d&&d()})},[d,w]),E=(0,t.useCallback)(()=>{let e=b>0?b:_;n.Animated.timing(w,{toValue:e,duration:u,easing:n.Easing.out(n.Easing.cubic),useNativeDriver:n.Platform.OS!==`web`}).start(({finished:e})=>{e&&(C(!1),l&&l())})},[b,_,l,w]);(0,t.useEffect)(()=>{S&&!c?E():!S&&c&&(C(!0),T())},[c,S,E,T]);let D=(0,t.useCallback)(e=>{x(e.nativeEvent.layout.height+v)},[v]);return S?(0,s.jsx)(n.Modal,{visible:!0,transparent:!0,statusBarTranslucent:!0,onRequestClose:f,children:(0,s.jsxs)(n.View,{style:[m.overlay,{backgroundColor:y.bgTransparent}],children:[g?(0,s.jsx)(o.default,{}):(0,s.jsx)(a.default,{}),(0,s.jsx)(n.Animated.View,{testID:e,accessibilityRole:`alert`,onLayout:D,style:[m.modal,{backgroundColor:y.bgModal},{transform:[{translateY:w}]},{paddingBottom:v+16},p],children:h})]})}):null}var m=n.StyleSheet.create({modal:{width:`100%`,maxHeight:`85%`,paddingTop:32,paddingBottom:16,paddingHorizontal:16,borderTopRightRadius:36,borderTopLeftRadius:36},backdrop:{position:`absolute`,left:0,right:0,top:0,bottom:0},overlay:{flex:1,justifyContent:`flex-end`}});e.default=t.default.memo(f)})),Qmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"HapticFeedbackTypes",{enumerable:!0,get:function(){return n.HapticFeedbackTypes}}),e.triggerHaptic=i;var t=(V(),d(tm)),n=r((jfn(),d(Dfn)));function r(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,i=new WeakMap;return(r=function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?r(o,t,a):o[t]=e[t]);return o})(e,t)}function i(e=t.Platform.OS===`ios`?n.HapticFeedbackTypes.selection:n.HapticFeedbackTypes.effectTick,r){n.default.trigger(e,{...r})}})),$mn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=i(p()),n=(V(),d(tm)),r=LJ();function i(e){return e&&e.__esModule?e:{default:e}}var a=22,o=26;function s({type:e,height:t,option:i,index:s,fontScale:l,onItemPress:u,colors:d}){return(0,r.jsx)(n.Pressable,{onPress:u,testID:`${e}-wheel-picker-item-`+s,children:(0,r.jsx)(n.Animated.View,{style:[c.option,{height:t}],children:(0,r.jsx)(n.Text,{allowFontScaling:!1,style:[c.itemTextStyle,{fontSize:a*l,lineHeight:o*l,color:d.labelPrimary}],children:i})})})}e.default=t.default.memo(s);var c=n.StyleSheet.create({option:{alignItems:`center`,justifyContent:`center`,zIndex:100},itemTextStyle:{fontWeight:`400`}})})),ehn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=l(p()),n=(V(),d(tm)),r=c(R4()),i=Gmn(),a=Qmn(),o=c($mn()),s=LJ();function c(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(l=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}function u({type:e,initialScrollIndex:c,selectedIndex:l,options:u,onChange:d,visibleRest:p=3,decelerationRate:m=`normal`,colors:h}){let{width:g}=(0,n.useWindowDimensions)(),_=(0,i.useFontScale)(),v=Math.round(35*_),y=v*p,b=(0,t.useRef)(null),x=(0,t.useRef)(null),S=(0,t.useMemo)(()=>new n.Animated.Value(0),[]),C=(1+p*2)*v,w=(0,t.useMemo)(()=>{let e=[...u];for(let t=0;t<p;t++)e.unshift(null),e.push(null);return e},[u,p]),T=(0,t.useMemo)(()=>[...Array(w.length)].map((e,t)=>t*v),[w,v]),E=(0,t.useRef)(v);(0,t.useEffect)(()=>{E.current!==v&&(E.current=v,x.current=l,b.current?.scrollToOffset({offset:l*v,animated:!1}))},[v,l]);let D=(0,t.useCallback)(e=>{let t=Math.min(v*(u.length-1),Math.max(e.nativeEvent.contentOffset.y,0)),n=Math.floor(Math.floor(t)/v);Math.floor(t%v)>v/2&&n++,n!==l&&d(n)},[v,u.length,l,d]),O=(0,t.useCallback)(e=>{n.Platform.OS!==`web`&&x.current!==e&&(x.current=e,(0,a.triggerHaptic)())},[]),k=(0,t.useCallback)(e=>{let t=Math.round(Math.round(e.nativeEvent.contentOffset.y)/v),r=Math.min(u.length-1,Math.max(t,0));O(r),r!==l&&d(r),n.Platform.OS===`web`&&b.current?.scrollToIndex({index:r,animated:!0})},[O,d,l,u.length,v]),A=(0,i.useDebouncedCallback)(k,100),ee=(0,t.useCallback)(e=>{d(e),b.current?.scrollToIndex({index:e,animated:!0})},[d]);return(0,s.jsxs)(n.View,{style:[f.containerPicker,{height:C,backgroundColor:h.iosKeyboardPicker}],testID:`${e}-wheel-picker`,children:[(0,s.jsx)(n.View,{style:[f.selectedIndicator,{backgroundColor:h.iosSelectorKeyboard,transform:[{translateY:-v/2}],height:v,width:g-32-20}]}),(0,s.jsx)(n.Animated.FlatList,{testID:`${e}-wheel-picker-list`,ref:b,style:f.scrollView,showsVerticalScrollIndicator:!1,onScroll:n.Animated.event([{nativeEvent:{contentOffset:{y:S}}}],{useNativeDriver:n.Platform.OS!==`web`,listener:n.Platform.OS===`web`?A:k}),onMomentumScrollEnd:D,snapToInterval:v,snapToOffsets:T,decelerationRate:m,initialScrollIndex:c,getItemLayout:(e,t)=>({length:v,offset:v*t,index:t}),data:w,keyExtractor:(e,t)=>t.toString(),renderItem:({item:t,index:n})=>(0,s.jsx)(o.default,{type:e,index:n,option:t,height:v,fontScale:_,onItemPress:()=>ee(Math.max(0,Math.min(n-p,u.length-1))),colors:h})}),(0,s.jsx)(r.default,{colors:[h.iosKeyboardPicker+`FF`,h.iosKeyboardPicker+`4D`],style:[f.mask,{top:0,height:y}]}),(0,s.jsx)(r.default,{colors:[h.iosKeyboardPicker+`4D`,h.iosKeyboardPicker+`FF`],style:[f.mask,{bottom:0,height:y}]})]})}e.default=t.default.memo(u);var f=n.StyleSheet.create({containerPicker:{borderTopLeftRadius:13,borderTopRightRadius:13,overflow:`hidden`},selectedIndicator:{position:`absolute`,borderRadius:7,top:`50%`,alignSelf:`center`},scrollView:{overflow:`hidden`,flex:1},mask:{position:`absolute`,left:0,right:0,pointerEvents:`none`}})})),thn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=u(p()),n=(V(),d(tm)),r=k7(),i=j7(),a=l(P7()),o=l(N7()),s=l(ehn()),c=LJ();function l(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(u=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}e.default=(0,t.memo)(e=>{let{isVisible:l,items:u,initialScrollIndex:d,type:p,onCancel:m,onConfirm:h,onDismiss:g}=e,{t:_}=(0,i.useLanguage)(),v=(0,r.useSemanticColors)(),[y,b]=(0,t.useState)(d),x=(0,t.useCallback)(e=>{b(e)},[]),S=(0,t.useCallback)(()=>{h(parseFloat(u[y]))},[u,y,h]),C=(0,t.useCallback)(()=>{b(d),m()},[d,m]);return(0,c.jsx)(a.default,{isVisible:l,onModalHide:g,containerStyle:{backgroundColor:v.bgTransparent},children:(0,c.jsxs)(n.View,{testID:`${p}-wheelpicker-modal`,children:[(0,c.jsx)(s.default,{type:p,selectedIndex:y,initialScrollIndex:d,options:u,onChange:x,colors:v}),(0,c.jsxs)(n.View,{style:f.buttonContainer,children:[(0,c.jsx)(n.Pressable,{testID:`${p}-wheel-picker-modal-confirm-button`,accessibilityRole:`button`,onPress:S,style:({pressed:e})=>[f.confirmButton,{backgroundColor:e?v.iosButtonHighlight:v.iosKeyboardPicker}],children:(0,c.jsx)(o.default,{style:[f.buttonText,{color:v.textKeyboardButtons}],children:_(`button_confirm`)})}),(0,c.jsx)(n.Pressable,{testID:`${p}-wheel-picker-modal-cancel-button`,accessibilityRole:`button`,onPress:C,style:({pressed:e})=>[f.secondaryButton,{backgroundColor:e?v.iosButtonHighlight:v.iosKeyboardPicker}],children:(0,c.jsx)(o.default,{style:[f.cancelText,{color:v.textKeyboardButtons}],children:_(`button_cancel`)})})]})]})})});var f=n.StyleSheet.create({buttonContainer:{gap:8},buttonText:{fontSize:17,lineHeight:22,fontWeight:`400`,paddingHorizontal:16,paddingVertical:14,textAlign:`center`},secondaryButton:{borderRadius:13},cancelText:{fontSize:17,lineHeight:22,fontWeight:`600`,paddingHorizontal:16,paddingVertical:14,textAlign:`center`},confirmButton:{borderBottomLeftRadius:13,borderBottomRightRadius:13}})})),nhn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=g(p()),n=(V(),d(tm)),r=h(qmn()),i=h(Jmn()),a=A7(),o=k7(),s=j7(),c=O7(),l=M7(),u=h(N7()),f=h(thn()),m=LJ();function h(e){return e&&e.__esModule?e:{default:e}}function g(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(g=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}var _=(0,l.createSequentialArrayInteger)(a.CARBOHYDRATES_LIMITS.min,a.CARBOHYDRATES_LIMITS.max);function v({carbsRecommendation:e,editedCarbsRecommendation:a,onDismiss:c,onConfirm:l}){let{t:d}=(0,s.useLanguage)(),p=(0,o.useSemanticColors)(),[h,g]=(0,t.useState)(!1),v=(0,t.useCallback)(()=>{g(!1)},[]),b=(0,t.useCallback)(()=>{g(!0)},[]),x=(0,t.useCallback)(e=>{g(!1),l(e)},[l]),S=(0,t.useCallback)(()=>{if(a!==null)return _.findIndex(e=>e===a.toString());let t=Math.round(e);return _.findIndex(e=>e===t.toString())},[a,e]);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(n.View,{style:[y.card,{backgroundColor:p.bgSecondary}],testID:`carbs-recommendation-display`,children:(0,m.jsxs)(n.View,{style:y.row,children:[(0,m.jsx)(r.default,{}),(0,m.jsxs)(n.View,{style:y.body,children:[(0,m.jsxs)(n.View,{style:y.valueRow,children:[(0,m.jsx)(u.default,{style:[y.label,{color:p.labelPrimary}],children:d(`recommendation_carb_eat`)+` `}),a===null?(0,m.jsx)(u.default,{style:[y.valueBold,{color:p.labelPrimary}],children:`${e} g`}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(u.default,{style:[y.valueEdited,{color:p.labelSecondary}],children:`${e} g`}),(0,m.jsx)(u.default,{style:[y.valueBold,{color:p.labelPrimary}],children:` ${a} g`})]})]}),(0,m.jsx)(u.default,{style:[y.subtitle,{color:p.labelPrimary}],children:d(`recommendation_carb_title`)})]}),(0,m.jsx)(n.TouchableOpacity,{onPress:b,testID:`carbohydrates-edit-button`,hitSlop:10,style:y.editButton,children:(0,m.jsx)(i.default,{style:y.editIcon})})]})}),(0,m.jsx)(f.default,{type:`carbohydrates`,items:_,isVisible:h,initialScrollIndex:S(),onConfirm:x,onCancel:v,onDismiss:c})]})}e.default=v;var y=n.StyleSheet.create({card:{borderRadius:16,marginBottom:32},row:{flexDirection:`row`,justifyContent:`center`,alignItems:`center`,padding:24,gap:12},body:{flex:1},valueRow:{flexDirection:`row`,alignItems:`center`},label:{...c.FONTS.Poppins.medium_Base},valueBold:{...c.FONTS.Poppins.semiBold_Base},subtitle:{...c.FONTS.Poppins.regular_Base,lineHeight:23},valueEdited:{...c.FONTS.Poppins.regular_Base,textDecorationLine:`line-through`,opacity:.6},editIcon:{marginLeft:4},editButton:{alignSelf:`flex-start`}})})),rhn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,i(p());var t=(V(),d(tm)),n=k7(),r=LJ();function i(e){return e&&e.__esModule?e:{default:e}}function a(){let e=(0,n.useSemanticColors)(),i=Array.from({length:25},(e,t)=>`dot-${t}`);return(0,r.jsx)(t.View,{style:o.container,children:i.map(n=>(0,r.jsx)(t.View,{testID:n,style:[o.line,{backgroundColor:e.divider}]},n))})}var o=t.StyleSheet.create({container:{flexDirection:`row`,justifyContent:`space-between`,alignItems:`center`,width:`100%`},line:{width:8,height:1,borderRadius:4}});e.default=a})),ihn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,a(p());var t=i((F4(),d(P4))),n=k7(),r=LJ();function i(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(i=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}function a(e){return e&&e.__esModule?e:{default:e}}function o(e){let i=(0,n.useSemanticColors)();return(0,r.jsx)(t.default,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,r.jsx)(t.Path,{d:`M4.227 8.207a.831.831 0 011.008-.069l.087.069L12 14.295l6.678-6.088a.83.83 0 011.008-.069l.087.069c.275.25.3.643.075.919l-.075.079-7.226 6.588a.831.831 0 01-1.008.069l-.086-.069-7.226-6.588a.663.663 0 010-.998z`,fill:i.labelSecondary})})}e.default=o})),ahn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,a(p());var t=i((F4(),d(P4))),n=k7(),r=LJ();function i(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(i=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}function a(e){return e&&e.__esModule?e:{default:e}}function o(e){let i=(0,n.useSemanticColors)();return(0,r.jsx)(t.default,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,r.jsx)(t.Path,{d:`M19.773 15.793a.831.831 0 01-1.008.069l-.087-.069L12 9.704l-6.678 6.09a.831.831 0 01-1.008.068l-.087-.069a.66.66 0 01-.075-.919l.075-.079 7.226-6.588a.83.83 0 011.008-.069l.086.069 7.226 6.588a.663.663 0 010 .998z`,fill:i.labelSecondary})})}e.default=o})),ohn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,r(p());var t=r((F4(),d(P4))),n=LJ();function r(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,i=new WeakMap;return(r=function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?r(o,t,a):o[t]=e[t]);return o})(e,t)}function i(e){return(0,n.jsx)(t.default,{width:20,height:20,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,n.jsx)(t.Path,{d:`M11.7012 4.125C11.8651 3.95886 12.1261 3.95886 12.29 4.125L18.2441 10.1582C19.2467 11.1743 19.2467 12.8256 18.2441 13.8418L12.29 19.875C12.1261 20.0411 11.8661 20.0411 11.7021 19.875L5.74805 13.8418C4.74547 12.8257 4.74558 11.1744 5.74805 10.1582L11.7012 4.125Z`,fill:`#401782`,stroke:`#9B8BF3`,strokeWidth:2})})}e.default=i})),shn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.styles=e.default=void 0,o(p());var t=(V(),d(tm)),n=k7(),r=O7(),i=o(N7()),a=LJ();function o(e){return e&&e.__esModule?e:{default:e}}function s({title:e,value:r,unit:o,hasSeparator:s,testID:l,icon:u}){let d=(0,n.useSemanticColors)();return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(t.View,{style:c.itemContainer,testID:l,children:[(0,a.jsx)(t.View,{style:c.itemTitleContainer,children:(0,a.jsx)(i.default,{style:[c.title,{color:d.labelPrimary}],testID:l+`-title`,children:e})}),(0,a.jsxs)(t.View,{style:c.row,children:[u&&(0,a.jsx)(t.View,{style:c.icon,testID:l+`-icon`,children:u}),(0,a.jsx)(i.default,{style:[c.itemText,{color:d.labelSecondary}],testID:l+`-value`,children:r}),!!o&&(0,a.jsx)(t.View,{style:c.row,children:(0,a.jsx)(i.default,{style:[c.itemText,{color:d.labelSecondary}],testID:l+`-unit`,children:` `+o})})]})]}),s&&(0,a.jsx)(t.View,{style:[c.divider,{backgroundColor:d.divider}],testID:l+`-divider`})]})}e.default=s;var c=e.styles=t.StyleSheet.create({itemContainer:{flex:1,flexDirection:`row`,alignItems:`center`,justifyContent:`space-between`,paddingVertical:12,gap:8},itemTitleContainer:{alignSelf:`flex-start`},icon:{marginRight:8,alignSelf:`center`},title:{...r.FONTS.Poppins.regular_Base},itemText:{...r.FONTS.Poppins.regular_Base,textAlign:`right`},divider:{height:1},row:{flexDirection:`row`,flexShrink:1,justifyContent:`flex-end`}})})),chn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.styles=e.default=void 0;var t=g(p()),n=(V(),d(tm)),r=h(ihn()),i=h(ahn()),a=h(ohn()),o=k7(),s=j7(),c=O7(),l=M7(),u=h(N7()),f=h(shn()),m=LJ();function h(e){return e&&e.__esModule?e:{default:e}}function g(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(g=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}function _({carbIntakeValue:e,activeInsulin:c,glucoseReading:d,bloodGlucoseUnit:p,activity:h,trackExpandDetails:g}){let{t:_}=(0,s.useLanguage)(),y=(0,o.useSemanticColors)(),[b,x]=(0,t.useState)(!1),S=(0,t.useMemo)(()=>({light:_(`activity_intensity_1`),moderate:_(`activity_intensity_2`),hard:_(`activity_intensity_3`)}),[_]),C=(0,t.useCallback)(()=>{n.Platform.OS===`ios`&&n.LayoutAnimation.configureNext(n.LayoutAnimation.Presets.easeInEaseOut),x(e=>{let t=!e;return t&&g(),t})},[g]),w=(0,t.useMemo)(()=>{if(!h)return``;let{activityDuration:e,activityIntensity:t,activityReduction:n}=h,r=n?Math.round(n*100):0,i=t?`${S[t]},`:``,a=`${r}% ${_(`recommendation_reduction`)}`;return`${(e=>e<=29?`0-29 min`:e<=45?`30-45 min`:e<=60?`46-60 min`:`61-120 min`)(e)}. ${i} \n ${a}`},[S,h,_]),T=(0,t.useMemo)(()=>[{title:_(`recommendation_summary_active_insulin_title`),value:c,unit:_(c===1?`unit`:`units`),testID:`active-insulin-item`},{title:_(`Glucose`),value:(0,l.convertAndFormatBGL)(d.value,d.unit,p),unit:(0,l.formatUnit)(p),testID:`blood-glucose-item`,icon:d.source===`forecast`?(0,m.jsx)(a.default,{}):void 0},{title:_(`recommendation_carbohydrates_title`),value:e||`-`,unit:e?_(e===1?`gram`:`grams`):void 0,testID:`carbs-item`},h!==void 0&&{title:_(`recommendation_activity_title`),value:w,testID:`activity-item`}].filter(e=>e),[_,c,d,p,e,h,w]);return(0,m.jsxs)(n.View,{style:v.container,children:[(0,m.jsxs)(n.TouchableOpacity,{style:v.clickableContainer,onPress:C,hitSlop:10,children:[(0,m.jsx)(u.default,{style:[v.title,{color:y.labelSecondary}],children:_(`recommendation_card_cal_details_title`)}),(0,m.jsx)(n.View,{style:v.expandButton,testID:`chevron-`+b,children:b?(0,m.jsx)(i.default,{style:v.chevron}):(0,m.jsx)(r.default,{style:v.chevron})})]}),b&&(0,m.jsx)(n.View,{children:T.map(({title:e,unit:t,value:n,testID:r,icon:i},a,o)=>(0,m.jsx)(f.default,{icon:i,testID:r,title:e,value:n,unit:t,hasSeparator:a!==o.length-1},e))})]})}e.default=_;var v=e.styles=n.StyleSheet.create({container:{padding:16,gap:16},clickableContainer:{flexDirection:`row`,justifyContent:`center`,alignItems:`center`},expandButton:{justifyContent:`center`,alignItems:`center`},chevron:{alignSelf:`center`,marginLeft:4},title:{...c.FONTS.Poppins.medium_SM,textAlign:`center`}})})),lhn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,s(p());var t=(V(),d(tm)),n=k7(),r=j7(),i=O7(),a=s(N7()),o=LJ();function s(e){return e&&e.__esModule?e:{default:e}}function c({prefixTestID:e,onSave:i,onDelete:s,onLayout:c}){let{t:u}=(0,r.useLanguage)(),d=(0,n.useSemanticColors)();return(0,o.jsxs)(t.View,{style:[l.container,{backgroundColor:d.bgNavigationBar,borderTopColor:d.divider}],onLayout:c,testID:e+`-footer`,children:[(0,o.jsx)(t.TouchableOpacity,{style:[l.saveButton,{backgroundColor:d.bgButtonPrimary,borderColor:d.divider}],onPress:i,testID:e+`-footer-save-button`,children:(0,o.jsx)(a.default,{style:[l.saveText,{color:d.textButtonPrimary}],children:u(`button_save`)})}),(0,o.jsx)(t.TouchableOpacity,{style:[l.deleteButton,{backgroundColor:d.bgButtonSecondaryDanger,borderColor:d.buttonBorder}],onPress:s,testID:e+`-footer-delete-button`,children:(0,o.jsx)(a.default,{style:[l.deleteText,{color:d.textButtonSecondaryDanger}],children:u(`button_delete`)})})]})}var l=t.StyleSheet.create({container:{justifyContent:`flex-end`,gap:16,padding:16,borderTopWidth:1},saveButton:{paddingHorizontal:16,paddingVertical:12,borderRadius:16,borderWidth:1},deleteButton:{paddingHorizontal:16,paddingVertical:12,borderRadius:16,borderWidth:2},saveText:{...i.FONTS.Poppins.semiBold_Base,textAlign:`center`},deleteText:{...i.FONTS.Poppins.semiBold_Base,textAlign:`center`}});e.default=c})),uhn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,c(p());var t=(V(),d(tm)),n=c(R4()),r=k7(),i=j7(),a=O7(),o=c(N7()),s=LJ();function c(e){return e&&e.__esModule?e:{default:e}}function l({isEdited:e}){let{t:a}=(0,i.useLanguage)(),c=(0,r.useSemanticColors)(),{width:l}=(0,t.useWindowDimensions)();return e?(0,s.jsx)(n.default,{colors:[c.bgGradientBottom,c.bgGradientTop],style:[u.gradientContainer],testID:`edited-recommendation-header`,children:(0,s.jsxs)(t.View,{style:u.containerChanges,children:[(0,s.jsx)(o.default,{style:[u.text,{color:c.textCarbRecommendation}],children:a(`recommendation_change_title`).toUpperCase()}),(0,s.jsx)(o.default,{style:[u.text,u.textCrossed,{color:c.textCarbRecommendation}],children:a(`recommendation_card_title`).toUpperCase()})]})}):(0,s.jsx)(n.default,{colors:[c.bgGradientBottom,c.bgGradientTop],style:[u.gradientContainer,{width:l-32}],testID:`initial-recommendation-header`,children:(0,s.jsx)(t.View,{style:u.container,children:(0,s.jsx)(o.default,{style:[u.text,{color:c.textCarbRecommendation}],children:a(`recommendation_card_title`).toUpperCase()})})})}var u=t.StyleSheet.create({gradientContainer:{borderTopLeftRadius:16,borderTopRightRadius:16},container:{flex:1,paddingVertical:20},containerChanges:{flex:1,paddingVertical:8},text:{...a.FONTS.Poppins.medium_Base,textAlign:`center`},textCrossed:{textDecorationLine:`line-through`,opacity:.5}});e.default=l})),dhn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=_(p()),n=(V(),d(tm)),r=Nan(),i=E2(),a=g(Jmn()),o=A7(),s=k7(),c=j7(),l=O7(),u=M7(),f=g(N7()),m=g(thn()),h=LJ();function g(e){return e&&e.__esModule?e:{default:e}}function _(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(_=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}function v({initialValue:e,editedValue:l,wasLimited:d,injectionMethod:p,onDismiss:g,onConfirm:_}){let{t:v}=(0,c.useLanguage)(),b=(0,s.useSemanticColors)(),[x,S]=(0,t.useState)(!1),C=(0,t.useCallback)(()=>{S(!0)},[]),w=(0,t.useCallback)(()=>{S(!1)},[]),T=(0,t.useCallback)(e=>{S(!1),_(e)},[_]),E=(0,t.useMemo)(()=>{let{min:t,max:n}=o.INSULIN_DOSE_LIMITS,r=d?e:n;return p===i.InjectionMethod.Pump?(0,u.createSequentialArrayDecimal)(t,r):p===i.InjectionMethod.PenWhole?(0,u.createSequentialArrayInteger)(t,r):(0,u.createSequentialArrayHalf)(t,r)},[p,e,d]),D=(0,t.useMemo)(()=>p===i.InjectionMethod.PenWhole?0:1,[p]),O=(0,t.useCallback)(()=>{if(l!==null)return E.findIndex(e=>e===l.toFixed(D));let t=(0,r.roundInsulinValue)(e,p);return E.findIndex(e=>e===t.toFixed(D))},[l,e,E,p,D]);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(n.View,{style:[y.container,{backgroundColor:b.bgSecondary}],children:[(0,h.jsx)(f.default,{style:[y.title,{color:b.labelSecondary}],testID:`insulin-display-title`,children:v(`recommendation_rapid_title`)}),(0,h.jsxs)(n.TouchableOpacity,{style:y.row,testID:`insulin-current-value-container`,onPress:C,children:[(0,h.jsx)(f.default,{style:[y.value,{color:b.labelPrimary}],testID:`insulin-value`,children:`${l??e} `}),(0,h.jsx)(n.TouchableOpacity,{onPress:C,testID:`insulin-edit-button`,hitSlop:10,children:(0,h.jsx)(a.default,{})})]}),l===null?(0,h.jsx)(f.default,{style:[y.unit,{color:b.labelSecondary}],testID:`insulin-current-unit`,children:v(e===1?`unit`:`units`)}):(0,h.jsxs)(f.default,{style:[y.crossedOut,{color:b.labelSecondary}],testID:`insulin-initial-value`,children:[`${e} `,(0,h.jsx)(f.default,{style:[y.unit,{color:b.labelSecondary}],testID:`insulin-initial-unit`,children:v(e===1?`unit`:`units`)})]})]}),(0,h.jsx)(m.default,{type:`insulin`,items:E,isVisible:x,initialScrollIndex:O(),onConfirm:T,onCancel:w,onDismiss:g})]})}var y=n.StyleSheet.create({container:{paddingVertical:32,justifyContent:`center`,alignItems:`center`},title:{...l.FONTS.Poppins.regular_Base,marginBottom:8},row:{flexDirection:`row`,alignItems:`center`,alignContent:`center`},value:{...l.FONTS.Poppins.bold_6XL,lineHeight:n.Platform.select({ios:0,default:l.FONTS.Poppins.bold_6XL.lineHeight}),textAlign:`center`},crossedOut:{...l.FONTS.Poppins.medium_2XL,textDecorationLine:`line-through`},unit:{...l.FONTS.Poppins.medium_2XL}});e.default=v})),F7=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.styles=void 0;var t=(V(),d(tm)),n=O7();e.styles=t.StyleSheet.create({containerStyle:{opacity:.5},handleIndicatorStyle:{display:`none`},title:{...n.FONTS.Poppins.semiBold_2XL,marginBottom:4},message:{marginBottom:32},buttonContainer:{gap:16},button:{paddingHorizontal:16,paddingVertical:12,borderRadius:16},buttonText:{...n.FONTS.Poppins.semiBold_Base,textAlign:`center`},secondaryButton:{paddingHorizontal:16,paddingVertical:12,borderRadius:16,borderWidth:2},secondaryButtonText:{...n.FONTS.Poppins.semiBold_Base,textAlign:`center`}})})),fhn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,c(p());var t=(V(),d(tm)),n=k7(),r=j7(),i=c(N7()),a=c(P7()),o=F7(),s=LJ();function c(e){return e&&e.__esModule?e:{default:e}}e.default=e=>{let{isVisible:c,onPressClose:l}=e,{t:u}=(0,r.useLanguage)(),d=(0,n.useSemanticColors)();return(0,s.jsx)(a.default,{isVisible:c,children:(0,s.jsxs)(t.View,{testID:`delete-failure-modal-visible-`+c,children:[(0,s.jsx)(i.default,{style:[o.styles.title,{color:d.labelPrimary}],testID:`delete-modal-failure-title`,children:u(`new_activity_modal_no_delete_title`)}),(0,s.jsx)(i.default,{style:[o.styles.message,{color:d.labelSecondary}],testID:`delete-modal-failure-message`,children:u(`new_activity_modal_no_delete_body`)}),(0,s.jsx)(t.TouchableOpacity,{style:[o.styles.button,{backgroundColor:d.bgButtonPrimary}],onPress:l,testID:`delete-modal-failure-close-button`,children:(0,s.jsx)(i.default,{style:[o.styles.buttonText,{color:d.textButtonPrimary}],children:u(`button_close`)})})]})})}})),phn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,c(p());var t=(V(),d(tm)),n=k7(),r=j7(),i=c(N7()),a=c(P7()),o=F7(),s=LJ();function c(e){return e&&e.__esModule?e:{default:e}}e.default=e=>{let{isVisible:c,onPressDelete:l,onPressCancel:u,onDismiss:d}=e,{t:f}=(0,r.useLanguage)(),p=(0,n.useSemanticColors)();return(0,s.jsx)(a.default,{onModalHide:d,isVisible:c,children:(0,s.jsxs)(t.View,{testID:`delete-modal-visible-`+c,children:[(0,s.jsx)(i.default,{style:[o.styles.title,{color:p.labelPrimary}],testID:`delete-modal-title`,children:f(`recommendation_modal_delete_rec_title`)}),(0,s.jsx)(i.default,{style:[o.styles.message,{color:p.labelSecondary}],testID:`delete-modal-message`,children:f(`recommendation_modal_delete_rec_body`)}),(0,s.jsxs)(t.View,{style:o.styles.buttonContainer,children:[(0,s.jsx)(t.TouchableOpacity,{style:[o.styles.button,{backgroundColor:p.bgButtonPrimaryDanger}],onPress:l,testID:`delete-modal-delete-button`,children:(0,s.jsx)(i.default,{style:[o.styles.buttonText,{color:p.textButtonPrimary}],children:f(`recommendation_modal_delete_rec_button_danger_delete`)})}),(0,s.jsx)(t.TouchableOpacity,{style:[o.styles.secondaryButton,{backgroundColor:p.bgButtonSecondary,borderColor:p.buttonBorder}],onPress:u,testID:`delete-modal-cancel-button`,children:(0,s.jsx)(i.default,{style:[o.styles.secondaryButtonText,{color:p.textButtonSecondary}],children:f(`button_cancel`)})})]})]})})}})),mhn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,c(p());var t=(V(),d(tm)),n=k7(),r=j7(),i=c(N7()),a=c(P7()),o=F7(),s=LJ();function c(e){return e&&e.__esModule?e:{default:e}}e.default=e=>{let{isVisible:c,onPressClose:l}=e,{t:u}=(0,r.useLanguage)(),d=(0,n.useSemanticColors)();return(0,s.jsx)(a.default,{isVisible:c,children:(0,s.jsxs)(t.View,{testID:`edit-failure-modal-visible-`+c,children:[(0,s.jsx)(i.default,{style:[o.styles.title,{color:d.labelPrimary}],testID:`edit-modal-failure-title`,children:u(`glucose_modal_changes_title`)}),(0,s.jsx)(i.default,{style:[o.styles.message,{color:d.labelSecondary}],testID:`edit-modal-failure-message`,children:u(`glucose_modal_changes_body`)}),(0,s.jsx)(t.TouchableOpacity,{style:[o.styles.button,{backgroundColor:d.bgButtonPrimary}],onPress:l,testID:`edit-modal-failure-close-button`,children:(0,s.jsx)(i.default,{style:[o.styles.buttonText,{color:d.textButtonPrimary}],children:u(`glucose_modal_changes_button_confirm`)})})]})})}})),hhn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.getLimitedValue=m;var t=f(p()),n=(V(),d(tm)),r=E2(),i=k7(),a=j7(),o=u(N7()),s=u(P7()),c=F7(),l=LJ();function u(e){return e&&e.__esModule?e:{default:e}}function f(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(f=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}function m(e){return r.CONSTANTS.INSULIN_DOSE_MAX-r.CONSTANTS.INSULIN_DOSE_MAX*e}e.default=e=>{let{isVisible:u,activityReduction:d,onPress:f}=e,{t:p}=(0,a.useLanguage)(),h=(0,i.useSemanticColors)(),g=(0,t.useMemo)(()=>d===null?p(`recommendation_modal_safety_limitation_body`,{SAFETY_INSULIN_LIMIT:`${r.CONSTANTS.INSULIN_DOSE_MAX}`}):p(`recommendation_modal_safety_limitation2_body`,{0:`${m(d)}`,SAFETY_INSULIN_LIMIT:`${r.CONSTANTS.INSULIN_DOSE_MAX}`,1:`${(d*100).toFixed(0)}`,2:`${m(d)}`}),[d,p]);return(0,l.jsx)(s.default,{isVisible:u,children:(0,l.jsxs)(n.View,{testID:`limitation-modal-visible-`+u,children:[(0,l.jsx)(o.default,{style:[c.styles.title,{color:h.labelPrimary}],children:p(`recommendation_modal_safety_limitation_title`)}),(0,l.jsx)(o.default,{style:[c.styles.message,{color:h.labelSecondary}],testID:`limitation-modal-message`,children:g}),(0,l.jsx)(n.TouchableOpacity,{style:[c.styles.button,{backgroundColor:h.bgButtonPrimary}],onPress:f,testID:`limitation-modal-button`,children:(0,l.jsx)(o.default,{style:[c.styles.buttonText,{color:h.textButtonPrimary}],children:p(`button_understood`)})})]})})}})),ghn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,c(p());var t=(V(),d(tm)),n=k7(),r=j7(),i=c(N7()),a=c(P7()),o=F7(),s=LJ();function c(e){return e&&e.__esModule?e:{default:e}}e.default=e=>{let{isVisible:c,onPressClose:l}=e,{t:u}=(0,r.useLanguage)(),d=(0,n.useSemanticColors)();return(0,s.jsx)(a.default,{isVisible:c,children:(0,s.jsxs)(t.View,{testID:`save-failure-modal-visible-`+c,children:[(0,s.jsx)(i.default,{style:[o.styles.title,{color:d.labelPrimary}],testID:`save-modal-failure-title`,children:u(`no_save_modal_title`)}),(0,s.jsx)(i.default,{style:[o.styles.message,{color:d.labelSecondary}],testID:`save-modal-failure-message`,children:u(`no_save_modal_body`)}),(0,s.jsx)(t.TouchableOpacity,{style:[o.styles.button,{backgroundColor:d.bgButtonPrimary}],onPress:l,testID:`save-modal-failure-close-button`,children:(0,s.jsx)(i.default,{style:[o.styles.buttonText,{color:d.textButtonPrimary}],children:u(`button_close`)})})]})})}})),_hn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,c(p());var t=(V(),d(tm)),n=k7(),r=j7(),i=c(N7()),a=c(P7()),o=F7(),s=LJ();function c(e){return e&&e.__esModule?e:{default:e}}e.default=e=>{let{isVisible:c,onPressViewInLogbook:l,onPressCancel:u,onDismiss:d}=e,{t:f}=(0,r.useLanguage)(),p=(0,n.useSemanticColors)(),m=t.Platform.OS===`web`;return(0,s.jsx)(a.default,{checkmark:!0,onModalHide:d,isVisible:c,children:(0,s.jsxs)(t.View,{testID:`timeout-modal-visible-`+c,children:[(0,s.jsx)(i.default,{style:[o.styles.title,{color:p.labelPrimary}],testID:`timeout-modal-title`,children:f(`recommendation_modal_auto_saved_title`)}),(0,s.jsx)(i.default,{style:[o.styles.message,{color:p.labelSecondary}],testID:`timeout-modal-message`,children:f(`recommendation_modal_auto_saved_body`)}),(0,s.jsxs)(t.View,{style:o.styles.buttonContainer,children:[!m&&(0,s.jsx)(t.TouchableOpacity,{style:[o.styles.button,{backgroundColor:p.bgButtonPrimary}],onPress:l,testID:`timeout-modal-view-button`,children:(0,s.jsx)(i.default,{style:[o.styles.buttonText,{color:p.textButtonPrimary}],children:f(`recommendation_modal_auto_saved_button_confirm`)})}),(0,s.jsx)(t.TouchableOpacity,{style:[o.styles.secondaryButton,{backgroundColor:p.bgButtonSecondary,borderColor:p.buttonBorder}],onPress:u,testID:`timeout-modal-close-button`,children:(0,s.jsx)(i.default,{style:[o.styles.secondaryButtonText,{color:p.textButtonSecondary}],children:f(`button_close`)})})]})]})})}})),vhn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,i(p());var t=r((F4(),d(P4))),n=LJ();function r(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,i=new WeakMap;return(r=function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?r(o,t,a):o[t]=e[t]);return o})(e,t)}function i(e){return e&&e.__esModule?e:{default:e}}function a(e){return(0,n.jsxs)(t.default,{width:29,height:28,viewBox:`0 0 29 28`,fill:`none`,...e,children:[(0,n.jsx)(t.Path,{d:`M14.5 0.5C21.9558 0.5 28 6.54416 28 14C28 21.4558 21.9558 27.5 14.5 27.5C7.04416 27.5 1 21.4558 1 14C1 6.54416 7.04416 0.5 14.5 0.5Z`,fill:`#4A5DEB`}),(0,n.jsx)(t.Path,{d:`M14.5 0.5C21.9558 0.5 28 6.54416 28 14C28 21.4558 21.9558 27.5 14.5 27.5C7.04416 27.5 1 21.4558 1 14C1 6.54416 7.04416 0.5 14.5 0.5Z`,stroke:`#FFFFFF`}),(0,n.jsx)(t.Path,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M20.8158 11.1809C21.0614 11.4221 21.0614 11.8132 20.8158 12.0544L14.9448 17.8191C14.6991 18.0603 14.3009 18.0603 14.0552 17.8191L8.18424 12.0544C7.93859 11.8132 7.93859 11.4221 8.18424 11.1809C8.4299 10.9397 8.82812 10.9397 9.07378 11.1809L14.5 16.5089L19.9262 11.1809C20.1718 10.9397 20.5701 10.9397 20.8158 11.1809Z`,fill:`#FFFFFF`})]})}e.default=a})),yhn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=c(p()),n=(V(),d(tm)),r=s(R4()),i=s(vhn()),a=k7(),o=LJ();function s(e){return e&&e.__esModule?e:{default:e}}function c(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(c=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}function l({scrollToEnd:e,isVisibleArrow:s,isVisibleBlur:c}){let l=(0,a.useSemanticColors)(),d=(0,t.useRef)(new n.Animated.Value(155)).current,f=(0,t.useRef)(new n.Animated.Value(+!!c)).current;return(0,t.useEffect)(()=>{n.Animated.timing(f,{toValue:+!!c,duration:400,useNativeDriver:n.Platform.OS!==`web`}).start()},[c,f]),(0,t.useEffect)(()=>{s&&n.Animated.spring(d,{toValue:0,damping:10,stiffness:100,mass:1,useNativeDriver:n.Platform.OS!==`web`}).start()},[s,d]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.Pressable,{style:u.scrollToEndButton,testID:`scroll-hint-arrow`,children:s&&(0,o.jsx)(n.Animated.View,{style:{backgroundColor:l.bgButtonPrimary,borderRadius:24,transform:[{translateY:d}]},children:(0,o.jsx)(n.TouchableOpacity,{testID:`scroll-hint-arrow-button`,onPress:e,children:(0,o.jsx)(i.default,{})})})}),(0,o.jsx)(n.Animated.View,{style:[u.gradient,{opacity:f}],pointerEvents:`none`,testID:`scroll-hint-blur`,children:(0,o.jsx)(r.default,{colors:l.gradientQuickGuide,style:u.linearGradient})})]})}var u=n.StyleSheet.create({scrollToEndButton:{position:`absolute`,bottom:80,alignSelf:`center`},gradient:{position:`absolute`,left:0,right:0,bottom:0,height:145},linearGradient:{flex:1}});e.default=l})),I7=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getParsedType=e.ZodParsedType=e.objectUtil=e.util=void 0;var t;(function(e){e.assertEqual=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`&&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})(t||(e.util=t={}));var n;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(n||(e.objectUtil=n={})),e.ZodParsedType=t.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),e.getParsedType=t=>{switch(typeof t){case`undefined`:return e.ZodParsedType.undefined;case`string`:return e.ZodParsedType.string;case`number`:return Number.isNaN(t)?e.ZodParsedType.nan:e.ZodParsedType.number;case`boolean`:return e.ZodParsedType.boolean;case`function`:return e.ZodParsedType.function;case`bigint`:return e.ZodParsedType.bigint;case`symbol`:return e.ZodParsedType.symbol;case`object`:return Array.isArray(t)?e.ZodParsedType.array:t===null?e.ZodParsedType.null:t.then&&typeof t.then==`function`&&t.catch&&typeof t.catch==`function`?e.ZodParsedType.promise:typeof Map<`u`&&t instanceof Map?e.ZodParsedType.map:typeof Set<`u`&&t instanceof Set?e.ZodParsedType.set:typeof Date<`u`&&t instanceof Date?e.ZodParsedType.date:e.ZodParsedType.object;default:return e.ZodParsedType.unknown}}})),bhn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ZodError=e.quotelessJson=e.ZodIssueCode=void 0;var t=I7();e.ZodIssueCode=t.util.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`]),e.quotelessJson=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,`$1:`);var n=class e extends Error{get errors(){return this.issues}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}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,t.util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=e=>e.message){let t={},n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};e.ZodError=n,n.create=e=>new n(e)})),xhn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=bhn(),n=I7();e.default=(e,r)=>{let i;switch(e.code){case t.ZodIssueCode.invalid_type:i=e.received===n.ZodParsedType.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case t.ZodIssueCode.invalid_literal:i=`Invalid literal value, expected ${JSON.stringify(e.expected,n.util.jsonStringifyReplacer)}`;break;case t.ZodIssueCode.unrecognized_keys:i=`Unrecognized key(s) in object: ${n.util.joinValues(e.keys,`, `)}`;break;case t.ZodIssueCode.invalid_union:i=`Invalid input`;break;case t.ZodIssueCode.invalid_union_discriminator:i=`Invalid discriminator value. Expected ${n.util.joinValues(e.options)}`;break;case t.ZodIssueCode.invalid_enum_value:i=`Invalid enum value. Expected ${n.util.joinValues(e.options)}, received '${e.received}'`;break;case t.ZodIssueCode.invalid_arguments:i=`Invalid function arguments`;break;case t.ZodIssueCode.invalid_return_type:i=`Invalid function return type`;break;case t.ZodIssueCode.invalid_date:i=`Invalid date`;break;case t.ZodIssueCode.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(i=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(i=`${i} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?i=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?i=`Invalid input: must end with "${e.validation.endsWith}"`:n.util.assertNever(e.validation):i=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case t.ZodIssueCode.too_small:i=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`||e.type===`bigint`?`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 t.ZodIssueCode.too_big:i=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 t.ZodIssueCode.custom:i=`Invalid input`;break;case t.ZodIssueCode.invalid_intersection_types:i=`Intersection results could not be merged`;break;case t.ZodIssueCode.not_multiple_of:i=`Number must be a multiple of ${e.multipleOf}`;break;case t.ZodIssueCode.not_finite:i=`Number must be finite`;break;default:i=r.defaultError,n.util.assertNever(e)}return{message:i}}})),Shn=s((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.defaultErrorMap=void 0,e.setErrorMap=i,e.getErrorMap=a;var n=t(xhn());e.defaultErrorMap=n.default;var r=n.default;function i(e){r=e}function a(){return r}})),Chn=s((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.isAsync=e.isValid=e.isDirty=e.isAborted=e.OK=e.DIRTY=e.INVALID=e.ParseStatus=e.EMPTY_PATH=e.makeIssue=void 0,e.addIssueToContext=i;var n=Shn(),r=t(xhn());e.makeIssue=e=>{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}},e.EMPTY_PATH=[];function i(t,i){let a=(0,n.getErrorMap)(),o=(0,e.makeIssue)({issueData:i,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,a,a===r.default?void 0:r.default].filter(e=>!!e)});t.common.issues.push(o)}e.ParseStatus=class t{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(t,n){let r=[];for(let i of n){if(i.status===`aborted`)return e.INVALID;i.status===`dirty`&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(e,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return t.mergeObjectSync(e,r)}static mergeObjectSync(t,n){let r={};for(let i of n){let{key:n,value:a}=i;if(n.status===`aborted`||a.status===`aborted`)return e.INVALID;n.status===`dirty`&&t.dirty(),a.status===`dirty`&&t.dirty(),n.value!==`__proto__`&&(a.value!==void 0||i.alwaysSet)&&(r[n.value]=a.value)}return{status:t.value,value:r}}},e.INVALID=Object.freeze({status:`aborted`}),e.DIRTY=e=>({status:`dirty`,value:e}),e.OK=e=>({status:`valid`,value:e}),e.isAborted=e=>e.status===`aborted`,e.isDirty=e=>e.status===`dirty`,e.isValid=e=>e.status===`valid`,e.isAsync=e=>typeof Promise<`u`&&e instanceof Promise})),whn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),Thn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.errorUtil=void 0;var t;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(t||(e.errorUtil=t={}))})),Ehn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.discriminatedUnion=e.date=e.boolean=e.bigint=e.array=e.any=e.coerce=e.ZodFirstPartyTypeKind=e.late=e.ZodSchema=e.Schema=e.ZodReadonly=e.ZodPipeline=e.ZodBranded=e.BRAND=e.ZodNaN=e.ZodCatch=e.ZodDefault=e.ZodNullable=e.ZodOptional=e.ZodTransformer=e.ZodEffects=e.ZodPromise=e.ZodNativeEnum=e.ZodEnum=e.ZodLiteral=e.ZodLazy=e.ZodFunction=e.ZodSet=e.ZodMap=e.ZodRecord=e.ZodTuple=e.ZodIntersection=e.ZodDiscriminatedUnion=e.ZodUnion=e.ZodObject=e.ZodArray=e.ZodVoid=e.ZodNever=e.ZodUnknown=e.ZodAny=e.ZodNull=e.ZodUndefined=e.ZodSymbol=e.ZodDate=e.ZodBoolean=e.ZodBigInt=e.ZodNumber=e.ZodString=e.ZodType=void 0,e.NEVER=e.void=e.unknown=e.union=e.undefined=e.tuple=e.transformer=e.symbol=e.string=e.strictObject=e.set=e.record=e.promise=e.preprocess=e.pipeline=e.ostring=e.optional=e.onumber=e.oboolean=e.object=e.number=e.nullable=e.null=e.never=e.nativeEnum=e.nan=e.map=e.literal=e.lazy=e.intersection=e.instanceof=e.function=e.enum=e.effect=void 0,e.datetimeRegex=A,e.custom=Re;var t=bhn(),n=Shn(),r=Thn(),i=Chn(),a=I7(),o=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||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},s=(e,n)=>{if((0,i.isValid)(n))return{success:!0,data:n.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 n=new t.ZodError(e.common.issues);return this._error=n,this._error}}};function c(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 l=class{get description(){return this._def.description}_getType(e){return(0,a.getParsedType)(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:(0,a.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new i.ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:(0,a.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if((0,i.isAsync)(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:(0,a.getParsedType)(e)};return s(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,a.getParsedType)(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return(0,i.isValid)(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>(0,i.isValid)(e)?{value:e.value}:{issues:t.common.issues})}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:(0,a.getParsedType)(e)},r=this._parse({data:e,path:n.path,parent:n});return s(n,await((0,i.isAsync)(r)?r:Promise.resolve(r)))}refine(e,n){let r=e=>typeof n==`string`||n===void 0?{message:n}:typeof n==`function`?n(e):n;return this._refinement((n,i)=>{let a=e(n),o=()=>i.addIssue({code:t.ZodIssueCode.custom,...r(n)});return typeof Promise<`u`&&a instanceof Promise?a.then(e=>e?!0:(o(),!1)):a?!0:(o(),!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 Oe({schema:this,typeName:ze.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:e=>this[`~validate`](e)}}optional(){return ke.create(this,this._def)}nullable(){return Ae.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return fe.create(this)}promise(){return De.create(this,this._def)}or(e){return he.create([this,e],this._def)}and(e){return I.create(this,e,this._def)}transform(e){return new Oe({...c(this._def),schema:this,typeName:ze.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new je({...c(this._def),innerType:this,defaultValue:t,typeName:ze.ZodDefault})}brand(){return new Pe({typeName:ze.ZodBranded,type:this,...c(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new Me({...c(this._def),innerType:this,catchValue:t,typeName:ze.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Fe.create(this,e)}readonly(){return Ie.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};e.ZodType=l,e.Schema=l,e.ZodSchema=l;var u=/^c[^\s-]{8,}$/i,d=/^[0-9a-z]+$/,f=/^[0-9A-HJKMNP-TV-Z]{26}$/i,p=/^[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,m=/^[a-z0-9_-]{21}$/i,h=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,g=/^[-+]?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)?)??$/,_=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,v=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,y,b=/^(?:(?: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])$/,x=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,S=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,C=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,w=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,T=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,E=`((\\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])))`,D=RegExp(`^${E}$`);function O(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function k(e){return RegExp(`^${O(e)}$`)}function A(e){let t=`${E}T${O(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function ee(e,t){return!!((t===`v4`||!t)&&b.test(e)||(t===`v6`||!t)&&S.test(e))}function te(e,t){if(!h.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function ne(e,t){return!!((t===`v4`||!t)&&x.test(e)||(t===`v6`||!t)&&C.test(e))}var re=class e extends l{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==a.ZodParsedType.string){let n=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.string,received:n.parsedType}),i.INVALID}let n=new i.ParseStatus,r;for(let o of this._def.checks)if(o.kind===`min`)e.data.length<o.value&&(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{code:t.ZodIssueCode.too_small,minimum:o.value,type:`string`,inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind===`max`)e.data.length>o.value&&(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{code:t.ZodIssueCode.too_big,maximum:o.value,type:`string`,inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind===`length`){let a=e.data.length>o.value,s=e.data.length<o.value;(a||s)&&(r=this._getOrReturnCtx(e,r),a?(0,i.addIssueToContext)(r,{code:t.ZodIssueCode.too_big,maximum:o.value,type:`string`,inclusive:!0,exact:!0,message:o.message}):s&&(0,i.addIssueToContext)(r,{code:t.ZodIssueCode.too_small,minimum:o.value,type:`string`,inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind===`email`)_.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{validation:`email`,code:t.ZodIssueCode.invalid_string,message:o.message}),n.dirty());else if(o.kind===`emoji`)y||=new RegExp(v,`u`),y.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{validation:`emoji`,code:t.ZodIssueCode.invalid_string,message:o.message}),n.dirty());else if(o.kind===`uuid`)p.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{validation:`uuid`,code:t.ZodIssueCode.invalid_string,message:o.message}),n.dirty());else if(o.kind===`nanoid`)m.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{validation:`nanoid`,code:t.ZodIssueCode.invalid_string,message:o.message}),n.dirty());else if(o.kind===`cuid`)u.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{validation:`cuid`,code:t.ZodIssueCode.invalid_string,message:o.message}),n.dirty());else if(o.kind===`cuid2`)d.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{validation:`cuid2`,code:t.ZodIssueCode.invalid_string,message:o.message}),n.dirty());else if(o.kind===`ulid`)f.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{validation:`ulid`,code:t.ZodIssueCode.invalid_string,message:o.message}),n.dirty());else if(o.kind===`url`)try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{validation:`url`,code:t.ZodIssueCode.invalid_string,message:o.message}),n.dirty()}else o.kind===`regex`?(o.regex.lastIndex=0,o.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{validation:`regex`,code:t.ZodIssueCode.invalid_string,message:o.message}),n.dirty())):o.kind===`trim`?e.data=e.data.trim():o.kind===`includes`?e.data.includes(o.value,o.position)||(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{code:t.ZodIssueCode.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind===`toLowerCase`?e.data=e.data.toLowerCase():o.kind===`toUpperCase`?e.data=e.data.toUpperCase():o.kind===`startsWith`?e.data.startsWith(o.value)||(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{code:t.ZodIssueCode.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind===`endsWith`?e.data.endsWith(o.value)||(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{code:t.ZodIssueCode.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind===`datetime`?A(o).test(e.data)||(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{code:t.ZodIssueCode.invalid_string,validation:`datetime`,message:o.message}),n.dirty()):o.kind===`date`?D.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{code:t.ZodIssueCode.invalid_string,validation:`date`,message:o.message}),n.dirty()):o.kind===`time`?k(o).test(e.data)||(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{code:t.ZodIssueCode.invalid_string,validation:`time`,message:o.message}),n.dirty()):o.kind===`duration`?g.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{validation:`duration`,code:t.ZodIssueCode.invalid_string,message:o.message}),n.dirty()):o.kind===`ip`?ee(e.data,o.version)||(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{validation:`ip`,code:t.ZodIssueCode.invalid_string,message:o.message}),n.dirty()):o.kind===`jwt`?te(e.data,o.alg)||(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{validation:`jwt`,code:t.ZodIssueCode.invalid_string,message:o.message}),n.dirty()):o.kind===`cidr`?ne(e.data,o.version)||(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{validation:`cidr`,code:t.ZodIssueCode.invalid_string,message:o.message}),n.dirty()):o.kind===`base64`?w.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{validation:`base64`,code:t.ZodIssueCode.invalid_string,message:o.message}),n.dirty()):o.kind===`base64url`?T.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{validation:`base64url`,code:t.ZodIssueCode.invalid_string,message:o.message}),n.dirty()):a.util.assertNever(o);return{status:n.value,value:e.data}}_regex(e,n,i){return this.refinement(t=>e.test(t),{validation:n,code:t.ZodIssueCode.invalid_string,...r.errorUtil.errToObj(i)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...r.errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...r.errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...r.errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...r.errorUtil.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...r.errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...r.errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...r.errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...r.errorUtil.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...r.errorUtil.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...r.errorUtil.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...r.errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...r.errorUtil.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...r.errorUtil.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,...r.errorUtil.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,...r.errorUtil.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...r.errorUtil.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...r.errorUtil.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...r.errorUtil.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...r.errorUtil.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...r.errorUtil.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...r.errorUtil.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...r.errorUtil.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...r.errorUtil.errToObj(t)})}nonempty(e){return this.min(1,r.errorUtil.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`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let 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}};e.ZodString=re,re.create=e=>new re({checks:[],typeName:ze.ZodString,coerce:e?.coerce??!1,...c(e)});function ie(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var j=class e extends l{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)!==a.ZodParsedType.number){let n=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.number,received:n.parsedType}),i.INVALID}let n,r=new i.ParseStatus;for(let o of this._def.checks)o.kind===`int`?a.util.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.invalid_type,expected:`integer`,received:`float`,message:o.message}),r.dirty()):o.kind===`min`?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.too_small,minimum:o.value,type:`number`,inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind===`max`?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.too_big,maximum:o.value,type:`number`,inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind===`multipleOf`?ie(e.data,o.value)!==0&&(n=this._getOrReturnCtx(e,n),(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):o.kind===`finite`?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.not_finite,message:o.message}),r.dirty()):a.util.assertNever(o);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,r.errorUtil.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,r.errorUtil.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,r.errorUtil.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,r.errorUtil.toString(t))}setLimit(t,n,i,a){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:r.errorUtil.toString(a)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:r.errorUtil.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:r.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:r.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:r.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:r.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:r.errorUtil.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:r.errorUtil.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:r.errorUtil.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:r.errorUtil.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`&&a.util.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)}};e.ZodNumber=j,j.create=e=>new j({checks:[],typeName:ze.ZodNumber,coerce:e?.coerce||!1,...c(e)});var ae=class e extends l{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==a.ZodParsedType.bigint)return this._getInvalidInput(e);let n,r=new i.ParseStatus;for(let o of this._def.checks)o.kind===`min`?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.too_small,type:`bigint`,minimum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind===`max`?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.too_big,type:`bigint`,maximum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind===`multipleOf`?e.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):a.util.assertNever(o);return{status:r.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.bigint,received:n.parsedType}),i.INVALID}gte(e,t){return this.setLimit(`min`,e,!0,r.errorUtil.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,r.errorUtil.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,r.errorUtil.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,r.errorUtil.toString(t))}setLimit(t,n,i,a){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:r.errorUtil.toString(a)}]})}_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:r.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:r.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:r.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:r.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:r.errorUtil.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}};e.ZodBigInt=ae,ae.create=e=>new ae({checks:[],typeName:ze.ZodBigInt,coerce:e?.coerce??!1,...c(e)});var oe=class extends l{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==a.ZodParsedType.boolean){let n=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.boolean,received:n.parsedType}),i.INVALID}return(0,i.OK)(e.data)}};e.ZodBoolean=oe,oe.create=e=>new oe({typeName:ze.ZodBoolean,coerce:e?.coerce||!1,...c(e)});var se=class e extends l{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==a.ZodParsedType.date){let n=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.date,received:n.parsedType}),i.INVALID}if(Number.isNaN(e.data.getTime())){let n=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.invalid_date}),i.INVALID}let n=new i.ParseStatus,r;for(let o of this._def.checks)o.kind===`min`?e.data.getTime()<o.value&&(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{code:t.ZodIssueCode.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:`date`}),n.dirty()):o.kind===`max`?e.data.getTime()>o.value&&(r=this._getOrReturnCtx(e,r),(0,i.addIssueToContext)(r,{code:t.ZodIssueCode.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:`date`}),n.dirty()):a.util.assertNever(o);return{status:n.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:r.errorUtil.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:r.errorUtil.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)}};e.ZodDate=se,se.create=e=>new se({checks:[],coerce:e?.coerce||!1,typeName:ze.ZodDate,...c(e)});var M=class extends l{_parse(e){if(this._getType(e)!==a.ZodParsedType.symbol){let n=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.symbol,received:n.parsedType}),i.INVALID}return(0,i.OK)(e.data)}};e.ZodSymbol=M,M.create=e=>new M({typeName:ze.ZodSymbol,...c(e)});var ce=class extends l{_parse(e){if(this._getType(e)!==a.ZodParsedType.undefined){let n=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.undefined,received:n.parsedType}),i.INVALID}return(0,i.OK)(e.data)}};e.ZodUndefined=ce,ce.create=e=>new ce({typeName:ze.ZodUndefined,...c(e)});var N=class extends l{_parse(e){if(this._getType(e)!==a.ZodParsedType.null){let n=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.null,received:n.parsedType}),i.INVALID}return(0,i.OK)(e.data)}};e.ZodNull=N,N.create=e=>new N({typeName:ze.ZodNull,...c(e)});var P=class extends l{constructor(){super(...arguments),this._any=!0}_parse(e){return(0,i.OK)(e.data)}};e.ZodAny=P,P.create=e=>new P({typeName:ze.ZodAny,...c(e)});var le=class extends l{constructor(){super(...arguments),this._unknown=!0}_parse(e){return(0,i.OK)(e.data)}};e.ZodUnknown=le,le.create=e=>new le({typeName:ze.ZodUnknown,...c(e)});var ue=class extends l{_parse(e){let n=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.never,received:n.parsedType}),i.INVALID}};e.ZodNever=ue,ue.create=e=>new ue({typeName:ze.ZodNever,...c(e)});var de=class extends l{_parse(e){if(this._getType(e)!==a.ZodParsedType.undefined){let n=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.void,received:n.parsedType}),i.INVALID}return(0,i.OK)(e.data)}};e.ZodVoid=de,de.create=e=>new de({typeName:ze.ZodVoid,...c(e)});var fe=class e extends l{_parse(e){let{ctx:n,status:r}=this._processInputParams(e),s=this._def;if(n.parsedType!==a.ZodParsedType.array)return(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.array,received:n.parsedType}),i.INVALID;if(s.exactLength!==null){let e=n.data.length>s.exactLength.value,a=n.data.length<s.exactLength.value;(e||a)&&((0,i.addIssueToContext)(n,{code:e?t.ZodIssueCode.too_big:t.ZodIssueCode.too_small,minimum:a?s.exactLength.value:void 0,maximum:e?s.exactLength.value:void 0,type:`array`,inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&((0,i.addIssueToContext)(n,{code:t.ZodIssueCode.too_small,minimum:s.minLength.value,type:`array`,inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&((0,i.addIssueToContext)(n,{code:t.ZodIssueCode.too_big,maximum:s.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((e,t)=>s.type._parseAsync(new o(n,e,n.path,t)))).then(e=>i.ParseStatus.mergeArray(r,e));let c=[...n.data].map((e,t)=>s.type._parseSync(new o(n,e,n.path,t)));return i.ParseStatus.mergeArray(r,c)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:r.errorUtil.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:r.errorUtil.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:r.errorUtil.toString(n)}})}nonempty(e){return this.min(1,e)}};e.ZodArray=fe,fe.create=(e,t)=>new fe({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ze.ZodArray,...c(t)});function pe(e){if(e instanceof me){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=ke.create(pe(r))}return new me({...e._def,shape:()=>t})}else if(e instanceof fe)return new fe({...e._def,type:pe(e.element)});else if(e instanceof ke)return ke.create(pe(e.unwrap()));else if(e instanceof Ae)return Ae.create(pe(e.unwrap()));else if(e instanceof ve)return ve.create(e.items.map(e=>pe(e)));else return e}var me=class e extends l{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=a.util.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==a.ZodParsedType.object){let n=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.object,received:n.parsedType}),i.INVALID}let{status:n,ctx:r}=this._processInputParams(e),{shape:s,keys:c}=this._getCached(),l=[];if(!(this._def.catchall instanceof ue&&this._def.unknownKeys===`strip`))for(let e in r.data)c.includes(e)||l.push(e);let u=[];for(let e of c){let t=s[e],n=r.data[e];u.push({key:{status:`valid`,value:e},value:t._parse(new o(r,n,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof ue){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of l)u.push({key:{status:`valid`,value:e},value:{status:`valid`,value:r.data[e]}});else if(e===`strict`)l.length>0&&((0,i.addIssueToContext)(r,{code:t.ZodIssueCode.unrecognized_keys,keys:l}),n.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of l){let n=r.data[t];u.push({key:{status:`valid`,value:t},value:e._parse(new o(r,n,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of u){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>i.ParseStatus.mergeObjectSync(n,e)):i.ParseStatus.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(t){return r.errorUtil.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let i=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:r.errorUtil.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:ze.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of a.util.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of a.util.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return pe(this)}partial(t){let n={};for(let e of a.util.objectKeys(this.shape)){let r=this.shape[e];t&&!t[e]?n[e]=r:n[e]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of a.util.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof ke;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return we(a.util.objectKeys(this.shape))}};e.ZodObject=me,me.create=(e,t)=>new me({shape:()=>e,unknownKeys:`strip`,catchall:ue.create(),typeName:ze.ZodObject,...c(t)}),me.strictCreate=(e,t)=>new me({shape:()=>e,unknownKeys:`strict`,catchall:ue.create(),typeName:ze.ZodObject,...c(t)}),me.lazycreate=(e,t)=>new me({shape:e,unknownKeys:`strip`,catchall:ue.create(),typeName:ze.ZodObject,...c(t)});var he=class extends l{_parse(e){let{ctx:n}=this._processInputParams(e),r=this._def.options;function a(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let t of e)if(t.result.status===`dirty`)return n.common.issues.push(...t.ctx.common.issues),t.result;let r=e.map(e=>new t.ZodError(e.ctx.common.issues));return(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.invalid_union,unionErrors:r}),i.INVALID}if(n.common.async)return Promise.all(r.map(async e=>{let t={...n,common:{...n.common,issues:[]},parent:null};return{result:await e._parseAsync({data:n.data,path:n.path,parent:t}),ctx:t}})).then(a);{let e,a=[];for(let t of r){let r={...n,common:{...n.common,issues:[]},parent:null},i=t._parseSync({data:n.data,path:n.path,parent:r});if(i.status===`valid`)return i;i.status===`dirty`&&!e&&(e={result:i,ctx:r}),r.common.issues.length&&a.push(r.common.issues)}if(e)return n.common.issues.push(...e.ctx.common.issues),e.result;let o=a.map(e=>new t.ZodError(e));return(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.invalid_union,unionErrors:o}),i.INVALID}}get options(){return this._def.options}};e.ZodUnion=he,he.create=(e,t)=>new he({options:e,typeName:ze.ZodUnion,...c(t)});var ge=e=>e instanceof Se?ge(e.schema):e instanceof Oe?ge(e.innerType()):e instanceof Ce?[e.value]:e instanceof Te?e.options:e instanceof Ee?a.util.objectValues(e.enum):e instanceof je?ge(e._def.innerType):e instanceof ce?[void 0]:e instanceof N?[null]:e instanceof ke?[void 0,...ge(e.unwrap())]:e instanceof Ae?[null,...ge(e.unwrap())]:e instanceof Pe||e instanceof Ie?ge(e.unwrap()):e instanceof Me?ge(e._def.innerType):[],F=class e extends l{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==a.ZodParsedType.object)return(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.object,received:n.parsedType}),i.INVALID;let r=this.discriminator,o=n.data[r],s=this.optionsMap.get(o);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):((0,i.addIssueToContext)(n,{code:t.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),i.INVALID)}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=ge(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:ze.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...c(r)})}};e.ZodDiscriminatedUnion=F;function _e(e,t){let n=(0,a.getParsedType)(e),r=(0,a.getParsedType)(t);if(e===t)return{valid:!0,data:e};if(n===a.ZodParsedType.object&&r===a.ZodParsedType.object){let n=a.util.objectKeys(t),r=a.util.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=_e(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}else if(n===a.ZodParsedType.array&&r===a.ZodParsedType.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=_e(i,a);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}else if(n===a.ZodParsedType.date&&r===a.ZodParsedType.date&&+e==+t)return{valid:!0,data:e};else return{valid:!1}}var I=class extends l{_parse(e){let{status:n,ctx:r}=this._processInputParams(e),a=(e,a)=>{if((0,i.isAborted)(e)||(0,i.isAborted)(a))return i.INVALID;let o=_e(e.value,a.value);return o.valid?(((0,i.isDirty)(e)||(0,i.isDirty)(a))&&n.dirty(),{status:n.value,value:o.data}):((0,i.addIssueToContext)(r,{code:t.ZodIssueCode.invalid_intersection_types}),i.INVALID)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([e,t])=>a(e,t)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};e.ZodIntersection=I,I.create=(e,t,n)=>new I({left:e,right:t,typeName:ze.ZodIntersection,...c(n)});var ve=class e extends l{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==a.ZodParsedType.array)return(0,i.addIssueToContext)(r,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.array,received:r.parsedType}),i.INVALID;if(r.data.length<this._def.items.length)return(0,i.addIssueToContext)(r,{code:t.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),i.INVALID;!this._def.rest&&r.data.length>this._def.items.length&&((0,i.addIssueToContext)(r,{code:t.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),n.dirty());let s=[...r.data].map((e,t)=>{let n=this._def.items[t]||this._def.rest;return n?n._parse(new o(r,e,r.path,t)):null}).filter(e=>!!e);return r.common.async?Promise.all(s).then(e=>i.ParseStatus.mergeArray(n,e)):i.ParseStatus.mergeArray(n,s)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};e.ZodTuple=ve,ve.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new ve({items:e,typeName:ze.ZodTuple,rest:null,...c(t)})};var ye=class e extends l{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==a.ZodParsedType.object)return(0,i.addIssueToContext)(r,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.object,received:r.parsedType}),i.INVALID;let s=[],c=this._def.keyType,l=this._def.valueType;for(let e in r.data)s.push({key:c._parse(new o(r,e,r.path,e)),value:l._parse(new o(r,r.data[e],r.path,e)),alwaysSet:e in r.data});return r.common.async?i.ParseStatus.mergeObjectAsync(n,s):i.ParseStatus.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof l?new e({keyType:t,valueType:n,typeName:ze.ZodRecord,...c(r)}):new e({keyType:re.create(),valueType:t,typeName:ze.ZodRecord,...c(n)})}};e.ZodRecord=ye;var be=class extends l{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==a.ZodParsedType.map)return(0,i.addIssueToContext)(r,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.map,received:r.parsedType}),i.INVALID;let s=this._def.keyType,c=this._def.valueType,l=[...r.data.entries()].map(([e,t],n)=>({key:s._parse(new o(r,e,r.path,[n,`key`])),value:c._parse(new o(r,t,r.path,[n,`value`]))}));if(r.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let t of l){let r=await t.key,a=await t.value;if(r.status===`aborted`||a.status===`aborted`)return i.INVALID;(r.status===`dirty`||a.status===`dirty`)&&n.dirty(),e.set(r.value,a.value)}return{status:n.value,value:e}})}else{let e=new Map;for(let t of l){let r=t.key,a=t.value;if(r.status===`aborted`||a.status===`aborted`)return i.INVALID;(r.status===`dirty`||a.status===`dirty`)&&n.dirty(),e.set(r.value,a.value)}return{status:n.value,value:e}}}};e.ZodMap=be,be.create=(e,t,n)=>new be({valueType:t,keyType:e,typeName:ze.ZodMap,...c(n)});var xe=class e extends l{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==a.ZodParsedType.set)return(0,i.addIssueToContext)(r,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.set,received:r.parsedType}),i.INVALID;let s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&((0,i.addIssueToContext)(r,{code:t.ZodIssueCode.too_small,minimum:s.minSize.value,type:`set`,inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&((0,i.addIssueToContext)(r,{code:t.ZodIssueCode.too_big,maximum:s.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());let c=this._def.valueType;function l(e){let t=new Set;for(let r of e){if(r.status===`aborted`)return i.INVALID;r.status===`dirty`&&n.dirty(),t.add(r.value)}return{status:n.value,value:t}}let u=[...r.data.values()].map((e,t)=>c._parse(new o(r,e,r.path,t)));return r.common.async?Promise.all(u).then(e=>l(e)):l(u)}min(t,n){return new e({...this._def,minSize:{value:t,message:r.errorUtil.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:r.errorUtil.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};e.ZodSet=xe,xe.create=(e,t)=>new xe({valueType:e,minSize:null,maxSize:null,typeName:ze.ZodSet,...c(t)});var L=class e extends l{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==a.ZodParsedType.function)return(0,i.addIssueToContext)(r,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.function,received:r.parsedType}),i.INVALID;function o(e,a){return(0,i.makeIssue)({data:e,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,(0,n.getErrorMap)(),n.defaultErrorMap].filter(e=>!!e),issueData:{code:t.ZodIssueCode.invalid_arguments,argumentsError:a}})}function s(e,a){return(0,i.makeIssue)({data:e,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,(0,n.getErrorMap)(),n.defaultErrorMap].filter(e=>!!e),issueData:{code:t.ZodIssueCode.invalid_return_type,returnTypeError:a}})}let c={errorMap:r.common.contextualErrorMap},l=r.data;if(this._def.returns instanceof De){let e=this;return(0,i.OK)(async function(...n){let r=new t.ZodError([]),i=await e._def.args.parseAsync(n,c).catch(e=>{throw r.addIssue(o(n,e)),r}),a=await Reflect.apply(l,this,i);return await e._def.returns._def.type.parseAsync(a,c).catch(e=>{throw r.addIssue(s(a,e)),r})})}else{let e=this;return(0,i.OK)(function(...n){let r=e._def.args.safeParse(n,c);if(!r.success)throw new t.ZodError([o(n,r.error)]);let i=Reflect.apply(l,this,r.data),a=e._def.returns.safeParse(i,c);if(!a.success)throw new t.ZodError([s(i,a.error)]);return a.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:ve.create(t).rest(le.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||ve.create([]).rest(le.create()),returns:n||le.create(),typeName:ze.ZodFunction,...c(r)})}};e.ZodFunction=L;var Se=class extends l{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})}};e.ZodLazy=Se,Se.create=(e,t)=>new Se({getter:e,typeName:ze.ZodLazy,...c(t)});var Ce=class extends l{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(n,{received:n.data,code:t.ZodIssueCode.invalid_literal,expected:this._def.value}),i.INVALID}return{status:`valid`,value:e.data}}get value(){return this._def.value}};e.ZodLiteral=Ce,Ce.create=(e,t)=>new Ce({value:e,typeName:ze.ZodLiteral,...c(t)});function we(e,t){return new Te({values:e,typeName:ze.ZodEnum,...c(t)})}var Te=class e extends l{_parse(e){if(typeof e.data!=`string`){let n=this._getOrReturnCtx(e),r=this._def.values;return(0,i.addIssueToContext)(n,{expected:a.util.joinValues(r),received:n.parsedType,code:t.ZodIssueCode.invalid_type}),i.INVALID}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),r=this._def.values;return(0,i.addIssueToContext)(n,{received:n.data,code:t.ZodIssueCode.invalid_enum_value,options:r}),i.INVALID}return(0,i.OK)(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})}};e.ZodEnum=Te,Te.create=we;var Ee=class extends l{_parse(e){let n=a.util.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==a.ZodParsedType.string&&r.parsedType!==a.ZodParsedType.number){let e=a.util.objectValues(n);return(0,i.addIssueToContext)(r,{expected:a.util.joinValues(e),received:r.parsedType,code:t.ZodIssueCode.invalid_type}),i.INVALID}if(this._cache||=new Set(a.util.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=a.util.objectValues(n);return(0,i.addIssueToContext)(r,{received:r.data,code:t.ZodIssueCode.invalid_enum_value,options:e}),i.INVALID}return(0,i.OK)(e.data)}get enum(){return this._def.values}};e.ZodNativeEnum=Ee,Ee.create=(e,t)=>new Ee({values:e,typeName:ze.ZodNativeEnum,...c(t)});var De=class extends l{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==a.ZodParsedType.promise&&n.common.async===!1)return(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.promise,received:n.parsedType}),i.INVALID;let r=n.parsedType===a.ZodParsedType.promise?n.data:Promise.resolve(n.data);return(0,i.OK)(r.then(e=>this._def.type.parseAsync(e,{path:n.path,errorMap:n.common.contextualErrorMap})))}};e.ZodPromise=De,De.create=(e,t)=>new De({type:e,typeName:ze.ZodPromise,...c(t)});var Oe=class extends l{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ze.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,o={addIssue:e=>{(0,i.addIssueToContext)(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),r.type===`preprocess`){let e=r.transform(n.data,o);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return i.INVALID;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?i.INVALID:r.status===`dirty`||t.value===`dirty`?(0,i.DIRTY)(r.value):r});{if(t.value===`aborted`)return i.INVALID;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?i.INVALID:r.status===`dirty`||t.value===`dirty`?(0,i.DIRTY)(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,o);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`?i.INVALID:(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`?i.INVALID:(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(!(0,i.isValid)(e))return i.INVALID;let a=r.transform(e.value,o);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=>(0,i.isValid)(e)?Promise.resolve(r.transform(e.value,o)).then(e=>({status:t.value,value:e})):i.INVALID);a.util.assertNever(r)}};e.ZodEffects=Oe,e.ZodTransformer=Oe,Oe.create=(e,t,n)=>new Oe({schema:e,typeName:ze.ZodEffects,effect:t,...c(n)}),Oe.createWithPreprocess=(e,t,n)=>new Oe({schema:t,effect:{type:`preprocess`,transform:e},typeName:ze.ZodEffects,...c(n)});var ke=class extends l{_parse(e){return this._getType(e)===a.ZodParsedType.undefined?(0,i.OK)(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};e.ZodOptional=ke,ke.create=(e,t)=>new ke({innerType:e,typeName:ze.ZodOptional,...c(t)});var Ae=class extends l{_parse(e){return this._getType(e)===a.ZodParsedType.null?(0,i.OK)(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};e.ZodNullable=Ae,Ae.create=(e,t)=>new Ae({innerType:e,typeName:ze.ZodNullable,...c(t)});var je=class extends l{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===a.ZodParsedType.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};e.ZodDefault=je,je.create=(e,t)=>new je({innerType:e,typeName:ze.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...c(t)});var Me=class extends l{_parse(e){let{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return(0,i.isAsync)(a)?a.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new t.ZodError(r.common.issues)},input:r.data})})):{status:`valid`,value:a.status===`valid`?a.value:this._def.catchValue({get error(){return new t.ZodError(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};e.ZodCatch=Me,Me.create=(e,t)=>new Me({innerType:e,typeName:ze.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...c(t)});var Ne=class extends l{_parse(e){if(this._getType(e)!==a.ZodParsedType.nan){let n=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(n,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.nan,received:n.parsedType}),i.INVALID}return{status:`valid`,value:e.data}}};e.ZodNaN=Ne,Ne.create=e=>new Ne({typeName:ze.ZodNaN,...c(e)}),e.BRAND=Symbol(`zod_brand`);var Pe=class extends l{_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}};e.ZodBranded=Pe;var Fe=class e extends l{_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`?i.INVALID:e.status===`dirty`?(t.dirty(),(0,i.DIRTY)(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`?i.INVALID: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:ze.ZodPipeline})}};e.ZodPipeline=Fe;var Ie=class extends l{_parse(e){let t=this._def.innerType._parse(e),n=e=>((0,i.isValid)(e)&&(e.value=Object.freeze(e.value)),e);return(0,i.isAsync)(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};e.ZodReadonly=Ie,Ie.create=(e,t)=>new Ie({innerType:e,typeName:ze.ZodReadonly,...c(t)});function Le(e,t){let n=typeof e==`function`?e(t):typeof e==`string`?{message:e}:e;return typeof n==`string`?{message:n}:n}function Re(e,t={},n){return e?P.create().superRefine((r,i)=>{let a=e(r);if(a instanceof Promise)return a.then(e=>{if(!e){let e=Le(t,r),a=e.fatal??n??!0;i.addIssue({code:`custom`,...e,fatal:a})}});if(!a){let e=Le(t,r),a=e.fatal??n??!0;i.addIssue({code:`custom`,...e,fatal:a})}}):P.create()}e.late={object:me.lazycreate};var ze;(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`})(ze||(e.ZodFirstPartyTypeKind=ze={})),e.instanceof=(e,t={message:`Input not instance of ${e.name}`})=>Re(t=>t instanceof e,t);var Be=re.create;e.string=Be;var Ve=j.create;e.number=Ve,e.nan=Ne.create,e.bigint=ae.create;var He=oe.create;e.boolean=He,e.date=se.create,e.symbol=M.create,e.undefined=ce.create,e.null=N.create,e.any=P.create,e.unknown=le.create,e.never=ue.create,e.void=de.create,e.array=fe.create,e.object=me.create,e.strictObject=me.strictCreate,e.union=he.create,e.discriminatedUnion=F.create,e.intersection=I.create,e.tuple=ve.create,e.record=ye.create,e.map=be.create,e.set=xe.create,e.function=L.create,e.lazy=Se.create,e.literal=Ce.create,e.enum=Te.create,e.nativeEnum=Ee.create,e.promise=De.create;var Ue=Oe.create;e.effect=Ue,e.transformer=Ue,e.optional=ke.create,e.nullable=Ae.create,e.preprocess=Oe.createWithPreprocess,e.pipeline=Fe.create,e.ostring=()=>Be().optional(),e.onumber=()=>Ve().optional(),e.oboolean=()=>He().optional(),e.coerce={string:(e=>re.create({...e,coerce:!0})),number:(e=>j.create({...e,coerce:!0})),boolean:(e=>oe.create({...e,coerce:!0})),bigint:(e=>ae.create({...e,coerce:!0})),date:(e=>se.create({...e,coerce:!0}))},e.NEVER=i.INVALID})),Dhn=s((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(Shn(),e),n(Chn(),e),n(whn(),e),n(I7(),e),n(Ehn(),e),n(bhn(),e)})),Ohn=s((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.z=void 0;var a=r(Dhn());e.z=a,i(Dhn(),e),e.default=a})),khn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.recommendationPropsSchema=e.calculatorParamsSchema=e.activitySchema=e.activityReductionSchema=void 0;var t=Ohn(),n=E2(),r=A7(),i=O7(),a=(e,n)=>t.z.number().refine(t=>t>=e.min&&t<=e.max,{message:n}),o=e.activityReductionSchema=t.z.object({fromZero:a(r.ACTIVITY_SETTINGS_INTERVAL_LIMITS),fromThirty:a(r.ACTIVITY_SETTINGS_INTERVAL_LIMITS),fromFortysix:a(r.ACTIVITY_SETTINGS_INTERVAL_LIMITS),fromSixtyone:a(r.ACTIVITY_SETTINGS_INTERVAL_LIMITS).nullable()}),s=e.activitySchema=t.z.object({activityDuration:a(r.ACTIVITY_DURATION_MINUTES_LIMITS),activityIntensity:t.z.nativeEnum(n.ActivityIntensity).nullable(),activitySettings:t.z.object({light:o,moderate:o,hard:t.z.object({...o.shape,fromFortysix:a(r.ACTIVITY_SETTINGS_INTERVAL_LIMITS).nullable()}),post:o,target:a(r.ACTIVITY_TARGET_BGL_MMOL_LIMITS)}),activityDate:t.z.date()}).nullable(),c=e.calculatorParamsSchema=t.z.object({glucoseReading:t.z.object({value:t.z.number(),unit:t.z.nativeEnum(n.BloodGlucoseUnit),source:t.z.enum([`manual`,`forecast`,`device`,`external`,`cgm`]),timestamp:t.z.number(),id:t.z.string().uuid()}),targetBGL:a(r.TARGET_BGL_MMOL_LIMITS),insulinSensitivity:a(r.INSULIN_SENSITIVITY_MMOL_LIMITS),carbohydrates:a(r.CARBOHYDRATES_LIMITS),carbohydrateRatio:a(r.INSULIN_TO_CARBS_RATIO_LIMITS),recentBoluses:t.z.array(t.z.object({secondsPassed:a(r.BOLUS_SECONDS_PASSED_LIMITS),insulinDose:a(r.INSULIN_DOSE_LIMITS),id:t.z.string().uuid()})),activity:s});e.recommendationPropsSchema=t.z.object({bloodGlucoseUnit:t.z.nativeEnum(n.BloodGlucoseUnit),injectionMethod:t.z.nativeEnum(n.InjectionMethod),language:t.z.enum([`da`,`de`,`en`,`es`,`fr`,`it`,`sv`,`pl`]),calculatorParams:c,colorScheme:t.z.nativeEnum(i.ColorScheme)})})),Ahn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.SyncStatus=e.RecommendationScreen=void 0;var t=O(p()),n=(V(),d(tm)),r=(Z0(),d(z4t)),i=Nan(),a=E2(),o=D(Kmn()),s=D(nhn()),c=D(rhn()),l=D(chn()),u=D(lhn()),f=D(uhn()),m=D(dhn()),h=D(fhn()),g=D(phn()),_=D(mhn()),v=D(hhn()),y=D(ghn()),b=D(_hn()),x=D(yhn()),S=A7(),C=k7(),w=j7(),T=khn(),E=LJ();function D(e){return e&&e.__esModule?e:{default:e}}function O(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(O=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}var k=e.SyncStatus=function(e){return e.Idle=`Idle`,e.Success=`Success`,e.Loading=`Loading`,e.Failure=`Failure`,e}({}),A=e=>{let d=(0,r.useSafeAreaInsets)(),{changeLanguage:p}=(0,w.useLanguage)(),D=(0,C.useSemanticColors)(),{height:O}=(0,n.useWindowDimensions)(),A=(0,t.useMemo)(()=>O-d.bottom-d.top,[O,d.bottom,d.top]),ee=(0,t.useRef)(null),{deleteStatus:ne,editStatus:re,saveStatus:ie,calculatorParams:j,bloodGlucoseUnit:ae,injectionMethod:oe,transferEditedRecommendation:se,closeCalculationFooter:M,closeCalculationTimeoutModal:ce,deleteCalculation:N,closeCalculationViewInlogbook:P,trackRecommendationTimeout:le,trackExpandDetails:ue}=e,{glucoseReading:de,carbohydrates:fe,activity:pe}=j,me=(0,t.useRef)((0,i.calculateRecommendation)(j)).current,[he,ge]=(0,t.useState)(null),[F,_e]=(0,t.useState)(null),[I,ve]=(0,t.useState)(null),[ye,be]=(0,t.useState)(null),[xe,L]=(0,t.useState)(0),[Se,Ce]=(0,t.useState)(0),[we,Te]=(0,t.useState)(0),[Ee,De]=(0,t.useState)(!0),[Oe,ke]=(0,t.useState)(!1),[Ae,je]=(0,t.useState)(!1),[Me,Ne]=(0,t.useState)(!0),[Pe,Fe]=(0,t.useState)(!1),[Ie,Le]=(0,t.useState)(!1),[Re,ze]=(0,t.useState)(!1),[Be,Ve]=(0,t.useState)(!1),[He,Ue]=(0,t.useState)(!1),[We,Ge]=(0,t.useState)(!1),[Ke,qe]=(0,t.useState)(!1),[Je,Ye]=(0,t.useState)(!1),[Xe,Ze]=(0,t.useState)(!1),[Qe,$e]=(0,t.useState)(!1);(0,t.useEffect)(()=>{ne===k.Failure&&Ze(!0)},[ne]),(0,t.useEffect)(()=>{ie===k.Failure&&Ye(!0)},[ie]),(0,t.useEffect)(()=>{re===k.Success&&(ge(F),ve(ye))},[ne,re,ye,F,ie]),(0,t.useEffect)(()=>{T.recommendationPropsSchema.parse(e),p(e.language)},[p,e]),(0,t.useEffect)(()=>{me.wasLimited&&qe(!0)},[me.wasLimited]),(0,t.useEffect)(()=>{let e=me.recommendationDate.getTime(),t=setInterval(()=>{new Date().getTime()-e>S.TIMEOUT_MODAL_TRIGGER&&!We&&!Re&&(ze(!0),Ge(!0),le())},a.Milliseconds.Second*1);return()=>clearInterval(t)},[Re,We,me,le]);let et=(0,t.useCallback)(e=>{let t=me.recommendationDate.getTime(),n=new Date().getTime()-t>S.TIMEOUT_MODAL_TRIGGER;e===`active`&&n&&!Be&&(Ge(!0),le())},[me,le,Be]),tt=(0,t.useCallback)(()=>(Ue(!0),!0),[]);(0,t.useEffect)(()=>{let e=n.AppState.addEventListener(`change`,et),t=null;return n.Platform.OS===`android`&&(t=n.BackHandler.addEventListener(`hardwareBackPress`,tt)),()=>{e.remove(),t?.remove()}},[et,tt]);let nt=(0,t.useMemo)(()=>{if(pe)return{activityDuration:pe.activityDuration,activityIntensity:pe.activityIntensity,activityReduction:me.activityReduction}},[pe,me.activityReduction]),rt=(0,t.useCallback)(e=>{n.LayoutAnimation.configureNext(n.LayoutAnimation.Presets.easeInEaseOut);let t=(0,i.roundInsulinValue)(me.bolus,oe),r=Math.round(me.carbRecommendation),a=e===t?null:e;e===t?(ge(null),_e(null)):_e(e),se({modified:I,suggested:r},{modified:a,suggested:t},me.recommendationDate)},[me,oe,I,se]),it=(0,t.useCallback)(e=>{n.LayoutAnimation.configureNext(n.LayoutAnimation.Presets.easeInEaseOut);let t=(0,i.roundInsulinValue)(me.bolus,oe),r=Math.round(me.carbRecommendation),a=e===r?null:e;e===r?(ve(null),be(null)):be(e),se({modified:a,suggested:r},{modified:he,suggested:t},me.recommendationDate)},[me,oe,he,se]),at=(0,t.useCallback)(()=>{Pe&&N()},[N,Pe]),ot=(0,t.useCallback)(()=>{Ve(!0),Ie?P():ce()},[Ie,ce,P]),st=(0,t.useCallback)(()=>{Le(!0),Ge(!1)},[]),ct=(0,t.useCallback)(()=>{Fe(!0),Ue(!1)},[]),lt=(0,t.useCallback)(()=>{re===k.Failure&&$e(!0)},[re]),ut=(0,t.useCallback)(()=>{$e(!1)},[]),dt=(0,t.useCallback)((e,t)=>{Te(t)},[]),ft=(0,t.useCallback)(()=>{ee?.current?.scrollToEnd(),je(!0),setTimeout(()=>Ne(!1),1)},[]),pt=(0,t.useCallback)(e=>{let{layoutMeasurement:{height:t},contentOffset:{y:n}}=e.nativeEvent,r=Math.round(t+n),i=r>=we-xe,a=r>=Math.round(we);ke(i),Ee&&De(!1),a&&je(!0),a&&setTimeout(()=>Ne(!1),1)},[xe,we,Ee]),mt=(0,t.useMemo)(()=>Math.round(Se+xe),[Se,xe]);return Re?(0,E.jsx)(n.View,{style:[{flex:1,backgroundColor:D.bgPrimary}],children:(0,E.jsx)(n.View,{style:te.timeoutContainer,children:(0,E.jsx)(b.default,{isVisible:We,onPressViewInLogbook:st,onPressCancel:()=>Ge(!1),onDismiss:ot})})}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(n.ScrollView,{ref:ee,scrollEventThrottle:16,style:[te.scrollView,{backgroundColor:D.bgPrimary}],contentContainerStyle:Ae&&te.scrollViewContentContainer,testID:`recommendation-screen`,onScroll:pt,onContentSizeChange:dt,children:[(0,E.jsxs)(n.View,{testID:`recommendation-content`,onLayout:({nativeEvent:e})=>Ce(e.layout.height),style:te.content,children:[(0,E.jsxs)(n.View,{style:[te.mainContainer,{backgroundColor:D.bgSecondary}],children:[(0,E.jsx)(f.default,{isEdited:he!==null}),(0,E.jsx)(m.default,{initialValue:(0,i.roundInsulinValue)(me.bolus,oe),editedValue:he,injectionMethod:oe,wasLimited:me.wasLimited,onDismiss:lt,onConfirm:rt}),(0,E.jsx)(c.default,{}),(0,E.jsx)(l.default,{glucoseReading:de,bloodGlucoseUnit:ae,trackExpandDetails:ue,carbIntakeValue:Math.round(fe),activeInsulin:Math.round(me.activeInsulin*10)/10,activity:nt})]}),(0,E.jsxs)(n.View,{style:te.carbsContainer,children:[Math.round(me.carbRecommendation)>0&&(0,E.jsx)(s.default,{carbsRecommendation:Math.round(me.carbRecommendation),editedCarbsRecommendation:I,onDismiss:lt,onConfirm:it}),(0,E.jsx)(o.default,{glucoseReading:de,hasActivity:pe!==null,bloodGlucoseUnit:ae})]})]}),mt>A&&Me&&(0,E.jsx)(u.default,{prefixTestID:`scroll`,onSave:ft,onDelete:ft,onLayout:({nativeEvent:e})=>L(e.layout.height)})]}),(0,E.jsx)(x.default,{scrollToEnd:ft,isVisibleArrow:mt>A&&Ee,isVisibleBlur:mt>A&&!Oe&&!Ae}),(mt<=A||Ae)&&(0,E.jsx)(u.default,{prefixTestID:`fixed`,onSave:M,onDelete:()=>Ue(!0),onLayout:({nativeEvent:e})=>L(e.layout.height)}),(0,E.jsx)(v.default,{isVisible:Ke,activityReduction:me.activityReduction,onPress:()=>qe(!1)}),(0,E.jsx)(g.default,{isVisible:He,onPressDelete:ct,onDismiss:at,onPressCancel:()=>Ue(!1)}),(0,E.jsx)(h.default,{isVisible:Xe,onPressClose:()=>Ze(!1)}),(0,E.jsx)(y.default,{isVisible:Je,onPressClose:()=>Ye(!1)}),(0,E.jsx)(_.default,{isVisible:Qe,onPressClose:ut})]})};e.RecommendationScreen=A;var ee=e=>(0,E.jsx)(w.LanguageProvider,{children:(0,E.jsx)(C.ColorSchemeProvider,{colorScheme:e.colorScheme,children:(0,E.jsx)(A,{...e})})}),te=n.StyleSheet.create({timeoutContainer:{flex:1,opacity:.5},scrollView:{flex:1},scrollViewContentContainer:{paddingBottom:32},content:{gap:32,paddingVertical:32},mainContainer:{borderRadius:16,marginHorizontal:16},carbsContainer:{paddingHorizontal:16}});e.default=ee})),L7=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"RecommendationScreenWrapper",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"SyncStatus",{enumerable:!0,get:function(){return t.SyncStatus}}),Object.defineProperty(e,"recommendationPropsSchema",{enumerable:!0,get:function(){return n.recommendationPropsSchema}});var t=r(Ahn()),n=khn();function r(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,i=new WeakMap;return(r=function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?r(o,t,a):o[t]=e[t]);return o})(e,t)}}))();function R7(e,t){return+e3(e)<+e3(t)}function jhn(e,t){return+e3(e)==+e3(t)}function Mhn(){return Object.assign({},v8())}function Nhn(e,t){let n=Phn(t)?new t(0):$4(t,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}function Phn(e){return typeof e==`function`&&e.prototype?.constructor===e}var Fhn=10,Ihn=class{subPriority=0;validate(e,t){return!0}},Lhn=class extends Ihn{constructor(e,t,n,r,i){super(),this.value=e,this.validateValue=t,this.setValue=n,this.priority=r,i&&(this.subPriority=i)}validate(e,t){return this.validateValue(e,this.value,t)}set(e,t,n){return this.setValue(e,t,this.value,n)}},Rhn=class extends Ihn{priority=Fhn;subPriority=-1;constructor(e,t){super(),this.context=e||(e=>$4(t,e))}set(e,t){return t.timestampIsSet?e:$4(e,Nhn(e,this.context))}},z7=class{run(e,t,n,r){let i=this.parse(e,t,n,r);return i?{setter:new Lhn(i.value,this.validate,this.set,this.priority,this.subPriority),rest:i.rest}:null}validate(e,t,n){return!0}},zhn=class extends z7{priority=140;parse(e,t,n){switch(t){case`G`:case`GG`:case`GGG`:return n.era(e,{width:`abbreviated`})||n.era(e,{width:`narrow`});case`GGGGG`:return n.era(e,{width:`narrow`});default:return n.era(e,{width:`wide`})||n.era(e,{width:`abbreviated`})||n.era(e,{width:`narrow`})}}set(e,t,n){return t.era=n,e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`R`,`u`,`t`,`T`]},B7={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},V7={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function H7(e,t){return e&&{value:t(e.value),rest:e.rest}}function U7(e,t){let n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function W7(e,t){let n=t.match(e);if(!n)return null;if(n[0]===`Z`)return{value:0,rest:t.slice(1)};let r=n[1]===`+`?1:-1,i=n[2]?parseInt(n[2],10):0,a=n[3]?parseInt(n[3],10):0,o=n[5]?parseInt(n[5],10):0;return{value:r*(i*P9t+a*N9t+o*F9t),rest:t.slice(n[0].length)}}function Bhn(e){return U7(B7.anyDigitsSigned,e)}function G7(e,t){switch(e){case 1:return U7(B7.singleDigit,t);case 2:return U7(B7.twoDigits,t);case 3:return U7(B7.threeDigits,t);case 4:return U7(B7.fourDigits,t);default:return U7(RegExp(`^\\d{1,`+e+`}`),t)}}function Vhn(e,t){switch(e){case 1:return U7(B7.singleDigitSigned,t);case 2:return U7(B7.twoDigitsSigned,t);case 3:return U7(B7.threeDigitsSigned,t);case 4:return U7(B7.fourDigitsSigned,t);default:return U7(RegExp(`^-?\\d{1,`+e+`}`),t)}}function Hhn(e){switch(e){case`morning`:return 4;case`evening`:return 17;case`pm`:case`noon`:case`afternoon`:return 12;default:return 0}}function Uhn(e,t){let n=t>0,r=n?t:1-t,i;if(r<=50)i=e||100;else{let t=r+50,n=Math.trunc(t/100)*100,a=e>=t%100;i=e+n-(a?100:0)}return n?i:1-i}function Whn(e){return e%400==0||e%4==0&&e%100!=0}var Ghn=class extends z7{priority=130;incompatibleTokens=[`Y`,`R`,`u`,`w`,`I`,`i`,`e`,`c`,`t`,`T`];parse(e,t,n){let r=e=>({year:e,isTwoDigitYear:t===`yy`});switch(t){case`y`:return H7(G7(4,e),r);case`yo`:return H7(n.ordinalNumber(e,{unit:`year`}),r);default:return H7(G7(t.length,e),r)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,n){let r=e.getFullYear();if(n.isTwoDigitYear){let t=Uhn(n.year,r);return e.setFullYear(t,0,1),e.setHours(0,0,0,0),e}let i=!(`era`in t)||t.era===1?n.year:1-n.year;return e.setFullYear(i,0,1),e.setHours(0,0,0,0),e}},Khn=class extends z7{priority=130;parse(e,t,n){let r=e=>({year:e,isTwoDigitYear:t===`YY`});switch(t){case`Y`:return H7(G7(4,e),r);case`Yo`:return H7(n.ordinalNumber(e,{unit:`year`}),r);default:return H7(G7(t.length,e),r)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,n,r){let i=von(e,r);if(n.isTwoDigitYear){let t=Uhn(n.year,i);return e.setFullYear(t,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),y8(e,r)}let a=!(`era`in t)||t.era===1?n.year:1-n.year;return e.setFullYear(a,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),y8(e,r)}incompatibleTokens=[`y`,`R`,`u`,`Q`,`q`,`M`,`L`,`I`,`d`,`D`,`i`,`t`,`T`]},qhn=class extends z7{priority=130;parse(e,t){return Vhn(t===`R`?4:t.length,e)}set(e,t,n){let r=$4(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),j8(r)}incompatibleTokens=[`G`,`y`,`Y`,`u`,`Q`,`q`,`M`,`L`,`w`,`d`,`D`,`e`,`c`,`t`,`T`]},Jhn=class extends z7{priority=130;parse(e,t){return Vhn(t===`u`?4:t.length,e)}set(e,t,n){return e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`G`,`y`,`Y`,`R`,`w`,`I`,`i`,`e`,`c`,`t`,`T`]},Yhn=class extends z7{priority=120;parse(e,t,n){switch(t){case`Q`:case`QQ`:return G7(t.length,e);case`Qo`:return n.ordinalNumber(e,{unit:`quarter`});case`QQQ`:return n.quarter(e,{width:`abbreviated`,context:`formatting`})||n.quarter(e,{width:`narrow`,context:`formatting`});case`QQQQQ`:return n.quarter(e,{width:`narrow`,context:`formatting`});default:return n.quarter(e,{width:`wide`,context:`formatting`})||n.quarter(e,{width:`abbreviated`,context:`formatting`})||n.quarter(e,{width:`narrow`,context:`formatting`})}}validate(e,t){return t>=1&&t<=4}set(e,t,n){return e.setMonth((n-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`q`,`M`,`L`,`w`,`I`,`d`,`D`,`i`,`e`,`c`,`t`,`T`]},Xhn=class extends z7{priority=120;parse(e,t,n){switch(t){case`q`:case`qq`:return G7(t.length,e);case`qo`:return n.ordinalNumber(e,{unit:`quarter`});case`qqq`:return n.quarter(e,{width:`abbreviated`,context:`standalone`})||n.quarter(e,{width:`narrow`,context:`standalone`});case`qqqqq`:return n.quarter(e,{width:`narrow`,context:`standalone`});default:return n.quarter(e,{width:`wide`,context:`standalone`})||n.quarter(e,{width:`abbreviated`,context:`standalone`})||n.quarter(e,{width:`narrow`,context:`standalone`})}}validate(e,t){return t>=1&&t<=4}set(e,t,n){return e.setMonth((n-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`Q`,`M`,`L`,`w`,`I`,`d`,`D`,`i`,`e`,`c`,`t`,`T`]},Zhn=class extends z7{incompatibleTokens=[`Y`,`R`,`q`,`Q`,`L`,`w`,`I`,`D`,`i`,`e`,`c`,`t`,`T`];priority=110;parse(e,t,n){let r=e=>e-1;switch(t){case`M`:return H7(U7(B7.month,e),r);case`MM`:return H7(G7(2,e),r);case`Mo`:return H7(n.ordinalNumber(e,{unit:`month`}),r);case`MMM`:return n.month(e,{width:`abbreviated`,context:`formatting`})||n.month(e,{width:`narrow`,context:`formatting`});case`MMMMM`:return n.month(e,{width:`narrow`,context:`formatting`});default:return n.month(e,{width:`wide`,context:`formatting`})||n.month(e,{width:`abbreviated`,context:`formatting`})||n.month(e,{width:`narrow`,context:`formatting`})}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.setMonth(n,1),e.setHours(0,0,0,0),e}},Qhn=class extends z7{priority=110;parse(e,t,n){let r=e=>e-1;switch(t){case`L`:return H7(U7(B7.month,e),r);case`LL`:return H7(G7(2,e),r);case`Lo`:return H7(n.ordinalNumber(e,{unit:`month`}),r);case`LLL`:return n.month(e,{width:`abbreviated`,context:`standalone`})||n.month(e,{width:`narrow`,context:`standalone`});case`LLLLL`:return n.month(e,{width:`narrow`,context:`standalone`});default:return n.month(e,{width:`wide`,context:`standalone`})||n.month(e,{width:`abbreviated`,context:`standalone`})||n.month(e,{width:`narrow`,context:`standalone`})}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.setMonth(n,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`q`,`Q`,`M`,`w`,`I`,`D`,`i`,`e`,`c`,`t`,`T`]};function $hn(e,t,n){let r=e3(e,n?.in),i=bon(r,n)-t;return r.setDate(r.getDate()-i*7),e3(r,n?.in)}var egn=class extends z7{priority=100;parse(e,t,n){switch(t){case`w`:return U7(B7.week,e);case`wo`:return n.ordinalNumber(e,{unit:`week`});default:return G7(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,n,r){return y8($hn(e,n,r),r)}incompatibleTokens=[`y`,`R`,`u`,`q`,`Q`,`M`,`L`,`I`,`d`,`D`,`i`,`t`,`T`]};function tgn(e,t,n){let r=e3(e,n?.in),i=_on(r,n)-t;return r.setDate(r.getDate()-i*7),r}var ngn=class extends z7{priority=100;parse(e,t,n){switch(t){case`I`:return U7(B7.week,e);case`Io`:return n.ordinalNumber(e,{unit:`week`});default:return G7(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,n){return j8(tgn(e,n))}incompatibleTokens=[`y`,`Y`,`u`,`q`,`Q`,`M`,`L`,`w`,`d`,`D`,`e`,`c`,`t`,`T`]},rgn=[31,28,31,30,31,30,31,31,30,31,30,31],ign=[31,29,31,30,31,30,31,31,30,31,30,31],agn=class extends z7{priority=90;subPriority=1;parse(e,t,n){switch(t){case`d`:return U7(B7.date,e);case`do`:return n.ordinalNumber(e,{unit:`date`});default:return G7(t.length,e)}}validate(e,t){let n=Whn(e.getFullYear()),r=e.getMonth();return n?t>=1&&t<=ign[r]:t>=1&&t<=rgn[r]}set(e,t,n){return e.setDate(n),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`q`,`Q`,`w`,`I`,`D`,`i`,`e`,`c`,`t`,`T`]},ogn=class extends z7{priority=90;subpriority=1;parse(e,t,n){switch(t){case`D`:case`DD`:return U7(B7.dayOfYear,e);case`Do`:return n.ordinalNumber(e,{unit:`date`});default:return G7(t.length,e)}}validate(e,t){return Whn(e.getFullYear())?t>=1&&t<=366:t>=1&&t<=365}set(e,t,n){return e.setMonth(0,n),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`q`,`Q`,`M`,`L`,`w`,`I`,`d`,`E`,`i`,`e`,`c`,`t`,`T`]};function K7(e,t,n){let r=e3(e,n?.in);return isNaN(t)?$4(n?.in||e,NaN):(t&&r.setDate(r.getDate()+t),r)}function sgn(e,t,n){let r=v8(),i=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=e3(e,n?.in),o=a.getDay(),s=(t%7+7)%7,c=7-i;return K7(a,t<0||t>6?t-(o+c)%7:(s+c)%7-(o+c)%7,n)}var cgn=class extends z7{priority=90;parse(e,t,n){switch(t){case`E`:case`EE`:case`EEE`:return n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`});case`EEEEE`:return n.day(e,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`});default:return n.day(e,{width:`wide`,context:`formatting`})||n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,r){return e=sgn(e,n,r),e.setHours(0,0,0,0),e}incompatibleTokens=[`D`,`i`,`e`,`c`,`t`,`T`]},lgn=class extends z7{priority=90;parse(e,t,n,r){let i=e=>{let t=Math.floor((e-1)/7)*7;return(e+r.weekStartsOn+6)%7+t};switch(t){case`e`:case`ee`:return H7(G7(t.length,e),i);case`eo`:return H7(n.ordinalNumber(e,{unit:`day`}),i);case`eee`:return n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`});case`eeeee`:return n.day(e,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`});default:return n.day(e,{width:`wide`,context:`formatting`})||n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,r){return e=sgn(e,n,r),e.setHours(0,0,0,0),e}incompatibleTokens=[`y`,`R`,`u`,`q`,`Q`,`M`,`L`,`I`,`d`,`D`,`E`,`i`,`c`,`t`,`T`]},ugn=class extends z7{priority=90;parse(e,t,n,r){let i=e=>{let t=Math.floor((e-1)/7)*7;return(e+r.weekStartsOn+6)%7+t};switch(t){case`c`:case`cc`:return H7(G7(t.length,e),i);case`co`:return H7(n.ordinalNumber(e,{unit:`day`}),i);case`ccc`:return n.day(e,{width:`abbreviated`,context:`standalone`})||n.day(e,{width:`short`,context:`standalone`})||n.day(e,{width:`narrow`,context:`standalone`});case`ccccc`:return n.day(e,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(e,{width:`short`,context:`standalone`})||n.day(e,{width:`narrow`,context:`standalone`});default:return n.day(e,{width:`wide`,context:`standalone`})||n.day(e,{width:`abbreviated`,context:`standalone`})||n.day(e,{width:`short`,context:`standalone`})||n.day(e,{width:`narrow`,context:`standalone`})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,r){return e=sgn(e,n,r),e.setHours(0,0,0,0),e}incompatibleTokens=[`y`,`R`,`u`,`q`,`Q`,`M`,`L`,`I`,`d`,`D`,`E`,`i`,`e`,`t`,`T`]};function dgn(e,t){let n=e3(e,t?.in).getDay();return n===0?7:n}function fgn(e,t,n){let r=e3(e,n?.in);return K7(r,t-dgn(r,n),n)}var pgn=class extends z7{priority=90;parse(e,t,n){let r=e=>e===0?7:e;switch(t){case`i`:case`ii`:return G7(t.length,e);case`io`:return n.ordinalNumber(e,{unit:`day`});case`iii`:return H7(n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`}),r);case`iiiii`:return H7(n.day(e,{width:`narrow`,context:`formatting`}),r);case`iiiiii`:return H7(n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`}),r);default:return H7(n.day(e,{width:`wide`,context:`formatting`})||n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`}),r)}}validate(e,t){return t>=1&&t<=7}set(e,t,n){return e=fgn(e,n),e.setHours(0,0,0,0),e}incompatibleTokens=[`y`,`Y`,`u`,`q`,`Q`,`M`,`L`,`w`,`d`,`D`,`E`,`e`,`c`,`t`,`T`]},mgn=class extends z7{priority=80;parse(e,t,n){switch(t){case`a`:case`aa`:case`aaa`:return n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`});case`aaaaa`:return n.dayPeriod(e,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(e,{width:`wide`,context:`formatting`})||n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`})}}set(e,t,n){return e.setHours(Hhn(n),0,0,0),e}incompatibleTokens=[`b`,`B`,`H`,`k`,`t`,`T`]},hgn=class extends z7{priority=80;parse(e,t,n){switch(t){case`b`:case`bb`:case`bbb`:return n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`});case`bbbbb`:return n.dayPeriod(e,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(e,{width:`wide`,context:`formatting`})||n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`})}}set(e,t,n){return e.setHours(Hhn(n),0,0,0),e}incompatibleTokens=[`a`,`B`,`H`,`k`,`t`,`T`]},ggn=class extends z7{priority=80;parse(e,t,n){switch(t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`});case`BBBBB`:return n.dayPeriod(e,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(e,{width:`wide`,context:`formatting`})||n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`})}}set(e,t,n){return e.setHours(Hhn(n),0,0,0),e}incompatibleTokens=[`a`,`b`,`t`,`T`]},_gn=class extends z7{priority=70;parse(e,t,n){switch(t){case`h`:return U7(B7.hour12h,e);case`ho`:return n.ordinalNumber(e,{unit:`hour`});default:return G7(t.length,e)}}validate(e,t){return t>=1&&t<=12}set(e,t,n){let r=e.getHours()>=12;return r&&n<12?e.setHours(n+12,0,0,0):!r&&n===12?e.setHours(0,0,0,0):e.setHours(n,0,0,0),e}incompatibleTokens=[`H`,`K`,`k`,`t`,`T`]},vgn=class extends z7{priority=70;parse(e,t,n){switch(t){case`H`:return U7(B7.hour23h,e);case`Ho`:return n.ordinalNumber(e,{unit:`hour`});default:return G7(t.length,e)}}validate(e,t){return t>=0&&t<=23}set(e,t,n){return e.setHours(n,0,0,0),e}incompatibleTokens=[`a`,`b`,`h`,`K`,`k`,`t`,`T`]},ygn=class extends z7{priority=70;parse(e,t,n){switch(t){case`K`:return U7(B7.hour11h,e);case`Ko`:return n.ordinalNumber(e,{unit:`hour`});default:return G7(t.length,e)}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.getHours()>=12&&n<12?e.setHours(n+12,0,0,0):e.setHours(n,0,0,0),e}incompatibleTokens=[`h`,`H`,`k`,`t`,`T`]},bgn=class extends z7{priority=70;parse(e,t,n){switch(t){case`k`:return U7(B7.hour24h,e);case`ko`:return n.ordinalNumber(e,{unit:`hour`});default:return G7(t.length,e)}}validate(e,t){return t>=1&&t<=24}set(e,t,n){let r=n<=24?n%24:n;return e.setHours(r,0,0,0),e}incompatibleTokens=[`a`,`b`,`h`,`H`,`K`,`t`,`T`]},xgn=class extends z7{priority=60;parse(e,t,n){switch(t){case`m`:return U7(B7.minute,e);case`mo`:return n.ordinalNumber(e,{unit:`minute`});default:return G7(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,n){return e.setMinutes(n,0,0),e}incompatibleTokens=[`t`,`T`]},Sgn=class extends z7{priority=50;parse(e,t,n){switch(t){case`s`:return U7(B7.second,e);case`so`:return n.ordinalNumber(e,{unit:`second`});default:return G7(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,n){return e.setSeconds(n,0),e}incompatibleTokens=[`t`,`T`]},Cgn=class extends z7{priority=30;parse(e,t){return H7(G7(t.length,e),e=>Math.trunc(e*10**(-t.length+3)))}set(e,t,n){return e.setMilliseconds(n),e}incompatibleTokens=[`t`,`T`]},wgn=class extends z7{priority=10;parse(e,t){switch(t){case`X`:return W7(V7.basicOptionalMinutes,e);case`XX`:return W7(V7.basic,e);case`XXXX`:return W7(V7.basicOptionalSeconds,e);case`XXXXX`:return W7(V7.extendedOptionalSeconds,e);default:return W7(V7.extended,e)}}set(e,t,n){return t.timestampIsSet?e:$4(e,e.getTime()-A8(e)-n)}incompatibleTokens=[`t`,`T`,`x`]},Tgn=class extends z7{priority=10;parse(e,t){switch(t){case`x`:return W7(V7.basicOptionalMinutes,e);case`xx`:return W7(V7.basic,e);case`xxxx`:return W7(V7.basicOptionalSeconds,e);case`xxxxx`:return W7(V7.extendedOptionalSeconds,e);default:return W7(V7.extended,e)}}set(e,t,n){return t.timestampIsSet?e:$4(e,e.getTime()-A8(e)-n)}incompatibleTokens=[`t`,`T`,`X`]},Egn=class extends z7{priority=40;parse(e){return Bhn(e)}set(e,t,n){return[$4(e,n*1e3),{timestampIsSet:!0}]}incompatibleTokens=`*`},Dgn=class extends z7{priority=20;parse(e){return Bhn(e)}set(e,t,n){return[$4(e,n),{timestampIsSet:!0}]}incompatibleTokens=`*`},Ogn={G:new zhn,y:new Ghn,Y:new Khn,R:new qhn,u:new Jhn,Q:new Yhn,q:new Xhn,M:new Zhn,L:new Qhn,w:new egn,I:new ngn,d:new agn,D:new ogn,E:new cgn,e:new lgn,c:new ugn,i:new pgn,a:new mgn,b:new hgn,B:new ggn,h:new _gn,H:new vgn,K:new ygn,k:new bgn,m:new xgn,s:new Sgn,S:new Cgn,X:new wgn,x:new Tgn,t:new Egn,T:new Dgn},kgn=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Agn=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,jgn=/^'([^]*?)'?$/,Mgn=/''/g,Ngn=/\S/,Pgn=/[a-zA-Z]/;function q7(e,t,n,r){let i=()=>$4(r?.in||n,NaN),a=Mhn(),o=r?.locale??a.locale??uon,s=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,c=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0;if(!t)return e?i():e3(n,r?.in);let l={firstWeekContainsDate:s,weekStartsOn:c,locale:o},u=[new Rhn(r?.in,n)],d=t.match(Agn).map(e=>{let t=e[0];if(t in Eon){let n=Eon[t];return n(e,o.formatLong)}return e}).join(``).match(kgn),f=[];for(let n of d){!r?.useAdditionalWeekYearTokens&&jon(n)&&Mon(n,t,e),!r?.useAdditionalDayOfYearTokens&&Aon(n)&&Mon(n,t,e);let a=n[0],s=Ogn[a];if(s){let{incompatibleTokens:t}=s;if(Array.isArray(t)){let e=f.find(e=>t.includes(e.token)||e.token===a);if(e)throw RangeError(`The format string mustn't contain \`${e.fullToken}\` and \`${n}\` at the same time`)}else if(s.incompatibleTokens===`*`&&f.length>0)throw RangeError(`The format string mustn't contain \`${n}\` and any other token at the same time`);f.push({token:a,fullToken:n});let r=s.run(e,n,o.match,l);if(!r)return i();u.push(r.setter),e=r.rest}else{if(a.match(Pgn))throw RangeError("Format string contains an unescaped latin alphabet character `"+a+"`");if(n===`''`?n=`'`:a===`'`&&(n=Fgn(n)),e.indexOf(n)===0)e=e.slice(n.length);else return i()}}if(e.length>0&&Ngn.test(e))return i();let p=u.map(e=>e.priority).sort((e,t)=>t-e).filter((e,t,n)=>n.indexOf(e)===t).map(e=>u.filter(t=>t.priority===e).sort((e,t)=>t.subPriority-e.subPriority)).map(e=>e[0]),m=e3(n,r?.in);if(isNaN(+m))return i();let h={};for(let e of p){if(!e.validate(m,l))return i();let t=e.set(m,h,l);Array.isArray(t)?(m=t[0],Object.assign(h,t[1])):m=t}return m}function Fgn(e){return e.match(jgn)[1].replace(Mgn,`'`)}function Ign(e){let{glucoseLevelTargets:t}=k8;if(t===void 0)throw Error(`[ParameterTimeIntervalsUtils::getBGLParameters] glucoseLevelTargets is undefined.`);let n=t.use===X.Usage.Overall,{overallTargetBGL:r,targetBGLIntervals:i}=t;if(n){if(r===void 0)throw Error(`[ParameterTimeIntervalsUtils::getBGLParameters] overallTargetBGL cannot be undefined`);return r}if(i===void 0)throw Error(`[ParameterTimeIntervalsUtils::getBGLParameters] targetBGLIntervals cannot be undefined`);return Rgn(e,i)}function Lgn(e){let t=k8.treatmentParameters?.use===X.Usage.Overall,{treatmentParameters:n}=k8;if(n===void 0)throw Error(`[ParameterTimeIntervalsUtils::getInsulinParameters] treatmentParameters is undefined.`);return t?n.overallParameters:Rgn(e,n.parameterIntervals)}function Rgn(e,t){let n=I8(e,`HH:mm`),r=zgn(t),i=q7(n,`HH:mm`,new Date);for(let e=0;e<r.length;e++)if(Bgn(r[e],r[(e+1)%r.length],i))return t[e];throw Error(`[ParameterTimeIntervalsUtils::getDailyParameters] The parameter interval has not been found`)}function zgn(e){let t=[];for(let n of e)t.push(q7(n.startTime,`HH:mm`,new Date));return t}function Bgn(e,t,n){let r=R7(e,t),i=jhn(e,n)||R7(e,n),a=Vgn(e),o=Vgn(t,!r),s=Vgn(n,!i);return a<=s&&s<o}function Vgn(e,t){return e.getMinutes()+(e.getHours()+(t?24:0))*60}V();var Hgn=1600;function Ugn({setRemeasurementNotification:e}){let{t,language:n}=Tq(),r=b7(),{selectedEventUUID:i}=a7(),{manualCarbsInput:a,foodIntakeCarbsAmount:o,saveCarbohydrates:s}=L5(),{noteId:c}=B5(),l=N$(),u=(0,H.useRef)(!1),[d,f]=H.useState(!1),[p,m]=H.useState(null),[h,g]=H.useState(null),{glucoseUnit:_,injectionMethod:v,activity:y}=k8;if(_===void 0)throw Error(`[LoadingRecommendationScreen::render] glucoseUnit is undefined`);if(v===void 0)throw Error(`[LoadingRecommendationScreen::render] injectionMethod is undefined`);if(y===void 0)throw Error(`[LoadingRecommendationScreen::render] activity is undefined`);if(r===null)throw Error(`[LoadingRecommendationScreen::render] selectedGlucoseReading is undefined`);let b=(0,H.useMemo)(()=>K8.getRecentBoluses(),[]),x=(0,H.useMemo)(()=>i?S8.getByUUID(i):null,[i]),S=(0,H.useMemo)(()=>{if(!x?.startTimestamp)return null;let e={activitySettings:y,activityDate:new Date(x.startTimestamp),activityDuration:x.durationSeconds/60,activityIntensity:x.activityIntensity};try{return(0,b8.getReduction)(e.activityDuration,e.activitySettings,e.activityIntensity,e.activityDate),e}catch(e){return console.error(`Error calculating activity reduction for recommendation`,e),null}},[y,x]),C=(0,H.useMemo)(()=>{let{target:e}=Ign(new Date),{carbohydrateRatio:t,insulinSensitivity:i}=Lgn(new Date);return{bloodGlucoseUnit:_,injectionMethod:v,language:n,calculatorParams:{glucoseReading:r,activity:S,carbohydrateRatio:t,insulinSensitivity:i,carbohydrates:a+o,targetBGL:e,recentBoluses:b}}},[_,v,n,r,S,a,o,b]),w=(0,H.useCallback)(async()=>{let t=L7.recommendationPropsSchema.omit({colorScheme:!0}).safeParse(C);if(!t.success){u8(l8.RecommendationInvalid),console.error(t.error),g(Eq.Validation);return}try{let{activeInsulin:t,carbRecommendation:n,bolus:i,activityReduction:l,recentBolusesIds:u,recommendationDate:d}=(0,b8.calculateRecommendation)(C.calculatorParams),f=a+o,p=z8(C.calculatorParams.glucoseReading.value,C.calculatorParams.glucoseReading.unit,X.BloodGlucoseUnit.MMOL_L),h=(0,b8.roundInsulinValue)(i,C.injectionMethod),_=Math.round(n),v=r.source===`external`||r.source===`forecast`,y=null,b=null;try{let e=await s(d);y=e?.sampleId??null,b=e?.foodIntakeId??null}catch(e){console.error(`[LoadingRecommendationScreen::saveRecommendation] saveCarbohydrates failed:`,e)}let S=await K8.addLogbook(dsn({blood_glucose_millimolar:p,blood_glucose_millimolar_sample_id:v?r.sampleId:null,glucose_sample_source_id:v?r.sourceId:null,entry_timestamp:d,event_uuid:x?x.uuid:null,is_bolus_calculation:!0,carbohydrates_suggested_grams:_,carbohydrates_entered_grams:f+_,carbohydrates_input_grams:f,carbohydrates_sample_id:y,carbohydrates_manual_grams:a||null,carbohydrates_food_grams:o||null,food_intake_id:b,insulin_entered_units:h,insulin_suggested_units:h,active_insulin:t,activity_reduction:l,active_insulin_source_logbook_ids:u,note_id:c}));if(S===null){g(Eq.Sync);return}if(S.blood_glucose_millimolar!==null&&e!==void 0)try{await e(S.blood_glucose_millimolar)}catch(e){console.error(`[LoadingRecommendationScreen::saveRecommendation] Remeasurement reminder failed:`,e)}m(S),u8(l8.RecommendationSuccess)}catch(e){console.error(`[LoadingRecommendationScreen::saveRecommendation] Unexpected error:`,e),g(Eq.System)}},[C,x,r,a,e,o,s,c]);return u.current||(u.current=!0,w().catch(console.error)),(0,H.useEffect)(()=>{setTimeout(()=>{f(!0)},Hgn)},[]),(0,H.useEffect)(()=>(l.setOptions({gestureEnabled:!1}),l.addListener(`beforeRemove`,({preventDefault:e})=>{d||e()})),[d,l]),(0,H.useEffect)(()=>{d&&p!==null&&h===null&&l.replace(Q.Recommendation,{...C,logbookEntry:lsn(p)}),d&&h!==null&&l.navigate(Q.Calculation,{errorType:h})},[h,d,p,C,l]),(0,W.jsxs)(B,{style:J7.animationContainer,children:[(0,W.jsx)(g2,{autoPlay:!0,source:_2.LOADING_RECOMMENDATION,style:J7.animation,webStyle:J7.animation,resizeMode:`cover`,loop:!0}),(0,W.jsx)(Z,{style:J7.text,children:t(`recommendation_loading_title`)})]})}var J7=R.create({animationContainer:{flex:1,justifyContent:`center`,alignItems:`center`},text:{...Y.Poppins.bold_Base,marginTop:32},animation:{width:128,height:128}}),Wgn=f7(Ugn),Ggn=5e3,Kgn=async()=>{try{return(await T3(`${bq.HEDIA_SERVER_BASE_URL}/ping`,{headers:Aq},Ggn)).ok}catch{return!1}};V(),Z0();function qgn(){let{COLORS:e,effectiveColorScheme:t}=J(),n=N$(),r=F$(),{manualCarbsInput:i,foodIntakeCarbsAmount:a}=L5(),[o,s]=(0,H.useState)(L7.SyncStatus.Idle),[c,l]=(0,H.useState)(L7.SyncStatus.Idle),[u,d]=(0,H.useState)(L7.SyncStatus.Idle),{bloodGlucoseUnit:f,calculatorParams:p,injectionMethod:m,language:h,logbookEntry:g}=r.params,[_,v]=(0,H.useState)(()=>usn(g));Cvt(),(0,H.useEffect)(()=>{n.setOptions({gestureEnabled:!1})},[n]);let y=(0,H.useCallback)(async(e,t)=>{d(L7.SyncStatus.Loading);let n=i+a,r=dsn({..._,insulin_entered_units:t.modified??t.suggested,carbohydrates_overwritten_suggested_grams:e.modified,carbohydrates_entered_grams:n+(e.modified??e.suggested)}),o=await K8.addLogbook(r,_.uuid);o?(v(o),d(L7.SyncStatus.Success)):d(L7.SyncStatus.Failure)},[i,_,a]),b=(0,H.useCallback)(()=>{if(Oq)throw Error(`Recommendation::handleOnCloseCalculationViewInLogbook] Cannot view-in-logbook on web`);n.popTo(Q.MainBottomTabs,{screen:Q.LogbooksTab,params:{logbookEntry:lsn(_)}}),l7()},[n,_]),x=(0,H.useCallback)(()=>{Oq?(window.location.href=`/redirect?status=success`,xq.clearAll()):n.popTo(Q.MainBottomTabs,{screen:Q.DashboardTab,params:{screen:Q.Dashboard}}),l7()},[n]),S=(0,H.useCallback)(async()=>{s(L7.SyncStatus.Loading);let e=await K8.deleteLogbook(_.uuid);Oq?e?(window.location.href=`/redirect?status=success`,l7(),xq.clearAll()):s(L7.SyncStatus.Failure):(l7(),n.popTo(Q.MainBottomTabs,{screen:Q.DashboardTab,params:{screen:Q.Dashboard,params:{action:hvt.Deleted}}}))},[_.uuid,n]),C=(0,H.useCallback)(async()=>{l(L7.SyncStatus.Loading);let e=()=>{l(L7.SyncStatus.Success),l7(),n.replace(Q.LeavingRecommendation,{logbookEntry:lsn(_)})};Oq?await Kgn()?e():l(L7.SyncStatus.Failure):e()},[n,_]);return(0,W.jsx)(X0,{style:[Jgn.container,{backgroundColor:e.bgPrimary}],children:(0,W.jsx)(L7.RecommendationScreenWrapper,{deleteStatus:o,saveStatus:c,editStatus:u,bloodGlucoseUnit:f,injectionMethod:m,language:h,colorScheme:t,calculatorParams:p,closeCalculationViewInlogbook:b,closeCalculationFooter:C,closeCalculationTimeoutModal:x,transferEditedRecommendation:y,deleteCalculation:S,trackExpandDetails:()=>{u8(l8.RecommendationViewDetailsPress)},trackRecommendationTimeout:()=>{u8(l8.RecommendationExpired)}})})}var Jgn=R.create({container:{flex:1}}),Ygn=e=>[`foods`,`curated`,e],Xgn=e=>{let{data:t=[],isLoading:n,isError:r,refetch:i}=b0({queryKey:Ygn(e),queryFn:()=>zan(e),staleTime:1e3*60*5,networkMode:`offlineFirst`,retry:3});return{curatedFoods:t,isCuratedFoodsLoading:n,isCuratedFoodsError:r,refetchCuratedFoods:i}},Zgn=e=>[`foods`,`categories`,e],Y7=()=>{let{language:e}=Cq(),{data:t=[],isLoading:n,isError:r,refetch:i}=b0({queryKey:Zgn(e),queryFn:()=>Kan(e),staleTime:1e3*60*5,networkMode:`offlineFirst`,retry:3});return{foodCategories:t,isFoodCategoriesLoading:n,isFoodCategoriesError:r,refetchFoodCategories:i}},Qgn=()=>{let e=N$().getParent(Q.NewCalculationStack),t=(0,H.useCallback)(()=>{e?.goBack()},[e]);return{isInCalculationFlow:e!==void 0,dismissFoodLibrary:t}},X7=e=>{let t=N$(),{isInCalculationFlow:n,dismissFoodLibrary:r}=Qgn(),{addFoodIntakeItem:i}=L5(),{addExtraFoodItem:a}=c7();return{canAddToCalculation:n||!!e,addToCalculation:(0,H.useCallback)((o,s)=>{if(e){a({foodItem:o,amount:s}),n?r():t.popTo(Q.VisualSearch);return}i({foodItem:o,amount:s}),r()},[e,a,n,t,i,r])}},$gn={tabBarHeight:0,paddingBottomScreenWithTabBar:0},Z7=gq()(vq(e=>({...$gn,setTabBarHeight:t=>{e({tabBarHeight:t,paddingBottomScreenWithTabBar:t+24})},clear:()=>{e($gn)}}),{name:`DIMENSIONS_STORE`,storage:_q(Sq)}));V();function e_n({icon:e,message:t}){let{COLORS:n}=J();return(0,W.jsxs)(B,{style:t_n.container,children:[e,(0,W.jsx)(Z,{style:[t_n.message,{color:n.labelSecondary}],children:t})]})}var t_n=R.create({container:{flex:1,alignItems:`center`,justifyContent:`center`},message:{...Y.Poppins.regular_SM,marginTop:13,textAlign:`center`}}),Q7=(0,H.memo)(e_n),n_n=({item:e,expandable:t,isExpanded:n,onExpand:r,onPress:i,onAddToCalculation:a,testID:o})=>{let{t:s}=Tq(),[c,l]=(0,H.useState)(``),u=$5(e.source===`personal`?e.imageId:null);(0,H.useEffect)(()=>{n||l(``)},[n]);let d=(0,H.useMemo)(()=>C8(Number(c||0),e.measures[0].gramsPerUnit,e.nutritionPer100g.carbohydrates.value),[c,e]),f=(0,H.useCallback)(()=>{a(e,Number(c)||0)},[a,e,c]);return(0,W.jsx)(y9t,{onPress:i,title:e.title,carbsPer100:e.nutritionPer100g.carbohydrates.value,unit:e.measures[0].unit,carbs:d,expandable:t,isExpanded:n,amount:c,imageUri:u,onAddPress:r,onChangeAmount:l,testID:o,children:n&&(0,W.jsx)(U4,{title:s(`foodAmount_button_addToCalculation`),disabled:!c,onPress:f,style:{marginTop:10}})})};V();var r_n=()=>{let{COLORS:e,isDark:t}=J(),{t:n}=Tq(),r=N$(),{categoryId:i,subcategoryId:a,cameFromVisualSearch:o}=F$().params,{canAddToCalculation:s,addToCalculation:c}=X7(o),l=N5(s&&kq),{bottomWithScroll:u}=Q4(),{paddingBottomScreenWithTabBar:d}=Z7(),{foodCategories:f}=Y7(),p=f.find(e=>e.id===i),m=p?.subcategories.find(e=>e.id===a),{curatedFoods:h,isCuratedFoodsLoading:g}=Xgn(a||i),_=t?p?.color.dark:p?.color.light,v=(t?m?.color.dark:m?.color.light)||_;(0,H.useLayoutEffect)(()=>{r.setOptions({header:()=>(0,W.jsx)(F5,{title:m?.title||p?.title,LeftButton:(0,W.jsx)(H5,{}),color:v,skipTopInset:s&&kq,overlay:!0})})},[r,m,p,v,s]);let[y,b]=(0,H.useState)(null),x=(0,H.useCallback)(({item:e})=>(0,W.jsx)(n_n,{item:e,expandable:s,isExpanded:y===e.id,onExpand:()=>b(e.id),onPress:()=>{r.navigate(Q.CuratedFoodItem,{foodId:e.id,categoryId:a||i,cameFromVisualSearch:o})},onAddToCalculation:c,testID:`curated-food-item-${e.id}`}),[i,a,o,r,s,c,y]),S=(0,H.useCallback)(e=>(0,W.jsx)(Z2t,{...e,bottomOffset:16}),[]);return(0,W.jsxs)(B,{style:[$7.screen,{backgroundColor:e.bgPrimary}],children:[v&&(0,W.jsx)(z4.default,{colors:[v,c3(v,0)],style:$7.gradient,pointerEvents:`none`}),g?(0,W.jsx)(x2,{}):(0,W.jsx)(Wc,{style:$7.list,data:h,keyExtractor:e=>e.id,renderItem:x,contentContainerStyle:[$7.contentContainer,{paddingTop:l+8,paddingBottom:s?u:d}],scrollEventThrottle:16,keyboardShouldPersistTaps:`handled`,renderScrollComponent:S,ListEmptyComponent:(0,W.jsx)(Q7,{icon:(0,W.jsx)(t9t,{}),message:n(`food_empty_state_no_food`)})})]})},$7=R.create({screen:{flex:1},gradient:{position:`absolute`,top:0,left:0,right:0,height:`50%`},contentContainer:{gap:8,paddingHorizontal:16},list:{flex:1}}),i_n=[Q.CuratedFoodItem,Q.PersonalFoodItem],a_n=(e,t)=>{if(e.name!==t.name)return!1;let n=e.params,r=t.params;return n?.categoryId===r?.categoryId&&n?.subcategoryId===r?.subcategoryId},o_n=(e,t)=>{let n=e.routes.filter(e=>!i_n.includes(e.name)).map(e=>({name:e.name,params:e.params})),r=t[t.length-1],i=n.findIndex(e=>a_n(e,r));if(i>=0)return n.slice(0,i+1);let a=t.filter(e=>!n.some(t=>a_n(t,e)));return[...n,...a]},s_n=()=>{let e=N$();return(0,H.useCallback)(t=>{e.dispatch(e=>{let n=o_n(e,t);return x$({...e,routes:n,index:n.length-1})})},[e])};V(),F4();var c_n={ringSize:120,strokeWidth:10,gap:14},l_n={ringSize:36,strokeWidth:4.5,gap:6},u_n=({totalAmount:e=100,carbsValue:t,carbsUnit:n,size:r=`large`})=>{let{COLORS:i}=J(),{ringSize:a,strokeWidth:o,gap:s}=r===`large`?c_n:l_n,c=(a-o)/2,l=2*Math.PI*c,u=a/2,d=Math.min(Math.max(t/e,0),1),f=Math.round(t*10)/10,p=d?s:s/2,m=l*d,h=(m+p)/l*360;return(0,W.jsxs)(B,{style:[e9.ringContainer,{width:a,height:a}],children:[(0,W.jsxs)(E4,{width:a,height:a,style:e9.ringSvg,children:[(0,W.jsx)(x4,{cx:u,cy:u,r:c,transform:`rotate(${h}, ${u}, ${u})`,stroke:i.border,strokeWidth:o,fill:`none`,strokeDasharray:[Math.max(l-m-p*2,0),l],strokeLinecap:`round`}),d>0&&(0,W.jsx)(x4,{cx:u,cy:u,r:c,stroke:i.bgFoodCarbsRing,strokeWidth:o,fill:`none`,strokeDasharray:[m,l-m],strokeLinecap:`round`})]}),r===`large`&&(0,W.jsx)(B,{style:e9.ringCenter,children:(0,W.jsxs)(Z,{style:[e9.carbsNumber,{color:i.labelPrimary}],maxFontSizeMultiplier:C2.s0,children:[f,(0,W.jsx)(Z,{style:[e9.carbsUnit,{color:i.labelPrimary}],children:n})]})})]})},e9=R.create({ringContainer:{alignItems:`center`,justifyContent:`center`},ringSvg:{transform:[{rotate:`-90deg`}],position:`absolute`},ringCenter:{alignItems:`center`,justifyContent:`center`},carbsNumber:{...Y.Poppins.semiBold_4XL},carbsUnit:{...Y.Poppins.medium_Base}});V();var d_n=({title:e,color:t,iconUri:n,onPress:r})=>{let{COLORS:i}=J();return(0,W.jsxs)(Yf,{style:[f_n.pill,{borderColor:i.border,backgroundColor:t}],onPress:r,testID:`food-category-pill`,children:[!!n&&(0,W.jsx)(Zu,{source:{uri:n},style:f_n.icon}),(0,W.jsx)(Z,{style:[f_n.label,{color:i.textFoodCategoryPill}],children:e})]})},f_n=R.create({pill:{flexDirection:`row`,alignItems:`center`,paddingVertical:6,paddingHorizontal:12,borderRadius:32,borderWidth:1},icon:{width:20,height:20,marginRight:4},label:{...Y.Poppins.regular_XS}});V();var p_n=`444`,m_n=({amount:e,onChangeAmount:t,unit:n,carbs:r,autoFocus:i=!1,testID:a})=>{let{t:o}=Tq(),{COLORS:s}=J(),[c,l]=(0,H.useState)(!1),u=(0,H.useRef)(null),d=(0,H.useCallback)(()=>{c||u.current?.focus()},[c]);return(0,W.jsxs)(B,{style:t9.inputContainer,children:[(0,W.jsx)(Z,{style:[t9.amountLabel,{color:s.labelPrimary}],children:o(`foodAmountInputField_weight`)}),(0,W.jsxs)(wp,{accessible:!1,onPress:d,style:[t9.inputBox,{backgroundColor:s.bgVsInput,borderColor:c?s.borderInputFocus:s.border}],children:[n===`g`?(0,W.jsx)(_9t,{}):(0,W.jsx)(v9t,{}),(0,W.jsxs)(B,{style:t9.inputValue,children:[(0,W.jsxs)(B,{children:[(0,W.jsx)(Z,{"aria-hidden":!0,style:t9.inputSizer,children:p_n}),(0,W.jsx)(I4,{ref:u,value:e,onChangeText:t,onFocusChange:l,autoFocus:i,selectTextOnFocus:!0,style:[t9.input,{color:s.labelPrimary}],testID:`${a}-food-input`})]}),(0,W.jsx)(Z,{style:[t9.inputUnit,{color:s.labelSecondary}],children:n})]})]}),(0,W.jsx)(Z,{style:[t9.carbsResult,{color:s.labelSecondary}],children:`= ${e?r:`-`} ${o(`my_food_add_unit`)}`})]})},t9=R.create({inputContainer:{alignItems:`center`,gap:8},amountLabel:{...Y.Poppins.regular_Base,textAlign:`center`},inputBox:{alignSelf:`center`,flexDirection:`row`,alignItems:`center`,justifyContent:`center`,gap:10,paddingHorizontal:16,paddingVertical:12,borderRadius:16,borderWidth:1},inputValue:{flexDirection:`row`,alignItems:`center`,gap:3},inputSizer:{...Y.Poppins.medium_2XL,opacity:0},input:{position:`absolute`,top:0,bottom:0,left:0,right:0,...Y.Poppins.medium_2XL,lineHeight:z.select({ios:0,default:Y.Poppins.medium_2XL.lineHeight}),includeFontPadding:!1,textAlign:`right`,padding:0},inputUnit:{...Y.Poppins.regular_Base},carbsResult:{...Y.Poppins.regular_Base,textAlign:`center`}});V();var h_n=({amount:e,onChangeAmount:t,unit:n,carbs:r,onAdd:i,testID:a})=>{let{t:o}=Tq(),{COLORS:s}=J();return(0,W.jsxs)(B,{style:[g_n.container,{borderColor:s.border,backgroundColor:s.bgInputLayer}],children:[(0,W.jsx)(m_n,{amount:e,onChangeAmount:t,unit:n,carbs:r,autoFocus:!0,testID:a}),(0,W.jsx)(U4,{title:o(`foodAmount_button_addToCalculation`),onPress:i,disabled:!e,style:g_n.addButton})]})},g_n=R.create({container:{alignSelf:`stretch`,padding:16,gap:16,borderWidth:1,borderRadius:24},addButton:{alignSelf:`center`}});V();var __n=56,v_n=20,y_n=100,n9=(e,t)=>{if(!e)return`-`;let n=e.value*t/100;return`${Math.round(n*10)/10} ${e.unit}`},b_n=(e,t)=>{if(t)for(let n of e){if(n.id===t)return{...n,browseCategoryId:n.id};let e=n.subcategories.find(e=>e.id===t);if(e)return{...e,browseCategoryId:n.id}}},x_n=()=>{let{t:e}=Tq(),{params:t}=F$(),{COLORS:n,isDark:r}=J(),{bottomWithScroll:i,topInsideModal:a}=Q4(),o=N$(),{canAddToCalculation:s,addToCalculation:c}=X7(t.cameFromVisualSearch),l=s_n(),u=[r9.headerRow,{paddingTop:a}],d={paddingTop:a+__n+v_n,paddingBottom:i},{food:f,isFoodLoading:p,isFoodError:m}=hfn(t.foodId),{foodCategories:h}=Y7(),{foodIntakeItems:g}=L5(),[_,v]=(0,H.useState)(()=>{let e=g.find(e=>e.foodItem.id===t.foodId);return e?e.amount.toString():c7.getState().extraFoodItems.find(e=>e.foodItem.id===t.foodId)?.amount.toString()??null}),y=f?.source===`curated`?f:null;(0,H.useEffect)(()=>{y||p||m||o.goBack()},[y,p,m,o]);let b=(0,H.useMemo)(()=>y?C8(Number(_||0),y.measures[0].gramsPerUnit,y.nutritionPer100g.carbohydrates.value):0,[y,_]),x=b_n(h,t.categoryId??y?.categoryId),S=r?x?.color.dark:x?.color.light,C=(0,H.useMemo)(()=>{if(!x)return;let e={name:Q.FoodSubcategories,params:{categoryId:x.browseCategoryId}};return x.id===x.browseCategoryId?[e]:[e,{name:Q.CuratedFood,params:{categoryId:x.browseCategoryId,subcategoryId:x.id}}]},[x]),w=(0,H.useCallback)(()=>{C&&l(C)},[C,l]),T=(0,H.useCallback)(()=>{y&&c(y,Number(_)||0)},[y,_,c]),E=s&&Number(_)>0?Number(_):y_n,D=(0,H.useMemo)(()=>{if(!y)return[];let t=E*y.measures[0].gramsPerUnit;return[{id:`1`,title:e(`food_library_item_carbohydrates`),value:n9(y.nutritionPer100g.carbohydrates,t)},{id:`2`,title:e(`food_library_item_energy`),value:n9(y.nutritionPer100g.energy,t)},{id:`3`,title:e(`food_library_item_protein`),value:n9(y.nutritionPer100g.protein,t)},{id:`4`,title:e(`food_library_item_sugar`),value:n9(y.nutritionPer100g.sugar,t)},{id:`5`,title:e(`food_library_item_fibers`),value:n9(y.nutritionPer100g.fibers,t)},{id:`6`,title:e(`food_library_item_fat`),value:n9(y.nutritionPer100g.fat,t)},{id:`7`,title:e(`food_library_item_sfat`),value:n9(y.nutritionPer100g.saturatedFat,t)}]},[e,y,E]);return y?(0,W.jsxs)(B,{style:r9.screen,children:[!!S&&(0,W.jsx)(z4.default,{colors:[S,c3(S,0)],style:R.absoluteFill,pointerEvents:`none`}),(0,W.jsxs)(fs,{style:r9.scrollableContent,contentContainerStyle:d,keyboardDismissMode:`on-drag`,keyboardShouldPersistTaps:`handled`,children:[(0,W.jsxs)(B,{style:r9.topSection,children:[(0,W.jsx)(Z,{style:[r9.title,{color:n.labelPrimary}],numberOfLines:2,children:y.title}),s?(0,W.jsx)(h_n,{amount:_||``,onChangeAmount:v,unit:y.measures[0].unit,carbs:b,onAdd:T,testID:`curated-food-item-input`}):(0,W.jsxs)(B,{style:r9.carbsContainer,children:[(0,W.jsx)(u_n,{totalAmount:100,carbsValue:y.nutritionPer100g.carbohydrates.value,carbsUnit:y.nutritionPer100g.carbohydrates.unit}),(0,W.jsx)(Z,{style:[r9.carbsLabel,{color:n.labelPrimary}],children:`${Math.round(y.nutritionPer100g.carbohydrates.value*10)/10} carbs / 100${y.nutritionPer100g.carbohydrates.unit}`})]})]}),(0,W.jsxs)(B,{style:r9.section,children:[!!x&&(0,W.jsxs)(B,{style:r9.categorySection,children:[(0,W.jsx)(Z,{style:[r9.categorySectionTitle,{color:n.labelSecondary}],children:e(`food_library_info_category`)}),(0,W.jsx)(d_n,{title:x.title,color:S,iconUri:x.icon,onPress:w})]}),(0,W.jsx)(Z,{style:[r9.contentsTitle,{color:n.labelPrimary}],children:e(`food_library_carb_body`,{amount:E.toString(),unit:y.measures[0].unit})}),D.map(e=>(0,W.jsxs)(B,{style:[r9.contentsRow,{borderBottomColor:n.border}],children:[(0,W.jsx)(Z,{style:[r9.contentsText,{color:n.labelSecondary}],children:e.title}),(0,W.jsx)(Z,{style:[r9.contentsText,{color:n.labelSecondary}],children:e.value})]},e.id)),(0,W.jsx)(B,{style:[r9.contentsRow,{borderBottomColor:n.bgTransparent}],children:(0,W.jsx)(Z,{style:[r9.contentsText,{color:n.labelSecondary}],children:`${e(`food_library_source`)} ${y.provider.name}`})})]})]}),(0,W.jsx)(B,{style:u,children:(0,W.jsx)(U5,{})})]}):(0,W.jsxs)(B,{style:r9.screen,children:[!!S&&(0,W.jsx)(z4.default,{colors:[S,c3(S,0)],style:R.absoluteFill,pointerEvents:`none`}),(0,W.jsx)(B,{style:r9.topSection,children:(0,W.jsx)(B,{style:u,children:(0,W.jsx)(U5,{})})}),m?(0,W.jsx)(Q7,{icon:(0,W.jsx)(s9t,{}),message:e(`food_offline_state_default`)}):(0,W.jsx)(x2,{})]})},r9=R.create({screen:{flex:1},topSection:{alignItems:`center`,paddingHorizontal:16,marginBottom:32},headerRow:{position:`absolute`,top:0,left:0,right:0,flexDirection:`row`,justifyContent:`space-between`,paddingHorizontal:16,paddingBottom:10},title:{...Y.Poppins.medium_2XL,textAlign:`center`,marginBottom:32,paddingHorizontal:16},carbsContainer:{alignItems:`center`},carbsLabel:{...Y.Poppins.regular_Base,marginTop:12},scrollableContent:{flex:1},section:{paddingHorizontal:16},categorySection:{flexDirection:`row`,alignItems:`center`,marginBottom:45},categorySectionTitle:{...Y.Poppins.regular_SM,marginRight:7},contentsTitle:{...Y.Poppins.medium_Base,marginBottom:6},contentsRow:{flexDirection:`row`,justifyContent:`space-between`,paddingVertical:10,borderBottomWidth:1},contentsText:{...Y.Poppins.regular_Base}}),S_n=[`foods`,`recent`],C_n=e=>{let{data:t=[],isLoading:n,isError:r,refetch:i}=b0({queryKey:S_n,queryFn:Ban,enabled:e,networkMode:`offlineFirst`,retry:3});return{recentFoods:t,isRecentFoodsLoading:n,isRecentFoodsError:r,refetchRecentFoods:i}};V();var w_n=({onPress:e,title:t,description:n,imageUrl:r,color:i})=>{let{COLORS:a}=J();return(0,W.jsxs)(Yf,{style:[i9.row,{backgroundColor:a.bgSecondary,borderColor:a.buttonBorder}],onPress:e,children:[(0,W.jsx)(B,{style:[i9.imageContainer,{backgroundColor:i}],children:(0,W.jsx)(Zu,{source:{uri:r},style:i9.categoryImage,resizeMode:`contain`})}),(0,W.jsxs)(B,{style:i9.textContainer,children:[(0,W.jsx)(Z,{style:[i9.title,{color:a.labelPrimary}],numberOfLines:1,ellipsizeMode:`tail`,children:t}),!!n&&(0,W.jsx)(Z,{style:[i9.description,{color:a.labelSecondary}],numberOfLines:2,ellipsizeMode:`tail`,children:n})]}),(0,W.jsx)(K4,{width:18,height:18,color:a.labelTertiary})]})},i9=R.create({row:{flexDirection:`row`,alignItems:`center`,borderRadius:16,borderWidth:1,paddingRight:12,paddingVertical:4,paddingLeft:4},imageContainer:{width:80,height:80,borderRadius:12,overflow:`hidden`,alignItems:`center`,justifyContent:`center`,flexShrink:0},categoryImage:{width:68,height:68},textContainer:{flex:1,paddingHorizontal:12,justifyContent:`center`},title:{...Y.Poppins.medium_Base},description:{...Y.Poppins.regular_SM,marginTop:2}});V();var T_n=Oq?{outlineStyle:`none`}:{},E_n=({isSearchActive:e,onSearch:t,onClear:n,onFocus:r,onBlur:i})=>{let{t:a}=Tq(),{COLORS:o}=J(),s=(0,H.useRef)(null),[c,l]=(0,H.useState)(``),u=U3t(t,300),d=(0,H.useCallback)(()=>{u.cancel(),l(``),s.current?.blur(),n()},[u,n]),f=(0,H.useCallback)(()=>{c.length>2&&(u.cancel(),t(c))},[u,t,c]),p=(0,H.useCallback)(e=>{if(l(e),e.length>2){u(e);return}u.cancel(),t(e)},[u,t]),m=(0,H.useCallback)(()=>{s.current?.focus()},[]);return(0,W.jsxs)(wp,{style:[D_n.container,{backgroundColor:o.bgInputActive,borderColor:o.buttonBorder}],onPress:m,accessible:!1,children:[(0,W.jsx)(u9t,{height:24,width:24}),(0,W.jsx)(Lp,{ref:s,testID:`food-searchbar-input`,autoCapitalize:`none`,placeholder:a(`food_search_title`),placeholderTextColor:o.labelSecondary,cursorColor:o.textSearchText,maxFontSizeMultiplier:C2.s3,style:[D_n.searchInput,{color:o.textSearchText}],multiline:!1,maxLength:64,value:c,onChangeText:p,onSubmitEditing:f,onFocus:r,onBlur:i,autoCorrect:!1,enterKeyHint:`search`}),(e||c.length>0)&&(0,W.jsx)(wp,{testID:`food-searchbar-clear`,onPress:d,hitSlop:10,children:(0,W.jsx)(Z7t,{color:o.labelSecondary,width:16,height:16})})]})},D_n=R.create({container:{flex:1,flexDirection:`row`,alignItems:`center`,height:48,borderRadius:16,borderWidth:1,paddingLeft:16,paddingRight:12,gap:4},searchInput:{...Y.Poppins.regular_Base,lineHeight:z.select({ios:0,default:Y.Poppins.regular_Base.lineHeight}),flex:1,includeFontPadding:!1,...T_n}});V();function O_n({showScanButton:e,isSearchActive:t,onSearch:n,onClearSearch:r,onSearchFocus:i,onSearchBlur:a,onScanFoodPress:o}){return(0,W.jsxs)(B,{style:k_n.row,children:[(0,W.jsx)(E_n,{isSearchActive:t,onSearch:n,onClear:r,onFocus:i,onBlur:a}),e&&!Oq&&(0,W.jsx)(aen,{onPress:o,style:{width:48,height:48}})]})}var k_n=R.create({row:{flexDirection:`row`,alignItems:`center`,gap:10,paddingVertical:12}}),A_n=(0,H.memo)(O_n),j_n=`/assets/webp/heart.webp`;V();var M_n=({onPress:e})=>{let{COLORS:t}=J(),{t:n}=Tq();return(0,W.jsxs)(Yf,{style:[a9.container,{backgroundColor:t.bgSecondary,borderColor:t.buttonBorder}],onPress:e,children:[(0,W.jsx)(B,{style:[a9.imageContainer,{backgroundColor:t.bgMyFoodCategory}],children:(0,W.jsx)(Zu,{source:j_n,style:a9.heartImage})}),(0,W.jsx)(Z,{style:[a9.title,{color:t.labelPrimary}],numberOfLines:1,children:n(`food_segment_button_my_food`)}),(0,W.jsx)(K4,{width:18,height:18,color:t.labelTertiary})]})},a9=R.create({container:{flexDirection:`row`,alignItems:`center`,borderRadius:16,borderWidth:1,paddingLeft:4,paddingRight:12,paddingVertical:4,gap:12},imageContainer:{width:80,height:52,borderRadius:12,alignItems:`center`,justifyContent:`center`,flexShrink:0},heartImage:{width:52,height:52},title:{...Y.Poppins.medium_Base,flex:1}});V();var N_n=e=>`measures`in e,P_n=()=>Tf.dismiss(),F_n=()=>{let{t:e}=Tq(),{COLORS:t,isDark:n}=J(),{paddingBottomScreenWithTabBar:r}=Z7(),{bottomWithScroll:i}=Q4(),a=N$(),o=F$(),{isInCalculationFlow:s}=Qgn(),{canAddToCalculation:c,addToCalculation:l}=X7(o.params?.cameFromVisualSearch),u=N5(c&&kq),[d,f]=(0,H.useState)(``),[p,m]=(0,H.useState)(!1),[h,g]=(0,H.useState)(null),_=!s&&!o.params?.cameFromVisualSearch,v=d.length>2,y=`categories`;p&&v?y=`searchResults`:p&&(y=`recentFoods`);let{foodCategories:b,isFoodCategoriesError:x}=Y7(),{recentFoods:S,isRecentFoodsLoading:C,isRecentFoodsError:w}=C_n(y===`recentFoods`),{foodSearchResults:T,isFoodSearchLoading:E,isFoodSearchError:D}=_fn(d);(0,H.useLayoutEffect)(()=>{a.setOptions({headerTransparent:!0,header:()=>(0,W.jsx)(F5,{title:e(`food_library_sheet_navigation`),LeftButton:c?(0,W.jsx)(U5,{}):void 0,color:t.bgPrimary,skipTopInset:c&&kq,overlay:!0})})},[a,e,c,t]);let O=(0,H.useCallback)(()=>{m(!0)},[]),k=(0,H.useCallback)(()=>{f(``),g(null),m(!1)},[]),A=(0,H.useCallback)(()=>{if(u8(l8.FoodLibraryScanFoodPress),!c7.getState().privacyNoticeAccepted){a.navigate(Q.VisualSearchIntro);return}a.navigate(Q.VisualSearch)},[a]),ee=(0,H.useCallback)(()=>{a.navigate(Q.PersonalFood,{cameFromVisualSearch:o.params?.cameFromVisualSearch})},[a,o.params]),te=(0,H.useCallback)(({item:e})=>{if(N_n(e))return(0,W.jsx)(n_n,{item:e,expandable:c,isExpanded:h===e.id,onExpand:()=>g(e.id),onPress:()=>{e.source===`curated`?a.navigate(Q.CuratedFoodItem,{foodId:e.id,categoryId:e.categoryId,cameFromVisualSearch:o.params?.cameFromVisualSearch}):a.navigate(Q.PersonalFoodItem,{foodId:e.id,cameFromVisualSearch:o.params?.cameFromVisualSearch})},onAddToCalculation:l,testID:`food-search-item-${e.id}`});let t=()=>{a.navigate(Q.FoodSubcategories,{categoryId:e.id,cameFromVisualSearch:o.params?.cameFromVisualSearch})},r=e.color.light;return n&&(r=e.color.dark),(0,W.jsx)(w_n,{onPress:t,title:e.title,description:e.description,imageUrl:e.icon,color:r})},[c,a,o.params,l,h,n]),ne=T;y===`categories`?ne=b:y===`recentFoods`&&(ne=S);let re=(0,H.useMemo)(()=>{let t=(0,W.jsx)(Q7,{icon:(0,W.jsx)(s9t,{}),message:e(`food_offline_state_default`)});return y===`categories`?x?t:null:y===`recentFoods`?w?t:C?(0,W.jsx)(x2,{}):null:D?t:E?(0,W.jsx)(x2,{}):(0,W.jsx)(Q7,{icon:(0,W.jsx)(t9t,{}),message:e(`food_empty_state_no_food`)})},[y,x,w,C,D,E,e]),ie=(0,H.useCallback)(e=>(0,W.jsx)(Z2t,{...e,bottomOffset:16}),[]),j=(0,H.useMemo)(()=>[o9.contentContainer,{paddingTop:u,paddingBottom:c?i:r}],[u,c,i,r]),ae=(0,W.jsxs)(B,{style:o9.listHeader,children:[(0,W.jsx)(A_n,{showScanButton:_,isSearchActive:p,onSearch:f,onClearSearch:k,onSearchFocus:O,onScanFoodPress:A}),y===`categories`&&(0,W.jsx)(M_n,{onPress:ee}),y===`recentFoods`&&S.length>0&&(0,W.jsxs)(B,{style:o9.recentTitleRow,children:[(0,W.jsx)(l9t,{width:16,height:16}),(0,W.jsx)(Z,{style:[o9.recentTitle,{color:t.labelPrimary}],children:e(`food_library_frequent_title`)})]})]});return(0,W.jsxs)(B,{style:[o9.screen,{backgroundColor:t.bgPrimary}],children:[(0,W.jsx)(z4.default,{colors:[t.bgPrimary,c3(t.bgPrimary,0)],style:o9.gradient,pointerEvents:`none`}),(0,W.jsx)(Wc,{style:o9.list,data:ne,keyExtractor:e=>e.id,renderItem:te,ListHeaderComponent:ae,ListEmptyComponent:re,contentContainerStyle:j,keyboardDismissMode:Oq?`none`:`on-drag`,keyboardShouldPersistTaps:`handled`,onScroll:Oq?P_n:void 0,renderScrollComponent:ie,scrollEventThrottle:16})]})},o9=R.create({screen:{flex:1},gradient:{position:`absolute`,top:0,left:0,right:0,height:`50%`},contentContainer:{gap:8,flexGrow:1,paddingHorizontal:16},listHeader:{gap:8},recentTitleRow:{flexDirection:`row`,alignItems:`center`,gap:8},recentTitle:{...Y.Poppins.medium_SM},list:{flex:1}});V();var I_n=()=>{let e=F$(),t=N$(),{categoryId:n,cameFromVisualSearch:r}=e.params,{canAddToCalculation:i}=X7(r),{COLORS:a,isDark:o}=J(),{bottomWithScroll:s}=Q4(),{paddingBottomScreenWithTabBar:c}=Z7(),l=N5(i&&kq),{foodCategories:u}=Y7(),d=u.find(e=>e.id===n),f=o?d?.color.dark:d?.color.light;(0,H.useLayoutEffect)(()=>{t.setOptions({header:()=>(0,W.jsx)(F5,{title:d?.title,LeftButton:(0,W.jsx)(H5,{}),color:f,skipTopInset:i&&kq,overlay:!0})})},[t,d,f,i]);let p=(0,H.useCallback)((e,n)=>{t.navigate(Q.CuratedFood,{categoryId:n,subcategoryId:e,cameFromVisualSearch:r})},[t,r]),m=(0,H.useCallback)(({item:e})=>(0,W.jsx)(w_n,{onPress:()=>p(e.id,d?.id),title:e.title,imageUrl:e.icon,color:f??a.bgPrimary}),[a,d,f,p]);return(0,W.jsxs)(B,{style:[s9.screen,{backgroundColor:a.bgPrimary}],children:[f&&(0,W.jsx)(z4.default,{colors:[f,c3(f,0)],style:s9.gradient,pointerEvents:`none`}),(0,W.jsx)(Wc,{data:d?.subcategories??[],keyExtractor:e=>e.id,renderItem:m,style:s9.list,contentContainerStyle:[s9.contentContainer,{paddingTop:l+8,paddingBottom:i?s:c}],scrollEventThrottle:16})]})},s9=R.create({screen:{flex:1},list:{flex:1},gradient:{position:`absolute`,top:0,left:0,right:0,height:`50%`},contentContainer:{gap:8,paddingHorizontal:16,flexGrow:1}});V();var L_n=()=>{let{COLORS:e}=J(),{t}=Tq(),n=N$(),{params:r}=F$(),{canAddToCalculation:i,addToCalculation:a}=X7(r?.cameFromVisualSearch),o=N5(i&&kq),{bottomWithScroll:s}=Q4(),{paddingBottomScreenWithTabBar:c}=Z7(),{personalFoods:l,isPersonalFoodsLoading:u}=ffn(),d=l.length===0;(0,H.useLayoutEffect)(()=>{n.setOptions({header:()=>(0,W.jsx)(F5,{title:t(`food_myFood_title`),LeftButton:(0,W.jsx)(H5,{}),color:e.bgMyFoodCategory,skipTopInset:i&&kq,overlay:!0})})},[n,e,i,t]);let f=(0,H.useCallback)(()=>{n.navigate(Q.CreateFood)},[n]),[p,m]=(0,H.useState)(null),h=(0,H.useCallback)(({item:e})=>(0,W.jsx)(n_n,{item:e,expandable:i,isExpanded:p===e.id,onExpand:()=>m(e.id),onPress:()=>{n.navigate(Q.PersonalFoodItem,{foodId:e.id,cameFromVisualSearch:r?.cameFromVisualSearch})},onAddToCalculation:a,testID:`personal-food-item-${e.id}`}),[i,n,r?.cameFromVisualSearch,a,p]),g=(0,H.useCallback)(e=>(0,W.jsx)(Z2t,{...e,bottomOffset:16}),[]);return(0,W.jsxs)(B,{style:[c9.screen,{backgroundColor:e.bgPrimary}],children:[(0,W.jsx)(z4.default,{colors:[e.bgMyFoodCategory,c3(e.bgMyFoodCategory,0)],style:c9.gradient,pointerEvents:`none`}),u?(0,W.jsx)(x2,{}):(0,W.jsx)(Wc,{data:l,keyExtractor:e=>e.id,renderItem:h,style:c9.list,contentContainerStyle:[c9.contentContainer,d?{justifyContent:`center`,paddingTop:o+8,paddingBottom:i?o+8:c}:{paddingTop:o+8,paddingBottom:i?s:c}],scrollEventThrottle:16,keyboardShouldPersistTaps:`handled`,renderScrollComponent:g,ListEmptyComponent:(0,W.jsx)(B,{children:(0,W.jsx)(Q7,{icon:(0,W.jsx)(t9t,{}),message:t(`food_myFood_empty_state_default`)})}),ListFooterComponent:(0,W.jsx)(U4,{title:t(`food_button_createFood`),onPress:f,type:H4.Secondary})})]})},c9=R.create({screen:{flex:1},gradient:{position:`absolute`,top:0,left:0,right:0,height:`50%`},list:{flex:1},contentContainer:{flexGrow:1,gap:8,paddingHorizontal:16}});V();var R_n=()=>{let{t:e}=Tq(),t=N$(),{params:n}=F$(),{COLORS:r}=J(),{topInsideModal:i}=Q4(),{canAddToCalculation:a,addToCalculation:o}=X7(n.cameFromVisualSearch),s=s_n(),c=(0,H.useCallback)(()=>{s([{name:Q.PersonalFood}])},[s]),l=[l9.headerRow,{paddingTop:i}],{foodIntakeItems:u}=L5(),{food:d,isFoodLoading:f,isFoodError:p}=hfn(n.foodId),[m,h]=(0,H.useState)(()=>{let e=u.find(e=>e.foodItem.id===n.foodId);return e?e.amount.toString():c7.getState().extraFoodItems.find(e=>e.foodItem.id===n.foodId)?.amount.toString()??null}),g=d?.source===`personal`?d:null,_=$5(g?g.imageId:null);(0,H.useEffect)(()=>{g||f||p||t.goBack()},[g,f,p,t]);let v=(0,H.useCallback)(()=>{g&&t.navigate(Q.CreateFood,{personalFoodId:g.id})},[t,g]),y=(0,H.useMemo)(()=>g?C8(Number(m||0),g.measures[0].gramsPerUnit,g.nutritionPer100g.carbohydrates.value):0,[g,m]),b=(0,H.useCallback)(()=>{g&&o(g,Number(m)||0)},[g,m,o]);if(!g)return(0,W.jsxs)(B,{style:l9.screen,children:[(0,W.jsxs)(B,{style:l9.gradient,children:[(0,W.jsx)(z4.default,{colors:[r.bgMyFoodCategory,c3(r.bgMyFoodCategory,0)],style:R.absoluteFill,pointerEvents:`none`}),(0,W.jsx)(B,{style:l,children:(0,W.jsx)(U5,{})})]}),p?(0,W.jsx)(Q7,{icon:(0,W.jsx)(s9t,{}),message:e(`food_offline_state_default`)}):(0,W.jsx)(x2,{})]});let x=`${Math.round(g.nutritionPer100g.carbohydrates.value*10)/10} carbs / 100${g.nutritionPer100g.carbohydrates.unit}`;return(0,W.jsxs)(B,{style:l9.screen,children:[(0,W.jsxs)(B,{style:l9.gradient,children:[(0,W.jsx)(z4.default,{colors:[r.bgMyFoodCategory,c3(r.bgMyFoodCategory,0)],style:R.absoluteFill,pointerEvents:`none`}),(0,W.jsxs)(B,{style:l,children:[(0,W.jsx)(U5,{}),(0,W.jsx)(sfn,{onPress:v})]}),(0,W.jsx)(Z,{style:[l9.title,a&&l9.titleInCalculation,{color:r.labelPrimary}],numberOfLines:2,children:g.title}),a?(0,W.jsx)(B,{style:l9.inputCardSection,children:(0,W.jsx)(h_n,{amount:m||``,onChangeAmount:h,unit:g.measures[0].unit,carbs:y,onAdd:b,testID:`personal-food-item-input`})}):(0,W.jsxs)(B,{style:l9.carbsContainer,children:[(0,W.jsx)(u_n,{totalAmount:100,carbsValue:g.nutritionPer100g.carbohydrates.value,carbsUnit:g.nutritionPer100g.carbohydrates.unit}),(0,W.jsx)(Z,{style:[l9.carbsLabel,{color:r.labelPrimary}],children:x})]})]}),(0,W.jsxs)(B,{style:l9.section,children:[(0,W.jsxs)(B,{style:l9.categoryRow,children:[(0,W.jsx)(Z,{style:[l9.categorySectionTitle,{color:r.labelSecondary}],children:e(`food_library_info_category`)}),(0,W.jsx)(d_n,{title:e(`food_segment_button_my_food`),color:r.bgMyFoodCategory,onPress:c})]}),(0,W.jsx)(B,{style:[l9.divider,{backgroundColor:r.border}]}),a&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(B,{style:l9.carbsInfoRow,children:[(0,W.jsx)(Z,{style:[l9.carbsInfoLabel,{color:r.labelPrimary}],children:x}),(0,W.jsx)(u_n,{size:`small`,totalAmount:100,carbsValue:g.nutritionPer100g.carbohydrates.value,carbsUnit:g.nutritionPer100g.carbohydrates.unit})]}),(0,W.jsx)(B,{style:[l9.divider,{backgroundColor:r.border}]})]}),(!!g.description||!!_)&&(0,W.jsxs)(B,{style:l9.notesRow,children:[!!g.description&&(0,W.jsx)(Z,{style:[l9.description,{color:r.labelSecondary}],children:g.description}),!!_&&(0,W.jsx)(Zu,{source:{uri:_},style:l9.foodImage,resizeMode:`cover`})]})]})]})},l9=R.create({screen:{flex:1},gradient:{alignItems:`center`},headerRow:{flexDirection:`row`,justifyContent:`space-between`,alignSelf:`stretch`,paddingHorizontal:16,paddingBottom:10,marginBottom:20},title:{...Y.Poppins.medium_2XL,textAlign:`center`,marginBottom:32,paddingHorizontal:16},titleInCalculation:{marginBottom:22},inputCardSection:{alignSelf:`stretch`,paddingHorizontal:16},carbsContainer:{alignItems:`center`},carbsLabel:{...Y.Poppins.regular_Base,marginTop:12},notesRow:{flexDirection:`row`,alignItems:`center`,paddingHorizontal:16,gap:8},description:{...Y.Poppins.regular_SM,flex:1},foodImage:{width:64,height:64,borderRadius:8},section:{paddingHorizontal:16,marginTop:32,gap:16},categoryRow:{flexDirection:`row`,alignItems:`center`,paddingHorizontal:16},categorySectionTitle:{...Y.Poppins.regular_SM,marginRight:7},divider:{height:1},carbsInfoRow:{flexDirection:`row`,alignItems:`center`,justifyContent:`space-between`,paddingHorizontal:16},carbsInfoLabel:{...Y.Poppins.regular_Base,flex:1}}),{Group:z_n,Navigator:B_n,Screen:u9}=j5();function V_n(){return(0,W.jsxs)(B_n,{screenOptions:{...K5,header:()=>null,...$8},children:[(0,W.jsx)(u9,{name:Q.FoodAndDrink,component:F_n}),(0,W.jsx)(u9,{name:Q.FoodSubcategories,component:I_n,options:{headerTransparent:!0}}),(0,W.jsx)(u9,{name:Q.PersonalFood,component:L_n,options:{headerTransparent:!0}}),(0,W.jsx)(u9,{name:Q.CuratedFood,component:r_n,options:{headerTransparent:!0}}),(0,W.jsxs)(z_n,{screenOptions:{...Jsn,headerShown:!1,gestureEnabled:!1},children:[(0,W.jsx)(u9,{name:Q.PersonalFoodItem,component:R_n}),(0,W.jsx)(u9,{name:Q.CuratedFoodItem,component:x_n})]})]})}var{Navigator:H_n,Screen:d9}=j5();function U_n(){let{COLORS:e}=J();return(0,W.jsxs)(H_n,{id:`NewCalculationStack`,screenOptions:{headerShown:!1,...$8},children:[(0,W.jsx)(d9,{name:Q.Calculation,component:Fmn,options:{headerShown:!0,cardStyle:{flex:1}}}),(0,W.jsx)(d9,{name:Q.LoadingRecommendation,component:Wgn}),(0,W.jsx)(d9,{name:Q.Recommendation,component:qgn,options:{...K5,headerStyle:{backgroundColor:e.bgSheet},headerShown:!1}}),(0,W.jsx)(d9,{name:Q.LeavingRecommendation,component:Lmn}),(0,W.jsx)(d9,{name:Q.FoodLibrary,component:V_n,options:{...lfn,...ncn,headerShown:!1,gestureEnabled:!1}})]})}var W_n=X.Milliseconds.Minute*20,G_n=()=>{let{pinCode:e,settingsUnlockedTimestamp:t,setSettingsUnlockedTimestamp:n}=E3(),r=(0,H.useMemo)(()=>t===null||Date.now()-t>W_n,[t]);V$((0,H.useCallback)(()=>{if(t===null)return;let e=W_n-(Date.now()-t);if(e<=0)return;let r=setTimeout(()=>n(null),e);return()=>clearTimeout(r)},[t,n]));let i=(0,H.useCallback)(()=>{n(Date.now())},[n]),a=(0,H.useCallback)(()=>{n(null)},[n]);return{areSettingsLocked:r,isPINSet:!!e,unlockSettings:i,lockSettings:a}};V();var K_n=()=>{let{t:e}=Tq(),{COLORS:t}=J();return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Z,{style:[f9.header,f9.firstHeaderSpacing],testID:`activity-info-title`,children:e(`physical_activity_modal_activity_insulin_title`)}),(0,W.jsx)(Z,{style:[{color:t.labelSecondary},f9.spacing],children:e(`physical_activity_modal_activity_insulin_body`)}),(0,W.jsx)(Z,{style:f9.header,children:e(`physical_activity_modal_adjust_insulin_title`)}),(0,W.jsx)(Z,{style:[{color:t.labelSecondary},f9.spacing],children:e(`physical_activity_modal_adjust_insulin_body`)})]})},f9=R.create({header:{...Y.Poppins.semiBold_2XL,marginBottom:8},firstHeaderSpacing:{marginTop:32},spacing:{marginBottom:32}});V();var p9=({text:e,learnMoreText:t,learnMoreOnPress:n})=>{let{t:r}=Tq(),{COLORS:i}=J();return(0,W.jsxs)(B,{style:[m9.card,{backgroundColor:i.bgSecondary}],children:[(0,W.jsx)(g9t,{}),(0,W.jsxs)(B,{style:m9.rightContainer,children:[(0,W.jsx)(Z,{style:[m9.contactText,{color:i.labelPrimary}],children:e??r(`warning_HCP`)}),t!==void 0&&n!==void 0&&(0,W.jsx)(Yf,{onPress:n,style:m9.learnMoreContainer,children:(0,W.jsx)(Z,{style:[m9.learnMoreText,{color:i.textLink}],children:t})})]})]})},m9=R.create({card:{borderRadius:16,paddingHorizontal:16,paddingVertical:12,flexDirection:`row`,gap:8},rightContainer:{flex:1,gap:8},learnMoreContainer:{flexDirection:`row`,alignItems:`center`,gap:4},contactText:{flexShrink:1,...Y.Poppins.medium_SM},learnMoreText:{flexShrink:1,...Y.Poppins.semiBold_SM}});V();var h9=4,q_n=({onFinish:e,ref:t})=>{let{COLORS:n}=J(),r=(0,H.useRef)(Array.from({length:h9},()=>H.createRef())),[i,a]=(0,H.useState)(()=>Array.from({length:h9},()=>``)),[o,s]=(0,H.useState)(0),[c,l]=(0,H.useState)(null);(0,H.useImperativeHandle)(t,()=>({resetDigits(){a(Array.from({length:h9},()=>``)),s(0),l(null),r.current[0].current?.focus()},displayError(e){l(e)}}),[r]);let u=(0,H.useCallback)((e,t)=>{let n=e.replace(/[^0-9]/g,``),o=[...i];o[t]=n,a(o),l(null),n&&t<r.current.length-1&&r.current[t+1].current?.focus(),!e&&t!==0&&r.current[t-1].current?.focus()},[i,r]),d=(0,H.useCallback)(e=>{i[e]===``&&e!==0&&r.current[e-1].current?.focus()},[i,r]);return(0,H.useEffect)(()=>{let t=i.join(``);t.length===h9&&e(t)},[i,e]),(0,W.jsxs)(B,{children:[(0,W.jsx)(B,{style:J_n.inputContainer,children:r.current.map((e,t)=>(0,W.jsx)(Lp,{ref:e,testID:`pin-digit-${t}`,value:i[t],autoFocus:t===0&&kq,keyboardType:`number-pad`,maxLength:1,onChangeText:e=>u(e,t),onKeyPress:e=>{e.nativeEvent.key===`Backspace`&&d(t)},onFocus:()=>s(t),onBlur:()=>s(null),style:[J_n.input,{borderColor:c===null?o===t?n.borderActivationCodeFocus:n.borderActivationCode:n.borderActivationCodeDanger,backgroundColor:n.bgTertiary,color:n.labelPrimary}]},t))}),c!==null&&(0,W.jsx)(Z,{style:[J_n.error,{color:n.textDanger}],children:c})]})},J_n=R.create({inputContainer:{flexDirection:`row`,gap:8,justifyContent:`center`},input:{...Y.Poppins.medium_2XL,lineHeight:z.select({ios:0,default:Y.Poppins.regular_Base.lineHeight}),width:49,height:55,borderRadius:8,padding:0,textAlign:`center`,textAlignVertical:`center`,borderWidth:2},error:{...Y.Poppins.regular_SM,textAlign:`center`,marginTop:8}});V();var Y_n=()=>(0,W.jsx)(B,{style:X_n.animationContainer,children:(0,W.jsx)(g2,{autoPlay:!0,source:_2.LEAVING_RECOMMENDATION,style:X_n.animation,loop:!0})}),X_n=R.create({animationContainer:{justifyContent:`center`,alignItems:`center`},animation:{width:75,height:75}});V(),YQ();var Z_n=1600,Q_n=({isVisible:e,onClose:t,onForgotPIN:n,onModalHide:r,onModalHideWithSuccess:i})=>{let{COLORS:a}=J(),{t:o}=(0,Z_t.useTranslation)(),{pinCode:s}=E3(),[c,l]=(0,H.useState)(`enter_pin`),[u,d]=H.useState(!1),f=(0,H.useRef)(null),p=(0,H.useRef)(null),{height:m}=N2t(),h=fQ(!1),g=fQ(0),_=mQ(()=>({paddingBottom:h.value?g.value:-m.value}));(0,H.useEffect)(()=>{e&&(h.value=!1)},[e,h]),(0,H.useEffect)(()=>(p.current&&=(clearTimeout(p.current),null),c===`success`&&(p.current=setTimeout(()=>{d(!0)},Z_n)),()=>{p.current&&=(clearTimeout(p.current),null)}),[c]);let v=(0,H.useCallback)(()=>{g.value=-m.value,h.value=!0,Tf.dismiss(),t()},[t,h,g,m]),y=(0,H.useCallback)(()=>{l(`enter_pin`),d(!1),c===`success`?i():r?.()},[i,r,c]);(0,H.useEffect)(()=>{c===`success`&&u&&v()},[u,c,v]);let b=(0,H.useCallback)(e=>{c===`enter_pin`&&(e===s?l(`success`):f.current?.displayError(o(`pin_modal_error_invalid`)))},[c,s,o]),x=(0,H.useCallback)(()=>{g.value=-m.value,h.value=!0,Tf.dismiss(),n()},[n,h,g,m]);return(0,W.jsxs)(u3,{testID:`validate_pin_code_modal`,isVisible:e,onModalHide:y,onModalShow:()=>f.current?.resetDigits(),containerStyle:{backgroundColor:a.bgSheet},children:[(0,W.jsx)(B,{style:$_n.header,children:(0,W.jsx)(U5,{onPress:v})}),(0,W.jsx)(Z,{style:$_n.title,children:o(`pin_modal_header_enter`)}),(0,W.jsxs)(JQ.View,{style:[$_n.content,_],children:[c===`success`?(0,W.jsx)(Y_n,{}):(0,W.jsx)(q_n,{onFinish:b,ref:f}),(0,W.jsx)(U4,{title:o(`pin_modal_button_forgot`),onPress:x,type:H4.Plain})]})]})},$_n=R.create({title:{...Y.Poppins.bold_2XL,marginBottom:6,textAlign:`center`},header:{alignItems:`flex-start`,paddingTop:16,marginBottom:10},content:{paddingTop:10}});V(),YQ();var evn=1600,tvn=({isVisible:e,onClose:t,onModalHideWithSuccess:n})=>{let{COLORS:r}=J(),{t:i}=Tq(),[a,o]=(0,H.useState)(`enter_pin`),[s,c]=(0,H.useState)(``),[l,u]=H.useState(!1),d=(0,H.useRef)(null),f=(0,H.useRef)(null),{height:p}=N2t(),m=fQ(!1),h=fQ(0),g=mQ(()=>({paddingBottom:m.value?h.value:-p.value}));(0,H.useEffect)(()=>{e&&(m.value=!1)},[e,m]),(0,H.useEffect)(()=>(f.current&&=(clearTimeout(f.current),null),a===`success`&&(f.current=setTimeout(()=>{u(!0)},evn)),()=>{f.current&&=(clearTimeout(f.current),null)}),[a]);let _=(0,H.useCallback)(()=>{h.value=-p.value,m.value=!0,Tf.dismiss(),t()},[t,m,h,p]),v=(0,H.useCallback)(()=>{o(`enter_pin`),u(!1),a===`success`&&n(s)},[n,s,a]);(0,H.useEffect)(()=>{a===`success`&&l&&_()},[l,a,_]);let y=(0,H.useCallback)(e=>{a===`enter_pin`?(c(e),d.current?.resetDigits(),o(`repeat_pin`)):a===`repeat_pin`&&(e===s?o(`success`):d.current?.displayError(i(`pin_modal_error_noMatch`)))},[a,s,i]);return(0,W.jsxs)(u3,{testID:`pin_code_modal`,isVisible:e,onModalHide:v,onModalShow:()=>d.current?.resetDigits(),containerStyle:{backgroundColor:r.bgSheet},children:[(0,W.jsx)(B,{style:g9.header,children:(0,W.jsx)(U5,{onPress:_})}),(0,W.jsx)(Z,{style:g9.title,children:i(a===`enter_pin`?`pin_modal_header_enter`:`pin_modal_header_repeat`)}),(0,W.jsxs)(JQ.View,{style:[g9.content,g],children:[a===`success`&&(0,W.jsx)(B,{style:g9.animationContainer,children:(0,W.jsx)(g2,{autoPlay:!0,source:_2.LEAVING_RECOMMENDATION,style:g9.animation,loop:!0})}),a!==`success`&&(0,W.jsx)(q_n,{onFinish:y,ref:d})]})]})},g9=R.create({title:{...Y.Poppins.bold_2XL,marginBottom:6,textAlign:`center`},header:{alignItems:`flex-start`,paddingTop:16,marginBottom:10},content:{paddingTop:10},animationContainer:{justifyContent:`center`,alignItems:`center`},animation:{width:75,height:75}}),nvn=()=>{let{setPINCode:e,isElevatedAuthConfirmed:t,setIsElevatedAuthConfirmed:n}=E3(),[r,i]=(0,H.useState)(!1);return V$((0,H.useCallback)(()=>{t&&(n(!1),i(!0))},[t,n])),(0,W.jsx)(tvn,{isVisible:r,onClose:()=>i(!1),onModalHideWithSuccess:(0,H.useCallback)(t=>{e(t)},[e])})},rvn=({isVisible:e,onModalHide:t,onEnterPIN:n,onCancel:r})=>{let{t:i}=Tq();return(0,W.jsx)(u3,{isVisible:e,title:i(`settings_locked_modal_header`),onModalHide:t,icon:()=>(0,W.jsx)(i9t,{width:96,height:96}),buttons:[{title:i(`settings_locked_modal_button_enter`),type:H4.Primary,onPress:n},{title:i(`button_cancel`),type:H4.Secondary,onPress:r}]})};V();function _9({columnDisposition:e,disabled:t=!1,testID:n,children:r,style:i}){let{COLORS:a}=J();return(0,W.jsx)(B,{testID:n,style:[ivn.row,t&&ivn.disabledRow,{backgroundColor:a.bgTableOdd},i],children:H.Children.map(r,(n,r)=>H.isValidElement(n)?H.cloneElement(n,{disabled:t,cellRatio:e?e[r]:void 0}):null)})}var ivn=R.create({row:{flexDirection:`row`,justifyContent:`space-between`},disabledRow:{opacity:.5}});V();function v9({index:e,columnDisposition:t,disabled:n=!1,testID:r,children:i,style:a}){let{COLORS:o}=J(),s=(0,H.useCallback)(e=>e===void 0?o.bgTableEven:e%2?o.bgTableOdd:o.bgTableEven,[o]);return(0,W.jsx)(B,{testID:r,style:[avn.row,{backgroundColor:s(e)},a],children:H.Children.map(i,(e,r)=>H.isValidElement(e)?H.cloneElement(e,{disabled:n,cellRatio:t?t[r]:void 0}):null)})}var avn=R.create({row:{flexDirection:`row`,justifyContent:`space-between`}});V();function y9({columnDisposition:e,disabled:t=!1,testID:n,children:r,style:i}){let{COLORS:a}=J();return(0,W.jsx)(B,{testID:n,style:[ovn.table,{backgroundColor:a.bgSecondary,borderWidth:1,borderColor:a.divider},t&&{backgroundColor:a.bgButtonSecondaryDangerDisabled},i],children:(()=>{let n=0;return H.Children.map(r,r=>{if(H.isValidElement(r)){if(r.type===_9){let n=r;return H.cloneElement(n,{disabled:n.props.disabled??t,columnDisposition:e})}if(r.type===v9){let i=r,a=H.cloneElement(i,{disabled:i.props.disabled??t,index:n,columnDisposition:e});return n+=1,a}return H.cloneElement(r)}return null})})()})}var ovn=R.create({table:{borderRadius:16,overflow:`hidden`}});V();function b9({disabled:e=!1,onPress:t,testID:n,accessibilityLabel:r,accessibilityValue:i,cellRatio:a,children:o,style:s}){let{COLORS:c}=J();return(0,W.jsx)(Yf,{disabled:!t||e,onPress:t,style:[svn.cell,{flex:a??1,borderColor:c.divider},s],testID:n,accessibilityRole:`button`,accessibilityHint:`Double-tap to set value`,accessibilityState:{disabled:e},accessibilityLabel:r,accessibilityValue:{text:i},children:H.Children.map(o,t=>{if(H.isValidElement(t)){let n=t;if(e){let e=n.props.style,t=Array.isArray(e)?[...e,{color:c.textTableSecondary}]:[e,{color:c.textTableSecondary}];return H.cloneElement(n,{...n.props,style:t})}else return H.cloneElement(n)}return null})})}var svn=R.create({cell:{justifyContent:`center`,alignItems:`center`,borderTopWidth:1,borderLeftWidth:1,paddingVertical:8}});V();function x9({testID:e,cellRatio:t,children:n,style:r,accessibilityLabel:i,accessibilityValue:a,disabled:o=!1}){let{COLORS:s}=J();return(0,W.jsx)(B,{style:[cvn.cell,{flex:t??1,borderColor:s.divider},r],testID:e,accessible:!0,accessibilityRole:`header`,accessibilityState:{disabled:o},accessibilityLabel:i,accessibilityValue:{text:a},children:n})}var cvn=R.create({cell:{justifyContent:`space-between`,alignItems:`center`,borderTopWidth:1,borderLeftWidth:1,paddingVertical:8}});V();var lvn=[X.ActivityIntensity.light,X.ActivityIntensity.moderate,X.ActivityIntensity.hard],uvn=[X.ActivityReductionIntervals.fromZero,X.ActivityReductionIntervals.fromThirty,X.ActivityReductionIntervals.fromFortysix,X.ActivityReductionIntervals.fromSixtyone],dvn={[X.ActivityReductionIntervals.fromZero]:`0-29`,[X.ActivityReductionIntervals.fromThirty]:`30-45`,[X.ActivityReductionIntervals.fromFortysix]:`46-60`,[X.ActivityReductionIntervals.fromSixtyone]:`61-120`},fvn=e=>Math.round((1-e)*100),pvn=e=>e==null?`-`:`${fvn(e).toString()} %`,mvn=e=>Math.round((1-e/100)*100)/100;function hvn(){let{t:e}=Tq(),t=N$(),{COLORS:n}=J(),{modalStoreActions:r}=z5(),{bottomWithScroll:i}=Q4(),a=N5(),[o,s]=(0,H.useState)(!1),[c,l]=(0,H.useState)(!1),[u,d]=(0,H.useState)(!1),[f,p]=(0,H.useState)(null),[m,h]=(0,H.useState)(null),[g,_]=(0,H.useState)(void 0),{glucoseUnit:v,activity:y,created:b}=k8;if(v===void 0)throw Error(`[ActivitySettings::render] glucoseUnit is not defined`);if(y===void 0)throw Error(`[ActivitySettings::render] activity is not defined`);let{target:x,post:S,hard:C,light:w,moderate:T}=y,E=(0,H.useMemo)(()=>B8(x,X.BloodGlucoseUnit.MMOL_L,v),[v,x]),{text:D}=(0,H.useMemo)(()=>L8(v),[v]),O=(0,H.useMemo)(()=>({light:w,moderate:T,hard:C}),[w,T,C]),k=(0,H.useMemo)(()=>({post:S}),[S]),A=(0,H.useMemo)(()=>[{title:e(`table_activity_duration`),maxFontSizeMultiplier:C2.s1},{title:R8.light(),maxFontSizeMultiplier:C2.s1},{title:R8.moderate(),maxFontSizeMultiplier:C2.s1},{title:R8.hard(),maxFontSizeMultiplier:C2.s1}],[e]),[ee,te]=(0,H.useState)(!1),[ne,re]=(0,H.useState)(!1),{areSettingsLocked:ie,isPINSet:j,lockSettings:ae,unlockSettings:oe}=G_n(),[se,M]=(0,H.useState)(!1),[ce,N]=(0,H.useState)(!1),P=(0,H.useCallback)(()=>{ie?te(!0):ae()},[ie,ae]);(0,H.useEffect)(()=>{t.setOptions({header:()=>(0,W.jsx)(F5,{title:e(`physical_activity_navigation`),LeftButton:(0,W.jsx)(H5,{}),RightButton:j?(0,W.jsx)(cfn,{onPress:P,isLocked:ie}):void 0,overlay:!0})})},[t,ie,j,P,e]);let le=(0,H.useCallback)(async()=>{let e={...w8(),target:x,post:S},{updatedAt:t,...n}=y;s3(n,e)||_(await k8.postUserSettings({activity:{...e,updatedAt:new Date().toISOString()}}))},[y,S,x]),ue=(0,H.useCallback)(async()=>{let e={hard:C,moderate:T,light:w,target:x,post:w8().post},{updatedAt:t,...n}=y;s3(n,e)||_(await k8.postUserSettings({activity:{...e,updatedAt:new Date().toISOString()}}))},[y,C,w,T,x]),de=(0,H.useCallback)((e,t)=>{p({interval:t,intensity:e}),s(!0)},[s,p]),fe=(0,H.useCallback)(()=>{p(null),s(!0)},[]),pe=(0,H.useCallback)(async e=>{if(f===null)throw Error(`[ActivitySettings::updateActivity] pressedTableCell is null`);if(mvn(e)!==y[f.intensity][f.interval]){let t=JSON.parse(JSON.stringify(y));t[f.intensity][f.interval]=mvn(e),t.updatedAt=new Date().toISOString(),_(await k8.postUserSettings({activity:t}))}},[y,f]),me=(0,H.useCallback)(async e=>{let t=z8(e,v,X.BloodGlucoseUnit.MMOL_L);if(t!==y.target){let e=JSON.parse(JSON.stringify(y));e.target=t,e.updatedAt=new Date().toISOString(),_(await k8.postUserSettings({activity:e}))}},[y,v]),he=(0,H.useCallback)(async e=>{f?await pe(e):await me(e),s(!1)},[f,pe,me]),ge=(0,H.useMemo)(()=>f===null?v===X.BloodGlucoseUnit.MMOL_L?Yan:Xan:a3(0,75),[f,v]),F=(0,H.useMemo)(()=>{if(f===null){let e=B8(x,X.BloodGlucoseUnit.MMOL_L,v);return ge.findIndex(t=>t===e)}let e=y[f.intensity][f.interval];return e===0?0:e?fvn(e):75},[f,y,x,v,ge]),_e=async()=>{m===`after`?await ue():await le(),l(!1)},I=()=>{h(`during`),l(!0)},ve=()=>{h(`after`),l(!0)},ye=(0,H.useCallback)(()=>{g===!1&&r.set({showSyncErrorModal:!0}),_(void 0)},[g,r]),be=(0,H.useCallback)(()=>{se&&(re(!0),M(!1))},[se,re,M]),xe=(0,H.useCallback)(()=>{M(!0),te(!1)},[M,te]),L=(0,H.useCallback)(()=>{oe()},[oe]),Se=(0,H.useCallback)(e=>j&&ie?(...e)=>te(!0):(...t)=>e(...t),[ie,j]),Ce=(0,H.useCallback)(()=>{ce&&(N(!1),setTimeout(()=>{t.navigate(Q.ChangePINCode)},500))},[ce,t]),we=y.updatedAt??b;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(fs,{testID:`settings-activity-scroll`,style:S9.scrollView,contentContainerStyle:[S9.scrollViewContent,{paddingBottom:i,paddingTop:a+16}],children:[(0,W.jsx)(Z,{style:[S9.updatedAtText,{color:n.labelSecondary}],children:e(`settings_lastEdited`,{date:we?I8(we,`d MMM yyyy`):``})}),(0,W.jsx)(p9,{text:e(`physical_activity_hcp_card_body`),learnMoreText:e(`physical_activity_hcp_card_button`),learnMoreOnPress:()=>{d(!0)}}),(0,W.jsxs)(y9,{children:[(0,W.jsxs)(B,{style:[S9.tableDescripContainer,{borderBottomColor:n.divider}],children:[(0,W.jsx)(Z,{style:[S9.title,{color:n.labelPrimary}],accessibilityRole:`header`,children:e(`physical_activity_target_title`)}),(0,W.jsx)(Z,{style:[S9.subtitle,{color:n.labelSecondary}],children:e(`physical_activity_target_body`)})]}),(0,W.jsx)(Y4,{title:e(`target_activity_input`),value:`${E} ${D}`,style:{backgroundColor:n.bgSecondary},testID:`activity-target`,onPress:Se(fe),valueStyle:{color:n.labelBrand}})]}),(0,W.jsxs)(y9,{columnDisposition:[1,1,1,1],children:[(0,W.jsxs)(B,{style:[S9.tableDescripContainer,{borderBottomColor:n.divider}],children:[(0,W.jsx)(Z,{style:[S9.title,{color:n.labelPrimary}],accessibilityRole:`header`,children:e(`target_activity_reduction_title`)}),(0,W.jsx)(Z,{style:[S9.subtitle,{color:n.labelSecondary}],children:e(`target_activity_reduction_body`)})]}),(0,W.jsx)(_9,{children:A.map((e,t)=>(0,W.jsx)(x9,{style:[t===0&&S9.tableFirstCell,S9.noTopBorder],children:(0,W.jsx)(Z,{style:[S9.tableHeaderTitle,{color:n.labelPrimary}],maxFontSizeMultiplier:e.maxFontSizeMultiplier,children:e.title})},e.title))}),uvn.map(t=>(0,W.jsxs)(v9,{children:[(0,W.jsxs)(b9,{style:S9.tableFirstCell,children:[(0,W.jsx)(Z,{style:[S9.tableInterval,{color:n.labelPrimary}],children:dvn[t]}),(0,W.jsx)(Z,{style:[S9.minutes,{color:n.textTableSecondary}],children:e(`activity_settings_table_min`)})]}),lvn.map(e=>(0,W.jsx)(b9,{testID:`settings-activity-${e}-${t}`,onPress:Se(()=>{de(e,t)}),children:(0,W.jsx)(Z,{style:[S9.tablePercentage,{color:n.textTableHighlight}],children:pvn(O[e][t])})},`${t}-${e}`))]},t)),(0,W.jsx)(Yf,{style:[S9.resetContainer,{backgroundColor:n.bgButtonSecondaryDanger,borderColor:n.divider}],onPress:Se(I),testID:`restore-default-activity-settings-during`,children:(0,W.jsx)(Z,{style:[S9.resetText,{color:n.textButtonSecondaryDanger}],children:e(`button_reset_default`)})})]}),(0,W.jsxs)(y9,{children:[(0,W.jsxs)(B,{style:[S9.tableDescripContainer,{borderBottomWidth:0}],children:[(0,W.jsx)(Z,{style:[S9.title,{color:n.labelPrimary}],accessibilityRole:`header`,children:e(`target_activity_reduction_after_title`)}),(0,W.jsx)(Z,{style:[S9.subtitle,{color:n.labelSecondary}],children:e(`target_activity_reduction_after_body`)})]}),uvn.map(t=>(0,W.jsxs)(v9,{children:[(0,W.jsxs)(b9,{style:[S9.tableFirstCell,S9.noLeftBorder],children:[(0,W.jsx)(Z,{style:S9.tableInterval,children:dvn[t]}),(0,W.jsx)(Z,{style:[S9.minutes,{color:n.textTableSecondary}],children:e(`activity_settings_table_min`)})]}),(0,W.jsx)(b9,{testID:`settings-activity-post-${t}`,onPress:Se(()=>{de(`post`,t)}),children:(0,W.jsx)(Z,{style:[S9.tablePercentage,{color:n.textTableHighlight}],children:pvn(k.post[t])})})]},`post-${t}`)),(0,W.jsx)(Yf,{style:[S9.resetContainer,{backgroundColor:n.bgButtonSecondaryDanger,borderColor:n.divider}],onPress:Se(ve),testID:`restore-default-activity-settings-after`,children:(0,W.jsx)(Z,{style:[S9.resetText,{color:n.textButtonSecondaryDanger}],children:e(`button_reset_default`)})})]})]}),(0,W.jsx)(Q5,{initialScrollIndex:F,isVisible:o,onCancel:()=>{s(!1)},onConfirm:he,items:ge,onModalHide:ye,testID:`activity-wheel-picker`}),(0,W.jsx)(u3,{title:e(`physical_activity_modal_reset_title `),isVisible:c,onModalHide:ye,buttons:[{title:e(`button_reset`),type:H4.Error,onPress:_e},{title:e(`button_cancel`),type:H4.Secondary,onPress:()=>{l(!1)}}]}),(0,W.jsx)(u3,{isVisible:u,enableScroll:!0,buttons:[{title:e(`button_close`),onPress:()=>{d(!1)},style:S9.activityInfoModalButton}],children:(0,W.jsx)(K_n,{})}),(0,W.jsx)(t7,{onModalHide:()=>{_(void 0)}}),(0,W.jsx)(rvn,{isVisible:ee,onModalHide:be,onEnterPIN:xe,onCancel:()=>te(!1)}),(0,W.jsx)(Q_n,{isVisible:ne,onClose:()=>re(!1),onModalHide:Ce,onForgotPIN:()=>{N(!0),re(!1)},onModalHideWithSuccess:L}),(0,W.jsx)(nvn,{})]})}var gvn=f7(hvn),S9=R.create({scrollView:{paddingHorizontal:16},scrollViewContent:{flexGrow:1,gap:32,paddingTop:32},updatedAtText:{...Y.Poppins.regular_SM,textAlign:`center`},tableDescripContainer:{padding:16,borderBottomWidth:1},title:{...Y.Poppins.semiBold_Base,marginBottom:8},subtitle:{...Y.Poppins.regular_SM},tableFirstCell:{paddingLeft:16,paddingVertical:12,borderLeftWidth:0},resetText:{...Y.Poppins.semiBold_Base,textAlign:`center`},resetContainer:{alignItems:`center`,padding:16,borderTopWidth:1},tableHeaderTitle:{...Y.Poppins.medium_SM},minutes:{...Y.Poppins.regular_XS},tableInterval:{...Y.Poppins.medium_Base},tablePercentage:{...Y.Poppins.medium_Base},activityInfoModalButton:{marginTop:32},noTopBorder:{borderTopWidth:0,paddingVertical:16},noLeftBorder:{borderLeftWidth:0}});function C9(e,t){return+e3(e)>+e3(t)}function _vn(e,t,n){return K7(e,-t,n)}function vvn(e,t){let n=e3(e,t?.in);return n.setMinutes(0,0,0),n}function yvn(e,t,n){let[r,i]=_8(n?.in,e,t);return+vvn(r)==+vvn(i)}V();var w9=Array.from({length:60},(e,t)=>t.toString().padStart(2,`0`));function bvn({isVisible:e,initialValue:t,min:n,max:r,onCancel:i,onConfirm:a,onModalHide:o}){let{COLORS:s}=J(),{width:c}=em(),l=(0,H.useRef)(null),u=(0,H.useRef)(null),d=(0,H.useMemo)(()=>{let e=[],t=r?q7(`59`,`mm`,new Date(r)):q7(`23:59`,`HH:mm`,new Date),i=n?q7(`00`,`mm`,new Date(n)):q7(`00:00`,`HH:mm`,new Date);for(;R7(i,t)||yvn(i,t);)e.push(i),i=Yon(i,1);return e},[r,n]),f=(0,H.useMemo)(()=>d.map(e=>e.getHours().toString().padStart(2,`0`),[]),[d]),[p,m]=(0,H.useState)(t),h=W3t(e);(0,H.useEffect)(()=>{!h&&e&&m(t)},[h,e,t]);let g=(0,H.useMemo)(()=>d.findIndex(e=>e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()&&e.getHours()===t.getHours()),[d,t]),_=(0,H.useMemo)(()=>{let[,e]=I8(t,`HH:mm`).split(`:`);return w9.indexOf(e)},[t]),v=(0,H.useMemo)(()=>d.findIndex(e=>e.getFullYear()===p.getFullYear()&&e.getMonth()===p.getMonth()&&e.getDate()===p.getDate()&&e.getHours()===p.getHours()),[d,p]),y=(0,H.useMemo)(()=>{let[,e]=I8(p,`HH:mm`).split(`:`);return w9.indexOf(e)},[p]),b=(0,H.useMemo)(()=>n?0:null,[n]),x=(0,H.useMemo)(()=>r?d.length-1:null,[r,d]),S=(0,H.useMemo)(()=>{if(!n)return null;let[,e]=I8(n,`HH:mm`).split(`:`);return w9.indexOf(e)},[n]),C=(0,H.useMemo)(()=>{if(!r)return null;let[,e]=I8(r,`HH:mm`).split(`:`);return w9.indexOf(e)},[r]),w=(0,H.useCallback)(()=>{a(p)},[a,p]),T=(0,H.useCallback)(()=>{m(t),i()},[i,t]),E=(0,H.useCallback)((e,i)=>{if(e<0||i<0||e>=d.length||i>=w9.length)return;let a=`${d[e].getHours()}:${w9[i]}`;if(!n||!r){m(q7(a,`HH:mm`,new Date(t)));return}let o=d[e];m(q7(a,`HH:mm`,new Date(o)))},[n,r,d,t]),D=(0,H.useCallback)(e=>{u.current?.scrollToIndex(e)},[]),O=(0,H.useCallback)(e=>{if(x===null||b===null||C===null||S===null){E(e,y);return}e===b&&y<S?(E(e,S),D(S)):e===x&&y>C?(E(e,C),D(C)):E(e,y)},[x,b,C,S,E,y,D]),k=(0,H.useCallback)(e=>{if(x===null||b===null||C===null||S===null){E(v,e);return}v===b&&e<S?(E(v,S),D(S)):v===x&&e>C?(E(v,C),D(C)):E(v,e)},[E,x,C,b,S,D,v]);return(0,W.jsx)(u3,{isVisible:e,containerStyle:{backgroundColor:s.bgTransparent},onModalHide:o,children:(0,W.jsxs)(B,{children:[(0,W.jsxs)(B,{style:T9.pickersContainer,children:[(0,W.jsx)(Z5,{testID:`hours_wheel_picker`,ref:l,initialScrollIndex:g,options:f,onChange:O,containerStyle:[T9.itemContainerLeft,{width:(c-32)/2}],selectedIndicatorStyle:[T9.selectedIndicatorLeft,{width:(c-32)/2-10}],itemStyle:T9.itemLeft},`hours-wheel-picker`),(0,W.jsx)(Z5,{testID:`minutes_wheel_picker`,ref:u,initialScrollIndex:_,options:w9,onChange:k,containerStyle:[T9.itemContainerRight,{width:(c-32)/2}],selectedIndicatorStyle:[T9.selectedIndicatorRight,{width:(c-32)/2-10}],itemStyle:T9.itemRight},`minutes-wheel-picker`)]}),(0,W.jsxs)(B,{style:T9.buttonContainer,children:[(0,W.jsx)(X5,{onPress:w}),(0,W.jsx)(Y5,{onPress:T})]})]})})}var xvn=H.memo(bvn),T9=R.create({buttonContainer:{gap:8},pickersContainer:{flexDirection:`row`,borderTopLeftRadius:13,borderTopRightRadius:13,overflow:`hidden`},itemContainerLeft:{borderTopRightRadius:0,paddingLeft:16},itemContainerRight:{borderTopLeftRadius:0,paddingRight:16},itemLeft:{alignSelf:`flex-end`,marginRight:16},itemRight:{alignSelf:`flex-start`,marginLeft:16},selectedIndicatorRight:{alignSelf:`flex-start`,borderTopLeftRadius:0,borderBottomLeftRadius:0},selectedIndicatorLeft:{alignSelf:`flex-end`,borderTopRightRadius:0,borderBottomRightRadius:0}});V();var Svn=(e,t)=>({startTime:e.startTime,target:B8(e.target,X.BloodGlucoseUnit.MMOL_L,t)}),Cvn=(e,t)=>e.map(e=>Svn(e,t)),wvn=(e,t)=>{let n=e.startTime,r=parseFloat(e.target);return r=z8(r,t,X.BloodGlucoseUnit.MMOL_L),{startTime:n,target:r}},Tvn=(e,t)=>e.map(e=>wvn(e,t));function Evn(){let{t:e}=Tq(),{COLORS:t}=J(),{modalStoreActions:n}=z5(),{bottomWithScroll:r}=Q4(),i=N$(),a=N5(),[o,s]=(0,H.useState)(),[c,l]=(0,H.useState)(void 0),[u,d]=(0,H.useState)(!1),[f,p]=(0,H.useState)(!1),[m,h]=(0,H.useState)(!1),[g,_]=(0,H.useState)(),[v,y]=(0,H.useState)(!1),[b,x]=(0,H.useState)(!1),S=k8.glucoseUnit;if(S===void 0)throw Error(`[GlucoseSettings::render] glucoseUnit is undefined.`);let{glucoseLevelTargets:C,created:w}=k8;if(C===void 0)throw Error(`[GlucoseSettings::render] parameters from userSettings must be defined and non-null.`);let T=C.targetBGLIntervals;if(!T)throw Error(`[GlucoseSettings::render] parameters from userSettings must be defined and non-null.`);let E=C.overallTargetBGL;if(!E)throw Error(`[GlucoseSettings::render] parameters from userSettings must be defined and non-null.`);let D=C.use===X.Usage.Overall,O=Cvn(T,S),k=Svn(E,S),{areSettingsLocked:A,isPINSet:ee,lockSettings:te,unlockSettings:ne}=G_n(),[re,ie]=(0,H.useState)(!1),[j,ae]=(0,H.useState)(!1),oe=(0,H.useCallback)(()=>{A?y(!0):te()},[A,te]);(0,H.useEffect)(()=>{i.setOptions({header:()=>(0,W.jsx)(F5,{title:e(`glucose_navigation`),LeftButton:(0,W.jsx)(H5,{}),RightButton:ee?(0,W.jsx)(cfn,{onPress:oe,isLocked:A}):void 0,overlay:!0})})},[i,A,ee,oe,e]);let se=(0,H.useCallback)(e=>{p(!0),_(e)},[]),M=(0,H.useCallback)(async()=>{let e=non(),t=ron(),n={...C,targetBGLIntervals:e},r={...C,overallTargetBGL:t},i=D?r:n;if(D?!s3(C.overallTargetBGL,t):!s3(C.targetBGLIntervals,e)){let e={glucoseLevelTargets:{...i,updatedAt:new Date().toISOString()}};l(await k8.postUserSettings(e))}h(!1)},[C,D]),ce=(0,H.useCallback)(async e=>{if(e!==parseFloat(k.target)){let t={...k};t.target=e.toString();let n=wvn(t,S),r={glucoseLevelTargets:{...C,updatedAt:new Date().toISOString(),overallTargetBGL:n}};l(await k8.postUserSettings(r))}},[S,k,C]),N=(0,H.useCallback)(async e=>{if(g!==void 0&&e!==parseFloat(O[g].target)){let t=[...O],n={...t[g]};n.target=e.toString(),t[g]=n;let r=Tvn(t,S),i={glucoseLevelTargets:{...C,updatedAt:new Date().toISOString(),targetBGLIntervals:r}};l(await k8.postUserSettings(i))}},[g,O,S,C]),P=(0,H.useCallback)(async e=>{D?await ce(e):await N(e),p(!1)},[D,ce,N]),le=(0,H.useCallback)(async()=>{let e=!D,t={glucoseLevelTargets:{...C,use:e?X.Usage.Overall:X.Usage.Intervals,updatedAt:new Date().toISOString()}},r=await k8.postUserSettings(t);n.set({showSyncErrorModal:!r})},[D,C,n]),ue=(0,H.useMemo)(()=>L8(S).text,[S]),de=(0,H.useMemo)(()=>{let{min:e,max:t}=S===X.BloodGlucoseUnit.MMOL_L?aon():oon();return S===X.BloodGlucoseUnit.MG_DL?a3(e,t):o3(e,t)},[S]),fe=(0,H.useMemo)(()=>g===void 0?0:D?de.indexOf(k.target):de.indexOf(O[g].target),[g,D,de,O,k.target]),pe=(0,H.useCallback)(e=>{let t=O[(e-1+O.length)%O.length].startTime,n=O[(e+1+O.length)%O.length].startTime,r=O[e].startTime,i=q7(r,`HH:mm`,new Date),a=q7(t,`HH:mm`,new Date),o=q7(n,`HH:mm`,new Date);R7(i,a)&&R7(i,o)?s({current:i,min:t3(_vn(a,1),1),max:n3(o,1)}):C9(i,a)&&C9(i,o)?s({current:i,min:t3(a,1),max:n3(K7(o,1),1)}):s({current:i,min:t3(a,1),max:n3(o,1)}),d(!0),_(e)},[O]),me=(0,H.useCallback)(async e=>{if(g===void 0)return;let t=I8(e,`HH:mm`);if(t!==O[g].startTime){let e=[...O],n={...e[g]};n.startTime=t,e[g]=n;let r=Tvn(e,S),i={glucoseLevelTargets:{...C,targetBGLIntervals:r,updatedAt:new Date().toISOString()}};l(await k8.postUserSettings(i))}d(!1)},[g,O,S,C]),he=(0,H.useCallback)(()=>{d(!1)},[]),ge=(0,H.useCallback)(()=>{p(!1)},[]),F=(0,H.useCallback)(()=>{c===!1&&n.set({showSyncErrorModal:!0}),l(void 0)},[n,c]),_e=(0,H.useCallback)(()=>{re&&(x(!0),ie(!1))},[re,x,ie]),I=(0,H.useCallback)(()=>{ie(!0),y(!1)},[ie,y]),ve=(0,H.useCallback)(()=>{i.navigate(Q.GlucoseUnit)},[i]),ye=(0,H.useCallback)(()=>{ne()},[ne]),be=(0,H.useCallback)(e=>ee&&A?(...e)=>y(!0):(...t)=>e(...t),[A,ee]),xe=(0,H.useCallback)(()=>{j&&(ae(!1),setTimeout(()=>{i.navigate(Q.ChangePINCode)},500))},[j,i]),L=C.updatedAt??w;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(fs,{testID:`settings-glucose-scrollview`,style:E9.scrollView,contentContainerStyle:[E9.scrollViewContent,{paddingBottom:r,paddingTop:a+16}],children:[(0,W.jsx)(Z,{style:[E9.updatedAtText,{color:t.labelSecondary}],children:e(`settings_lastEdited`,{date:L?I8(L,`d MMM yyyy`):``})}),(0,W.jsx)(p9,{}),(0,W.jsx)(Y4,{title:e(`glucose_input`),value:ue,testID:`glucose-change`,onPress:be(ve),renderRightSlot:()=>(0,W.jsx)(K4,{})}),(0,W.jsxs)(y9,{columnDisposition:[1,2],children:[(0,W.jsx)(f3,{title:e(`fixed_input_title`),message:e(`fixed_input_body`),value:D,testID:`settings-glucose-overall-switch`,onValueChange:be(le),style:E9.switchContainer}),(0,W.jsxs)(_9,{disabled:!D,testID:`settings-glucose-overall-header`,children:[(0,W.jsx)(x9,{style:E9.tableFirstCell,testID:`settings-glucose-overall-header-time`,children:(0,W.jsx)(Z,{style:[E9.headerTitle,{color:t.textTableActive}],maxFontSizeMultiplier:C2.s2,children:e(`table_fixed_time`)})}),(0,W.jsxs)(x9,{testID:`settings-glucose-overall-header-target`,children:[(0,W.jsx)(Z,{style:[E9.headerTitle,{color:t.textTableActive}],maxFontSizeMultiplier:C2.s2,children:e(`table_fixed_target`)}),(0,W.jsx)(Z,{style:[E9.headerSubtitle,{color:t.textTableSecondary}],children:ue})]})]}),(0,W.jsxs)(v9,{disabled:!D,children:[(0,W.jsx)(b9,{style:E9.tableFirstCell,children:(0,W.jsx)(Z,{style:[E9.subtitle,{color:t.textTableActive}],children:e(`table_fixed_all_day `)})}),(0,W.jsx)(b9,{onPress:be(()=>se(0)),children:(0,W.jsx)(Z,{style:[E9.fixedValueTitle,{color:t.textTableHighlight}],testID:`settings-glucose-overall-all-day-target`,children:k.target})})]}),(0,W.jsx)(Yf,{style:[E9.resetContainer,{borderColor:t.divider}],disabled:!D,onPress:be(()=>h(!0)),children:(0,W.jsx)(Z,{style:[E9.resetText,D?{color:t.textButtonSecondaryDanger}:{color:t.textButtonSecondaryDangerDisabled}],children:e(`button_reset_default`)})})]}),(0,W.jsxs)(y9,{columnDisposition:[1,2],children:[(0,W.jsx)(f3,{title:e(`table_variable_title`),message:e(`table_variable_body`),value:!D,testID:`daily-interval-switch`,onValueChange:be(le),style:E9.switchContainer}),(0,W.jsxs)(_9,{disabled:D,testID:`settings-glucose-variable-header`,children:[(0,W.jsxs)(x9,{style:E9.tableFirstCell,testID:`settings-glucose-variable-header-time`,children:[(0,W.jsx)(Z,{style:[E9.headerTitle,{color:t.textTableActive}],maxFontSizeMultiplier:C2.s2,children:e(`table_variable_time`)}),(0,W.jsx)(Z,{style:[E9.headerSubtitle,{color:t.textTableSecondary}],children:e(`table_variable_time_unit`)})]}),(0,W.jsxs)(x9,{testID:`settings-glucose-variable-header-target`,children:[(0,W.jsx)(Z,{style:[E9.headerTitle,{color:t.textTableActive}],maxFontSizeMultiplier:C2.s2,children:e(`table_fixed_target`)}),(0,W.jsx)(Z,{style:[E9.headerSubtitle,{color:t.textTableSecondary}],children:ue})]})]}),O.map((e,n)=>(0,W.jsxs)(v9,{disabled:D,children:[(0,W.jsxs)(b9,{style:E9.tableFirstCell,onPress:be(()=>{pe(n)}),children:[(0,W.jsx)(Z,{style:[E9.title,{color:t.textTableHighlight}],children:e.startTime}),(0,W.jsx)(Z,{style:[E9.subtitle,{color:t.textTableSecondary}],children:_vt[Object.keys(Dq)[n]]()})]}),(0,W.jsx)(b9,{onPress:be(()=>{se(n)}),children:(0,W.jsx)(Z,{style:[E9.title,{color:t.textTableHighlight}],testID:`settings-glucose-variable-target-${Object.keys(Dq)[n].toLowerCase()}`,children:e.target})})]},e.startTime)),(0,W.jsx)(Yf,{style:[E9.resetContainer,{borderColor:t.divider}],disabled:D,onPress:be(()=>{h(!0)}),children:(0,W.jsx)(Z,{style:[E9.resetText,D?{color:t.textButtonSecondaryDangerDisabled}:{color:t.textButtonSecondaryDanger}],children:e(`button_reset_default`)})})]})]}),(0,W.jsx)(Q5,{isVisible:f,items:de,onConfirm:P,onCancel:ge,initialScrollIndex:fe,onModalHide:F,testID:`settings-glucose-target-wheel-picker`}),(0,W.jsx)(xvn,{isVisible:u,initialValue:o?.current??new Date,min:o?.min,max:o?.max,onConfirm:me,onCancel:he,onModalHide:F}),(0,W.jsx)(u3,{isVisible:m,title:e(`physical_activity_modal_reset_title `),onModalHide:F,buttons:[{title:e(`button_reset`),type:H4.Error,onPress:M},{title:e(`button_cancel`),type:H4.Secondary,onPress:()=>{h(!1)}}]}),(0,W.jsx)(t7,{onModalHide:()=>{l(void 0)}}),(0,W.jsx)(rvn,{isVisible:v,onModalHide:_e,onEnterPIN:I,onCancel:()=>y(!1)}),(0,W.jsx)(Q_n,{isVisible:b,onClose:()=>x(!1),onModalHide:xe,onForgotPIN:()=>{ae(!0),x(!1)},onModalHideWithSuccess:ye}),(0,W.jsx)(nvn,{})]})}var Dvn=f7(Evn),E9=R.create({scrollView:{paddingHorizontal:16},scrollViewContent:{flexGrow:1,gap:32},updatedAtText:{...Y.Poppins.regular_SM,textAlign:`center`},tableFirstCell:{alignItems:`flex-start`,paddingLeft:16,borderLeftWidth:0},resetContainer:{alignItems:`center`,padding:16,borderTopWidth:1},resetText:{...Y.Poppins.semiBold_Base,textAlign:`center`},headerTitle:{...Y.Poppins.medium_SM},headerSubtitle:{...Y.Poppins.medium_XS},title:{...Y.Poppins.medium_Base},fixedValueTitle:{...Y.Poppins.medium_Base,paddingVertical:8},subtitle:{...Y.Poppins.regular_XS},switchContainer:{borderBottomLeftRadius:0,borderBottomRightRadius:0}});V();var Ovn=e=>{let{t}=Tq(),{COLORS:n}=J(),{glucoseUnit:r,isError:i,onPressMGDL:a,onPressMMOLL:o}=e,s=r===X.BloodGlucoseUnit.MMOL_L,c=r===X.BloodGlucoseUnit.MG_DL;return(0,W.jsxs)(B,{style:D9.unitsContainer,children:[(0,W.jsxs)(wp,{testID:`mmoll-button-${s}`,onPress:o,style:({pressed:e})=>[D9.unitButton,{backgroundColor:s?n.bgSegmentPrimary:n.bgSegmentContainer,borderColor:s?n.bgSegmentPrimary:n.buttonBorder,opacity:e?.5:1},i&&{borderColor:n.borderInputDanger}],accessibilityRole:`button`,accessibilityState:{selected:s},children:[(0,W.jsx)(Z,{style:[D9.unitText,{color:s?n.textLabelActive:n.textLabelInactive}],children:t(`glucose_unit_mmol/l`)}),(0,W.jsx)(Z,{style:[D9.exampleText,{color:s?n.textLabelActive:n.textLabelInactive}],children:t(`example`)}),(0,W.jsx)(Z,{style:[D9.unitExampleText,{color:s?n.textLabelActive:n.textLabelInactive}],maxFontSizeMultiplier:C2.s2,children:t(`glucose_unit_example_mmol/L`)})]}),(0,W.jsxs)(wp,{testID:`mgdl-button-${c}`,onPress:a,style:({pressed:e})=>[D9.unitButton,{backgroundColor:c?n.bgSegmentPrimary:n.bgSegmentContainer,borderColor:c?n.bgSegmentPrimary:n.buttonBorder,opacity:e?.5:1},i&&{borderColor:n.borderInputDanger}],accessibilityRole:`button`,accessibilityState:{selected:c},children:[(0,W.jsx)(Z,{style:[D9.unitText,{color:c?n.textLabelActive:n.textLabelInactive}],children:t(`glucose_unit_mg/dl`)}),(0,W.jsx)(Z,{style:[D9.exampleText,{color:c?n.textLabelActive:n.textLabelInactive}],children:t(`example`)}),(0,W.jsx)(Z,{style:[D9.unitExampleText,{color:c?n.textLabelActive:n.textLabelInactive}],maxFontSizeMultiplier:C2.s2,children:t(`glucose_unit_example_mg/dl`)})]})]})},D9=R.create({unitsContainer:{flexDirection:`row`,justifyContent:`space-between`,gap:12},unitButton:{flex:1,paddingHorizontal:14,paddingVertical:10,borderRadius:16,borderWidth:2},unitText:{...Y.Poppins.medium_Base,marginBottom:8},exampleText:{...Y.Poppins.medium_XS,marginBottom:4},unitExampleText:{...Y.Poppins.regular_XS}});V();var kvn=()=>{let{modalStoreActions:e}=z5(),t=N5(),n=(0,H.useCallback)(async t=>{if(t===k8.glucoseUnit)return;let n=k8.glucoseLevelTargets,r=await k8.postUserSettings({bloodGlucoseUnits:t,...n&&{glucoseLevelTargets:{...n,updatedAt:new Date().toISOString()}}});e.set({showSyncErrorModal:!r})},[e]);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(B,{style:[Avn.container,{paddingTop:t+16}],children:(0,W.jsx)(Ovn,{onPressMMOLL:()=>n(X.BloodGlucoseUnit.MMOL_L),onPressMGDL:()=>n(X.BloodGlucoseUnit.MG_DL),glucoseUnit:k8.glucoseUnit})}),(0,W.jsx)(t7,{})]})},Avn=R.create({container:{paddingHorizontal:16}}),jvn=f7(kvn);V();var Mvn=()=>{let{t:e}=Tq(),{COLORS:t}=J(),n=N$(),{bottomWithScroll:r}=Q4(),i=N5();return(0,W.jsxs)(fs,{contentContainerStyle:[O9.scrollView,{paddingBottom:r,paddingTop:i+16}],testID:`legal-page-scrollview`,children:[(0,W.jsx)(Z,{style:O9.title,children:e(`legal_title`)}),(0,W.jsxs)(B,{style:O9.section,children:[(0,W.jsx)(o9t,{testID:`manufacturer-symbol`,color:t.bgPrimary}),(0,W.jsx)(Z,{style:[O9.textContainer,{color:t.labelSecondary}],children:cin})]}),(0,W.jsxs)(B,{style:O9.section,children:[(0,W.jsx)(a9t,{testID:`manual-icon`}),(0,W.jsx)(Z,{testID:`manual-button`,style:[O9.manualText,{color:t.textLink}],onPress:()=>{u8(l8.SettingsIFU),n.navigate(Q.IFU)},children:e(`legal_IFU`)})]}),(0,W.jsxs)(B,{style:O9.section,children:[(0,W.jsx)(d9t,{testID:`SN-symbol`}),(0,W.jsx)(Z,{style:[O9.textContainer,{color:t.labelSecondary}],children:c8})]}),(0,W.jsxs)(B,{style:O9.section,children:[(0,W.jsx)(q7t,{testID:`ce-logo`}),(0,W.jsx)(Z,{style:[O9.alignTop,{color:t.labelSecondary}],children:e(`legal_ce_mark_text`)})]}),(0,W.jsxs)(B,{style:O9.section,children:[(0,W.jsx)(o9t,{color:t.labelPrimary}),(0,W.jsxs)(B,{style:O9.textContainer,children:[(0,W.jsx)(Z,{style:[O9.sectionTitle,{color:t.labelSecondary}],children:e(`legal_company_name`)}),(0,W.jsx)(Z,{style:{color:t.labelSecondary},children:e(`legal_company_adress`)}),(0,W.jsx)(Z,{style:{color:t.labelSecondary},children:e(`legal_company_country`)}),(0,W.jsx)(Z,{style:{color:t.labelSecondary},children:e(`legal_company_email`)}),(0,W.jsx)(Z,{style:{color:t.labelSecondary},children:e(`legal_company_cvr_vat`)})]})]}),(0,W.jsxs)(B,{style:[O9.section,O9.udiSection],children:[(0,W.jsx)(f9t,{testID:`udi-logo`,style:O9.udiLogo}),(0,W.jsxs)(Z,{style:[O9.textContainer,O9.udiText,{color:t.labelSecondary}],children:[(0,W.jsx)(Z,{style:{color:t.labelSecondary},children:`(01)${uin}(10)`}),(0,W.jsx)(Z,{style:{color:t.labelSecondary},children:`${c8}(8012)${c8}`})]})]}),(0,W.jsxs)(B,{style:O9.sectionColumn,children:[(0,W.jsx)(p9t,{testID:`uk-rep-logo`,style:O9.repIcon}),(0,W.jsx)(Z,{style:{color:t.labelSecondary},children:e(`legal_ukrep`)})]}),Oq?null:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Z,{style:[O9.sectionTitle,{color:t.labelSecondary}],children:e(`more_legal_novo_nordisk_disclaimer_title`)}),(0,W.jsx)(Z,{style:{color:t.labelSecondary},children:e(`more_legal_novo_nordisk_disclaimer_text`)})]})]})},O9=R.create({scrollView:{paddingTop:32,paddingHorizontal:16},title:{...Y.Poppins.regular_SM,textAlign:`center`,marginBottom:32},section:{flexDirection:`row`,marginBottom:32},sectionTitle:{...Y.Poppins.medium_Base},textContainer:{flex:1,marginLeft:20,alignSelf:`center`},alignTop:{flex:1,marginLeft:20,alignSelf:`flex-start`},sectionColumn:{marginBottom:32},repIcon:{marginBottom:12},manualText:{...Y.Poppins.medium_Base,marginLeft:20,alignSelf:`center`},udiSection:{flexWrap:`wrap`,marginBottom:20},udiLogo:{marginRight:20,marginBottom:12},udiText:{marginLeft:0,marginBottom:12,display:`flex`,flexWrap:`wrap`}});V();var Nvn=()=>{let e=new Date().getFullYear();return[...Array(12).keys()].map(t=>I8(new Date(e,t),`MMM`))},Pvn=()=>{let e=1900,t=new Date().getFullYear()-e+1;return Array.from({length:t},(t,n)=>(n+e).toString())},Fvn=(e,t)=>wpn(new Date(e,t)),Ivn=Nvn(),Lvn=Array.from({length:31},(e,t)=>(t+1).toString().padStart(2,`0`)),Rvn=Pvn();function zvn({isVisible:e,initialValue:t,onCancel:n,onConfirm:r,onModalHide:i}){let{COLORS:a}=J(),{width:o}=em(),s=(0,H.useRef)(null),c=(0,H.useRef)(null),l=(0,H.useRef)(null),[u,d]=(0,H.useState)(t);(0,H.useEffect)(()=>{e&&d(e=>e.getTime()===t.getTime()?e:new Date(t))},[t,e]);let f=(0,H.useMemo)(()=>t.getDate()-1,[t]),p=(0,H.useMemo)(()=>t.getMonth(),[t]),m=(0,H.useMemo)(()=>{let e=t.getFullYear();return Rvn.indexOf(e.toString())},[t]),h=(0,H.useMemo)(()=>u.getDate()-1,[u]),g=(0,H.useMemo)(()=>u.getMonth(),[u]),_=(0,H.useMemo)(()=>u.getFullYear(),[u]),v=(0,H.useCallback)(()=>{r(u)},[r,u]),y=(0,H.useCallback)(()=>{d(t),n()},[n,t]),b=(0,H.useCallback)(e=>{let t=Fvn(_,e)-1;d(new Date(_,e,Math.min(h,t)+1)),h>t&&s.current?.scrollToIndex(t)},[h,_]),x=(0,H.useCallback)(e=>{let t=Fvn(_,g)-1;d(new Date(_,g,Math.min(e,t)+1)),e>t&&s.current?.scrollToIndex(t)},[g,_]),S=(0,H.useCallback)(e=>{let t=parseInt(Rvn[e],10),n=Fvn(t,g)-1;d(new Date(t,g,Math.min(h,n)+1)),h>n&&s.current?.scrollToIndex(n)},[h,g]);return(0,W.jsx)(u3,{isVisible:e,containerStyle:{backgroundColor:a.bgTransparent},onModalHide:i,children:(0,W.jsxs)(B,{children:[(0,W.jsxs)(B,{style:k9.pickersContainer,children:[(0,W.jsx)(Z5,{ref:c,initialScrollIndex:p,options:Ivn,onChange:b,containerStyle:[k9.itemContainerLeft,{width:(o-32)/3}],selectedIndicatorStyle:[k9.selectedIndicatorLeft,{width:(o-32)/3-10}],itemStyle:k9.itemLeft,testID:`months-wheel-picker`},`months-wheel-picker`),(0,W.jsx)(Z5,{ref:s,initialScrollIndex:f,options:Lvn,onChange:x,containerStyle:[k9.itemContainerCenter,{width:(o-32)/3}],selectedIndicatorStyle:[k9.selectedIndicatorCenter,{width:(o-32)/3}],itemStyle:k9.itemCenter,testID:`days-wheel-picker`},`days-wheel-picker`),(0,W.jsx)(Z5,{ref:l,initialScrollIndex:m,options:Rvn,onChange:S,containerStyle:[k9.itemContainerRight,{width:(o-32)/3}],selectedIndicatorStyle:[k9.selectedIndicatorRight,{width:(o-32)/3-10}],itemStyle:k9.itemRight,testID:`years-wheel-picker`},`years-wheel-picker`)]}),(0,W.jsxs)(B,{style:k9.buttonContainer,children:[(0,W.jsx)(X5,{onPress:v}),(0,W.jsx)(Y5,{onPress:y})]})]})})}var Bvn=H.memo(zvn),k9=R.create({buttonContainer:{gap:8},pickersContainer:{flexDirection:`row`,borderTopLeftRadius:13,borderTopRightRadius:13,overflow:`hidden`},itemContainerLeft:{borderTopRightRadius:0,paddingLeft:8},itemContainerCenter:{borderTopLeftRadius:0,borderTopRightRadius:0},itemContainerRight:{borderTopLeftRadius:0,paddingRight:8},itemLeft:{alignSelf:`flex-end`},itemCenter:{alignSelf:`center`},itemRight:{alignSelf:`flex-start`},selectedIndicatorRight:{alignSelf:`flex-start`,borderTopLeftRadius:0,borderBottomLeftRadius:0},selectedIndicatorCenter:{alignSelf:`center`,borderRadius:0},selectedIndicatorLeft:{alignSelf:`flex-end`,borderTopRightRadius:0,borderBottomRightRadius:0}}),Vvn=a3(0,220),Hvn=a3(0,300),Uvn=f7(({isVisible:e,onCancel:t,onModalHide:n})=>{let{t:r}=Tq(),{isOnboardingFinished:i}=E3(),{biologicalSex:a}=s7(),{setSetupCalculatorStoreValues:o}=o7(),{modalStoreActions:s}=z5(),c=i?k8.biologicalSex:a,[l,u]=(0,H.useState)(void 0),d=!k8.biologicalSex,f=+!!d,p=(0,H.useMemo)(()=>{switch(c){case X.BiologicalSex.Male:return 0;case X.BiologicalSex.Female:return 1;case X.BiologicalSex.Unspecified:return 2;default:return 0}},[c]),m=(0,H.useCallback)(async(e,n)=>{if(d&&n===0){o({biologicalSex:void 0}),t();return}let r=n-f,a=X.BiologicalSex.Male;if(r===1&&(a=X.BiologicalSex.Female),r===2&&(a=X.BiologicalSex.Unspecified),c===a){t();return}i?u(await k8.postUserSettings({biologicalSex:a})):o({biologicalSex:a}),t()},[c,i,d,f,t,o]),h=(0,H.useCallback)(()=>{l===!1?s.set({showSyncErrorModal:!0}):n&&n(),u(void 0)},[s,l,n]);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Q5,{isVisible:e,items:d?[`-`,r(`biological_sex_male`),r(`biological_sex_female`),r(`biological_sex_no_answer`)]:[r(`biological_sex_male`),r(`biological_sex_female`),r(`biological_sex_no_answer`)],onConfirm:m,onCancel:t,initialScrollIndex:p,onModalHide:h,testID:`biological_sex_wheel_picker`}),(0,W.jsx)(t7,{})]})}),Wvn=f7(({isVisible:e,onCancel:t,onModalHide:n})=>{let{t:r}=Tq(),{modalStoreActions:i}=z5(),a=k8.diabetesType,[o,s]=(0,H.useState)(!1),[c,l]=(0,H.useState)(void 0),u=(0,H.useMemo)(()=>a===X.DiabetesType.Type1?0:1,[a]),d=(0,H.useCallback)(async(e,n)=>{let r=n===0?X.DiabetesType.Type1:X.DiabetesType.Type2;if(a===r){t();return}l(await k8.postUserSettings({diabetesType:r})),t()},[a,t]),f=(0,H.useCallback)(()=>{s(!1)},[]),p=(0,H.useCallback)(()=>{c===!1?i.set({showSyncErrorModal:!0}):c&&a===X.DiabetesType.Type2?s(!0):n&&n(),l(void 0)},[i,c,a,n]);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Q5,{isVisible:e,items:[r(`type_of_diabetes_type1`),r(`type_of_diabetes_type2`)],onConfirm:d,onCancel:t,initialScrollIndex:u,onModalHide:p,testID:`diabetes_type_wheel_picker`}),(0,W.jsx)(u3,{title:r(`modal_diabetes2_title`),isVisible:o,message:r(`modal_diabetes2_body`),onModalHide:n,buttons:[{title:r(`button_close`),onPress:f}]}),(0,W.jsx)(t7,{})]})});V(),Z0();function Gvn(){let{t:e}=Tq(),{COLORS:t,isDark:n,effectiveColorScheme:r}=J(),{bottom:i}=W0(),{modalStoreActions:a}=z5(),[o,s]=(0,H.useState)(!1),[c,l]=(0,H.useState)(!1),[u,d]=(0,H.useState)(!1),[f,p]=(0,H.useState)(!1),[m,h]=(0,H.useState)(!1),[g,_]=(0,H.useState)(void 0),{birthDate:v,diabetesType:y,biologicalSex:b,weightKg:x,heightCm:S}=k8;if(y===void 0)throw Error(`[AboutSection::render] diatbetesType must be defined.`);let C=(0,H.useMemo)(()=>v?new Date(v):void 0,[v]),w=(0,H.useMemo)(()=>y===X.DiabetesType.Type1?`type_of_diabetes_type1`:`type_of_diabetes_type2`,[y]),T=(0,H.useCallback)(async e=>{e!==S&&_(await k8.postUserSettings({height:e})),d(!1)},[S]),E=(0,H.useCallback)(async e=>{e!==x&&_(await k8.postUserSettings({weight:e})),p(!1)},[x]),D=(0,H.useMemo)(()=>{if(S===void 0)return 0;let e=Math.round(S*10)/10;return Vvn.indexOf(e.toString())},[S]),O=(0,H.useMemo)(()=>{if(x===void 0)return 0;let e=Math.round(x*10)/10;return Hvn.indexOf(e.toString())},[x]),k=async e=>{e.toISOString()!==v&&_(await k8.postUserSettings({birthday:e.toISOString()})),h(!1)},A=(0,H.useCallback)(()=>{g===!1&&a.set({showSyncErrorModal:!0}),_(void 0)},[a,g]),ee=(0,H.useCallback)(()=>{A()},[A]);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(B,{children:(0,W.jsxs)(Y4.Container,{children:[(0,W.jsx)(Y4,{title:e(`my_profile_birth`),value:C?C.toLocaleDateString():`-`,testID:`date-of-birth`,onPress:()=>{h(!0)}}),(0,W.jsx)(Y4,{title:e(`my_profile_diabetes_type`),value:e(w),testID:`diabetes-type`,onPress:()=>{s(!0)}}),(0,W.jsx)(Y4,{title:e(`my_profile_sex`),testID:`biologicalSex`,value:b?vvt[b]():`-`,onPress:()=>{l(!0)}}),(0,W.jsx)(Y4,{title:e(`my_profile_height`),value:`${S??`-`} cm`,testID:`height`,onPress:()=>{d(!0)}}),(0,W.jsx)(Y4,{title:e(`my_profile_weight`),value:`${x??`-`} kg`,testID:`weight`,onPress:()=>{p(!0)}})]})}),kq?(0,W.jsx)(Zpn,{testID:`birthday-date-picker`,display:`spinner`,minimumDate:new Date(1900,0,1),maximumDate:new Date,date:C,isVisible:m,onConfirm:k,onCancel:()=>{h(!1)},customConfirmButtonIOS:emn,customCancelButtonIOS:tmn,pickerContainerStyleIOS:{backgroundColor:t.iosKeyboardPicker},modalStyleIOS:{paddingBottom:i},themeVariant:r,isDarkModeEnabled:n,onHide:ee,pickerStyleIOS:{alignSelf:`center`}}):(0,W.jsx)(Bvn,{isVisible:m,initialValue:C??new Date,onConfirm:k,onCancel:()=>{h(!1)},onModalHide:ee}),(0,W.jsx)(Wvn,{isVisible:o,onCancel:()=>{s(!1)},onModalHide:A}),(0,W.jsx)(Uvn,{isVisible:c,onCancel:()=>{l(!1)},onModalHide:A}),(0,W.jsx)(Q5,{isVisible:u,items:Vvn,onConfirm:T,onCancel:()=>{d(!1)},initialScrollIndex:D,onModalHide:A,testID:`height_wheel_picker`}),(0,W.jsx)(Q5,{isVisible:f,items:Hvn,onConfirm:E,onCancel:()=>{p(!1)},initialScrollIndex:O,onModalHide:A,testID:`weight_wheel_picker`}),(0,W.jsx)(t7,{onModalHide:()=>{_(void 0)}})]})}var Kvn=f7(Gvn);V();function qvn(){let{t:e}=Tq();return(0,W.jsxs)(fs,{testID:`profile-screen-scroll`,style:Jvn.scrollView,contentContainerStyle:Jvn.contentContainer,children:[(0,W.jsx)(Y4,{title:e(`my_profile_account`),testID:`first-name`,renderRightSlot:()=>(0,W.jsx)(K4,{}),onPress:()=>{window.location.href=`/account`}}),(0,W.jsx)(Kvn,{})]})}var Jvn=R.create({scrollView:{paddingHorizontal:16},contentContainer:{paddingVertical:32,flexGrow:1,gap:24}});V(),new Of(yi.RNDeviceInfo);var Yvn=c({getBaseOs:()=>gyn,getBatteryLevel:()=>fyn,getBatteryLevelSync:()=>pyn,getFreeDiskStorage:()=>yyn,getFreeDiskStorageSync:()=>byn,getInstallReferrer:()=>oyn,getInstallReferrerSync:()=>Qvn,getMaxMemory:()=>xyn,getMaxMemorySync:()=>Zvn,getPowerState:()=>wyn,getPowerStateSync:()=>Tyn,getTotalDiskCapacity:()=>_yn,getTotalDiskCapacitySync:()=>vyn,getTotalMemory:()=>Cyn,getTotalMemorySync:()=>nyn,getUsedMemory:()=>Syn,getUsedMemorySync:()=>ryn,getUserAgent:()=>syn,getUserAgentSync:()=>eyn,isAirplaneMode:()=>hyn,isAirplaneModeSync:()=>$vn,isBatteryCharging:()=>cyn,isBatteryChargingSync:()=>lyn,isCameraPresent:()=>uyn,isCameraPresentSync:()=>dyn,isLocationEnabled:()=>myn,isLocationEnabledSync:()=>tyn}),A9,j9,Xvn,M9,N9,Zvn,Qvn,$vn,eyn,tyn,nyn,ryn,iyn,ayn,oyn,syn,cyn,lyn,uyn,dyn,fyn,pyn,myn,hyn,gyn,_yn,vyn,yyn,byn,xyn,Syn,Cyn,wyn,Tyn,Eyn=o((()=>{V(),A9=new Of(yi.RNDeviceInfo),j9=!1,Xvn=-1,M9={},N9=e=>{let{level:t,charging:n,chargingtime:r,dischargingtime:i}=e;return{batteryLevel:t,lowPowerMode:!1,batteryState:t===1?`full`:n?`charging`:`unplugged`,chargingtime:r,dischargingtime:i}},Zvn=()=>window.performance&&window.performance.memory?window.performance.memory.jsHeapSizeLimit:-1,Qvn=()=>document.referrer,$vn=()=>!!navigator.onLine,eyn=()=>window.navigator.userAgent,tyn=()=>!!navigator.geolocation,nyn=()=>navigator.deviceMemory?navigator.deviceMemory*1e9:-1,ryn=()=>window.performance&&window.performance.memory?window.performance.memory.usedJSHeapSize:-1,iyn=()=>{typeof navigator>`u`||!navigator.getBattery||navigator.getBattery().then(e=>{j9=e.charging,e.addEventListener(`chargingchange`,()=>{let{charging:t}=e;j9=t,M9=N9(e),A9.emit(`RNDeviceInfo_powerStateDidChange`,M9)}),e.addEventListener(`levelchange`,()=>{let{level:t}=e;Xvn=t,M9=N9(e),A9.emit(`RNDeviceInfo_batteryLevelDidChange`,t),t<.2&&A9.emit(`RNDeviceInfo_batteryLevelIsLow`,t)})})},ayn=()=>{let e=window.navigator.userAgent,t=window.navigator.platform,n=[`Macintosh`,`MacIntel`,`MacPPC`,`Mac68K`],r=[`Win32`,`Win64`,`Windows`,`WinCE`],i=[`iPhone`,`iPad`,`iPod`],a=t;return n.indexOf(t)===-1?i.indexOf(t)===-1?r.indexOf(t)===-1?/Android/.test(e)?a=`Android`:!a&&/Linux/.test(t)&&(a=`Linux`):a=`Windows`:a=`iOS`:a=`Mac OS`,a},iyn(),oyn=async()=>Qvn(),syn=async()=>eyn(),cyn=async()=>navigator.getBattery?navigator.getBattery().then(e=>e.charging):!1,lyn=()=>j9,uyn=async()=>navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices?navigator.mediaDevices.enumerateDevices().then(e=>!!e.find(e=>e.kind===`videoinput`)):!1,dyn=()=>(console.log(`[react-native-device-info] isCameraPresentSync not supported - please use isCameraPresent`),!1),fyn=async()=>navigator.getBattery?navigator.getBattery().then(e=>e.level):-1,pyn=()=>Xvn,myn=async()=>tyn(),hyn=async()=>$vn(),gyn=async()=>ayn(),_yn=async()=>navigator.storage&&navigator.storage.estimate?navigator.storage.estimate().then(({quota:e})=>e):-1,vyn=()=>(console.log(`[react-native-device-info] getTotalDiskCapacitySync not supported - please use getTotalDiskCapacity`),-1),yyn=async()=>navigator.storage&&navigator.storage.estimate?navigator.storage.estimate().then(({quota:e,usage:t})=>e-t):-1,byn=()=>(console.log(`[react-native-device-info] getFreeDiskStorageSync not supported - please use getFreeDiskStorage`),-1),xyn=async()=>Zvn(),Syn=async()=>ryn(),Cyn=async()=>nyn(),wyn=async()=>navigator.getBattery?navigator.getBattery().then(e=>N9(e)):{},Tyn=()=>M9}));V();var Dyn=yi.RNDeviceInfo;if((z.OS===`web`||z.OS===`dom`)&&(Dyn=(Eyn(),d(Yvn))),!Dyn&&(z.OS===`android`||z.OS===`ios`||z.OS===`web`||z.OS===`dom`))throw Error("react-native-device-info: NativeModule.RNDeviceInfo is null. To fix this issue try these steps:\n • For react-native <= 0.59: Run `react-native link react-native-device-info` in the project root.\n • Rebuild and re-run the app.\n • If you are using CocoaPods on iOS, run `pod install` in the `ios` directory and then rebuild and re-run the app. You may also need to re-open Xcode to get the new pods.\n If none of these fix the issue, please open an issue on the Github repository: https://github.com/react-native-device-info/react-native-device-info");var $=Dyn;V();var P9={};function Oyn(e,t,n){let r={};return e.filter(e=>z.OS==e).forEach(e=>r[e]=t),z.select({...r,default:n})}function kyn({getter:e,supportedPlatforms:t,defaultValue:n,memoKey:r}){if(r&&P9[r]!=null)return P9[r];{let i=Oyn(t,e,()=>n)();return r&&(P9[r]=i),i}}async function Ayn({getter:e,supportedPlatforms:t,defaultValue:n,memoKey:r}){if(r&&P9[r]!=null)return P9[r];{let i=await Oyn(t,e,()=>Promise.resolve(n))();return r&&(P9[r]=i),i}}function F9({syncGetter:e,...t}){return[(...e)=>Ayn({...t,getter:()=>t.getter(...e)}),(...n)=>kyn({...t,getter:()=>e(...n)})]}V();var[jyn,Myn]=F9({memoKey:`uniqueId`,supportedPlatforms:[`android`,`ios`,`windows`],getter:()=>$.getUniqueId(),syncGetter:()=>$.getUniqueIdSync(),defaultValue:`unknown`}),[Nyn,Pyn]=F9({memoKey:`instanceId`,supportedPlatforms:[`android`],getter:()=>$.getInstanceId(),syncGetter:()=>$.getInstanceIdSync(),defaultValue:`unknown`}),[Fyn,Iyn]=F9({memoKey:`serialNumber`,supportedPlatforms:[`android`,`windows`],getter:()=>$.getSerialNumber(),syncGetter:()=>$.getSerialNumberSync(),defaultValue:`unknown`}),[Lyn,Ryn]=F9({memoKey:`androidId`,supportedPlatforms:[`android`],getter:()=>$.getAndroidId(),syncGetter:()=>$.getAndroidIdSync(),defaultValue:`unknown`}),[zyn,Byn]=F9({supportedPlatforms:[`android`,`ios`,`windows`],getter:()=>$.getIpAddress(),syncGetter:()=>$.getIpAddressSync(),defaultValue:`unknown`}),[Vyn,Hyn]=F9({supportedPlatforms:[`android`,`windows`,`web`],getter:()=>$.isCameraPresent(),syncGetter:()=>$.isCameraPresentSync(),defaultValue:!1}),[Uyn,Wyn]=F9({memoKey:`manufacturer`,supportedPlatforms:[`android`,`ios`,`windows`],getter:()=>z.OS==`ios`?Promise.resolve(`Apple`):$.getSystemManufacturer(),syncGetter:()=>z.OS==`ios`?`Apple`:$.getSystemManufacturerSync(),defaultValue:`unknown`}),Gyn=()=>kyn({defaultValue:`unknown`,supportedPlatforms:[`ios`,`android`,`windows`],memoKey:`systemName`,getter:()=>z.select({ios:$.systemName,android:`Android`,windows:`Windows`,default:`unknown`})}),Kyn=()=>kyn({defaultValue:`unknown`,getter:()=>$.systemVersion,supportedPlatforms:[`android`,`ios`,`windows`],memoKey:`systemVersion`}),[qyn,Jyn]=F9({memoKey:`buildId`,supportedPlatforms:[`android`,`ios`,`windows`],getter:()=>$.getBuildId(),syncGetter:()=>$.getBuildIdSync(),defaultValue:`unknown`}),[Yyn,Xyn]=F9({memoKey:`apiLevel`,supportedPlatforms:[`android`],getter:()=>$.getApiLevel(),syncGetter:()=>$.getApiLevelSync(),defaultValue:-1}),[Zyn,Qyn]=F9({memoKey:`installerPackageName`,supportedPlatforms:[`android`,`windows`,`ios`],getter:()=>$.getInstallerPackageName(),syncGetter:()=>$.getInstallerPackageNameSync(),defaultValue:`unknown`}),[$yn,ebn]=F9({supportedPlatforms:[`android`,`ios`,`windows`],getter:()=>$.getDeviceName(),syncGetter:()=>$.getDeviceNameSync(),defaultValue:`unknown`}),[tbn,nbn]=F9({supportedPlatforms:[`android`,`ios`,`windows`,`web`],getter:()=>$.getUsedMemory(),syncGetter:()=>$.getUsedMemorySync(),defaultValue:-1}),[rbn,ibn]=F9({supportedPlatforms:[`android`,`ios`,`windows`],getter:()=>$.getFontScale(),syncGetter:()=>$.getFontScaleSync(),defaultValue:-1}),[abn,obn]=F9({memoKey:`bootloader`,supportedPlatforms:[`android`],getter:()=>$.getBootloader(),syncGetter:()=>$.getBootloaderSync(),defaultValue:`unknown`}),[sbn,cbn]=F9({getter:()=>$.getDevice(),syncGetter:()=>$.getDeviceSync(),defaultValue:`unknown`,memoKey:`device`,supportedPlatforms:[`android`]}),[lbn,ubn]=F9({memoKey:`display`,supportedPlatforms:[`android`],getter:()=>$.getDisplay(),syncGetter:()=>$.getDisplaySync(),defaultValue:`unknown`}),[dbn,fbn]=F9({memoKey:`fingerprint`,supportedPlatforms:[`android`],getter:()=>$.getFingerprint(),syncGetter:()=>$.getFingerprintSync(),defaultValue:`unknown`}),[pbn,mbn]=F9({memoKey:`hardware`,supportedPlatforms:[`android`],getter:()=>$.getHardware(),syncGetter:()=>$.getHardwareSync(),defaultValue:`unknown`}),[hbn,gbn]=F9({memoKey:`host`,supportedPlatforms:[`android`,`windows`],getter:()=>$.getHost(),syncGetter:()=>$.getHostSync(),defaultValue:`unknown`}),[_bn,vbn]=F9({memoKey:`hostNames`,supportedPlatforms:[`windows`],getter:()=>$.getHostNames(),syncGetter:()=>$.getHostNamesSync(),defaultValue:[]}),[ybn,bbn]=F9({memoKey:`product`,supportedPlatforms:[`android`],getter:()=>$.getProduct(),syncGetter:()=>$.getProductSync(),defaultValue:`unknown`}),[xbn,Sbn]=F9({memoKey:`tags`,supportedPlatforms:[`android`],getter:()=>$.getTags(),syncGetter:()=>$.getTagsSync(),defaultValue:`unknown`}),[Cbn,wbn]=F9({memoKey:`type`,supportedPlatforms:[`android`],getter:()=>$.getType(),syncGetter:()=>$.getTypeSync(),defaultValue:`unknown`}),[Tbn,Ebn]=F9({memoKey:`baseOs`,supportedPlatforms:[`android`,`web`,`windows`],getter:()=>$.getBaseOs(),syncGetter:()=>$.getBaseOsSync(),defaultValue:`unknown`}),[Dbn,Obn]=F9({memoKey:`previewSdkInt`,supportedPlatforms:[`android`],getter:()=>$.getPreviewSdkInt(),syncGetter:()=>$.getPreviewSdkIntSync(),defaultValue:-1}),[kbn,Abn]=F9({memoKey:`securityPatch`,supportedPlatforms:[`android`],getter:()=>$.getSecurityPatch(),syncGetter:()=>$.getSecurityPatchSync(),defaultValue:`unknown`}),[jbn,Mbn]=F9({memoKey:`codeName`,supportedPlatforms:[`android`],getter:()=>$.getCodename(),syncGetter:()=>$.getCodenameSync(),defaultValue:`unknown`}),[Nbn,Pbn]=F9({memoKey:`incremental`,supportedPlatforms:[`android`],getter:()=>$.getIncremental(),syncGetter:()=>$.getIncrementalSync(),defaultValue:`unknown`}),[Fbn,Ibn]=F9({memoKey:`emulator`,supportedPlatforms:[`android`,`ios`,`windows`],getter:()=>$.isEmulator(),syncGetter:()=>$.isEmulatorSync(),defaultValue:!1}),[Lbn,Rbn]=F9({supportedPlatforms:[`android`,`ios`,`windows`],getter:()=>$.isPinOrFingerprintSet(),syncGetter:()=>$.isPinOrFingerprintSetSync(),defaultValue:!1}),[zbn,Bbn]=F9({supportedPlatforms:[`android`],getter:()=>$.hasGms(),syncGetter:()=>$.hasGmsSync(),defaultValue:!1}),[Vbn,Hbn]=F9({supportedPlatforms:[`android`],getter:()=>$.hasHms(),syncGetter:()=>$.hasHmsSync(),defaultValue:!1}),[Ubn,Wbn]=F9({memoKey:`firstInstallTime`,supportedPlatforms:[`android`,`ios`,`windows`],getter:()=>$.getFirstInstallTime(),syncGetter:()=>$.getFirstInstallTimeSync(),defaultValue:-1}),[Gbn,Kbn]=F9({memoKey:`installReferrer`,supportedPlatforms:[`android`,`windows`,`web`],getter:()=>$.getInstallReferrer(),syncGetter:()=>$.getInstallReferrerSync(),defaultValue:`unknown`}),[qbn,Jbn]=F9({memoKey:`lastUpdateTime`,supportedPlatforms:[`android`],getter:()=>$.getLastUpdateTime(),syncGetter:()=>$.getLastUpdateTimeSync(),defaultValue:-1}),[Ybn,Xbn]=F9({memoKey:`startupTime`,supportedPlatforms:[`android`,`ios`],getter:()=>$.getStartupTime(),syncGetter:()=>$.getStartupTimeSync(),defaultValue:-1}),[Zbn,Qbn]=F9({supportedPlatforms:[`android`,`ios`],getter:()=>$.getCarrier(),syncGetter:()=>$.getCarrierSync(),defaultValue:`unknown`}),[$bn,exn]=F9({memoKey:`totalMemory`,supportedPlatforms:[`android`,`ios`,`windows`,`web`],getter:()=>$.getTotalMemory(),syncGetter:()=>$.getTotalMemorySync(),defaultValue:-1}),[txn,nxn]=F9({memoKey:`maxMemory`,supportedPlatforms:[`android`,`windows`,`web`],getter:()=>$.getMaxMemory(),syncGetter:()=>$.getMaxMemorySync(),defaultValue:-1}),[rxn,ixn]=F9({supportedPlatforms:[`android`,`ios`,`windows`,`web`],getter:()=>$.getTotalDiskCapacity(),syncGetter:()=>$.getTotalDiskCapacitySync(),defaultValue:-1}),[axn,oxn]=F9({supportedPlatforms:[`android`,`ios`,`windows`,`web`],getter:(e=`total`)=>z.OS===`ios`?$.getFreeDiskStorage(e):$.getFreeDiskStorage(),syncGetter:(e=`total`)=>z.OS===`ios`?$.getFreeDiskStorageSync(e):$.getFreeDiskStorageSync(),defaultValue:-1}),[sxn,cxn]=F9({supportedPlatforms:[`android`,`ios`,`windows`,`web`],getter:()=>$.getBatteryLevel(),syncGetter:()=>$.getBatteryLevelSync(),defaultValue:-1}),[lxn,uxn]=F9({supportedPlatforms:[`ios`,`android`,`windows`,`web`],getter:()=>$.getPowerState(),syncGetter:()=>$.getPowerStateSync(),defaultValue:{}}),[dxn,fxn]=F9({supportedPlatforms:[`android`,`ios`,`windows`,`web`],getter:()=>$.isBatteryCharging(),syncGetter:()=>$.isBatteryChargingSync(),defaultValue:!1}),[pxn,mxn]=F9({supportedPlatforms:[`android`,`web`],getter:()=>$.isAirplaneMode(),syncGetter:()=>$.isAirplaneModeSync(),defaultValue:!1}),[hxn,gxn]=F9({memoKey:`_supportedAbis`,supportedPlatforms:[`android`,`ios`,`windows`],getter:()=>$.getSupportedAbis(),syncGetter:()=>$.getSupportedAbisSync(),defaultValue:[]}),[_xn,vxn]=F9({memoKey:`_supported32BitAbis`,supportedPlatforms:[`android`],getter:()=>$.getSupported32BitAbis(),syncGetter:()=>$.getSupported32BitAbisSync(),defaultValue:[]}),[yxn,bxn]=F9({memoKey:`_supported64BitAbis`,supportedPlatforms:[`android`],getter:()=>$.getSupported64BitAbis(),syncGetter:()=>$.getSupported64BitAbisSync(),defaultValue:[]}),[xxn,Sxn]=F9({supportedPlatforms:[`android`],getter:()=>$.getSystemAvailableFeatures(),syncGetter:()=>$.getSystemAvailableFeaturesSync(),defaultValue:[]}),[Cxn,wxn]=F9({supportedPlatforms:[`android`,`ios`,`web`],getter:()=>$.isLocationEnabled(),syncGetter:()=>$.isLocationEnabledSync(),defaultValue:!1}),[Txn,Exn]=F9({supportedPlatforms:[`android`,`ios`],getter:()=>$.isHeadphonesConnected(),syncGetter:()=>$.isHeadphonesConnectedSync(),defaultValue:!1}),[Dxn,Oxn]=F9({supportedPlatforms:[`android`,`ios`],getter:()=>$.isWiredHeadphonesConnected(),syncGetter:()=>$.isWiredHeadphonesConnectedSync(),defaultValue:!1}),[kxn,Axn]=F9({supportedPlatforms:[`android`,`ios`],getter:()=>$.isBluetoothHeadphonesConnected(),syncGetter:()=>$.isBluetoothHeadphonesConnectedSync(),defaultValue:!1}),[jxn,Mxn]=F9({supportedPlatforms:[`windows`],getter:()=>$.isMouseConnected(),syncGetter:()=>$.isMouseConnectedSync(),defaultValue:!1}),[Nxn,Pxn]=F9({supportedPlatforms:[`windows`],getter:()=>$.isKeyboardConnected(),syncGetter:()=>$.isKeyboardConnectedSync(),defaultValue:!1}),[Fxn,Ixn]=F9({supportedPlatforms:[`android`],getter:()=>$.getSupportedMediaTypeList(),syncGetter:()=>$.getSupportedMediaTypeListSync(),defaultValue:[]}),[Lxn,Rxn]=F9({supportedPlatforms:[`android`,`ios`],getter:()=>$.getAvailableLocationProviders(),syncGetter:()=>$.getAvailableLocationProvidersSync(),defaultValue:{}}),[zxn,Bxn]=F9({supportedPlatforms:[`ios`],getter:()=>$.getBrightness(),syncGetter:()=>$.getBrightnessSync(),defaultValue:-1});new Of(yi.RNDeviceInfo),V();var Vxn=()=>{let{t:e}=Tq(),{COLORS:t}=J(),{navigate:n}=N$(),r=(0,H.useCallback)(async()=>{if(Oq)n(Q.SupportContact);else{let e=`App version: ${c8}\n${Gyn()} version: ${Kyn()}`;await Lre.openURL(`mailto:support@hedia.com?subject=Hedia support&body=${e}`)}},[n]);return(0,W.jsxs)(fs,{contentContainerStyle:Hxn.wrapper,children:[(0,W.jsx)(Z,{style:[Hxn.title,{color:t.labelPrimary}],children:e(`support_title`)}),(0,W.jsxs)(B,{style:Hxn.buttons,children:[(0,W.jsx)(U4,{title:e(`button_email`),onPress:r,testID:`send_email_button`}),(0,W.jsx)(U4,{title:e(`button_support_page`),onPress:()=>{n(Q.SupportWebView)},testID:`open_support_page_button`,type:H4.Secondary}),(0,W.jsx)(U4,{title:e(`button_instructions`),onPress:()=>{u8(l8.SettingsIFU),n(Q.IFU)},testID:`open_ifu_page_button`,type:H4.Secondary})]})]})},Hxn=R.create({wrapper:{flex:1,justifyContent:`center`,paddingHorizontal:16},title:{...Y.Poppins.bold_2XL,marginBottom:48,textAlign:`center`},buttons:{gap:16}});V();var Uxn=()=>{let{t:e}=Tq(),{COLORS:t}=J(),{colorScheme:n,setColorScheme:r}=L3t(),i=N5(),{bottomWithScroll:a}=Q4(),o=(0,H.useCallback)(e=>{let t=`colorScheme-${e.toLowerCase()}`;return v2[e]===n?`${t}-selected`:t},[n]),s=(0,H.useCallback)(e=>{r(v2[e])},[r]);return(0,W.jsxs)(fs,{contentContainerStyle:[I9.scrollView,{paddingTop:i+16,paddingBottom:a}],children:[(0,W.jsxs)(Y4.Container,{children:[(0,W.jsx)(Y4,{title:e(`theme_system`),renderRightSlot:()=>(0,W.jsx)(B,{style:I9.checkmarkContainer,children:v2.System===n?(0,W.jsx)(G4,{width:24,height:24}):null}),onPress:()=>{s(`System`)},testID:o(`System`),displayType:J4.ListItem}),(0,W.jsx)(Y4,{title:e(`theme_dark`),renderRightSlot:()=>(0,W.jsx)(B,{style:I9.checkmarkContainer,children:v2.Dark===n?(0,W.jsx)(G4,{width:24,height:24}):null}),onPress:()=>{s(`Dark`)},testID:o(`Dark`),displayType:J4.ListItem}),(0,W.jsx)(Y4,{title:e(`theme_light`),renderRightSlot:()=>(0,W.jsx)(B,{style:I9.checkmarkContainer,children:v2.Light===n?(0,W.jsx)(G4,{width:24,height:24}):null}),onPress:()=>{s(`Light`)},testID:o(`Light`),displayType:J4.ListItem})]}),(0,W.jsx)(Z,{style:[I9.description,{color:t.labelSecondary}],testID:`settings-colorScheme-hint`,children:e(`theme_subtitle`)})]})},I9=R.create({scrollView:{paddingHorizontal:16,flexGrow:1},checkmarkContainer:{width:24,height:24},description:{...Y.Poppins.regular_SM,margin:16}}),Wxn=`urn:hedia:acr:elevated`,Gxn=60*X.Milliseconds.Minute,Kxn=e=>{if(e?.authenticationContextClassReference!==Wxn)return!1;let t=Date.parse(e.authenticationTime),n=Date.now()-t;return!(!Number.isFinite(t)||n<0||n>Gxn)};V();var qxn=()=>{let{COLORS:e}=J(),{fontScale:t}=em(),n=t.toFixed(3);return(0,W.jsxs)(B,{style:{backgroundColor:e.textWarning,borderRadius:16,padding:8},children:[(0,W.jsx)(Z,{style:[Jxn.text,{color:e.bgPrimary}],children:`Font scale: ${n}`}),(0,W.jsx)(Z,{style:[Jxn.textBold,{color:e.bgPrimary}],children:bq.HEDIA_SERVER_BASE_URL})]})},Jxn=R.create({text:{...Y.Poppins.regular_Base,textAlign:`center`},textBold:{...Y.Poppins.semiBold_Base,textAlign:`center`}});V();function Yxn(){let{t:e}=Tq(),{COLORS:t}=J(),n=N$(),[r,i]=(0,H.useState)(!0),a=(0,H.useCallback)(()=>{u8(l8.SettingsProfile),n.navigate(Q.Profile)},[n]),o=(0,H.useCallback)(()=>{u8(l8.SettingsGlucose),n.navigate(Q.GlucoseSettings)},[n]),s=(0,H.useCallback)(()=>{u8(l8.SettingsInsulin),n.navigate(Q.InsulinSettingsStack,{screen:Q.InsulinSettings})},[n]),c=(0,H.useCallback)(()=>{u8(l8.SettingsActivity),n.navigate(Q.ActivitySettings)},[n]),l=(0,H.useCallback)(()=>{u8(l8.SettingsSupport),n.navigate(Q.Support)},[n]),u=(0,H.useCallback)(()=>{u8(l8.SettingsLegal),n.navigate(Q.Legal)},[n]);return(0,W.jsxs)(fs,{testID:`scroll-settings`,style:L9.scrollView,contentContainerStyle:L9.scrollViewContentContainer,contentInsetAdjustmentBehavior:`automatic`,children:[(0,W.jsx)(Y4,{title:e(`settings_card_my_profile`),testID:`edit-profile-button`,renderRightSlot:()=>(0,W.jsx)(K4,{}),onPress:a}),(0,W.jsxs)(Y4.Container,{children:[(0,W.jsx)(Y4,{title:e(`settings_card_glucose`),testID:`settings-glucose`,onPress:o,renderRightSlot:()=>(0,W.jsx)(K4,{})}),(0,W.jsx)(Y4,{title:e(`settings_card_insulin_settings`),testID:`settings-insulin`,onPress:s,renderRightSlot:()=>(0,W.jsx)(K4,{})}),(0,W.jsx)(Y4,{title:e(`settings_card_physical_activity`),testID:`settings-activity`,onPress:c,renderRightSlot:()=>(0,W.jsx)(K4,{})})]}),(0,W.jsxs)(Y4.Container,{children:[(0,W.jsx)(Y4,{title:e(`settings_support`),testID:`settings-support`,onPress:l,renderRightSlot:()=>(0,W.jsx)(K4,{})}),(0,W.jsx)(Y4,{title:e(`settings_card_legal`),testID:`settings-legal`,onPress:u,renderRightSlot:()=>(0,W.jsx)(K4,{})})]}),(0,W.jsx)(Yf,{onPress:()=>{i(!r)},style:L9.versionContainer,children:(0,W.jsx)(Z,{style:[L9.versionText,{color:t.labelSecondary}],children:r?c8:`(${lin})`})}),bq.IS_PRODUCTION!==`true`&&(0,W.jsx)(B,{children:(0,W.jsx)(qxn,{})})]})}var L9=R.create({scrollView:{flex:1,paddingHorizontal:16},scrollViewContentContainer:{paddingVertical:32,flexGrow:1,gap:24},versionContainer:{alignItems:`center`,marginTop:`auto`},versionText:{...Y.Poppins.regular_Base}});V();function Xxn(){let{COLORS:e}=J();return(0,W.jsx)(B,{style:[Zxn.separator,{backgroundColor:e.divider}]})}var Zxn=R.create({separator:{height:1}}),R9=o3(X.CONSTANTS.INSULIN_TO_CARBS_RATIO_MIN,X.CONSTANTS.INSULIN_TO_CARBS_RATIO_MAX),z9=function(e){return e.DividendNumber=`109`,e.ExampleInsulinSensitivity=`2.2`,e}({}),Qxn=function(e){return e.DividendNumber=`1960`,e.ExampleInsulinSensitivity=`39.2`,e}({}),$xn=o3(X.CONSTANTS.INSULIN_SENSITIVITY_MIN,X.CONSTANTS.INSULIN_SENSITIVITY_MAX),eSn=a3(5,393);V();var tSn=({onPress:e,isVisible:t})=>{let{t:n}=Tq(),{COLORS:r}=J();return(0,W.jsxs)(u3,{isVisible:t,title:n(`insulin_settings_modal_carb_ratio_title`),enableScroll:!0,buttons:[{title:n(`button_close`),onPress:e,testID:`close-button`}],children:[(0,W.jsx)(Z,{testID:`insulin_settings_modal_carb_ratio_body`,style:[nSn.bodyText,{color:r.labelSecondary}],children:n(`insulin_settings_modal_carb_ratio_body`)}),(0,W.jsx)(Z,{testID:`insulin_settings_modal_carb_ratio_example`,style:{color:r.labelSecondary},children:n(`insulin_settings_modal_carb_example_body`)})]})},nSn=R.create({bodyText:{marginTop:12,marginBottom:16}});V();var rSn=({glucoseUnit:e,onPress:t,isVisible:n})=>{let{t:r}=Tq(),{COLORS:i}=J(),{text:a}=L8(e),o=e===X.BloodGlucoseUnit.MMOL_L?z9.DividendNumber:Qxn.DividendNumber,s=e===X.BloodGlucoseUnit.MMOL_L?z9.ExampleInsulinSensitivity:Qxn.ExampleInsulinSensitivity;return(0,W.jsxs)(u3,{title:r(`modal_insulin_seneitivity_title`),isVisible:n,enableScroll:!0,buttons:[{title:r(`button_close`),onPress:t,testID:`close-button`}],children:[(0,W.jsx)(Z,{testID:`insulin_sensitivity_modal_body`,style:[iSn.bodyText,{color:i.labelSecondary}],children:r(`insulin_sensitivity_modal_body`,{dividerNumber:o})}),(0,W.jsx)(Z,{testID:`insulin_sensitivity_modal_example`,style:{color:i.labelSecondary},children:r(`insulin_sensitivity_modal_example`,{dividerNumber:o,displayResult:s,displayUnit:a})})]})},iSn=R.create({bodyText:{marginTop:12,marginBottom:16}});V();var aSn=()=>{let{t:e}=Tq(),{bloodGlucoseUnits:t}=s7(),n=k8.glucoseUnit??t;if(n===void 0)throw Error(`[HelpCalculatingSection::render] glucoseUnit must be defined.`);let[r,i]=(0,H.useState)(!1),[a,o]=(0,H.useState)(!1),s=n===X.BloodGlucoseUnit.MMOL_L?z9.DividendNumber:Qxn.DividendNumber;return(0,W.jsxs)(B,{children:[(0,W.jsx)(d3,{title:e(`insulin_settings_learn_more_title`)}),(0,W.jsxs)(Y4.Container,{children:[(0,W.jsx)(Y4,{testID:`info-insulin-carbs-ratio`,title:e(`insulin_settings_learn_more_carb_ratio`),onPress:()=>{o(!0)},displayType:J4.ListItem}),(0,W.jsx)(Y4,{testID:`info-insulin-sensitivity-${s}`,title:e(`insulin_settings_learn_more_sensitivity`),onPress:()=>{i(!0)},displayType:J4.ListItem})]}),(0,W.jsx)(rSn,{onPress:()=>{i(!1)},glucoseUnit:n,isVisible:r}),(0,W.jsx)(tSn,{onPress:()=>{o(!1)},isVisible:a})]})};V();var oSn=({withLockedSettings:e})=>{let{t}=Tq(),{COLORS:n}=J(),{modalStoreActions:r}=z5(),{glucoseUnit:i,treatmentParameters:a}=k8;if(i===void 0)throw Error(`[DailyInsulinTable::render] glucoseUnit is undefined.`);if(a===void 0)throw Error(`[DailyInsulinTable::render] parameters from userSettings must be defined and non-null.`);let o=a.use,[s,c]=(0,H.useState)(!1),[l,u]=(0,H.useState)(!1),[d,f]=(0,H.useState)(void 0),[p,m]=(0,H.useState)(0),[h,g]=(0,H.useState)(!1),[_,v]=(0,H.useState)(),y=(0,H.useCallback)(async e=>{let t=z8(e,i,X.BloodGlucoseUnit.MMOL_L);if(t!==a.parameterIntervals[p].insulinSensitivity){let e={...a,parameterIntervals:a.parameterIntervals.map((e,n)=>n===p?{...e,insulinSensitivity:t}:e),updatedAt:new Date().toISOString()};f(await k8.postUserSettings({parameters:e}))}c(!1)},[i,a,p]),b=(0,H.useCallback)(async e=>{let t=Number(e.toFixed(1));if(t!==a.parameterIntervals[p].carbohydrateRatio){let e={...a,parameterIntervals:a.parameterIntervals.map((e,n)=>n===p?{...e,carbohydrateRatio:t}:e),updatedAt:new Date().toISOString()};f(await k8.postUserSettings({parameters:e}))}u(!1)},[a,p]),{text:x}=L8(i),S=(0,H.useMemo)(()=>[{title:t(`table_variable_insulin_time`),subtitle:t(`table_variable_time_unit`),scale:C2.s2},{title:t(`table_variable_insulin_sensitivity`),subtitle:t(`table_variable_insulin_sensitivity_unit`,{displayUnit:x}),scale:C2.s2},{title:t(`table_variable_insulin_carb`),subtitle:t(`table_variable_insulin_carb_unit`),scale:C2.s2}],[x,t]),C=(0,H.useMemo)(()=>i===X.BloodGlucoseUnit.MG_DL?eSn:$xn,[i]),w=(0,H.useMemo)(()=>{let e=a.parameterIntervals[p].insulinSensitivity,t=B8(e,X.BloodGlucoseUnit.MMOL_L,i);return C.findIndex(e=>e===t)},[C,i,a.parameterIntervals,p]),T=(0,H.useMemo)(()=>{let e=a.parameterIntervals[p].carbohydrateRatio.toFixed(1);return R9.findIndex(t=>t===e)},[a.parameterIntervals,p]),E=e=>{let t=a.parameterIntervals[(e-1+a.parameterIntervals.length)%a.parameterIntervals.length].startTime,n=a.parameterIntervals[(e+1+a.parameterIntervals.length)%a.parameterIntervals.length].startTime,r=a.parameterIntervals[e].startTime,i=q7(r,`HH:mm`,new Date),o=q7(t,`HH:mm`,new Date),s=q7(n,`HH:mm`,new Date);R7(i,o)&&R7(i,s)?v({current:i,min:t3(q7(t,`HH:mm`,_vn(new Date,1)),1),max:n3(s,1)}):C9(i,o)&&C9(i,s)?v({current:i,min:t3(o,1),max:n3(q7(n,`HH:mm`,K7(new Date,1)),1)}):v({current:i,min:t3(o,1),max:n3(s,1)}),m(e),g(!0)},D=e=>{m(e),c(!0)},O=e=>{m(e),u(!0)},k=(0,H.useCallback)(async e=>{let t=I8(e,`HH:mm`);if(t!==a.parameterIntervals[p].startTime){let e=[...a.parameterIntervals],n={...e[p]};n.startTime=t,e[p]=n,f(await k8.postUserSettings({parameters:{...a,parameterIntervals:e,updatedAt:new Date().toISOString()}}))}g(!1)},[a,p]),A=(0,H.useCallback)(()=>{g(!1)},[]),ee=(0,H.useCallback)(async e=>{let t={...a,use:e?X.Usage.Intervals:X.Usage.Overall,updatedAt:new Date().toISOString()},n=await k8.postUserSettings({parameters:t});r.set({showSyncErrorModal:!n})},[a,r]),te=(0,H.useCallback)(()=>{d===!1&&r.set({showSyncErrorModal:!0}),f(void 0)},[r,d]);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(y9,{columnDisposition:[2,3,3],children:[(0,W.jsx)(f3,{testID:`daily-interval-switch`,title:t(`variable_insulin_settings_title`),message:t(`variable_insulin_settings_body`),value:o===X.Usage.Intervals,onValueChange:e(ee),style:B9.switchContainer}),(0,W.jsx)(_9,{disabled:o!==X.Usage.Intervals,children:S.map((e,t)=>(0,W.jsxs)(x9,{style:t===0&&B9.firstTableCell,children:[(0,W.jsx)(Z,{maxFontSizeMultiplier:e.scale,style:[B9.tableHeaderTitle,{color:n.labelPrimary},t!==0&&B9.tableHeaderTitleWithMargin],children:e.title}),(0,W.jsx)(Z,{style:[B9.tableSubtitle,{color:n.textTableSecondary}],children:e.subtitle})]},e.title))}),Object.keys(Dq).map((t,r)=>(0,W.jsxs)(v9,{disabled:o!==X.Usage.Intervals,children:[(0,W.jsxs)(b9,{onPress:e(()=>{E(r)}),style:B9.firstTableCell,children:[(0,W.jsx)(Z,{maxFontSizeMultiplier:C2.s2,style:[B9.tableTitle,{color:n.textTableHighlight}],children:a.parameterIntervals[r].startTime}),(0,W.jsx)(Z,{style:[B9.tableSubtitle,{color:n.textTableSecondary}],children:_vt[t]()})]}),(0,W.jsx)(b9,{testID:`${t.toLowerCase()}-insulin`,onPress:e(()=>{D(r)}),children:(0,W.jsx)(Z,{maxFontSizeMultiplier:C2.s2,style:[B9.tableText,{color:n.textTableHighlight}],children:B8(a.parameterIntervals[r].insulinSensitivity,X.BloodGlucoseUnit.MMOL_L,i)})}),(0,W.jsx)(b9,{testID:`${t.toLowerCase()}-carbs`,onPress:e(()=>{O(r)}),children:(0,W.jsx)(Z,{maxFontSizeMultiplier:C2.s2,style:[B9.tableText,{color:n.textTableHighlight}],children:a.parameterIntervals[r].carbohydrateRatio.toFixed(1)})})]},t))]}),(0,W.jsx)(xvn,{isVisible:h,initialValue:_?.current??new Date,min:_?.min,max:_?.max,onConfirm:k,onCancel:A,onModalHide:te}),(0,W.jsx)(Q5,{isVisible:s,items:C,initialScrollIndex:w,onConfirm:y,onCancel:()=>{c(!1)},onModalHide:te,testID:`insulin_sensitivity_picker`}),(0,W.jsx)(Q5,{isVisible:l,items:R9,initialScrollIndex:T,onConfirm:b,onCancel:()=>{u(!1)},onModalHide:te,testID:`insulin_to_carb_ratio_picker`})]})},B9=R.create({switchContainer:{borderBottomLeftRadius:0,borderBottomRightRadius:0},firstTableCell:{paddingLeft:16,alignItems:`flex-start`,justifyContent:`space-between`,borderLeftWidth:0},tableHeaderTitle:{...Y.Poppins.medium_SM,textAlign:`center`},tableHeaderTitleWithMargin:{marginHorizontal:8},tableTitle:{...Y.Poppins.medium_Base},tableSubtitle:{...Y.Poppins.regular_XS},tableText:{...Y.Poppins.medium_Base}}),sSn=f7(oSn);V();var cSn={Lantus:()=>wq(`long-acting_insulin_option1`),Basaglar:()=>wq(`long-acting_insulin_option2`),Tuojeo:()=>wq(`long-acting_insulin_option3`),Levemir:()=>wq(`long-acting_insulin_option4`),Tresiba:()=>wq(`long-acting_insulin_option5`),Other:()=>wq(`long-acting_insulin_option6`),None:()=>wq(`long-acting_insulin_option7`)},lSn=()=>{let{modalStoreActions:e}=z5(),t=N5(),{longActingInsulin:n,treatmentParameters:r}=k8,i=(0,H.useCallback)(async t=>{t!==n&&(await k8.postUserSettings({longActingInsulin:X.LongActingInsulin[t],parameters:r?{...r,updatedAt:new Date().toISOString()}:void 0})||e.set({showSyncErrorModal:!0}))},[n,r,e]);return(0,W.jsxs)(fs,{testID:`scroll`,contentContainerStyle:[uSn.scrollView,{paddingTop:t+16}],children:[(0,W.jsx)(Y4.Container,{children:Object.keys(X.LongActingInsulin).map(e=>(0,W.jsx)(Y4,{title:cSn[e](),renderRightSlot:()=>(0,W.jsx)(B,{style:uSn.checkmarkContainer,children:X.LongActingInsulin[e]===n?(0,W.jsx)(G4,{width:24,height:24}):null}),onPress:()=>i(e),displayType:J4.ListItem,testID:`treatment-${e.match(/[A-Z][a-z]+/g)?.join(`-`).toLowerCase()}`},e))}),(0,W.jsx)(t7,{})]})},uSn=R.create({scrollView:{paddingVertical:32,paddingHorizontal:16,flexGrow:1},checkmarkContainer:{width:24,height:24}}),dSn=f7(lSn);V();var fSn={Novorapid:()=>wq(`rapid-acting_insulin_option1`),Fiasp:()=>wq(`rapid-acting_insulin_option2`),Humalog:()=>wq(`rapid-acting_insulin_option3`),Apidra:()=>wq(`rapid-acting_insulin_option4`),Other:()=>wq(`rapid-acting_insulin_option5`),None:()=>wq(`rapid-acting_insulin_option6`)},pSn=()=>{let{modalStoreActions:e}=z5(),t=N5(),{fastActingInsulin:n,treatmentParameters:r}=k8,i=(0,H.useCallback)(async t=>{t!==n&&(await k8.postUserSettings({fastActingInsulin:X.FastActingInsulin[t],parameters:r?{...r,updatedAt:new Date().toISOString()}:void 0})||e.set({showSyncErrorModal:!0}))},[n,r,e]);return(0,W.jsxs)(fs,{testID:`scroll`,contentContainerStyle:[mSn.scrollView,{paddingTop:t+16}],children:[(0,W.jsx)(Y4.Container,{children:Object.keys(X.FastActingInsulin).map(e=>(0,W.jsx)(Y4,{title:fSn[e](),renderRightSlot:()=>(0,W.jsx)(B,{style:mSn.checkmarkContainer,children:X.FastActingInsulin[e]===n?(0,W.jsx)(G4,{width:24,height:24}):null}),onPress:()=>i(e),displayType:J4.ListItem,testID:`treatment-${e.match(/[A-Z][a-z]+/g)?.join(`-`).toLowerCase()}`},e))}),(0,W.jsx)(t7,{})]})},mSn=R.create({scrollView:{paddingVertical:32,paddingHorizontal:16,flexGrow:1},checkmarkContainer:{width:24,height:24}}),hSn=f7(pSn);V();var V9={PenHalf:()=>wq(`treatment_type_option1`),PenWhole:()=>wq(`treatment_type_option2`),Pump:()=>wq(`treatment_type_option3`)},gSn=()=>{let{modalStoreActions:e}=z5(),t=N5(),{injectionMethod:n,treatmentParameters:r}=k8,i=(0,H.useCallback)(async t=>{t!==n&&(await k8.postUserSettings({treatmentType:X.InjectionMethod[t],parameters:r?{...r,updatedAt:new Date().toISOString()}:void 0})||e.set({showSyncErrorModal:!0}))},[n,r,e]);return(0,W.jsxs)(fs,{testID:`scroll`,contentContainerStyle:[{..._Sn.scrollView,paddingTop:t+16}],children:[(0,W.jsx)(Y4.Container,{children:Object.keys(X.InjectionMethod).map(e=>(0,W.jsx)(Y4,{title:V9[e](),renderRightSlot:()=>(0,W.jsx)(B,{style:_Sn.checkmarkContainer,children:X.InjectionMethod[e]===n?(0,W.jsx)(G4,{width:24,height:24}):null}),onPress:()=>i(e),testID:`treatment-${e.match(/[A-Z][a-z]+/g)?.join(`-`).toLowerCase()}`,displayType:J4.ListItem},e))}),(0,W.jsx)(t7,{})]})},_Sn=R.create({scrollView:{paddingVertical:32,paddingHorizontal:16,flexGrow:1},checkmarkContainer:{width:24,height:24}}),vSn=f7(gSn);V();function ySn({withLockedSettings:e}){let{t}=Tq(),n=N$(),{injectionMethod:r,fastActingInsulin:i,longActingInsulin:a}=k8;if(r===void 0)throw Error(`[TreatmentSection::render] injectionMethod must be defined and non-null.`);let o=(0,H.useMemo)(()=>V9[K9t(X.InjectionMethod,r)](),[r]),s=(0,H.useMemo)(()=>i?fSn[i]():`-`,[i]),c=(0,H.useMemo)(()=>a?cSn[a]():`-`,[a]);return(0,W.jsxs)(B,{children:[(0,W.jsx)(Y4,{title:t(`my_profile_treatment_type`),value:o,testID:`treatment-type`,onPress:e(()=>{n.navigate(Q.TreatmentType)}),renderRightSlot:()=>(0,W.jsx)(K4,{}),style:{marginBottom:24}}),(0,W.jsxs)(Y4.Container,{children:[(0,W.jsx)(Y4,{title:t(`my_profile_rapid-acting_insulin`),value:s,testID:`fast-acting-insulin`,onPress:e(()=>{n.navigate(Q.RapidActingInsulin)}),renderRightSlot:()=>(0,W.jsx)(K4,{})}),(0,W.jsx)(Y4,{title:t(`my_profile_long-acting_insulin`),value:c,testID:`long-acting-insulin`,onPress:e(()=>{n.navigate(Q.LongActingInsulin)}),renderRightSlot:()=>(0,W.jsx)(K4,{})})]})]})}var bSn=f7(ySn);V();var{MMOL_L:H9}=X.BloodGlucoseUnit,xSn=()=>{let e=N$(),{t}=Tq(),{COLORS:n}=J(),{modalStoreActions:r}=z5(),{bottomWithScroll:i}=Q4(),a=N5(),{glucoseUnit:o,treatmentParameters:s,created:c}=k8;if(o===void 0)throw Error(`[InsulinSettings::render] glucoseUnit is undefined.`);if(s===void 0)throw Error(`[InsulinSettings::render] parameters from userSettings must be defined and non-null.`);let l=s.use===X.Usage.Overall,{text:u}=L8(o),{carbohydrateRatio:d,insulinSensitivity:f}=s.overallParameters,[p,m]=(0,H.useState)(!1),[h,g]=(0,H.useState)(!1),[_,v]=(0,H.useState)(void 0),[y,b]=(0,H.useState)(!1),[x,S]=(0,H.useState)(!1),{areSettingsLocked:C,isPINSet:w,lockSettings:T,unlockSettings:E}=G_n(),[D,O]=(0,H.useState)(!1),[k,A]=(0,H.useState)(!1),ee=(0,H.useCallback)(()=>{C?b(!0):T()},[C,T]);(0,H.useEffect)(()=>{e.setOptions({header:()=>(0,W.jsx)(F5,{title:t(`insulin_settings_navigation`),LeftButton:(0,W.jsx)(H5,{}),RightButton:w?(0,W.jsx)(cfn,{onPress:ee,isLocked:C}):void 0,overlay:!0})})},[e,C,w,ee,t]);let te=(0,H.useMemo)(()=>o===H9?$xn:eSn,[o]),ne=()=>{m(!0)},re=()=>{g(!0)},ie=(0,H.useCallback)(async e=>{let t=z8(e,o,H9);if(t!==s.overallParameters.insulinSensitivity){let e={...s,overallParameters:{...s.overallParameters,insulinSensitivity:t},updatedAt:new Date().toISOString()};v(await k8.postUserSettings({parameters:e}))}m(!1)},[o,s]),j=(0,H.useCallback)(async e=>{let t=Number(e.toFixed(1));if(t!==s.overallParameters.carbohydrateRatio){let e={...s,overallParameters:{...s.overallParameters,carbohydrateRatio:t},updatedAt:new Date().toISOString()};v(await k8.postUserSettings({parameters:e}))}g(!1)},[s]),ae=(0,H.useMemo)(()=>{let e=B8(f,H9,o);return te.findIndex(t=>t===e)},[te,o,f]),oe=(0,H.useMemo)(()=>R9.findIndex(e=>e===d.toFixed(1)),[d]),se=(0,H.useCallback)(()=>{_===!1&&r.set({showSyncErrorModal:!0}),v(void 0)},[r,_]),M=(0,H.useCallback)(async e=>{let t={...s,use:e?X.Usage.Overall:X.Usage.Intervals,updatedAt:new Date().toISOString()},n=await k8.postUserSettings({parameters:t});r.set({showSyncErrorModal:!n})},[s,r]),ce=(0,H.useCallback)(()=>{D&&(S(!0),O(!1))},[D,S,O]),N=(0,H.useCallback)(()=>{O(!0),b(!1)},[O,b]),P=(0,H.useCallback)(()=>{E()},[E]),le=(0,H.useCallback)(e=>w&&C?(...e)=>b(!0):(...t)=>e(...t),[C,w]),ue=(0,H.useCallback)(()=>{k&&(A(!1),setTimeout(()=>{e.navigate(Q.ChangePINCode)},500))},[k,e]),de=s.updatedAt??c;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(fs,{testID:`scroll`,contentContainerStyle:[U9.scrollView,{paddingBottom:i,paddingTop:a+16}],children:[(0,W.jsx)(Z,{style:[U9.updatedAtText,{color:n.labelSecondary}],children:t(`settings_lastEdited`,{date:de?I8(de,`d MMM yyyy`):``})}),(0,W.jsx)(bSn,{withLockedSettings:le}),(0,W.jsx)(B,{style:U9.spacing}),(0,W.jsx)(p9,{}),(0,W.jsx)(B,{style:U9.spacing}),(0,W.jsxs)(Y4.Container,{containerStyle:{backgroundColor:n.bgSecondary,borderColor:n.divider,borderWidth:1},children:[(0,W.jsx)(f3,{testID:`insulin-settings-overall-switch`,title:t(`fixed_insulin_settings_title`),message:t(`fixed_insulin_settings_body`),value:l,onValueChange:le(M),style:U9.switchContainer}),(0,W.jsx)(Xxn,{}),(0,W.jsx)(Y4,{title:t(`fixed_insulin_settings_carb_ratio_title`),value:`${d.toFixed(1)} ${t(`fixed_insulin_settings_carb_ratio_unit`)}`,testID:`carbohydrate-ratio`,onPress:le(()=>l?re():void 0),containerStyle:l?U9.active:U9.inactive,valueStyle:l?{color:n.textTableHighlight}:{color:n.labelSecondary}}),(0,W.jsx)(Y4,{title:t(`fixed_insulin_settings_sensitivity_title`),value:`${B8(f,H9,o)} ${t(`fixed_insulin_settings_sensitivity_unit`,{displayUnit:u})}`,testID:`insulin-sensitivity`,onPress:le(()=>l?ne():void 0),containerStyle:l?U9.active:U9.inactive,valueStyle:l?{color:n.textTableHighlight}:{color:n.labelSecondary}})]}),(0,W.jsx)(B,{style:U9.spacing}),(0,W.jsx)(sSn,{withLockedSettings:le}),(0,W.jsx)(B,{style:U9.spacing}),(0,W.jsx)(aSn,{})]}),(0,W.jsx)(Q5,{isVisible:p,items:te,initialScrollIndex:ae,onConfirm:ie,onCancel:()=>{m(!1)},onModalHide:se,testID:`insulin_sensitivity_picker`}),(0,W.jsx)(Q5,{isVisible:h,items:R9,initialScrollIndex:oe,onConfirm:j,onCancel:()=>{g(!1)},onModalHide:se,testID:`insulin_to_carb_ratio_picker`}),(0,W.jsx)(t7,{onModalHide:()=>{v(void 0)}}),(0,W.jsx)(rvn,{isVisible:y,onModalHide:ce,onEnterPIN:N,onCancel:()=>b(!1)}),(0,W.jsx)(Q_n,{isVisible:x,onClose:()=>S(!1),onModalHide:ue,onForgotPIN:()=>{A(!0),S(!1)},onModalHideWithSuccess:P}),(0,W.jsx)(nvn,{})]})},U9=R.create({scrollView:{paddingTop:32,paddingHorizontal:16,flexGrow:1},spacing:{height:32},updatedAtText:{...Y.Poppins.regular_SM,textAlign:`center`,marginBottom:24},active:{opacity:1},inactive:{opacity:.5},switchContainer:{borderBottomLeftRadius:0,borderBottomRightRadius:0}}),SSn=f7(xSn),{Navigator:CSn,Screen:W9}=j5(),wSn=()=>{let{t:e}=Tq();return(0,W.jsxs)(CSn,{screenOptions:{...K5,...$8},children:[(0,W.jsx)(W9,{name:Q.InsulinSettings,component:SSn,options:{header:()=>(0,W.jsx)(F5,{LeftButton:(0,W.jsx)(H5,{}),title:e(`insulin_settings_navigation`),overlay:!0})}}),(0,W.jsx)(W9,{name:Q.TreatmentType,component:vSn,options:{header:()=>(0,W.jsx)(F5,{LeftButton:(0,W.jsx)(H5,{}),title:e(`treatment_type_navigation`),overlay:!0})}}),(0,W.jsx)(W9,{name:Q.RapidActingInsulin,component:hSn,options:{header:()=>(0,W.jsx)(F5,{LeftButton:(0,W.jsx)(H5,{}),title:e(`rapid-acting_insulin_navigation`),overlay:!0})}}),(0,W.jsx)(W9,{name:Q.LongActingInsulin,component:dSn,options:{header:()=>(0,W.jsx)(F5,{LeftButton:(0,W.jsx)(H5,{}),title:e(`long-acting_insulin_navigation`),overlay:!0})}})]})};V();var{Navigator:TSn,Screen:G9}=j5(),ESn=()=>{let{t:e}=Tq(),{COLORS:t}=J(),n=N$(),[r,i]=(0,H.useState)(!1),a=(0,H.useCallback)(()=>{if(n.canGoBack()){n.goBack();return}n.navigate(Q.NewCalculationStack,{screen:Q.Calculation})},[n]),o=(0,H.useCallback)(async()=>{i(!1);try{Kxn(await Fen())?i(!0):window.location.href=`/reauthenticate?path=/app/settings`}catch{n.reset({index:0,routes:[{name:Q.NewCalculationStack,params:{screen:Q.Calculation}}]})}},[n]);return V$((0,H.useCallback)(()=>{o();let e=Sf.currentState,t=Sf.addEventListener(`change`,t=>{let n=t===`active`&&e!==`active`;e=t,n&&o()});return()=>t.remove()},[o])),r?(0,W.jsxs)(TSn,{screenOptions:{...K5,...$8,headerStyle:{backgroundColor:t.bgNavigationBar}},children:[(0,W.jsx)(G9,{name:Q.Settings,component:Yxn,options:{header:()=>(0,W.jsx)(F5,{LeftButton:(0,W.jsx)(U5,{onPress:a}),title:e(`settings_navigation`)})}}),(0,W.jsx)(G9,{name:Q.Profile,component:qvn,options:{header:()=>(0,W.jsx)(F5,{LeftButton:(0,W.jsx)(H5,{}),title:e(`my_profile_navigation`)})}}),(0,W.jsx)(G9,{name:Q.GlucoseSettings,component:Dvn,options:{header:()=>(0,W.jsx)(F5,{LeftButton:(0,W.jsx)(H5,{}),title:e(`glucose_navigation`),overlay:!0})}}),(0,W.jsx)(G9,{name:Q.GlucoseUnit,component:jvn,options:{header:()=>(0,W.jsx)(F5,{LeftButton:(0,W.jsx)(H5,{}),title:e(`glucose_unit_navigation`),overlay:!0})}}),(0,W.jsx)(G9,{name:Q.ActivitySettings,component:gvn,options:{header:()=>(0,W.jsx)(F5,{LeftButton:(0,W.jsx)(H5,{}),title:e(`physical_activity_navigation`),overlay:!0})}}),(0,W.jsx)(G9,{name:Q.InsulinSettingsStack,component:wSn,options:{headerShown:!1}}),(0,W.jsx)(G9,{name:Q.Theme,component:Uxn,options:{header:()=>(0,W.jsx)(F5,{LeftButton:(0,W.jsx)(H5,{}),title:e(`navigation_title_theme`),overlay:!0})}}),(0,W.jsx)(G9,{name:Q.Support,component:Vxn,options:{header:()=>(0,W.jsx)(F5,{LeftButton:(0,W.jsx)(H5,{}),title:e(`support_navigation`)})}}),(0,W.jsx)(G9,{name:Q.Legal,component:Mvn,options:{header:()=>(0,W.jsx)(F5,{LeftButton:(0,W.jsx)(H5,{}),title:e(`legal_navigation`),overlay:!0})}})]}):(0,W.jsx)(x2,{})};V();function DSn(){return(0,W.jsx)(Xfn,{style:OSn.iframe,uri:`https://www.hedia.com/contact#contactsupport`})}var OSn=R.create({iframe:{flex:1}}),{Navigator:kSn,Screen:K9,Group:ASn}=j5(),jSn=()=>{let{t:e}=Tq();return(0,W.jsxs)(kSn,{children:[(0,W.jsxs)(ASn,{screenOptions:{headerShown:!1},children:[(0,W.jsx)(K9,{name:Q.NewCalculationStack,component:U_n}),(0,W.jsx)(K9,{name:Q.SettingsStack,component:ESn})]}),(0,W.jsxs)(ASn,{screenOptions:{...lfn},children:[(0,W.jsx)(K9,{name:Q.CreateFood,component:Yfn}),(0,W.jsx)(K9,{name:Q.IFU,component:Qfn,options:{header:()=>(0,W.jsx)(F5,{LeftButton:(0,W.jsx)(U5,{}),title:e(`IFU_navigation`)})}}),(0,W.jsx)(K9,{name:Q.SupportWebView,component:ipn,options:{header:()=>(0,W.jsx)(F5,{LeftButton:(0,W.jsx)(U5,{}),title:e(`support_navigation`)})}}),(0,W.jsx)(K9,{name:Q.SupportContact,component:DSn,options:{header:()=>(0,W.jsx)(F5,{LeftButton:(0,W.jsx)(U5,{}),title:e(`support_navigation`)})}})]})]})};V();var MSn=({title:e,subtitle:t,stepChecked:n,onAnimationFinished:r})=>{let{t:i}=Tq(),{COLORS:a}=J();return(0,H.useEffect)(()=>{r?.()},[r]),(0,W.jsxs)(fs,{contentContainerStyle:q9.container,style:{backgroundColor:a.bgPrimary},children:[(0,W.jsx)(Z,{style:q9.title,children:e}),(0,W.jsx)(Z,{style:[q9.subtitle,{color:a.labelSecondary}],children:t}),(0,W.jsxs)(B,{style:q9.stepsWrapper,children:[(0,W.jsxs)(B,{style:q9.stepContainer,children:[(0,W.jsx)(Z,{style:[q9.text,n===1||n===2||n===3?{color:a.labelPrimary}:{color:a.labelSecondary}],children:` 1. `+i(`overview1`)}),(n===1||n===2||n===3)&&(0,W.jsx)(G4,{width:24,height:24,color:a.labelPrimary})]}),(0,W.jsxs)(B,{style:q9.stepContainer,children:[(0,W.jsx)(Z,{style:[q9.text,n===2||n===3?{color:a.labelPrimary}:{color:a.labelSecondary}],children:`2. `+i(`overview2`)}),(n===2||n===3)&&(0,W.jsx)(G4,{width:24,height:24,color:a.labelPrimary})]}),(0,W.jsxs)(B,{style:q9.stepContainer,children:[(0,W.jsx)(Z,{style:[q9.text,n===3?{color:a.labelPrimary}:{color:a.labelSecondary}],children:`3. `+i(`overview3`)}),n===3&&(0,W.jsx)(G4,{width:24,height:24,color:a.labelPrimary})]})]})]})},q9=R.create({container:{flex:1,justifyContent:`center`,paddingHorizontal:16},title:{...Y.Poppins.bold_4XL,paddingHorizontal:16,marginBottom:2},subtitle:{...Y.Poppins.regular_Base,paddingHorizontal:16,marginBottom:32},stepsWrapper:{padding:16,gap:8},stepContainer:{flexDirection:`row`,alignItems:`center`,gap:8},text:{marginBottom:8}}),NSn=()=>{let{t:e}=Tq(),{setIsOnboardingFinished:t}=E3(),n=(0,H.useCallback)(()=>{setTimeout(()=>{t(!0)},1e3)},[t]);return(0,W.jsx)(MSn,{title:e(`guide_end_title`),subtitle:e(`guide_end_body`),stepChecked:3,onAnimationFinished:n})};V();var J9=({currentStep:e,text:t,onPress:n,inactive:r,isBackVisible:i=!0,onBackPress:a})=>{let{t:o}=Tq(),{COLORS:s}=J(),{goBack:c}=N$();return(0,W.jsx)(lpn,{children:(0,W.jsxs)(B,{style:[PSn.buttonsWrapper,{borderColor:s.bgTransparent}],children:[i&&(0,W.jsx)(U4,{title:o(`button_back`),onPress:a||c,testID:`back${e}`,style:PSn.button,type:H4.Secondary}),(0,W.jsx)(U4,{title:t??o(`button_next`),onPress:n,inactive:r,testID:`next${e}`,style:PSn.button})]})})},PSn=R.create({buttonsWrapper:{flexDirection:`row`,paddingTop:16,gap:8,borderWidth:1},button:{flex:1}});V();var FSn=()=>{let{t:e}=Tq(),{COLORS:t}=J(),{top:n}=Q4(),{navigate:r}=N$(),i=(0,H.useCallback)(()=>{r(I5.QuickGuideStack,{screen:I5.QuickGuide}),u8(l8.QuickGuideStartPress)},[r]);return(0,W.jsxs)(B,{style:{flex:1,backgroundColor:t.bgSecondary,paddingTop:n},children:[(0,W.jsx)(MSn,{title:e(`guide_quick_guide_title`),subtitle:e(`guide_quick_guide_body`),stepChecked:2}),(0,W.jsx)(J9,{currentStep:1,isBackVisible:!1,onPress:i,text:e(`button_start`)})]})},ISn=`/assets/webp/1_EN.webp`,LSn=`/assets/webp/2_EN.webp`,RSn=`/assets/webp/3_EN.webp`,zSn=`/assets/webp/4_EN.webp`,BSn=`/assets/webp/1_EN2.webp`,VSn=`/assets/webp/2_EN2.webp`,HSn=`/assets/webp/3_EN2.webp`,USn=`/assets/webp/4_EN2.webp`;V();var WSn=()=>{let{t:e}=Tq(),t=N$(),{COLORS:n,isDark:r}=J(),i=(0,H.useRef)(null),[a,o]=(0,H.useState)(2),[s,c]=(0,H.useState)(0),{width:l}=em(),u=(0,H.useMemo)(()=>[{title:e(`guide_recent_insulin_title`),body:e(`guide_recent_insulin_body`),image:r?ISn:BSn},{title:e(`web_guide_no_import_title`),body:e(`web_guide_no_import_body`),image:r?LSn:VSn},{title:e(`guide_glucose_title`),body:e(`guide_glucose_body`),image:r?RSn:HSn},{title:e(`guide_recommendation_title`),body:e(`guide_recommendation_body`),image:r?zSn:USn}],[r,e]),d=(0,H.useCallback)(e=>{switch(e-1){case 1:return l8.QuickGuideBackPressStep1;case 2:return l8.QuickGuideBackPressStep2;case 3:return l8.QuickGuideBackPressStep3;case 4:return l8.QuickGuideBackPressStep4;default:throw Error(`[QuickGuide::getTrackingEventBackPress] Invalid step`)}},[]),f=(0,H.useCallback)(e=>{switch(e-1){case 1:return l8.QuickGuideNextPressStep1;case 2:return l8.QuickGuideNextPressStep2;case 3:return l8.QuickGuideNextPressStep3;default:throw Error(`[QuickGuide::getTrackingEventNextPress] Invalid step`)}},[]),p=(0,H.useCallback)(()=>{if(s===u.length-1)u8(l8.QuickGuideFinishPress),t.navigate(I5.QuickGuideAllSet);else{let e=s+1;i.current?.scrollToIndex({index:e,animated:!0}),o(a+1),c(e),u8(f(a))}},[s,a,f,t,u.length]),m=(0,H.useCallback)(()=>{if(s===0)t.navigate(I5.QuickGuideStart);else{let e=s-1;i.current?.scrollToIndex({index:e,animated:!0}),o(a-1),c(e)}u8(d(a))},[s,a,d,t]);return(0,W.jsxs)(B,{style:{flex:1,backgroundColor:n.bgSecondary},children:[(0,W.jsx)(Wc,{ref:i,data:u,initialNumToRender:1,scrollEnabled:!1,horizontal:!0,showsHorizontalScrollIndicator:!1,renderItem:({item:e,index:t})=>(0,W.jsxs)(B,{style:[Y9.container,{width:l,backgroundColor:n.bgPrimary}],children:[(0,W.jsx)(Zu,{source:e.image,style:[Y9.image,{bottom:t===0?64:0,width:t===1?`55%`:`100%`,height:t===1?`55%`:`60%`}],resizeMode:`contain`}),(0,W.jsxs)(B,{style:Y9.contentContainer,children:[(0,W.jsx)(Z,{style:Y9.title,maxFontSizeMultiplier:C2.s2,children:e.title}),(0,W.jsx)(Z,{style:[Y9.body,{color:n.labelSecondary}],maxFontSizeMultiplier:C2.s2,children:e.body})]})]})}),(0,W.jsx)(J9,{currentStep:a,onPress:p,onBackPress:m,text:s===u.length-1?e(`button_complete`):e(`button_next`)})]})},Y9=R.create({container:{alignItems:`center`,justifyContent:`flex-end`},image:{width:`100%`,height:`60%`,marginTop:64},contentContainer:{minHeight:`25%`,paddingTop:12,marginBottom:84},title:{...Y.Poppins.semiBold_2XL,marginBottom:2,paddingHorizontal:16,textAlign:`center`},body:{...Y.Poppins.regular_Base,paddingHorizontal:Ru.getFontScale()>C2.s0?16:32,textAlign:`center`}}),{Navigator:GSn,Screen:KSn}=j5(),qSn=()=>(0,W.jsxs)(GSn,{screenOptions:{...K5,headerShown:!1},children:[(0,W.jsx)(KSn,{name:I5.QuickGuideStart,component:FSn}),(0,W.jsx)(KSn,{name:I5.QuickGuide,component:WSn}),(0,W.jsx)(KSn,{name:I5.QuickGuideAllSet,component:NSn})]});V();function JSn({onOptionSelect:e,setNextEnabled:t,ref:n}){let{t:r}=Tq(),{COLORS:i}=J(),{width:a}=em(),o=N5(),[s,c]=(0,H.useState)(null),l=(0,H.useCallback)(n=>{c(n),e(n),t(!0)},[e,t]);return(0,H.useImperativeHandle)(n,()=>({onBackPress(){u8(l8.SetupOptionsBackPress)},onNextPressed:()=>s===null?(t(!1),{transitionAllowed:!1}):(u8(l8.SetupOptionsNextPress),t(!0),{transitionAllowed:!0}),validateData(){return{isValid:s!==null}}}),[s,t]),(0,W.jsxs)(fs,{contentContainerStyle:[X9.container,{width:a,paddingTop:o+16}],style:{backgroundColor:i.bgPrimary},children:[(0,W.jsx)(Z,{style:[X9.header,{color:i.labelPrimary}],children:r(`insulin_settings_title`)}),(0,W.jsxs)(B,{style:X9.buttonsContainer,children:[(0,W.jsx)(U4,{title:r(`insulin_settings_button_yes`),testID:`insulin_settings_yes`,onPress:()=>{l(`yes`)},type:s===`yes`?H4.Primary:H4.Secondary,style:X9.button}),(0,W.jsx)(U4,{title:r(`insulin_settings_button_no`),testID:`insulin_settings_no`,onPress:()=>{l(`no`)},type:s===`no`?H4.Primary:H4.Secondary,style:X9.button})]})]})}var X9=R.create({container:{flex:1,paddingHorizontal:16,paddingTop:32},header:{...Y.Poppins.bold_2XL,paddingHorizontal:16,marginBottom:24},buttonsContainer:{flexDirection:`row`,marginBottom:24,gap:12},button:{flex:1}});function YSn(e,t){let n=e3(e)-+e3(t);return n<0?-1:n>0?1:n}function XSn(e,t,n){let[r,i]=_8(n?.in,e,t);return r.getFullYear()-i.getFullYear()}function ZSn(e,t,n){let[r,i]=_8(n?.in,e,t),a=YSn(r,i),o=Math.abs(XSn(r,i));r.setFullYear(1584),i.setFullYear(1584);let s=a*(o-+(YSn(r,i)===-a));return s===0?0:s}V(),Z0();function QSn({setNextEnabled:e,ref:t}){let{t:n}=Tq(),{COLORS:r,isDark:i,effectiveColorScheme:a}=J(),{width:o}=em(),{bottom:s}=W0(),{bottomWithFooterButton:c}=Q4(),l=N5(),{birthday:u,biologicalSex:d,diabetesType:f,bloodGlucoseUnits:p}=s7(),{setSetupCalculatorStoreValues:m}=o7(),[h,g]=(0,H.useState)(!1),[_,v]=(0,H.useState)(!1),[y,b]=(0,H.useState)(!1),[x,S]=(0,H.useState)(``),[C,w]=(0,H.useState)(``),[T,E]=(0,H.useState)(!1),D=(0,H.useCallback)(e=>{let t=new Date(e);t.setHours(0,0,0,0);let r=new Date;r.setHours(0,0,0,0);let i=ZSn(r,t)>=18;m({birthday:t.toISOString()}),S(``),w(i?``:n(`setup_birthday_hint_under18`))},[m,n]),O=(0,H.useCallback)(e=>{D(e),g(!1)},[D]),k=(0,H.useCallback)(()=>{m({diabetesType:X.DiabetesType.Type2}),v(!0)},[m]),A=(0,H.useCallback)(()=>!!(u&&d&&f&&p),[u,p,f,d]);return(0,H.useEffect)(()=>{e(A())},[e,A]),(0,H.useImperativeHandle)(t,()=>({onBackPress(){u8(l8.SetupGeneralBackPress)},onNextPressed:()=>(E(!0),!u&&S(n(`birthday_error`)),A()?(e(!0),u8(l8.SetupGeneralNextPress),{transitionAllowed:!0}):(e(!1),{transitionAllowed:!1})),validateData(){return{isValid:A()}}}),[u,n,A,e]),(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(fs,{testID:`step_2`,contentContainerStyle:[Z9.container,{width:o,paddingTop:l+16,paddingBottom:c}],style:{backgroundColor:r.bgPrimary},children:[(0,W.jsx)(Y4,{testID:`birthday`,title:n(`general_input_birthday`),renderRightSlot:()=>(0,W.jsx)(B,{style:[Z9.pillButton,{backgroundColor:r.bgPill}],children:(0,W.jsx)(Z,{style:[Z9.pillText,{color:h?r.textLink:r.labelPrimary}],children:u?I8(new Date(u),`dd-MM-yyyy`):`DD-MM-YYYY`})}),errorMessage:x,warningMessage:C,containerStyle:Z9.wrapper,style:Z9.customRow,onPress:()=>{g(!0)}}),(0,W.jsx)(B,{style:Z9.wrapper,children:(0,W.jsx)(B4,{isAnimated:T&&!d,children:(0,W.jsx)(Y4,{title:n(`my_profile_sex`),testID:`biological-sex`,value:d?vvt[d]():`-`,onPress:()=>{b(!0)},errorMessage:T&&!d?n(`diabetes_error`):void 0})})}),(0,W.jsxs)(B,{style:Z9.wrapper,children:[(0,W.jsx)(d3,{title:n(`type_of_diabetes_title`)}),(0,W.jsx)(B4,{isAnimated:T&&!f,message:n(`diabetes_error`),children:(0,W.jsxs)(B,{style:[Z9.row,{backgroundColor:r.bgSegmentContainer,borderColor:r.buttonBorder}],children:[(0,W.jsx)(S9t,{title:n(`type_of_diabetes_type1`),isActive:f===X.DiabetesType.Type1,testID:`type-1`,onPress:()=>{m({diabetesType:X.DiabetesType.Type1})},isError:T&&!f}),!f&&(0,W.jsx)(B,{style:[Z9.separator,{backgroundColor:r.divider}]}),(0,W.jsx)(S9t,{title:n(`type_of_diabetes_type2`),isActive:f===X.DiabetesType.Type2,testID:`type-2`,onPress:k,isError:T&&!f})]})})]}),(0,W.jsxs)(B,{style:Z9.wrapper,children:[(0,W.jsx)(d3,{title:n(`glucose_unit_title`)}),(0,W.jsx)(B4,{isAnimated:T&&!p,message:n(`glucose_unit_error`),children:(0,W.jsx)(Ovn,{glucoseUnit:p,onPressMMOLL:()=>{m({bloodGlucoseUnits:X.BloodGlucoseUnit.MMOL_L})},onPressMGDL:()=>{m({bloodGlucoseUnits:X.BloodGlucoseUnit.MG_DL})},isError:T&&!p})})]})]}),kq?(0,W.jsx)(Zpn,{testID:`birthday-date-picker`,display:`spinner`,date:u?new Date(u):new Date,isVisible:h,onConfirm:O,onCancel:()=>{g(!1)},customConfirmButtonIOS:emn,customCancelButtonIOS:tmn,pickerContainerStyleIOS:{backgroundColor:r.iosKeyboardPicker},modalStyleIOS:{paddingBottom:s},themeVariant:a,isDarkModeEnabled:i,pickerStyleIOS:Z9.alignCenter,minimumDate:new Date(1900,0,1),maximumDate:new Date(2100,0,1)}):(0,W.jsx)(Bvn,{isVisible:h,initialValue:u?new Date(u):new Date,onConfirm:O,onCancel:()=>{g(!1)}}),(0,W.jsx)(u3,{isVisible:_,title:n(`modal_diabetes2_title`),message:n(`modal_diabetes2_body`),buttons:[{title:n(`button_close`),testID:`type2-modal-understood-button`,onPress:()=>{v(!1)}}]}),(0,W.jsx)(Uvn,{isVisible:y,onCancel:()=>{b(!1)}})]})}var Z9=R.create({container:{paddingHorizontal:16},wrapper:{marginBottom:24},row:{flexDirection:`row`,padding:2,borderRadius:16,borderWidth:1},alignCenter:{alignSelf:`center`},separator:{width:1,height:24,alignSelf:`center`},customRow:{paddingVertical:8},pillButton:{borderRadius:16},pillText:{...Y.Poppins.regular_SM,paddingHorizontal:8,paddingVertical:6}});V();function $Sn({setNextEnabled:e,ref:t}){let{COLORS:n}=J(),{t:r}=Tq(),{width:i}=em(),a=N5(),{parameters:o,treatmentType:s}=s7(),{setSetupCalculatorStoreValues:c}=o7(),[l,u]=(0,H.useState)(!1);(0,H.useEffect)(()=>{o||c({parameters:O8(0,0,X.Usage.Overall)})},[o,c]),(0,H.useEffect)(()=>{e(!!s)},[e,s]);let d=(0,H.useCallback)(e=>{c({treatmentType:X.InjectionMethod[e]})},[c]);return(0,H.useImperativeHandle)(t,()=>({onBackPress(){u8(l8.SetupTreatmentBackPress)},onNextPressed:()=>(u(!0),s?(e(!0),u8(l8.SetupTreatmentNextPress),{transitionAllowed:!0}):(e(!1),{transitionAllowed:!1})),validateData(){return{isValid:!!s}}}),[e,s]),(0,W.jsxs)(B,{testID:`step_3`,style:[eCn.container,{width:i,backgroundColor:n.bgPrimary,paddingTop:a+16}],children:[(0,W.jsx)(d3,{title:r(`treatment_units_title`)}),(0,W.jsx)(B4,{isAnimated:l&&!s,message:r(`treatment_type_input_error`),children:(0,W.jsx)(Y4.Container,{children:Object.keys(X.InjectionMethod).map(e=>(0,W.jsx)(Y4,{title:V9[e](),renderRightSlot:()=>(0,W.jsx)(B,{style:eCn.checkmarkContainer,children:X.InjectionMethod[e]===s?(0,W.jsx)(G4,{width:24,height:24}):null}),onPress:()=>{d(e)},testID:`treatment-${e.match(/[A-Z][a-z]+/g)?.join(`-`).toLowerCase()}`,displayType:J4.ListItem},e))})})]})}var eCn=R.create({container:{paddingHorizontal:16,paddingVertical:32},checkmarkContainer:{width:24,height:24}}),tCn=a3(5,350);V();function nCn({setNextEnabled:e,ref:t}){let{t:n}=Tq(),{COLORS:r}=J(),{width:i}=em(),a=N5(),{bottomWithFooterButton:o}=Q4(),{bloodGlucoseUnits:s,parameters:c}=s7();if(!s||!c)throw Error(`[Step4::render] are not defined`);let l=xpn(),{setSetupCalculatorStoreValues:u,setTotalDailyDosage:d}=o7(),[f,p]=(0,H.useState)(!1),[m,h]=(0,H.useState)(void 0),g=(0,H.useMemo)(()=>l?{carbohydrateRatio:parseFloat((500/l).toFixed(1)),insulinSensitivityMMOLL:Number(z9.DividendNumber)/l}:{carbohydrateRatio:0,insulinSensitivityMMOLL:0},[l]);(0,H.useEffect)(()=>{let{carbohydrateRatio:e,insulinSensitivityMMOLL:t}=g;u({parameters:O8(t,e,X.Usage.Overall)})},[s,g,u]);let _=(0,H.useMemo)(()=>l?tCn.findIndex(e=>e===l.toString()):tCn.findIndex(e=>e===`50`),[l]);(0,H.useImperativeHandle)(t,()=>({onBackPress(){u8(l8.SetupTDDBackPress)},onNextPressed:()=>l?(u8(l8.SetupTDDNextPress),e(!0),{transitionAllowed:!0}):(h(n(`insulin_settings_input_error`,{inputTypeTranslated:n(`daily_insulin_dosage_input`)})),e(!1),{transitionAllowed:!1}),validateData(){return{isValid:!!l}}}),[e,l,n]);let v=(0,H.useCallback)(t=>{d(t),p(!1),h(void 0),e(!0)},[e,d]),{text:y}=(0,H.useMemo)(()=>L8(s),[s]),b=(0,H.useMemo)(()=>`${B8(c.overallParameters.insulinSensitivity,X.BloodGlucoseUnit.MMOL_L,s)} ${n(`fixed_insulin_settings_sensitivity_unit`,{displayUnit:y})}`,[c,y,n,s]),x=(0,H.useMemo)(()=>c.overallParameters.carbohydrateRatio+` `+n(`insulin_helper_carb_ratio_unit`),[c,n]);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(fs,{contentContainerStyle:[Q9.container,{width:i,paddingTop:a+16,paddingBottom:o}],style:{backgroundColor:r.bgPrimary},children:[(0,W.jsxs)(B,{children:[(0,W.jsx)(d3,{title:n(`daily_insulin_dosage_title`)}),(0,W.jsx)(Z,{style:[Q9.subheader,{color:r.labelSecondary}],children:n(`daily_insulin_dosage_body`)}),(0,W.jsx)(B4,{isAnimated:!!m,children:(0,W.jsx)(Y4,{testID:`daily_insulin_dosage`,title:n(`daily_insulin_dosage_input`),value:`${l??`-`} ${n(l===1?`unit`:`units`)}`,valueStyle:{color:r.labelBrand},onPress:()=>{p(!0)},errorMessage:m})})]}),!!l&&(0,W.jsxs)(B,{style:[Q9.explanation,{backgroundColor:r.bgSecondary}],children:[(0,W.jsx)(Z,{style:[Q9.description,{color:r.labelPrimary,borderBottomColor:r.divider}],children:n(`insulin_helper_body`)}),(0,W.jsxs)(B,{style:Q9.row,children:[(0,W.jsx)(Z,{style:[Q9.textSemiBold,{color:r.labelPrimary}],children:n(`insulin_helper_carb_ratio_input`)}),(0,W.jsx)(Z,{style:[Q9.textSemiBold,{color:r.labelSecondary}],children:x})]}),(0,W.jsx)(Xxn,{}),(0,W.jsxs)(B,{style:Q9.row,children:[(0,W.jsx)(Z,{style:[Q9.textSemiBold,{color:r.labelPrimary}],children:n(`insulin_helper_insulin_sensitivity_input`)}),(0,W.jsx)(Z,{style:[Q9.textSemiBold,{color:r.labelSecondary}],children:b})]})]}),(0,W.jsx)(p9,{}),(0,W.jsx)(B,{children:(0,W.jsx)(aSn,{})})]}),(0,W.jsx)(Q5,{testID:`daily_insulin_dosage_picker`,onCancel:()=>{p(!1)},onConfirm:v,initialScrollIndex:_,isVisible:f,items:tCn})]})}var Q9=R.create({container:{paddingVertical:32,paddingHorizontal:16,gap:24},subheader:{...Y.Poppins.regular_SM,marginBottom:8},explanation:{borderRadius:8,paddingBottom:0},row:{flexDirection:`row`,justifyContent:`space-between`},description:{...Y.Poppins.regular_SM,padding:16,borderBottomWidth:1},textSemiBold:{...Y.Poppins.medium_SM,padding:16}});V();function rCn({setNextEnabled:e,ref:t}){let{t:n}=Tq(),{COLORS:r}=J(),{width:i}=em(),a=N5(),{bottomWithFooterButton:o}=Q4(),{bloodGlucoseUnits:s,parameters:c}=s7();if(!c||!s)throw Error(`[Step5::render] setupCalculatorStoreValues are not defined`);let{setSetupCalculatorStoreValues:l,setTotalDailyDosage:u}=o7(),[d,f]=(0,H.useState)(void 0),[p,m]=(0,H.useState)(void 0),[h,g]=(0,H.useState)(!1),[_,v]=(0,H.useState)(!1),{text:y}=(0,H.useMemo)(()=>L8(s),[s]),{carbohydrateRatio:b,insulinSensitivity:x}=(0,H.useMemo)(()=>c.overallParameters,[c]),S=(0,H.useCallback)(e=>n(`insulin_settings_input_error`,{inputTypeTranslated:n(e===`IS`?`insulin_sensitivity_input`:`insulin-to-carb_ratio_input`)}),[n]);(0,H.useEffect)(()=>{e(!!(x&&b))},[b,x,e]),(0,H.useImperativeHandle)(t,()=>({onBackPress(){u8(l8.SetupInsulinBackPress)},onNextPressed:()=>!b&&!x?(m(S(`ICR`)),f(S(`IS`)),e(!1),{transitionAllowed:!1}):b?x?(m(void 0),f(void 0),u(null),e(!0),u8(l8.SetupInsulinNextPress),{transitionAllowed:!0}):(e(!1),f(S(`IS`)),{transitionAllowed:!1}):(m(S(`ICR`)),e(!1),{transitionAllowed:!1}),validateData(){return{isValid:!!(b&&x)}}}),[b,x,u,e,S]);let C=(0,H.useCallback)(e=>{let t=z8(e,s,X.BloodGlucoseUnit.MMOL_L);l({parameters:{...c,overallParameters:{...c.overallParameters,insulinSensitivity:t}}}),u(null),f(void 0),g(!1)},[s,c,l,u]),w=(0,H.useCallback)(e=>{let t=Number(e.toFixed(1));c.overallParameters.carbohydrateRatio=t,l({parameters:{...c,overallParameters:{...c.overallParameters,carbohydrateRatio:t}}}),u(null),m(void 0),v(!1)},[c,l,u]),T=(0,H.useMemo)(()=>s===X.BloodGlucoseUnit.MMOL_L?$xn:eSn,[s]),E=(0,H.useMemo)(()=>{let e=s===X.BloodGlucoseUnit.MMOL_L?2 .toFixed(1):`36`;if(x===0)return T.findIndex(t=>t===e);let t=B8(x,X.BloodGlucoseUnit.MMOL_L,s);return T.findIndex(e=>e===t)},[T,s,x]),D=(0,H.useMemo)(()=>b===0?R9.findIndex(e=>e===10 .toFixed(1)):R9.findIndex(e=>e===b.toFixed(1)),[b]),O=(0,H.useMemo)(()=>{let e=B8(x,X.BloodGlucoseUnit.MMOL_L,s);return`${x?e:`-`} ${n(`fixed_insulin_settings_sensitivity_unit`,{displayUnit:y})}`},[x,s,y,n]);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(fs,{contentContainerStyle:[iCn.contentContainer,{width:i,paddingTop:a+16,paddingBottom:o}],style:{backgroundColor:r.bgPrimary},children:[(0,W.jsxs)(B,{children:[(0,W.jsx)(d3,{title:n(`insulin-to-carb_ratio_title`)}),(0,W.jsx)(B4,{isAnimated:!!p,children:(0,W.jsx)(Y4,{title:n(`insulin-to-carb_ratio_input`),value:`${b||`-`} ${n(`fixed_insulin_settings_carb_ratio_unit`)}`,valueStyle:{color:r.labelBrand},testID:`carb_ratio`,onPress:()=>{v(!0)},errorMessage:p})})]}),(0,W.jsxs)(B,{children:[(0,W.jsx)(d3,{title:n(`insulin_sensitivity_title`)}),(0,W.jsx)(B4,{isAnimated:!!d,children:(0,W.jsx)(Y4,{title:n(`insulin_sensitivity_input`),value:O,valueStyle:{color:r.labelBrand},testID:`insulin_sensitivity`,onPress:()=>{g(!0)},errorMessage:d})})]}),(0,W.jsx)(p9,{}),(0,W.jsx)(aSn,{})]}),(0,W.jsx)(Q5,{testID:`insulin_sensitivity_picker`,isVisible:h,items:T,initialScrollIndex:E,onConfirm:C,onCancel:()=>{g(!1)}}),(0,W.jsx)(Q5,{testID:`insulin_to_carb_ratio_picker`,isVisible:_,items:R9,initialScrollIndex:D,onConfirm:w,onCancel:()=>{v(!1)}})]})}var iCn=R.create({contentContainer:{paddingTop:32,paddingHorizontal:16,gap:24}});V();function aCn({setNextEnabled:e,ref:t}){let{t:n}=Tq(),{COLORS:r}=J(),{width:i}=em(),a=N5(),{bottomWithFooterButton:o}=Q4(),{bloodGlucoseUnits:s,parameters:c,treatmentType:l,diabetesType:u,birthday:d,biologicalSex:f}=s7(),p=xpn(),{modalStoreActions:m}=z5(),h=(0,H.useCallback)(async()=>{if(s===void 0)throw Error(`[Step6::setUserSettings] bloodGlucoseUnits from userSettingsManager is undefined.`);if(u===void 0)throw Error(`[Step6::setUserSettings] diabetesType from userSettingsManager is undefined.`);if(c===void 0)throw Error(`[Step6::setUserSettings] parameters from newUserSettingsManager is undefined.`);if(d===void 0)throw Error(`[Step6::setUserSettings] birthday from newUserSettingsManager is undefined.`);if(f===void 0)throw Error(`[Step6::setUserSettings] biologicalSex from newUserSettingsManager is undefined.`);let{carbohydrateRatio:e,insulinSensitivity:t}=c.overallParameters,n=O8(t,e,X.Usage.Overall);return k8.postUserSettings({parameters:n,activity:w8(),notifications:lon(),glucoseLevelTargets:ion(),bloodGlucoseUnits:s,treatmentType:l,diabetesType:u,birthday:d,biologicalSex:f})},[d,s,u,f,c,l]);(0,H.useImperativeHandle)(t,()=>({onBackPress(){u8(l8.SetupSummaryBackPress)},onNextPressed:async()=>{u8(l8.SetupSummaryFinishPress);let t=await h();return t?e(!0):m.set({showSyncErrorModal:!0}),{transitionAllowed:t}},validateData(){return{isValid:!0}}}),[e,m,h]);let g=(0,H.useMemo)(()=>{if(s===void 0)throw Error(`[Step6::generalTreatmentItems] bloodGlucoseUnits is undefined`);if(l===void 0)throw Error(`[Step6::generalTreatmentItems] treatmentType is undefined`);if(u===void 0)throw Error(`[Step6::generalTreatmentItems] diabetesType is undefined`);let{text:e}=L8(s),t=K9t(X.InjectionMethod,l),r=u===X.DiabetesType.Type1?`type_of_diabetes_type1`:`type_of_diabetes_type2`;return[{label:n(`summary_setup_input_diabetes_type`),value:n(r),testID:`diabetes-type-result`},{label:n(`summary_setup_input_treatment_type`),value:V9[t](),testID:`treatment-type-result`},{label:n(`summary_setup_input_glucose_unit`),value:e,testID:`glucose-result`}]},[s,u,l,n]),_=(0,H.useMemo)(()=>{if(s===void 0)throw Error(`[Step6::insulinFactorsItems] bloodGlucoseUnits is undefined`);let{text:e}=L8(s),{carbohydrateRatio:t,insulinSensitivity:r}=c?.overallParameters??{};if(t===void 0||r===void 0)throw Error(`[Step6::insulinFactorsItems] carbohydrateRatio or insulinSensitivity is undefined`);return[p?{label:n(`summary_setup_input_daily_dose_input`),value:p.toFixed(0),unit:n(`units`),testID:`total-daily-insulin-result`}:null,{label:n(`summary_setup_input_insulin-to-carb_input`),value:`${t}`,unit:n(`summary_setup_insulin-to-carb_unit`),testID:`carb-ratio-result`},{label:n(`summary_setup_input_insulin_sensitivity_input`),value:B8(r,X.BloodGlucoseUnit.MMOL_L,s),unit:n(`summary_setup_insulin_sensitivity_unit`,{displayUnit:e}),testID:`insulin-sensitivity-result`}].filter(e=>e!==null)},[s,c?.overallParameters,n,p]);return(0,W.jsxs)(fs,{testID:`scroll`,contentContainerStyle:[oCn.scrollContent,{width:i,paddingTop:a+16,paddingBottom:o}],style:{backgroundColor:r.bgPrimary},children:[(0,W.jsx)(p9,{}),(0,W.jsx)(B,{style:oCn.spacer}),(0,W.jsx)(d3,{title:n(`summary_setup_general_title`)}),(0,W.jsx)(Y4.Container,{children:g.map(({testID:e,label:t,value:n,unit:i})=>(0,W.jsx)(Y4,{testID:e,title:t,displayStyle:b9t.List,displayType:J4.ListItem,titleStyle:{color:r.labelPrimary},valueStyle:{color:r.labelSecondary},value:`${n} ${i??``}`},e))}),(0,W.jsx)(B,{style:oCn.spacer}),(0,W.jsx)(d3,{title:n(`summary_setup_insuling_settings_title`)}),(0,W.jsx)(Y4.Container,{children:_.map(({testID:e,label:t,value:n,unit:i})=>(0,W.jsx)(Y4,{testID:e,title:t,displayStyle:b9t.List,displayType:J4.ListItem,titleStyle:{color:r.labelPrimary},valueStyle:{color:r.labelSecondary},value:`${n} ${i??``}`},e))}),(0,W.jsx)(t7,{})]})}var oCn=R.create({scrollContent:{paddingHorizontal:16},spacer:{height:24}});V();var sCn=()=>{let{t:e}=Tq(),{COLORS:t}=J(),{width:n}=em(),{clear:r}=o7(),{setHasCompletedSetupFlow:i,setIsPinSetupShouldBeShown:a}=E3(),o=N$(),[s,c]=(0,H.useState)(2),[l,u]=(0,H.useState)(0),[d,f]=(0,H.useState)(0),[p,m]=(0,H.useState)(!1),[h,g]=(0,H.useState)(!1),_=(0,H.useRef)(null),v=(0,H.useRef)(null);(0,H.useEffect)(()=>{r()},[r]);let y=(0,H.useCallback)(e=>{m(e)},[]),b=(0,H.useCallback)(e=>{g(e===`yes`)},[]),x=(0,H.useMemo)(()=>[{title:e(`general_navigation`),stepNumber:2,renderComponent:e=>(0,W.jsx)(QSn,{ref:e,setNextEnabled:y})},{title:e(`treatment_navigation`),stepNumber:3,renderComponent:e=>(0,W.jsx)($Sn,{ref:e,setNextEnabled:y})},{title:e(`insulin_settings_navigation`),stepNumber:4,renderComponent:e=>(0,W.jsx)(JSn,{ref:e,onOptionSelect:b,setNextEnabled:y})},{title:e(`insulin_settings_navigation`),stepNumber:4,renderComponent:e=>h?(0,W.jsx)(rCn,{ref:e,setNextEnabled:y}):(0,W.jsx)(nCn,{ref:e,setNextEnabled:y})},{title:e(`summary_setup_navigation`),stepNumber:5,renderComponent:e=>(0,W.jsx)(aCn,{ref:e,setNextEnabled:y})}],[b,y,h,e]);(0,H.useEffect)(()=>{o.setOptions({headerTransparent:!0,header:()=>(0,W.jsx)(F5,{title:x[l].title,overlay:!0})})},[l,o,x]),(0,H.useEffect)(()=>{if(!v.current)return;let{isValid:e}=v.current.validateData();m(e)},[l,x]);let S=(0,H.useCallback)(async()=>{if(!v.current)return;let{transitionAllowed:e}=await v.current.onNextPressed();if(e)if(l===x.length-1){Oq||a(!0),i(!0);let e=Oq?{name:I5.QuickGuideStack}:{name:I5.PINCodeSetup,params:{comingFrom:I5.Setup}};o.dispatch(x$({index:0,routes:[e]}))}else{let e=l+1;_.current?.scrollToIndex({index:e,animated:!0}),c(x[e].stepNumber),u(e),f(t=>Math.max(t,e))}},[l,x,o,i,a]),C=(0,H.useCallback)(()=>{if(v.current?.onBackPress(),l===0)o.goBack();else{let e=l-1;_.current?.scrollToIndex({index:e,animated:!0}),c(x[e].stepNumber),u(e),f(t=>Math.max(t,e))}},[l,o,x]);return V$((0,H.useCallback)(()=>{let e=Cf.addEventListener(`hardwareBackPress`,()=>(C(),!0));return()=>{e.remove()}},[C])),(0,W.jsxs)(B,{style:[cCn.container,{backgroundColor:t.bgSecondary}],children:[(0,W.jsx)(Wc,{ref:_,data:x,renderItem:({item:e,index:t})=>t<=d?e.renderComponent(t===l?v:null):(0,W.jsx)(B,{style:{width:n}}),scrollEnabled:!1,horizontal:!0,initialNumToRender:1,showsHorizontalScrollIndicator:!1}),(0,W.jsx)(J9,{currentStep:s,onPress:S,onBackPress:C,inactive:!p,text:l===x.length-1?e(`button_complete`):e(`button_next`)})]})},cCn=R.create({container:{flex:1}});V();var lCn=({isVisible:e,onCancelPress:t,onContinuePress:n,onModalHide:r})=>{let{t:i}=Tq(),{COLORS:a}=J(),[o,s]=(0,H.useState)([!1,!1]),[c,l]=(0,H.useState)(!1),u=(0,H.useMemo)(()=>o.every(Boolean),[o]);(0,H.useEffect)(()=>{e&&(s([!1,!1]),l(!1))},[e]);let d=(0,H.useCallback)(e=>{s(t=>t.map((t,n)=>n===e?!t:t))},[]),f=(0,H.useCallback)(()=>{c&&u&&r()},[u,c,r]),p=(0,H.useCallback)(()=>{l(!0),n()},[n]);return(0,W.jsxs)(u3,{testID:`restrictions_modal`,isVisible:e,enableScroll:!0,onModalHide:f,containerStyle:{backgroundColor:a.bgModal},buttons:[{testID:`restrictions_continue_button`,title:i(`welcome_modal_button_confirm`),onPress:p,disabled:!u},{testID:`restrictions_cancel_button`,title:i(`button_cancel`),type:H4.Secondary,onPress:t}],children:[(0,W.jsx)(Z,{style:$9.title,children:i(`welcome_modal_title`)}),(0,W.jsx)(Z,{style:[$9.subtitle,{color:a.labelSecondary}],children:i(`welcome_modal_body`)}),(0,W.jsxs)(wp,{testID:`restrictions_checkmark_1`,onPress:()=>{d(0)},style:({pressed:e})=>[{opacity:e?.5:1},$9.checkmarkContainer],children:[o[0]?(0,W.jsx)(Y7t,{}):(0,W.jsx)(J7t,{}),(0,W.jsxs)(B,{style:$9.checkmarkTextContainer,children:[(0,W.jsx)(Z,{style:$9.checkmarkTitle,children:i(`welcome_modal_pregnancy_title`)}),(0,W.jsx)(Z,{style:[$9.checkmarkSubtitle,{color:a.labelSecondary}],children:i(`welcome_modal_pregnancy_body`)})]})]}),(0,W.jsx)(B,{style:[$9.separatorLine,{backgroundColor:a.divider}]}),(0,W.jsxs)(wp,{testID:`restrictions_checkmark_2`,onPress:()=>{d(1)},style:({pressed:e})=>[{opacity:e?.5:1},$9.checkmarkContainer],children:[o[1]?(0,W.jsx)(Y7t,{}):(0,W.jsx)(J7t,{}),(0,W.jsxs)(B,{style:$9.checkmarkTextContainer,children:[(0,W.jsx)(Z,{style:$9.checkmarkTitle,children:i(`welcome_modal_gestational_title`)}),(0,W.jsx)(Z,{style:[$9.checkmarkSubtitle,{color:a.labelSecondary}],children:i(`welcome_modal_gestational_body`)})]})]})]})},$9=R.create({title:{...Y.Poppins.bold_2XL,marginTop:32,marginBottom:8},subtitle:{...Y.Poppins.regular_Base,marginBottom:16},checkmarkContainer:{paddingVertical:16,flexDirection:`row`,justifyContent:`space-between`},checkmarkTextContainer:{flex:1,marginLeft:8},checkmarkTitle:{...Y.Poppins.semiBold_Base,marginBottom:2},checkmarkSubtitle:{...Y.Poppins.regular_SM},separatorLine:{width:`100%`,height:1}});V();var uCn=()=>{let{t:e}=Tq(),{navigate:t}=N$(),{clear:n}=o7(),{COLORS:r}=J(),[i,a]=(0,H.useState)(!1);(0,H.useEffect)(()=>{n()},[n]);let o=(0,H.useCallback)(()=>{a(!0),u8(l8.SetupIntroStartPress)},[]);return(0,W.jsxs)(B,{style:[dCn.container,{backgroundColor:r.bgSecondary}],children:[(0,W.jsx)(MSn,{title:e(`setup_account_title`),subtitle:e(`setup_account_body`),stepChecked:1}),(0,W.jsx)(J9,{currentStep:1,isBackVisible:!1,onPress:o,text:e(`button_start`)}),(0,W.jsx)(lCn,{isVisible:i,onCancelPress:()=>{a(!1)},onContinuePress:()=>{a(!1)},onModalHide:()=>{t(I5.Setup)}})]})},dCn=R.create({container:{flex:1}}),{Navigator:fCn,Screen:pCn}=j5(),mCn=()=>{let{t:e}=Tq();return(0,W.jsxs)(fCn,{screenOptions:{...K5},children:[(0,W.jsx)(pCn,{name:I5.SetupStart,component:uCn,options:{header:()=>(0,W.jsx)(F5,{title:e(`setup_account_navigation`),overlay:!0})}}),(0,W.jsx)(pCn,{name:I5.Setup,component:sCn,options:{header:()=>(0,W.jsx)(F5,{title:e(`general_navigation`),overlay:!0})}})]})},{Navigator:hCn,Screen:gCn}=j5(),_Cn=()=>{let{hasCompletedSetupFlow:e}=E3(),t=H.useMemo(()=>e?I5.QuickGuideStack:I5.SetupBolusCalculator,[e]);return(0,W.jsxs)(hCn,{initialRouteName:t,screenOptions:{...K5,headerShown:!1},children:[(0,W.jsx)(gCn,{name:I5.SetupBolusCalculator,component:mCn}),(0,W.jsx)(gCn,{name:I5.QuickGuideStack,component:qSn})]},t)},vCn=()=>{let{isOnboardingFinished:e,setIsOnboardingFinished:t}=E3(),[n,r]=H.useState(!1),i=(0,H.useCallback)(async()=>{if(await q8.syncAll(),!k8.uuid){if(bq.IS_PRODUCTION===`true`)throw window.location.href=`/redirect?status=error`,Error(`[App::syncData] User settings not found`);k8.updateMockUserSettings()}t(a8t(X.BloodGlucoseUnit).safeParse(k8.glucoseUnit).success)},[t]);return(0,H.useEffect)(()=>{i().catch(console.error).finally(()=>{r(!0)})},[i]),!n||e===void 0?(0,W.jsx)(x2,{}):e?(0,W.jsx)(jSn,{}):(0,W.jsx)(_Cn,{})},yCn={prefixes:[],config:{path:`app`,screens:{SetupBolusCalculator:{path:`setup-bolus-calculator`,screens:{SetupStart:`setup-start`,Setup:`setup`}},QuickGuideStack:{path:`quick-guide`,screens:{QuickGuideStart:`quick-guide-start`,QuickGuide:`quick-guide`,QuickGuideAllSet:`quick-guide-all-set`}},NewCalculationStack:{path:`new-calculation`,screens:{Calculation:``,LoadingRecommendation:{path:`loading`},Recommendation:{path:`recommendation`},LeavingRecommendation:{path:`leaving`}}},IFU:`ifu`,SettingsStack:{path:`settings`,screens:{Settings:``,ProfileStack:`profile`,GlucoseSettings:`glucose`,ActivitySettings:`activity`,InsulinSettingsStack:{path:`insulin-settings`,screens:{InsulinSettings:``,TreatmentType:`treatment-type`,RapidActingInsulin:`rapid-acting-insulin`,LongActingInsulin:`long-acting-insulin`}},IFU:`ifu`,Legal:`legal`,GlucoseUnit:`glucose-unit`}}}}};Z0();var bCn=yWt(),xCn=document.querySelector(`meta[name="sentry-environment"]`)?.content;bq.SENTRY_ENABLED===`true`&&W1t({dsn:bq.SENTRY_DSN,environment:xCn||bq.SENTRY_ENVIRONMENT,release:`hedia-web@3.9.0+1238`,dist:`1238`,beforeSend:(e,t)=>{let n=e.exception?.values?.[0],r=[n?.type,n?.value].filter(Boolean).join(`: `);if(r.includes(gvt.NetworkErrorFailure)||r.includes(gvt.NetworkErrorTimeout)||bq.IS_PRODUCTION===`false`&&r.includes(gvt.TranslationError))return null;if(t.originalException instanceof w2){let{statusCode:n,method:r,url:i,responseBody:a}=t.originalException;e.tags={...e.tags,"http.status":String(n),"http.method":r},e.contexts={...e.contexts,response:{status:n,url:i,method:r,body:a}}}return e.user&&(delete e.user.email,delete e.user.ip_address,delete e.user.username,delete e.user.geo),e}});var SCn=()=>(0,W.jsx)(q3t,{children:(0,W.jsx)(sSt,{children:(0,W.jsx)(S4t,{children:(0,W.jsx)(C2t,{children:(0,W.jsx)(z0t,{client:B4t,children:(0,W.jsx)(PKt,{theme:Z3t(),ref:bCn,linking:yCn,children:(0,W.jsx)(LUt,{children:(0,W.jsx)(vCn,{})})})})})})})}),CCn=u(y());Svt(),CCn.createRoot(document.getElementById(`root`)).render((0,W.jsx)(SCn,{}));
|