@hedia/web-public 3.9.0-1218 → 3.9.0-1220
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:`7fd8393a3474889f1d45fe9531d448c4c88eb215`};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`e17bfd91-8cee-4776-b2b4-69f328b023f8`,e._sentryDebugIdIdentifier=`sentry-dbid-e17bfd91-8cee-4776-b2b4-69f328b023f8`)}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)},M={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=M,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,M=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},oe=[],N=-1;function se(e){return{current:e}}function P(e){0>N||(e.current=oe[N],oe[N]=null,N--)}function F(e,t){N++,oe[N]=e.current,e.current=t}var ce=se(null),le=se(null),ue=se(null),de=se(null);function fe(e,t){switch(F(ue,t),F(le,e),F(ce,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Du(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Du(t),e=Ou(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}P(ce),F(ce,e)}function pe(){P(ce),P(le),P(ue)}function me(e){e.memoizedState!==null&&F(de,e);var t=ce.current,n=Ou(t,e.type);t!==n&&(F(le,e),F(ce,n))}function he(e){le.current===e&&(P(ce),P(le)),de.current===e&&(P(de),bd._currentValue=ae)}var I,ge;function L(e){if(I===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);I=t&&t[1]||``,ge=-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+1220`};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`add619b3-3029-4e82-96b2-7330e7bc0b6b`,e._sentryDebugIdIdentifier=`sentry-dbid-add619b3-3029-4e82-96b2-7330e7bc0b6b`)}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)},M={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=M,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,M=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},oe=[],N=-1;function se(e){return{current:e}}function P(e){0>N||(e.current=oe[N],oe[N]=null,N--)}function F(e,t){N++,oe[N]=e.current,e.current=t}var ce=se(null),le=se(null),ue=se(null),de=se(null);function fe(e,t){switch(F(ue,t),F(le,e),F(ce,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Du(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Du(t),e=Ou(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}P(ce),F(ce,e)}function pe(){P(ce),P(le),P(ue)}function me(e){e.memoizedState!==null&&F(de,e);var t=ce.current,n=Ou(t,e.type);t!==n&&(F(le,e),F(ce,n))}function he(e){le.current===e&&(P(ce),P(le)),de.current===e&&(P(de),bd._currentValue=ae)}var I,ge;function L(e){if(I===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);I=t&&t[1]||``,ge=-1<e.stack.indexOf(`
|
|
2
2
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
3
3
|
`+I+e+ge}var _e=!1;function ve(e,t){if(!e||_e)return``;_e=!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: ${C1(e)}.
|
|
|
862
862
|
Url: ${G1(e)}`),!0;if(!aQt(e,t.allowUrls))return W$&&Q$.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
863
863
|
Event: ${C1(e)}.
|
|
864
864
|
Url: ${G1(e)}`),!0}else if(e.type===`transaction`&&rQt(e,t.ignoreTransactions))return W$&&Q$.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
865
|
-
Event: ${C1(e)}`),!0;return!1}function nQt(e,t){return t?.length?aZt(e).some(e=>x1(e,t)):!1}function rQt(e,t){if(!t?.length)return!1;let n=e.transaction;return n?x1(n,t):!1}function iQt(e,t){if(!t?.length)return!1;let n=G1(e);return n?x1(n,t):!1}function aQt(e,t){if(!t?.length)return!0;let n=G1(e);return n?x1(n,t):!0}function oQt(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 G1(e){try{let t=[...e.exception?.values??[]].reverse().find(e=>e.mechanism?.parent_id===void 0&&e.stacktrace?.frames?.length)?.stacktrace?.frames;return t?oQt(t):null}catch{return W$&&Q$.error(`Cannot extract url for event ${C1(e)}`),null}}function sQt(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(e=>e.stacktrace||e.type&&e.type!==`Error`||e.value):!1}function cQt(e,t,n,r,i,a){if(!i.exception?.values||!a||!a1(a.originalException))return;let o=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;o&&(i.exception.values=lQt(e,t,r,a.originalException,n,i.exception.values,o,0))}function lQt(e,t,n,r,i,a,o,s){if(a.length>=n+1)return a;let c=[...a];if(a1(r[i])){dQt(o,s,r);let a=e(t,r[i]),l=c.length;fQt(a,i,l,s),c=lQt(e,t,n,r[i],i,[a,...c],a,l)}return uQt(r)&&r.errors.forEach((a,l)=>{if(a1(a)){dQt(o,s,r);let u=e(t,a),d=c.length;fQt(u,`errors[${l}]`,d,s),c=lQt(e,t,n,a,i,[u,...c],u,d)}}),c}function uQt(e){return Array.isArray(e.errors)}function dQt(e,t,n){e.mechanism={handled:!0,type:`auto.core.linked_errors`,...uQt(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function fQt(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:`chained`,source:t,exception_id:n,parent_id:r}}function pQt(e){return a1(e)&&`__sentry_fetch_url_host__`in e&&typeof e.__sentry_fetch_url_host__==`string`}function mQt(e){return pQt(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}var hQt=new Set([]);function gQt(e){let t=`console`,n=n1(t,e);return r1(t,vQt),n}var _Qt=new Set;function vQt(){`console`in G$&&RKt.forEach(function(e){_Qt.has(e)||!(e in G$.console)||(_Qt.add(e),p1(G$.console,e,function(t){return X$[e]=t,function(...t){let n=t[0],r=X$[e],i=hQt.size&&typeof n==`string`&&x1(n,hQt);i||i1(`console`,{args:t,level:e}),(!i||W$&&Q$.isEnabled())&&r?.apply(G$.console,t)}}))})}function yQt(e){return e===`warn`?`warning`:[`fatal`,`error`,`warning`,`log`,`info`,`debug`].includes(e)?e:`log`}var bQt=`Dedupe`,xQt=V1((()=>{let e;return{name:bQt,processEvent(t){if(t.type)return t;try{if(SQt(t,e))return W$&&Q$.warn(`Event dropped due to being a duplicate of previously captured event.`),null}catch{}return e=t}}}));function SQt(e,t){return t?!!(CQt(e,t)||wQt(e,t)):!1}function CQt(e,t){let n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!EQt(e,t)||!TQt(e,t))}function wQt(e,t){let n=DQt(t),r=DQt(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!EQt(e,t)||!TQt(e,t))}function TQt(e,t){let n=tqt(e),r=tqt(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 EQt(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 DQt(e){return e.exception?.values?.[0]}var OQt=`ConversationId`,kQt=V1((()=>({name:OQt,setup(e){e.on(`spanStart`,e=>{let t=j1().getScopeData(),n=M1().getScopeData(),r=t.conversationId||n.conversationId;if(r){let{op:t,data:n,description:i}=F1(e);if(!t?.startsWith(`gen_ai.`)&&!n[`ai.operationId`]&&!i?.startsWith(`ai.`))return;e.setAttribute(kJt,r)}})}})));function AQt(e){if(e!==void 0){if(e>=400&&e<500)return`warning`;if(e>=500)return`error`}}var K1=G$;function jQt(){return`history`in K1&&!!K1.history}function MQt(){if(!(`fetch`in K1))return!1;try{return new Headers,new Request(`data:,`),new Response,!0}catch{return!1}}function NQt(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function PQt(){if(typeof EdgeRuntime==`string`)return!0;if(!MQt())return!1;if(NQt(K1.fetch))return!0;let e=!1,t=K1.document;if(t&&typeof t.createElement==`function`)try{let n=t.createElement(`iframe`);n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=NQt(n.contentWindow.fetch)),t.head.removeChild(n)}catch(e){W$&&Q$.warn(`Could not create sandbox iframe for pure fetch check, bailing to window.fetch: `,e)}return e}function FQt(e,t){let n=`fetch`,r=n1(n,e);return r1(n,()=>IQt(void 0,t)),r}function IQt(e,t=!1){t&&!PQt()||p1(G$,`fetch`,function(t){return function(...n){let r=Error(),{method:i,url:a}=RQt(n),o={args:n,fetchData:{method:i,url:a},startTimestamp:E1()*1e3,virtualError:r,headers:zQt(n)};return e||i1(`fetch`,{...o}),t.apply(G$,n).then(async t=>(e?e(t):i1(`fetch`,{...o,endTimestamp:E1()*1e3,response:t}),t),e=>{i1(`fetch`,{...o,endTimestamp:E1()*1e3,error:e}),a1(e)&&e.stack===void 0&&(e.stack=r.stack,m1(e,`framesToPop`,1));let t=N1()?.getOptions().enhanceFetchErrorMessages??`always`;if(t!==!1&&a1(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})`:m1(e,`__sentry_fetch_url_host__`,n)}catch{}throw e})}})}function q1(e,t){return u1(e)&&!!e[t]}function LQt(e){return typeof e==`string`?e:e?q1(e,`url`)?e.url:e.toString?e.toString():``:``}function RQt(e){if(e.length===0)return{method:`GET`,url:``};if(e.length===2){let[t,n]=e;return{url:LQt(t),method:q1(n,`method`)?String(n.method).toUpperCase():gqt(t)&&q1(t,`method`)?String(t.method).toUpperCase():`GET`}}let t=e[0];return{url:LQt(t),method:q1(t,`method`)?String(t.method).toUpperCase():`GET`}}function zQt(e){let[t,n]=e;try{if(typeof n==`object`&&n&&`headers`in n&&n.headers)return new Headers(n.headers);if(gqt(t))return new Headers(t.headers)}catch{}}var BQt=G$;function VQt(){try{return BQt.document.location.href}catch{return``}}function HQt(e,t=5){if(!BQt.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 J1=G$,UQt=0;function WQt(){return UQt>0}function GQt(){UQt++,setTimeout(()=>{UQt--})}function Y1(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(vqt(e))return e}catch{return e}let r=function(...n){G$._sentryWrappedDepth=(G$._sentryWrappedDepth||0)+1;try{let r=n.map(e=>Y1(e,t));return e.apply(this,r)}catch(e){throw GQt(),CJt(r=>{r.addEventProcessor(e=>(t.mechanism&&(Vqt(e,void 0,void 0),w1(e,t.mechanism)),e.extra={...e.extra,arguments:n},e)),mXt(e)}),e}finally{G$._sentryWrappedDepth=(G$._sentryWrappedDepth||0)-1}};try{for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])}catch{}_qt(r,e),m1(e,`__sentry_wrapped__`,r);try{Object.getOwnPropertyDescriptor(r,`name`).configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function KQt(){let e=VQt(),{referrer:t}=J1.document||{},{userAgent:n}=J1.navigator||{};return{url:e,headers:{...t&&{Referer:t},...n&&{"User-Agent":n}}}}function qQt(e,t){let n=X1(e,t),r={type:e$t(t),value:t$t(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===``&&(r.value=`Unrecoverable error caught`),r}function JQt(e,t,n,r){let i=N1()?.getOptions().normalizeDepth,a=c$t(t),o={__serialized__:Oqt(t,i)};if(a)return{exception:{values:[qQt(e,a)]},extra:o};let s={exception:{values:[{type:d1(t)?t.constructor.name:r?`UnhandledRejection`:`Error`,value:o$t(t,{isUnhandledRejection:r})}]},extra:o};if(n){let t=X1(e,n);t.length&&(s.exception.values[0].stacktrace={frames:t})}return s}function YQt(e,t){return{exception:{values:[qQt(e,t)]}}}function X1(e,t){let n=t.stacktrace||t.stack||``,r=ZQt(t),i=QQt(t);try{return e(n,r,i)}catch{}return[]}var XQt=/Minified React error #\d+;/i;function ZQt(e){return e&&XQt.test(e.message)?1:0}function QQt(e){return typeof e.framesToPop==`number`?e.framesToPop:0}function $Qt(e){return typeof WebAssembly<`u`&&WebAssembly.Exception!==void 0?e instanceof WebAssembly.Exception:!1}function e$t(e){let t=e?.name;return!t&&$Qt(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:`WebAssembly.Exception`:t}function t$t(e){let t=e?.message;return $Qt(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:`wasm exception`:t?t.error&&typeof t.error.message==`string`?mQt(t.error):mQt(e):`No error message`}function n$t(e,t,n,r){let i=i$t(e,t,n?.syntheticException||void 0,r);return w1(i),i.level=`error`,n?.event_id&&(i.event_id=n.event_id),R1(i)}function r$t(e,t,n=`info`,r,i){let a=a$t(e,t,r?.syntheticException||void 0,i);return a.level=n,r?.event_id&&(a.event_id=r.event_id),R1(a)}function i$t(e,t,n,r,i){let a;if(uqt(t)&&t.error)return YQt(e,t.error);if(dqt(t)||fqt(t)){let i=t;if(`stack`in t){a=YQt(e,t);let i=a.exception?.values?.[0];if(r&&n&&i&&!i.stacktrace){let t=X1(e,n);t.length&&(i.stacktrace={frames:t},w1(a,{synthetic:!0}))}}else{let t=i.name||(dqt(i)?`DOMError`:`DOMException`),o=i.message?`${t}: ${i.message}`:t;a=a$t(e,o,n,r),Vqt(a,o)}return`code`in i&&(a.tags={...a.tags,"DOMException.code":`${i.code}`}),a}return a1(t)?YQt(e,t):l1(t)||d1(t)?(a=JQt(e,t,n,i),w1(a,{synthetic:!0}),a):(a=a$t(e,t,n,r),Vqt(a,`${t}`,void 0),w1(a,{synthetic:!0}),a)}function a$t(e,t,n,r){let i={};if(r&&n){let r=X1(e,n);r.length&&(i.exception={values:[{value:t,stacktrace:{frames:r}}]}),w1(i,{synthetic:!0})}if(pqt(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 o$t(e,{isUnhandledRejection:t}){let n=xqt(e),r=t?`promise rejection`:`exception`;return uqt(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:d1(e)?`Event \`${s$t(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function s$t(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function c$t(e){return Object.values(e).find(a1)}var l$t=class extends wZt{constructor(e){let t=u$t(e);GZt(t,`browser`,[`browser`],J1.SENTRY_SDK_SOURCE||PXt()),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;J1.document&&J1.document.addEventListener(`visibilitychange`,()=>{J1.document.visibilityState===`hidden`&&(r&&this._flushOutcomes(),queueMicrotask(()=>{this.flush()}))}),n&&this.on(`beforeSendSession`,WZt)}eventFromException(e,t){return n$t(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t=`info`,n){return r$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 u$t(e){return{release:typeof __SENTRY_RELEASE__==`string`?__SENTRY_RELEASE__:J1.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}var d$t=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,Z1=G$;function f$t(e,t,n){Z1.document&&Z1.addEventListener(e,t,n)}function p$t(e,t,n){Z1.document&&Z1.removeEventListener(e,t,n)}var m$t=e=>{let t=!1;return()=>{t||=(e(),!0)}},h$t=e=>{let t=Z1.requestIdleCallback||Z1.setTimeout;Z1.document?.visibilityState===`hidden`?e():(e=m$t(e),f$t(`visibilitychange`,e,{once:!0,capture:!0}),f$t(`pagehide`,e,{once:!0,capture:!0}),t(()=>{e(),p$t(`visibilitychange`,e,{capture:!0}),p$t(`pagehide`,e,{capture:!0})}))},g$t=80,Q1={};try{typeof Node<`u`&&(Q1.parentNode=Object.getOwnPropertyDescriptor(Node.prototype,`parentNode`).get),typeof Element<`u`&&(Q1.tagName=Object.getOwnPropertyDescriptor(Element.prototype,`tagName`).get,Q1.id=Object.getOwnPropertyDescriptor(Element.prototype,`id`).get,Q1.className=Object.getOwnPropertyDescriptor(Element.prototype,`className`).get,Q1.getAttribute=Element.prototype.getAttribute),typeof HTMLElement<`u`&&(Q1.dataset=Object.getOwnPropertyDescriptor(HTMLElement.prototype,`dataset`).get)}catch{}function $1(e,t,n){let r=Q1[t];if(r)try{return r.call(e,n)}catch{}let i=e[t];return typeof i==`function`?i.call(e,n):i}function _$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||g$t;for(;n&&i++<5&&(o=v$t(n,s),!(o===`html`||i>1&&a+r.length*3+o.length>=c));)r.push(o),a+=o.length,n=$1(n,`parentNode`);return r.reverse().join(` > `)}catch{return`<unknown>`}}function v$t(e,t){let n=[],r=$1(e,`tagName`);if(!r)return``;if(typeof HTMLElement<`u`&&e instanceof HTMLElement){let t=$1(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=>$1(e,`getAttribute`,t)).map(t=>[t,$1(e,`getAttribute`,t)]):null;if(i?.length)i.forEach(e=>{n.push(`[${e[0]}="${e[1]}"]`)});else{let t=$1(e,`id`);t&&n.push(`#${t}`);let r=$1(e,`className`);if(r&&s1(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=$1(e,`getAttribute`,t);r&&n.push(`[${t}="${r}"]`)}return n.join(``)}var y$t=1e3,b$t,x$t,S$t;function C$t(e){n1(`dom`,e),r1(`dom`,w$t)}function w$t(){if(!Z1.document)return;let e=i1.bind(null,`dom`),t=D$t(e,!0);Z1.document.addEventListener(`click`,t,!1),Z1.document.addEventListener(`keypress`,t,!1),[`EventTarget`,`Node`].forEach(t=>{let n=Z1[t]?.prototype;n?.hasOwnProperty?.(`addEventListener`)&&(p1(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=D$t(e);a.handler=r,t.call(this,n,r,i)}a.refCount++}catch{}return t.call(this,n,r,i)}}),p1(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 T$t(e){if(e.type!==x$t)return!1;try{if(!e.target||e.target._sentryId!==S$t)return!1}catch{}return!0}function E$t(e,t){return e===`keypress`?t?.tagName?!(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable):!0:!1}function D$t(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;let r=O$t(n);if(E$t(n.type,r))return;m1(n,`_sentryCaptured`,!0),r&&!r._sentryId&&m1(r,`_sentryId`,S1());let i=n.type===`keypress`?`input`:n.type;T$t(n)||(e({event:n,name:i,global:t}),x$t=n.type,S$t=r?r._sentryId:void 0),clearTimeout(b$t),b$t=Z1.setTimeout(()=>{S$t=void 0,x$t=void 0},y$t)}}function O$t(e){try{return e.target}catch{return null}}var e0;function k$t(e){let t=`history`;n1(t,e),r1(t,A$t)}function A$t(){if(Z1.addEventListener(`popstate`,()=>{let e=Z1.location.href,t=e0;e0=e,t!==e&&i1(`history`,{from:t,to:e})}),!jQt())return;function e(e){return function(...t){let n=t.length>2?t[2]:void 0;if(n){let r=e0,i=j$t(String(n));if(e0=i,r===i)return e.apply(this,t);i1(`history`,{from:r,to:i})}return e.apply(this,t)}}p1(Z1.history,`pushState`,e),p1(Z1.history,`replaceState`,e)}function j$t(e){try{return new URL(e,Z1.location.origin).toString()}catch{return e}}var t0={};function M$t(e){let t=t0[e];if(t)return t;let n=Z1[e];if(NQt(n))return t0[e]=n.bind(Z1);let r=Z1.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){d$t&&Q$.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,t)}return n&&(t0[e]=n.bind(Z1))}function N$t(e){t0[e]=void 0}var n0=`__sentry_xhr_v3__`;function P$t(e){n1(`xhr`,e),r1(`xhr`,F$t)}function F$t(){if(!Z1.XMLHttpRequest)return;let e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(e,t,n){let r=Error(),i=E1()*1e3,a=s1(n[0])?n[0].toUpperCase():void 0,o=I$t(n[1]);if(!a||!o)return e.apply(t,n);t[n0]={method:a,url:o,request_headers:{}},a===`POST`&&o.match(/sentry_key/)&&(t.__sentry_own_request__=!0);let s=()=>{let e=t[n0];if(e&&t.readyState===4){try{e.status_code=t.status}catch{}i1(`xhr`,{endTimestamp:E1()*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[n0];return a&&s1(r)&&s1(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[n0];return r?(n[0]!==void 0&&(r.body=n[0]),i1(`xhr`,{startTimestamp:E1()*1e3,xhr:t}),e.apply(t,n)):e.apply(t,n)}})}function I$t(e){if(s1(e))return e;try{return e.toString()}catch{}}function L$t(e){if(typeof Element>`u`)return!1;try{return e instanceof Element}catch{return!1}}var R$t=40;function z$t(e,t=M$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 N$t(`fetch`),e}finally{n-=a,r--}}return rZt(e,i,ZXt(e.bufferSize||R$t))}var r0=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,B$t=30,V$t=50;function H$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 U$t=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,W$t=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,G$t=/\((\S*)(?::(\d+))(?::(\d+))\)/,K$t=/at (.+?) ?\(data:(.+?),/,q$t=[B$t,e=>{let t=e.match(K$t);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};let n=U$t.exec(e);if(n){let[,e,t,r]=n;return H$t(e,`?`,+t,+r)}let r=W$t.exec(e);if(r){if(r[2]?.indexOf(`eval`)===0){let e=G$t.exec(r[2]);e&&(r[2]=e[1],r[3]=e[2],r[4]=e[3])}let[e,t]=Z$t(r[1]||`?`,r[2]);return H$t(t,e,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}}],J$t=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Y$t=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,X$t=ZKt(q$t,[V$t,e=>{let t=J$t.exec(e);if(t){if(t[3]&&t[3].indexOf(` > eval`)>-1){let e=Y$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]=Z$t(n,e),H$t(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]),Z$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]},i0=1024,Q$t=`Breadcrumbs`,$$t=V1(((e={})=>{let t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:Q$t,setup(e){t.console&&gQt(n1t(e)),t.dom&&C$t(t1t(e,t.dom)),t.xhr&&P$t(r1t(e)),t.fetch&&FQt(i1t(e)),t.history&&k$t(a1t(e)),t.sentry&&e.on(`beforeSendEvent`,e1t(e))}}}));function e1t(e){return function(t){N1()===e&&W1({category:`sentry.${t.type===`transaction`?`transaction`:`event`}`,event_id:t.event_id,level:t.level,message:C1(t)},{event:t})}}function t1t(e,t){return function(n){if(N1()!==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>i0&&(r0&&Q$.warn(`\`dom.maxStringLength\` cannot exceed ${i0}, but a value of ${o} was configured. Sentry will use ${i0} instead.`),o=i0),typeof a==`string`&&(a=[a]);try{let e=n.event,t=o1t(e)?e.target:e;r=_$t(t,{keyAttrs:a,maxStringLength:o}),i=HQt(t)}catch{r=`<unknown>`}if(r.length===0)return;let s={category:`ui.${n.name}`,message:r};i&&(s.data={"ui.component_name":i}),W1(s,{event:n.event,name:n.name,global:n.global})}}function n1t(e){return function(t){if(N1()!==e)return;let n={category:`console`,data:{arguments:t.args,logger:`console`},level:yQt(t.level),message:Iqt(t.args,` `)};if(t.level===`assert`)if(t.args[0]===!1)n.message=`Assertion failed: ${Iqt(t.args.slice(1),` `)||`console.assert`}`,n.data.arguments=t.args.slice(1);else return;W1(n,{input:t.args,level:t.level})}}function r1t(e){return function(t){if(N1()!==e)return;let{startTimestamp:n,endTimestamp:r}=t,i=t.xhr[n0];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:AQt(s)};e.emit(`beforeOutgoingRequestBreadcrumb`,d,u),W1(d,u)}}function i1t(e){return function(t){if(N1()!==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),W1(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:AQt(a.status_code)};e.emit(`beforeOutgoingRequestBreadcrumb`,s,o),W1(s,o)}}}function a1t(e){return function(t){if(N1()!==e)return;let n=t.from,r=t.to,i=HZt(J1.location.href),a=n?HZt(n):void 0,o=HZt(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),W1({category:`navigation`,data:{from:n,to:r}})}}function o1t(e){return!!e&&!!e.target}var s1t=`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(`,`),c1t=`BrowserApiErrors`,l1t=V1(((e={})=>{let t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:c1t,setupOnce(){t.setTimeout&&p1(J1,`setTimeout`,u1t),t.setInterval&&p1(J1,`setInterval`,u1t),t.requestAnimationFrame&&p1(J1,`requestAnimationFrame`,d1t),t.XMLHttpRequest&&`XMLHttpRequest`in J1&&p1(XMLHttpRequest.prototype,`send`,f1t);let e=t.eventTarget;e&&(Array.isArray(e)?e:s1t).forEach(e=>p1t(e,t))}}}));function u1t(e){return function(...t){let n=t[0];return t[0]=Y1(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${e1(e)}`}}),e.apply(this,t)}}function d1t(e){return function(t){return e.apply(this,[Y1(t,{mechanism:{data:{handler:e1(e)},handled:!1,type:`auto.browser.browserapierrors.requestAnimationFrame`}})])}}function f1t(e){return function(...t){let n=this;return[`onload`,`onerror`,`onprogress`,`onreadystatechange`].forEach(e=>{e in n&&typeof n[e]==`function`&&p1(n,e,function(t){let n={mechanism:{data:{handler:e1(t)},handled:!1,type:`auto.browser.browserapierrors.xhr.${e}`}},r=vqt(t);return r&&(n.mechanism.data.handler=e1(r)),Y1(t,n)})}),e.apply(this,t)}}function p1t(e,t){let n=J1[e]?.prototype;n?.hasOwnProperty?.(`addEventListener`)&&(p1(n,`addEventListener`,function(n){return function(r,i,a){try{m1t(i)&&(i.handleEvent=Y1(i.handleEvent,{mechanism:{data:{handler:e1(i),target:e},handled:!1,type:`auto.browser.browserapierrors.handleEvent`}}))}catch{}return t.unregisterOriginalCallbacks&&h1t(this,r,i),n.apply(this,[r,Y1(i,{mechanism:{data:{handler:e1(i),target:e},handled:!1,type:`auto.browser.browserapierrors.addEventListener`}}),a])}}),p1(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 m1t(e){return typeof e.handleEvent==`function`}function h1t(e,t,n){e&&typeof e==`object`&&`removeEventListener`in e&&typeof e.removeEventListener==`function`&&e.removeEventListener(t,n)}var g1t=V1((e={})=>{let t=e.lifecycle??`route`;return{name:`BrowserSession`,setupOnce(){if(J1.document===void 0){r0&&Q$.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}vXt({ignoreDuration:!0});let e=!1;h$t(()=>{e||=(xXt(),!0)});let n=M1(),r=n.getUser();n.addScopeListener(t=>{let n=t.getUser();(r?.id!==n?.id||r?.ip_address!==n?.ip_address)&&(r=n,e&&xXt())}),t===`route`&&k$t(({from:t,to:n})=>{t!==n&&(vXt({ignoreDuration:!0}),xXt(),e=!0)})}}}),_1t=`CultureContext`,v1t=V1((()=>({name:_1t,preprocessEvent(e){let t=y1t();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})},processSegmentSpan(e){let t=y1t();t&&KYt(e,{"culture.locale":t.locale,"culture.timezone":t.timezone,"culture.calendar":t.calendar})}})));function y1t(){try{let e=J1.Intl;if(!e)return;let t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}var b1t=`GlobalHandlers`,x1t=V1(((e={})=>{let t={onerror:!0,onunhandledrejection:!0,...e};return{name:b1t,setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(S1t(e),D1t(`onerror`)),t.onunhandledrejection&&(C1t(e),D1t(`onunhandledrejection`))}}}));function S1t(e){iqt(t=>{let{stackParser:n,attachStacktrace:r}=O1t();if(N1()!==e||WQt())return;let{msg:i,url:a,line:o,column:s,error:c}=t,l=E1t(i$t(n,c||i,void 0,r,!1),a,o,s);l.level=`error`,hXt(l,{originalException:c,mechanism:{handled:!1,type:`auto.browser.global_handlers.onerror`}})})}function C1t(e){sqt(t=>{let{stackParser:n,attachStacktrace:r}=O1t();if(N1()!==e||WQt())return;let i=w1t(t),a=c1(i)?T1t(i):i$t(n,i,void 0,r,!0);a.level=`error`,hXt(a,{originalException:i,mechanism:{handled:!1,type:`auto.browser.global_handlers.onunhandledrejection`}})})}function w1t(e){if(c1(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 T1t(e){return{exception:{values:[{type:`UnhandledRejection`,value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function E1t(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:k1t(t)??VQt(),function:`?`,in_app:!0}),e}function D1t(e){r0&&Q$.log(`Global Handler attached: ${e}`)}function O1t(){return N1()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function k1t(e){if(!(!s1(e)||e.length===0))return e.startsWith(`data:`)?`<${UZt(e,!1)}>`:e}var A1t=V1(()=>({name:`HttpContext`,preprocessEvent(e){if(!J1.navigator&&!J1.location&&!J1.document)return;let t=KQt(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}},processSpan(e){if(!J1.navigator&&!J1.location&&!J1.document)return;let t=KQt();KYt(e,{[GYt]:t.headers[`User-Agent`],...e.is_segment&&{"url.full":e.attributes?.[`sentry.op`]===`http.client`?void 0:VZt(t.url),"http.request.header.referer":t.headers.Referer}})}})),j1t=`cause`,M1t=5,N1t=`LinkedErrors`,P1t=V1(((e={})=>{let t=e.limit||M1t,n=e.key||j1t;return{name:N1t,preprocessEvent(e,r,i){cQt(qQt,i.getOptions().stackParser,n,t,e,r)}}})),F1t=/^HTML(\w*)Element$/;function I1t(e){if(typeof window<`u`&&e===window)return`[Window]`;if(typeof document<`u`&&e===document)return`[Document]`;if(L$t(e)){let t=L1t(e);if(F1t.test(t))return`[HTMLElement: ${_$t(e)}]`}}function L1t(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:`null prototype`}function R1t(){return z1t()?(r0&&Z$(()=>{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 z1t(){if(J1.window===void 0)return!1;let e=J1;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;let t=VQt();return!(J1===J1.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(t))}function B1t(e){return[$Zt(),YZt(),kQt(),l1t(),$$t(),x1t(),P1t(),xQt(),A1t(),v1t(),g1t()]}function V1t(e={}){let t=!e.skipBrowserExtensionCheck&&R1t(),n=e.defaultIntegrations==null?B1t():e.defaultIntegrations,r={...e,enabled:t?!1:e.enabled,stackParser:QKt(e.stackParser||X$t),integrations:kXt({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||z$t};return Dqt(I1t),PZt(l$t,r)}function H1t(e){return l1(e)&&`nativeEvent`in e&&`preventDefault`in e&&`stopPropagation`in e}function U1t(e){let t={...e};GZt(t,`react`),gXt(`react`,{version:U.version});let n=V1t(t);return Dqt(W1t),n}function W1t(e){return H1t(e)?`[SyntheticEvent]`:I1t(e)}var a0=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(){}},o0=typeof window>`u`||`Deno`in globalThis;function s0(){}function G1t(e,t){return typeof e==`function`?e(t):e}function K1t(e){return typeof e==`number`&&e>=0&&e!==1/0}function q1t(e,t){return Math.max(e+(t||0)-Date.now(),0)}function c0(e,t){return typeof e==`function`?e(t):e}function l0(e,t){return typeof e==`function`?e(t):e}function J1t(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==X1t(o,t.options))return!1}else if(!d0(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 Y1t(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(u0(t.options.mutationKey)!==u0(a))return!1}else if(!d0(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function X1t(e,t){return(t?.queryKeyHashFn||u0)(e)}function u0(e){return JSON.stringify(e,(e,t)=>$1t(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function d0(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>d0(e[n],t[n])):!1}function Z1t(e,t){if(e===t)return e;let n=Q1t(e)&&Q1t(t);if(n||$1t(e)&&$1t(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]=Z1t(e[i],t[i]),s[i]===e[i]&&e[i]!==void 0&&l++)}return i===o&&l===i?e:s}return t}function f0(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 Q1t(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function $1t(e){if(!e0t(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!e0t(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function e0t(e){return Object.prototype.toString.call(e)===`[object Object]`}function t0t(e){return new Promise(t=>{setTimeout(t,e)})}function n0t(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Z1t(e,t)}function r0t(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function i0t(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var a0t=Symbol();function o0t(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===a0t?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function s0t(e,t){return typeof e==`function`?e(...t):!!e}var c0t=new class extends a0{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!o0&&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`}},p0=new class extends a0{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!o0&&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 l0t(){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 u0t(e){return Math.min(1e3*2**e,3e4)}function d0t(e){return(e??`online`)===`online`?p0.isOnline():!0}var f0t=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function p0t(e){return e instanceof f0t}function m0t(e){let t=!1,n=0,r=!1,i,a=l0t(),o=t=>{r||(f(new f0t(t)),e.abort?.())},s=()=>{t=!0},c=()=>{t=!1},l=()=>c0t.isFocused()&&(e.networkMode===`always`||p0.isOnline())&&e.canRun(),u=()=>d0t(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??(o0?0:3),o=e.retryDelay??u0t,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),t0t(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 h0t=e=>setTimeout(e,0);function g0t(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=h0t,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 m0=g0t(),_0t=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),K1t(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(o0?1/0:300*1e3))}clearGcTimeout(){this.#e&&=(clearTimeout(this.#e),void 0)}},v0t=class extends _0t{#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=b0t(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=n0t(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(s0).catch(s0):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>l0(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===a0t||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>c0(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:!q1t(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=o0t(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=>{p0t(e)&&e.silent||this.#s({type:`error`,error:e}),p0t(e)||(this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this)),this.scheduleGc()};return this.#i=m0t({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,...y0t(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 p0t(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),m0.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function y0t(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:d0t(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function b0t(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 x0t=class extends a0{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??X1t(r,t),a=this.get(i);return a||(a=new v0t({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(){m0.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=>J1t(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>J1t(e,t)):t}notify(e){m0.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){m0.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){m0.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},S0t=class extends _0t{#e;#t;#n;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||C0t(),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=m0t({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),m0.batch(()=>{this.#e.forEach(t=>{t.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:`updated`,action:e})})}};function C0t(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var w0t=class extends a0{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 S0t({mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=h0(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=h0(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=h0(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=h0(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){m0.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=>Y1t(t,e))}findAll(e={}){return this.getAll().filter(t=>Y1t(e,t))}notify(e){m0.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return m0.batch(()=>Promise.all(e.map(e=>e.continue().catch(s0))))}};function h0(e){return e.options.scope?.id}function T0t(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=o0t(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?i0t:r0t;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?D0t:E0t,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:E0t(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 E0t(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 D0t(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var O0t=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new x0t,this.#t=e.mutationCache||new w0t,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=c0t.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=p0.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(c0(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=G1t(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return m0.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;m0.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return m0.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=m0.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(s0).catch(s0)}invalidateQueries(e,t={}){return m0.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=m0.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(s0)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(s0)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(c0(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(s0).catch(s0)}fetchInfiniteQuery(e){return e.behavior=T0t(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(s0).catch(s0)}ensureInfiniteQueryData(e){return e.behavior=T0t(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return p0.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(u0(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{d0(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(u0(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{d0(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||=X1t(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===a0t&&(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()}},k0t=class extends a0{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=l0t(),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),j0t(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return M0t(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return M0t(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 l0(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&&!f0(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&N0t(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||l0(this.options.enabled,this.#t)!==l0(t.enabled,this.#t)||c0(this.options.staleTime,this.#t)!==c0(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||l0(this.options.enabled,this.#t)!==l0(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 F0t(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(s0)),t}#g(){this.#b();let e=c0(this.options.staleTime,this.#t);if(o0||this.#r.isStale||!K1t(e))return;let t=q1t(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,!(o0||l0(this.options.enabled,this.#t)===!1||!K1t(this.#p)||this.#p===0)&&(this.#f=setInterval(()=>{(this.options.refetchIntervalInBackground||c0t.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&&j0t(e,t),o=i&&N0t(e,n,t,r);(a||o)&&(l={...l,...y0t(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=n0t(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=n0t(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:P0t(e,t),refetch:this.refetch,promise:this.#o,isEnabled:l0(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=l0t())},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),!f0(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){m0.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function A0t(e,t){return l0(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&t.retryOnMount===!1)}function j0t(e,t){return A0t(e,t)||e.state.data!==void 0&&M0t(e,t,t.refetchOnMount)}function M0t(e,t,n){if(l0(t.enabled,e)!==!1&&c0(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&P0t(e,t)}return!1}function N0t(e,t,n,r){return(e!==t||l0(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&P0t(e,n)}function P0t(e,t){return l0(t.enabled,e)!==!1&&e.isStaleByTime(c0(t.staleTime,e))}function F0t(e,t){return!f0(e.getCurrentResult(),t)}var I0t=class extends a0{#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),f0(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&u0(t.mutationKey)!==u0(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??C0t();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){m0.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)})})}},L0t=U.createContext(void 0),g0=e=>{let t=U.useContext(L0t);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},R0t=({client:e,children:t})=>(U.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,G.jsx)(L0t.Provider,{value:e,children:t})),z0t=U.createContext(!1),B0t=()=>U.useContext(z0t);z0t.Provider;function V0t(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var H0t=U.createContext(V0t()),U0t=()=>U.useContext(H0t),W0t=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},G0t=e=>{U.useEffect(()=>{e.clearReset()},[e])},K0t=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||s0t(n,[e.error,r])),q0t=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))}},J0t=(e,t)=>e.isLoading&&e.isFetching&&!t,Y0t=(e,t)=>e?.suspense&&t.isPending,X0t=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Z0t(e,t,n){let r=B0t(),i=U0t(),a=g0(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o),o._optimisticResults=r?`isRestoring`:`optimistic`,q0t(o),W0t(o,i),G0t(i);let s=!a.getQueryCache().get(o.queryHash),[c]=U.useState(()=>new t(a,o)),l=c.getOptimisticResult(o),u=!r&&e.subscribed!==!1;if(U.useSyncExternalStore(U.useCallback(e=>{let t=u?c.subscribe(m0.batchCalls(e)):s0;return c.updateResult(),t},[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),U.useEffect(()=>{c.setOptions(o)},[o,c]),Y0t(o,l))throw X0t(o,c,i);if(K0t({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&&!o0&&J0t(l,r)&&(s?X0t(o,c,i):a.getQueryCache().get(o.queryHash)?.promise)?.catch(s0).finally(()=>{c.updateResult()}),o.notifyOnChangeProps?l:c.trackResult(l)}function _0(e,t){return Z0t(e,k0t,t)}function Q0t(e,t){let n=g0(t),[r]=U.useState(()=>new I0t(n,e));U.useEffect(()=>{r.setOptions(e)},[r,e]);let i=U.useSyncExternalStore(U.useCallback(e=>r.subscribe(m0.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=U.useCallback((e,t)=>{r.mutate(e,t).catch(s0)},[r]);if(i.error&&s0t(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}H();var v0=()=>{},y0={setDefaultMode:v0,setInputMode:v0,preload:v0,setTranslucent:v0,dismiss:v0,setFocusTo:v0,viewPositionInWindow:()=>Promise.resolve({x:0,y:0,width:0,height:0}),addListener:v0,removeListeners:v0,getConstants:()=>({keyboardBorderRadius:0})},b0={addListener:()=>({remove:v0})},$0t={addListener:()=>({remove:v0})},e2t={addListener:()=>({remove:v0})},t2t=V,n2t={synchronizeFocusedInputLayout:e=>{}},r2t=V,i2t=V,a2t=V;H();var x0=()=>{},o2t=()=>x0,s2t=e=>({value:e,addListener:x0,removeListener:x0,modify:x0,get:()=>e,set:x0}),c2t=s2t(0),l2t=s2t(null),u2t={enabled:!0,animated:{progress:new cf.Value(0),height:new cf.Value(0)},reanimated:{progress:c2t,height:c2t},layout:l2t,update:Promise.resolve,setKeyboardHandlers:o2t,setInputHandlers:o2t,setEnabled:x0},d2t=(0,U.createContext)(u2t),S0=()=>(0,U.useContext)(d2t),f2t=e=>e;H();function p2t(e){return t=>{let n=t,r=null,i=!1,a=()=>{if(i)return;let t=f2t(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 m2t(e,t){let n=(0,U.useRef)(null);return n.current===null&&(n.current=new cf.Value(e,t)),n.current}var C0=!0,h2t={height:0,duration:0,timestamp:new Date().getTime(),target:-1,type:`default`,appearance:`light`};b0.addListener(`keyboardDidHide`,e=>{C0=!0,h2t=e}),b0.addListener(`keyboardWillShow`,e=>{C0=!1,h2t=e});var w0={setDefaultMode:y0.setDefaultMode,setInputMode:y0.setInputMode,setFocusTo:y0.setFocusTo,preload:y0.preload,setTranslucent:y0.setTranslucent,dismiss:async e=>{let t=e?.keepFocus??!1,n=e?.animated??!0;return new Promise(e=>{if(C0){e();return}let r=b0.addListener(`keyboardDidHide`,()=>{e(void 0),r.remove()});y0.dismiss(t,n)})},isVisible:()=>!C0,state:()=>h2t};KQ();var g2t=()=>()=>{},_2t=g2t,v2t=g2t;H(),TOt(),KQ();var y2t=wOt(),b2t=GQ.createAnimatedComponent(cf.createAnimatedComponent(t2t)),x2t=z.create({container:{flex:1},hidden:{display:`none`,position:`absolute`}}),T0=B.OS,S2t=e=>{let{children:t,statusBarTranslucent:n,navigationBarTranslucent:r,preserveEdgeToEdge:i,enabled:a=!0,preload:o=!0}=e,s=(0,U.useRef)(null),[c,l]=(0,U.useState)(a),u=m2t(0),d=m2t(0),f=lQ(0),p=lQ(0),m=lQ(null),h=p2t(s),g=p2t(s),_=(0,U.useCallback)(async()=>{n2t.synchronizeFocusedInputLayout(s.current),await new Promise(e=>{let t=$0t.addListener(`layoutDidSynchronize`,()=>{t.remove(),e(null)})})},[]),v=(0,U.useMemo)(()=>({enabled:c,animated:{progress:u,height:cf.multiply(d,-1)},reanimated:{progress:f,height:p},layout:m,update:_,setKeyboardHandlers:h,setInputHandlers:g,setEnabled:l}),[c]),y=(0,U.useMemo)(()=>[x2t.hidden,{transform:[{translateX:d},{translateY:u}]}],[]),b=(0,U.useMemo)(()=>cf.event([{nativeEvent:{progress:u,height:d}}],{useNativeDriver:B.OS!==`web`}),[]),x=(e,t)=>{"worklet";t.includes(T0)&&(f.value=e.progress,p.value=-e.height)},S=_2t({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=v2t({onFocusedInputLayoutChanged:e=>{"worklet";e.target===-1?m.value=null:m.value=e}},[]);return(0,U.useEffect)(()=>{o&&w0.preload()},[o]),U.createElement(d2t.Provider,{value:v},U.createElement(b2t,{ref:s,enabled:c,navigationBarTranslucent:y2t||r,statusBarTranslucent:y2t||n,preserveEdgeToEdge:y2t||i,style:x2t.container,onKeyboardMoveReanimated:S,onKeyboardMoveStart:T0===`ios`?b:void 0,onKeyboardMove:T0===`android`?b:void 0,onKeyboardMoveInteractive:b,onKeyboardMoveEnd:T0===`android`?b:void 0,onFocusedInputLayoutChangedReanimated:C},t),U.createElement(cf.View,{style:y}))},C2t=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}({}),w2t=y0.getConstants().keyboardBorderRadius,E0=w2t>0;H();var T2t=Uo.get(`window`),E2t={width:T2t.width,height:T2t.height};e2t.addListener(`windowDidResize`,e=>{E2t=e});var D2t=()=>{let[e,t]=(0,U.useState)(E2t);return(0,U.useEffect)(()=>{let e=e2t.addListener(`windowDidResize`,e=>{t(e)});return t(E2t),()=>{e.remove()}},[]),e},O2t=[`keyboardWillShow`,`keyboardDidHide`],k2t=()=>({...w0.state(),isVisible:w0.isVisible()}),A2t=e=>e;function D0(e=A2t){let[t,n]=(0,U.useState)(()=>e(k2t()));return(0,U.useEffect)(()=>{let t=O2t.map(t=>b0.addListener(t,()=>n(e(k2t()))));return n(e(k2t())),()=>{t.forEach(e=>e.remove())}},[]),t}KQ();var j2t=()=>{(0,U.useEffect)(()=>(w0.setInputMode(C2t.SOFT_INPUT_ADJUST_RESIZE),()=>w0.setDefaultMode()),[])},M2t=()=>(j2t(),S0().reanimated);function N2t(e,t){let n=S0(),{doDependenciesDiffer:r}=vQ(e,t),i=gQ(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,U.useLayoutEffect)(()=>{let e=n.setKeyboardHandlers(i);return()=>e()},t)}function P2t(e,t){j2t(),N2t(e,t)}function F2t(){let e=S0();return{input:e.layout,update:e.update}}function I2t(e,t){let n=S0(),{doDependenciesDiffer:r}=vQ(e,t),i=gQ(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,U.useLayoutEffect)(()=>{let e=n.setInputHandlers(i);return()=>e()},t)}KQ();var L2t=(...e)=>(0,U.useCallback)(t=>{for(let n of e)n&&(typeof n==`function`?n(t):n.current=t)},e);H(),KQ(),B.OS,KQ(),KQ();function R2t(){return R2t=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},R2t.apply(null,arguments)}var z2t=(0,U.forwardRef)(({children:e,offset:{closed:t=0,opened:n=0}={},style:r,enabled:i=!0,...a},o)=>{let{height:s,progress:c}=M2t(),l=dQ(()=>{let e=DQ(c.value,[0,1],[t,n]);return{transform:[{translateY:i?s.value+e:t}]}},[t,n,i]),u=(0,U.useMemo)(()=>[r,l],[r,l]);return U.createElement(GQ.View,R2t({ref:o,style:u},a),e)});KQ();var B2t=[`onScroll`,`onScrollBeginDrag`,`onScrollEndDrag`,`onMomentumScrollBegin`,`onMomentumScrollEnd`],V2t=(e,t=0)=>{let n=lQ(t),r=lQ({width:0,height:0}),i=lQ({width:0,height:0}),a=p2t(e),o=gQ(e=>{"worklet";n.value=e.contentOffset.y,r.value=e.layoutMeasurement,i.value=e.contentSize},B2t);return(0,U.useEffect)(()=>{let e=a(o);return()=>{e()}},[]),{offset:n,layout:r,size:i,onLayout:(0,U.useCallback)(e=>{r.value={width:e.nativeEvent.layout.width,height:e.nativeEvent.layout.height}},[r]),onContentSizeChange:(0,U.useCallback)((e,t)=>{i.value={width:e,height:t}},[i])}};H();var H2t=z.create({container:{flexGrow:1,flexShrink:1}});H(),KQ();function U2t(){return U2t=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},U2t.apply(null,arguments)}var W2t=B.OS===`android`?GQ.createAnimatedComponent(i2t):i2t,G2t=(0,U.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=lQ(null);(0,U.useEffect)(()=>{o&&(o.value=f?.y??0)},[o,f?.y]);let m=bQ(()=>{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]);mQ(()=>m.value.effective,(e,t)=>{c&&(t&&e.top===t.top&&e.bottom===t.bottom&&e.left===t.left&&e.right===t.right||UQ(c)(e))},[c]);let h=pQ(()=>{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 U.createElement(W2t,{animatedProps:h,applyWorkaroundForContentInsetHitTestBug:s,style:H2t.container},U.createElement(e,U2t({ref:d,animatedProps:h},u),l))});H(),KQ();var O0=B.OS===`android`&&B.Version>=30||B.OS===`ios`,K2t={duration:250,easing:qX.bezier(.19919472913616398,.010644531250000006,.27920937042459737,.91025390625)},q2t=(e,t)=>{let n=(0,U.useMemo)(()=>e,t??[]),r=lQ(-1),i=lQ(0),a=lQ(0),o=lQ(0);mQ(()=>{if(!O0&&a.value!==0)return{duration:K2t.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]),P2t({onStart:e=>{"worklet";var t;if(!O0&&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),O0||(o.value=YX(e.height,K2t)),(t=n.onStart)==null||t.call(n,{...e,duration:O0?e.duration:K2t.duration})},onMove:e=>{"worklet";if(O0){var t;(t=n.onMove)==null||t.call(n,e)}},onEnd:e=>{"worklet";if(O0){var t;(t=n.onEnd)==null||t.call(n,e)}}},t)},J2t=(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)}},Y2t=(e,t)=>{"worklet";let n;return t&&(n=t.find(t=>t>=e)),n??e};KQ();function k0(){return k0=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},k0.apply(null,arguments)}var X2t=(0,U.forwardRef)(({children:e,onLayout:t,bottomOffset:n=0,disableScrollOnKeyboardHide:r=!1,enabled:i=!0,extraKeyboardSpace:a=0,mode:o=`insets`,ScrollViewComponent:s=GQ.ScrollView,snapToOffsets:c,...l},u)=>{let d=jFt(),f=U.useRef(null),p=L2t(d,f),m=lQ(null),h=lQ(0),{offset:g,layout:_,size:v}=V2t(d),y=lQ(0),b=lQ(0),x=lQ(!1),S=lQ(!1),C=lQ(-1),w=lQ(0),T=lQ(0),{input:E,update:D}=F2t(),O=lQ(null),k=lQ(null),A=lQ(-1),ee=lQ(!1),te=lQ(!1),ne=lQ(0),{height:re}=D2t(),ie=(0,U.useCallback)(async()=>{let e=f2t(d.current);if(m.value=e,e!==null)try{let{y:t}=await y0.viewPositionInWindow(e);ne.value=t}catch{}},[]),j=(0,U.useCallback)(e=>{ie(),t?.(e)},[t,ie]);(0,U.useEffect)(()=>{ie()},[ie]);let M=(0,U.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=DQ(e,[w.value,b.value],[0,Y2t(r+h.value,c)-h.value]);return zQ(d,0,Math.max(i,0)+h.value,t),i}if(a<ne.value){let e=r-n;zQ(d,0,h.value+a-e,t)}return 0},[n,i,re,c]),ae=(0,U.useCallback)(e=>{"worklet";return o===`layout`?!1:S.value&&A.value>0?(zQ(d,0,h.value-DQ(e,[w.value,b.value],[A.value,0]),!1),!0):!1},[o]),oe=(0,U.useCallback)(e=>{"worklet";let t=h.value;h.value=e,M(b.value,!0),h.value=t},[h,b,M]),N=(0,U.useCallback)(e=>{"worklet";y.value=DQ(e.height,[0,b.value],[0,b.value+a])},[a]),se=(0,U.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:kLt(t,0,E.value.layout.height)}},!0)},[E,k,O]),P=(0,U.useCallback)(()=>{"worklet";let e=O.value;se()&&(oe(g.value),O.value=e)},[oe]),F=(0,U.useCallback)(()=>{"worklet";P()},[P]),ce=(0,U.useMemo)(()=>J2t(F,200),[F]),le=(0,U.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,se(),!x.value&&b.value>0&&(g.value+=M(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 P();ce()},[P,ce,se,M]);I2t({onSelectionChange:le},[le]),q2t({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`&&N(e)),n&&(C.value=e.target,k.value?.target===e.target&&te.value?(se(),ee.value=!1):(k.value?.target===e.target?se():E.value&&(O.value=E.value),ee.value=!0),T.value=g.value),n&&!x.value&&(ee.value||(g.value+=M(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||ae(e.height)||(o===`layout`&&N(e),(!r||x.value)&&M(e.height))},onEnd:e=>{"worklet";e.height===0&&ae(e.height),b.value=e.height,h.value=g.value,e.height===0?te.value=!1:x.value&&(ee.value=!1),N(e)}},[o,M,ae,r,N]);let ue=(0,U.useCallback)(async()=>{await D(),requestAnimationFrame(()=>{WQ(()=>{"worklet";P()})()})},[D,P]);(0,U.useImperativeHandle)(u,()=>{let e=f.current;if(e){let t=e;return t.assureFocusedInputVisible=()=>{ue()},t}return{assureFocusedInputVisible:()=>{ue()}}},[ue]),(0,U.useEffect)(()=>{ue()},[n]),mQ(()=>E.value,(e,t)=>{e?.target===t?.target&&e?.layout.height!==t?.layout.height&&P()},[]);let de=bQ(()=>i?y.value:0,[i]),fe=dQ(()=>i&&o===`layout`?{paddingBottom:y.value+1}:{},[i,o]);return o===`layout`?U.createElement(s,k0({ref:p},l,{scrollEventThrottle:16,onLayout:j}),e,i&&U.createElement(GQ.View,{style:fe})):U.createElement(G2t,k0({ref:p},l,{bottomPadding:de,scrollEventThrottle:16,ScrollViewComponent:s,onLayout:j}),e)});H();var Z2t=({type:e,disabled:t,theme:n})=>{let r=D0(e=>e.appearance),i=(0,U.useMemo)(()=>({backgroundColor:t?n[r].disabled:n[r].primary}),[t,n,r]),a=(0,U.useMemo)(()=>[A0.arrowLeftLine,i],[i]),o=(0,U.useMemo)(()=>[A0.arrowRightLine,i],[i]);return U.createElement(V,{style:e===`next`?A0.arrowDownContainer:A0.arrowUpContainer},U.createElement(V,{style:A0.arrow},U.createElement(cf.View,{style:a}),U.createElement(cf.View,{style:o})))},Q2t={width:13,height:2,borderRadius:1},$2t={marginHorizontal:5,width:30,height:30,justifyContent:`center`,alignItems:`center`},A0=z.create({arrowUpContainer:$2t,arrowDownContainer:{...$2t,transform:[{rotate:`180deg`}]},arrow:{width:20,height:20,flexDirection:`row`,alignItems:`center`,justifyContent:`space-between`},arrowLeftLine:{...Q2t,transform:[{rotate:`-45deg`}],left:-.5},arrowRightLine:{...Q2t,transform:[{rotate:`45deg`}],left:-5.5}});H();var j0=B.select({android:({children:e,onPress:t,disabled:n,accessibilityLabel:r,accessibilityHint:i,testID:a,rippleRadius:o=18,style:s,theme:c})=>{let l=D0(e=>e.appearance),u=(0,U.useMemo)(()=>({disabled:n}),[n]),d=(0,U.useMemo)(()=>Xp.Ripple(c[l].ripple,!0,o),[l,o,c]);return U.createElement(Xp,{accessibilityHint:i,accessibilityLabel:r,accessibilityRole:`button`,accessibilityState:u,background:d,style:s,testID:a,onPress:t},U.createElement(V,{style:s},e))},default:({children:e,onPress:t,disabled:n,accessibilityLabel:r,accessibilityHint:i,testID:a,style:o})=>{let s=n?V:Jf,c=(0,U.useMemo)(()=>({disabled:n}),[n]);return U.createElement(s,{accessibilityHint:i,accessibilityLabel:r,accessibilityRole:`button`,accessibilityState:c,style:o,testID:a,onPress:t},e)}}),e4t={light:{primary:`#2c2c2c`,disabled:`#B0BEC5`,background:`#f3f3f4`,ripple:`#bcbcbcbc`},dark:{primary:`#fafafa`,disabled:`#707070`,background:`#2C2C2E`,ripple:`#F8F8F888`}},t4t=({children:e})=>U.createElement(U.Fragment,null,e),M0=`keyboard.toolbar`,n4t=`${M0}.previous`,r4t=`${M0}.next`,i4t=`${M0}.content`,a4t=`${M0}.done`,o4t=E0?-11:0;H();var N0=({children:e})=>U.createElement(V,{style:s4t.flex,testID:i4t},e),s4t=z.create({flex:{flex:1}}),c4t=(0,U.createContext)(void 0),l4t=()=>{let e=(0,U.useContext)(c4t);if(!e)throw Error(`KeyboardToolbar.* component must be used inside <KeyboardToolbar>`);return e};H();var u4t=({children:e,onPress:t,rippleRadius:n=28,text:r,button:i=j0})=>{let a=D0(e=>e.appearance),{theme:o}=l4t(),s=(0,U.useMemo)(()=>[d4t.doneButton,{color:o[a].primary}],[a,o]),c=(0,U.useCallback)(e=>{t?.(e),e.isDefaultPrevented()||w0.dismiss()},[t]);return U.createElement(i,{accessibilityHint:`Closes the keyboard`,accessibilityLabel:`Done`,rippleRadius:n,style:d4t.doneButtonContainer,testID:a4t,theme:o,onPress:c},U.createElement(gd,{maxFontSizeMultiplier:1.3,style:s},e??r??`Done`))},d4t=z.create({doneButton:{fontWeight:`600`,fontSize:15},doneButtonContainer:{marginRight:16,marginLeft:8}}),f4t=({children:e,onPress:t,disabled:n,rippleRadius:r,style:i,button:a=j0,icon:o=Z2t})=>{let{theme:s,isNextDisabled:c}=l4t(),l=n??c,u=(0,U.useCallback)(e=>{t?.(e),e.isDefaultPrevented()||w0.setFocusTo(`next`)},[t]);return U.createElement(a,{accessibilityHint:`Moves focus to the next field`,accessibilityLabel:`Next`,disabled:l,rippleRadius:r,style:i,testID:r4t,theme:s,onPress:u},e??U.createElement(o,{disabled:l,theme:s,type:`next`}))},p4t=({children:e,onPress:t,disabled:n,rippleRadius:r,style:i,button:a=j0,icon:o=Z2t})=>{let{theme:s,isPrevDisabled:c}=l4t(),l=n??c,u=(0,U.useCallback)(e=>{t?.(e),e.isDefaultPrevented()||w0.setFocusTo(`prev`)},[t]);return U.createElement(a,{accessibilityHint:`Moves focus to the previous field`,accessibilityLabel:`Previous`,disabled:l,rippleRadius:r,style:i,testID:n4t,theme:s,onPress:u},e??U.createElement(o,{disabled:l,theme:s,type:`prev`}))};H();function m4t(){return m4t=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},m4t.apply(null,arguments)}var P0=e=>{let{children:t,content:n,theme:r=e4t,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=D0(e=>e.appearance),[y,b]=(0,U.useState)({current:0,count:0}),x=y.current===0,S=y.current===y.count-1,C=a??j0,w=o??Z2t;(0,U.useEffect)(()=>$0t.addListener(`focusDidSet`,e=>{b(e)}).remove,[]);let T=(0,U.useMemo)(()=>[F0.toolbar,{backgroundColor:`${r[v].background}${f}`},E0?null:{paddingLeft:g?.left,paddingRight:g?.right},E0?F0.floating:null],[v,f,r,g]),E=(0,U.useMemo)(()=>[F0.sticky,E0?{left:(g?.left??0)+16,right:(g?.right??0)+16}:null],[g]),D=(0,U.useMemo)(()=>({closed:p+42,opened:m+o4t}),[p,m]),O=null,k=null,A=null,ee=null;if(t){let e=null,n=null,r=null,i=null,a=null;U.Children.forEach(t,t=>{if(!U.isValidElement(t))return;let o=t.type;o===t4t?a=t:o===N0?r=t:o===p4t?e=t:o===f4t?n=t:o===u4t&&(i=t)}),O=a,ee=i,k=e||n?U.createElement(V,{style:F0.arrows},e,n):null,A=r??U.createElement(N0,null,r)}else O=d,k=s?U.createElement(V,{style:F0.arrows},U.createElement(p4t,{button:C,icon:w,onPress:l}),U.createElement(f4t,{button:C,icon:w,onPress:c})):null,A=U.createElement(N0,null,n),ee=i?U.createElement(u4t,{button:C,text:i,onPress:u}):null;let te=(0,U.useMemo)(()=>({theme:r,isPrevDisabled:x,isNextDisabled:S}),[r,x,S]);return U.createElement(c4t.Provider,{value:te},U.createElement(z2t,{enabled:h,offset:D,style:E},U.createElement(V,m4t({},_,{style:T,testID:M0}),O,k,A,ee)))},F0=z.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`}});P0.Background=t4t,P0.Content=N0,P0.Prev=p4t,P0.Next=f4t,P0.Done=u4t,P0.Group=a2t,KQ(),KQ(),KQ(),`nativeFabricUIManager`in globalThis,H(),KQ(),B.OS,KQ(),H(),KQ(),cX(0),cX(0),z.create({commitView:{display:`none`,position:`absolute`}}),H(),z.create({container:{position:`absolute`,bottom:0,top:0,left:0,right:0,height:999},rounded:{borderTopLeftRadius:w2t,borderTopRightRadius:w2t,overflow:`hidden`}}),H(),z.create({absolute:{position:`absolute`},stretch:{top:0,bottom:0,left:0,right:0}}),H(),cf.createAnimatedComponent(r2t);function h4t({children:e,style:t,onInsetsChange:n}){return y4t.useEffect(()=>{if(typeof document>`u`)return;let e=v4t();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(g4t(),t),t(),()=>{document.body.removeChild(e),e.removeEventListener(g4t(),t)}},[n]),y4t.createElement(V,{style:t},e)}function g4t(){if(R0!=null)return R0;let e=document.createElement(`invalidtype`);R0=L0.Transition;for(let t in L0)if(e.style[t]!==void 0){R0=L0[t];break}return R0}function _4t(){if(z0!==null)return z0;let{CSS:e}=window;return z0=e&&e.supports&&e.supports(`top: constant(safe-area-inset-top)`)?`constant`:`env`,z0}function I0(e){return`${_4t()}(safe-area-inset-${e})`}function v4t(){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=I0(`top`),t.paddingBottom=I0(`bottom`),t.paddingLeft=I0(`left`),t.paddingRight=I0(`right`),e}var y4t,L0,R0,z0,b4t=o((()=>{y4t=u(p()),H(),L0={WebkitTransition:`webkitTransitionEnd`,Transition:`transitionEnd`,MozTransition:`transitionend`,MSTransition:`msTransitionEnd`,OTransition:`oTransitionEnd`},R0=null,z0=null}));function B0(){return B0=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},B0.apply(null,arguments)}function x4t({children:e,initialMetrics:t,initialSafeAreaInsets:n,style:r,...i}){let a=C4t(),o=w4t(),[s,c]=H0.useState(t?.insets??n??a??null),[l,u]=H0.useState(t?.frame??o??{x:0,y:0,width:Uo.get(`window`).width,height:Uo.get(`window`).height}),d=H0.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 H0.createElement(h4t,B0({style:[O4t.fill,r],onInsetsChange:d},i),s==null?null:H0.createElement(W0.Provider,{value:l},H0.createElement(U0.Provider,{value:s},e)))}function S4t({onChange:e,style:t,children:n,...r}){return H0.createElement(h4t,B0({},r,{style:[O4t.fill,t],onInsetsChange:t=>{e({insets:t.nativeEvent.insets,frame:t.nativeEvent.frame})}}),n)}function C4t(){return H0.useContext(U0)}function w4t(){return H0.useContext(W0)}function V0(){let e=H0.useContext(U0);if(e==null)throw Error(k4t);return e}function T4t(){let e=H0.useContext(W0);if(e==null)throw Error(k4t);return e}function E4t(e){return H0.forwardRef((t,n)=>{let r=V0();return H0.createElement(e,B0({},t,{insets:r,ref:n}))})}function D4t(){return V0()}var H0,U0,W0,O4t,k4t,A4t,j4t,M4t=o((()=>{H0=u(p()),H(),b4t(),U0=H0.createContext(null),W0=H0.createContext(null),O4t=z.create({fill:{flex:1}}),k4t="No safe area value available. Make sure you are rendering `<SafeAreaProvider>` at the top of your app.",A4t=U0.Consumer,j4t=U0}));function N4t(){return N4t=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},N4t.apply(null,arguments)}function G0(e,t,n){switch(n){case`maximum`:return Math.max(t,e);case`additive`:return t+e;default:return t}}var K0,P4t,q0,F4t=o((()=>{K0=u(p()),H(),M4t(),P4t={top:`additive`,left:`additive`,bottom:`additive`,right:`additive`},q0=K0.forwardRef(({style:e={},mode:t,edges:n,...r},i)=>{let a=V0(),o=K0.useMemo(()=>n==null?P4t:Array.isArray(n)?n.reduce((e,t)=>(e[t]=`additive`,e),{}):n,[n]),s=K0.useMemo(()=>{let n=z.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:G0(a.top,s,o.top),marginRight:G0(a.right,c,o.right),marginBottom:G0(a.bottom,l,o.bottom),marginLeft:G0(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:G0(a.top,s,o.top),paddingRight:G0(a.right,c,o.right),paddingBottom:G0(a.bottom,l,o.bottom),paddingLeft:G0(a.left,u,o.left)}]}},[o.bottom,o.left,o.right,o.top,a.bottom,a.left,a.right,a.top,t,e]);return K0.createElement(V,N4t({style:s},r,{ref:i}))})})),I4t=o((()=>{})),L4t=o((()=>{})),R4t=c({SafeAreaConsumer:()=>A4t,SafeAreaContext:()=>j4t,SafeAreaFrameContext:()=>W0,SafeAreaInsetsContext:()=>U0,SafeAreaListener:()=>S4t,SafeAreaProvider:()=>x4t,SafeAreaView:()=>q0,initialWindowMetrics:()=>null,initialWindowSafeAreaInsets:()=>null,useSafeArea:()=>D4t,useSafeAreaFrame:()=>T4t,useSafeAreaInsets:()=>V0,withSafeAreaInsets:()=>E4t}),J0=o((()=>{M4t(),F4t(),I4t(),L4t()}));J0();var z4t=new O0t({defaultOptions:{queries:{gcTime:1/0}}});H();function B4t(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:Xu.resolveAssetSource(e).uri}}function Y0(e){"@babel/helpers - typeof";return Y0=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},Y0(e)}function V4t(e,t){if(Y0(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Y0(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function H4t(e){var t=V4t(e,`string`);return Y0(t)==`symbol`?t:t+``}function X0(e,t,n){return(t=H4t(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var U4t=class{requestAnimationFrame(e){return requestAnimationFrame(e)}cancelAnimationFrame(e){cancelAnimationFrame(e)}},W4t=class{constructor(){X0(this,`_lastHandleId`,0),X0(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)}},G4t=class{constructor(){X0(this,`_strategy`,void 0),this._strategy=typeof requestAnimationFrame==`function`?new U4t:new W4t}requestAnimationFrame(e){return this._strategy.requestAnimationFrame(e)}cancelAnimationFrame(e){this._strategy.cancelAnimationFrame(e)}},Z0=typeof window<`u`&&window.document!==void 0,K4t=new Uint8Array([80,75,3,4]),q4t=[`v`,`ip`,`op`,`layers`,`fr`,`w`,`h`],J4t=`0.70.0`,Y4t=`@lottiefiles/dotlottie-web`,K,X4t=typeof TextDecoder<`u`?new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error(`TextDecoder not available`)}};typeof TextDecoder<`u`&&X4t.decode();var Q0=null;function $0(){return(Q0===null||Q0.byteLength===0)&&(Q0=new Uint8Array(K.memory.buffer)),Q0}function e2(e,t){return e>>>=0,X4t.decode($0().subarray(e,e+t))}function Z4t(e){let t=K.__externref_table_alloc_command_export();return K.__wbindgen_export_3.set(t,e),t}function Q4t(e,t){try{return e.apply(this,t)}catch(e){let t=Z4t(e);K.__wbindgen_exn_store_command_export(t)}}var t2=0,n2=typeof TextEncoder<`u`?new TextEncoder(`utf-8`):{encode:()=>{throw Error(`TextEncoder not available`)}},$4t=typeof n2.encodeInto==`function`?function(e,t){return n2.encodeInto(e,t)}:function(e,t){let n=n2.encode(e);return t.set(n),{read:e.length,written:n.length}};function r2(e,t,n){if(n===void 0){let n=n2.encode(e),r=t(n.length,1)>>>0;return $0().subarray(r,r+n.length).set(n),t2=n.length,r}let r=e.length,i=t(r,1)>>>0,a=$0(),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=$0().subarray(i+o,i+r),a=$4t(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return t2=o,i}var i2=null;function a2(){return(i2===null||i2.buffer.detached===!0||i2.buffer.detached===void 0&&i2.buffer!==K.memory.buffer)&&(i2=new DataView(K.memory.buffer)),i2}function e3t(e){return e==null}var o2=null;function t3t(){return(o2===null||o2.byteLength===0)&&(o2=new Float32Array(K.memory.buffer)),o2}function n3t(e,t){let n=t(e.length*4,4)>>>0;return t3t().set(e,n/4),t2=e.length,n}function r3t(e,t){let n=t(e.length*1,1)>>>0;return $0().set(e,n/1),t2=e.length,n}function i3t(e,t){let n=t(e.length*4,4)>>>0;for(let t=0;t<e.length;t++){let r=Z4t(e[t]);a2().setUint32(n+4*t,r,!0)}return t2=e.length,n}function a3t(e,t){let n=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),r=t2,i=r3t(t,K.__wbindgen_malloc_command_export),a=t2;return K.register_font(n,r,i,a)!==0}var s2=Object.freeze({Forward:0,0:`Forward`,Reverse:1,1:`Reverse`,Bounce:2,2:`Bounce`,ReverseBounce:3,3:`ReverseBounce`}),o3t=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>K.__wbg_dotlottieplayerwasm_free(e>>>0,1)),s3t=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,o3t.unregister(this),e}free(){let e=this.__destroy_into_raw();K.__wbg_dotlottieplayerwasm_free(e,0)}clear_slot(e){let t=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),n=t2;return K.dotlottieplayerwasm_clear_slot(this.__wbg_ptr,t,n)!==0}is_playing(){return K.dotlottieplayerwasm_is_playing(this.__wbg_ptr)!==0}is_stopped(){return K.dotlottieplayerwasm_is_stopped(this.__wbg_ptr)!==0}layout_fit(){let e,t;try{let n=K.dotlottieplayerwasm_layout_fit(this.__wbg_ptr);return e=n[0],t=n[1],e2(n[0],n[1])}finally{K.__wbindgen_free_command_export(e,t,1)}}loop_count(){return K.dotlottieplayerwasm_loop_count(this.__wbg_ptr)>>>0}poll_event(){return K.dotlottieplayerwasm_poll_event(this.__wbg_ptr)}reset_slot(e){let t=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),n=t2;return K.dotlottieplayerwasm_reset_slot(this.__wbg_ptr,t,n)!==0}set_layout(e,t,n){let r=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),i=t2;return K.dotlottieplayerwasm_set_layout(this.__wbg_ptr,r,i,t,n)!==0}set_marker(e){let t=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),n=t2;K.dotlottieplayerwasm_set_marker(this.__wbg_ptr,t,n)}clear_slots(){return K.dotlottieplayerwasm_clear_slots(this.__wbg_ptr)!==0}has_segment(){return K.dotlottieplayerwasm_has_segment(this.__wbg_ptr)!==0}is_complete(){return K.dotlottieplayerwasm_is_complete(this.__wbg_ptr)!==0}is_tweening(){return K.dotlottieplayerwasm_is_tweening(this.__wbg_ptr)!==0}reset_slots(){return K.dotlottieplayerwasm_reset_slots(this.__wbg_ptr)!==0}reset_theme(){return K.dotlottieplayerwasm_reset_theme(this.__wbg_ptr)!==0}segment_end(){return K.dotlottieplayerwasm_segment_end(this.__wbg_ptr)}set_quality(e){return K.dotlottieplayerwasm_set_quality(this.__wbg_ptr,e)!==0}set_segment(e,t){return K.dotlottieplayerwasm_set_segment(this.__wbg_ptr,e,t)!==0}static unload_font(e){let t=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),n=t2;return K.dotlottieplayerwasm_unload_font(t,n)!==0}animation_id(){let e=K.dotlottieplayerwasm_animation_id(this.__wbg_ptr),t;return e[0]!==0&&(t=e2(e[0],e[1]).slice(),K.__wbindgen_free_command_export(e[0],e[1]*1,1)),t}clear_marker(){K.dotlottieplayerwasm_clear_marker(this.__wbg_ptr)}emit_on_loop(){K.dotlottieplayerwasm_emit_on_loop(this.__wbg_ptr)}get_slot_ids(){return K.dotlottieplayerwasm_get_slot_ids(this.__wbg_ptr)}get_slot_str(e){let t=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),n=t2,r=K.dotlottieplayerwasm_get_slot_str(this.__wbg_ptr,t,n),i;return r[0]!==0&&(i=e2(r[0],r[1]).slice(),K.__wbindgen_free_command_export(r[0],r[1]*1,1)),i}marker_names(){return K.dotlottieplayerwasm_marker_names(this.__wbg_ptr)}set_autoplay(e){K.dotlottieplayerwasm_set_autoplay(this.__wbg_ptr,e)}set_slot_str(e,t){let n=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),r=t2,i=r2(t,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),a=t2;return K.dotlottieplayerwasm_set_slot_str(this.__wbg_ptr,n,r,i,a)!==0}set_viewport(e,t,n,r){return K.dotlottieplayerwasm_set_viewport(this.__wbg_ptr,e,t,n,r)!==0}total_frames(){return K.dotlottieplayerwasm_total_frames(this.__wbg_ptr)}clear_segment(){return K.dotlottieplayerwasm_clear_segment(this.__wbg_ptr)!==0}current_frame(){return K.dotlottieplayerwasm_current_frame(this.__wbg_ptr)}get_slot_type(e){let t=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),n=t2,r=K.dotlottieplayerwasm_get_slot_type(this.__wbg_ptr,t,n),i;return r[0]!==0&&(i=e2(r[0],r[1]).slice(),K.__wbindgen_free_command_export(r[0],r[1]*1,1)),i}get_slots_str(){let e,t;try{let n=K.dotlottieplayerwasm_get_slots_str(this.__wbg_ptr);return e=n[0],t=n[1],e2(n[0],n[1])}finally{K.__wbindgen_free_command_export(e,t,1)}}get_transform(){return K.dotlottieplayerwasm_get_transform(this.__wbg_ptr)}request_frame(){return K.dotlottieplayerwasm_request_frame(this.__wbg_ptr)}segment_start(){return K.dotlottieplayerwasm_segment_start(this.__wbg_ptr)}set_slots_str(e){let t=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),n=t2;return K.dotlottieplayerwasm_set_slots_str(this.__wbg_ptr,t,n)!==0}set_text_slot(e,t){let n=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),r=t2,i=r2(t,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),a=t2;return K.dotlottieplayerwasm_set_text_slot(this.__wbg_ptr,n,r,i,a)!==0}set_transform(e){let t=n3t(e,K.__wbindgen_malloc_command_export),n=t2;return K.dotlottieplayerwasm_set_transform(this.__wbg_ptr,t,n)!==0}sm_get_inputs(){return K.dotlottieplayerwasm_sm_get_inputs(this.__wbg_ptr)}sm_poll_event(){return K.dotlottieplayerwasm_sm_poll_event(this.__wbg_ptr)}sm_post_click(e,t){K.dotlottieplayerwasm_sm_post_click(this.__wbg_ptr,e,t)}animation_size(){return K.dotlottieplayerwasm_animation_size(this.__wbg_ptr)}current_marker(){let e=K.dotlottieplayerwasm_current_marker(this.__wbg_ptr),t;return e[0]!==0&&(t=e2(e[0],e[1]).slice(),K.__wbindgen_free_command_export(e[0],e[1]*1,1)),t}layout_align_x(){return K.dotlottieplayerwasm_layout_align_x(this.__wbg_ptr)}layout_align_y(){return K.dotlottieplayerwasm_layout_align_y(this.__wbg_ptr)}load_animation(e,t,n){let r=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),i=t2;return K.dotlottieplayerwasm_load_animation(this.__wbg_ptr,r,i,t,n)!==0}loop_animation(){return K.dotlottieplayerwasm_loop_animation(this.__wbg_ptr)!==0}set_color_slot(e,t,n,r){let i=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),a=t2;return K.dotlottieplayerwasm_set_color_slot(this.__wbg_ptr,i,a,t,n,r)!==0}set_loop_count(e){K.dotlottieplayerwasm_set_loop_count(this.__wbg_ptr,e)}set_theme_data(e){let t=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),n=t2;return K.dotlottieplayerwasm_set_theme_data(this.__wbg_ptr,t,n)!==0}sm_reset_input(e){let t=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),n=t2;K.dotlottieplayerwasm_sm_reset_input(this.__wbg_ptr,t,n)}manifest_string(){let e,t;try{let n=K.dotlottieplayerwasm_manifest_string(this.__wbg_ptr);return e=n[0],t=n[1],e2(n[0],n[1])}finally{K.__wbindgen_free_command_export(e,t,1)}}set_scalar_slot(e,t){let n=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),r=t2;return K.dotlottieplayerwasm_set_scalar_slot(this.__wbg_ptr,n,r,t)!==0}set_vector_slot(e,t,n){let r=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),i=t2;return K.dotlottieplayerwasm_set_vector_slot(this.__wbg_ptr,r,i,t,n)!==0}background_color(){return K.dotlottieplayerwasm_background_color(this.__wbg_ptr)>>>0}get_layer_bounds(e){let t=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),n=t2;return K.dotlottieplayerwasm_get_layer_bounds(this.__wbg_ptr,t,n)}get_pixel_buffer(){return K.dotlottieplayerwasm_get_pixel_buffer(this.__wbg_ptr)}segment_duration(){return K.dotlottieplayerwasm_segment_duration(this.__wbg_ptr)}sm_current_state(){let e,t;try{let n=K.dotlottieplayerwasm_sm_current_state(this.__wbg_ptr);return e=n[0],t=n[1],e2(n[0],n[1])}finally{K.__wbindgen_free_command_export(e,t,1)}}state_machine_id(){let e=K.dotlottieplayerwasm_state_machine_id(this.__wbg_ptr),t;return e[0]!==0&&(t=e2(e[0],e[1]).slice(),K.__wbindgen_free_command_export(e[0],e[1]*1,1)),t}get_state_machine(e){let t=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),n=t2,r=K.dotlottieplayerwasm_get_state_machine(this.__wbg_ptr,t,n),i;return r[0]!==0&&(i=e2(r[0],r[1]).slice(),K.__wbindgen_free_command_export(r[0],r[1]*1,1)),i}set_position_slot(e,t,n){let r=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),i=t2;return K.dotlottieplayerwasm_set_position_slot(this.__wbg_ptr,r,i,t,n)!==0}current_loop_count(){return K.dotlottieplayerwasm_current_loop_count(this.__wbg_ptr)>>>0}sm_framework_setup(){return K.dotlottieplayerwasm_sm_framework_setup(this.__wbg_ptr)}sm_post_pointer_up(e,t){K.dotlottieplayerwasm_sm_post_pointer_up(this.__wbg_ptr,e,t)}state_machine_load(e){let t=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),n=t2;return K.dotlottieplayerwasm_state_machine_load(this.__wbg_ptr,t,n)!==0}load_dotlottie_data(e,t,n){let r=r3t(e,K.__wbindgen_malloc_command_export),i=t2;return K.dotlottieplayerwasm_load_dotlottie_data(this.__wbg_ptr,r,i,t,n)!==0}sm_get_string_input(e){let t=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),n=t2,r=K.dotlottieplayerwasm_sm_get_string_input(this.__wbg_ptr,t,n),i;return r[0]!==0&&(i=e2(r[0],r[1]).slice(),K.__wbindgen_free_command_export(r[0],r[1]*1,1)),i}sm_set_string_input(e,t){let n=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),r=t2,i=r2(t,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),a=t2;return K.dotlottieplayerwasm_sm_set_string_input(this.__wbg_ptr,n,r,i,a)!==0}set_background_color(e){return K.dotlottieplayerwasm_set_background_color(this.__wbg_ptr,e)!==0}sm_get_boolean_input(e){let t=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),n=t2,r=K.dotlottieplayerwasm_sm_get_boolean_input(this.__wbg_ptr,t,n);return r===16777215?void 0:r!==0}sm_get_numeric_input(e){let t=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),n=t2,r=K.dotlottieplayerwasm_sm_get_numeric_input(this.__wbg_ptr,t,n);return r===4294967297?void 0:r}sm_post_pointer_down(e,t){K.dotlottieplayerwasm_sm_post_pointer_down(this.__wbg_ptr,e,t)}sm_post_pointer_exit(e,t){K.dotlottieplayerwasm_sm_post_pointer_exit(this.__wbg_ptr,e,t)}sm_post_pointer_move(e,t){K.dotlottieplayerwasm_sm_post_pointer_move(this.__wbg_ptr,e,t)}sm_set_boolean_input(e,t){let n=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),r=t2;return K.dotlottieplayerwasm_sm_set_boolean_input(this.__wbg_ptr,n,r,t)!==0}sm_set_numeric_input(e,t){let n=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),r=t2;return K.dotlottieplayerwasm_sm_set_numeric_input(this.__wbg_ptr,n,r,t)!==0}state_machine_unload(){K.dotlottieplayerwasm_state_machine_unload(this.__wbg_ptr)}sm_post_pointer_enter(e,t){K.dotlottieplayerwasm_sm_post_pointer_enter(this.__wbg_ptr,e,t)}clear_background_color(){return K.dotlottieplayerwasm_clear_background_color(this.__wbg_ptr)!==0}load_animation_from_id(e,t,n){let r=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),i=t2;return K.dotlottieplayerwasm_load_animation_from_id(this.__wbg_ptr,r,i,t,n)!==0}sm_poll_internal_event(){return K.dotlottieplayerwasm_sm_poll_internal_event(this.__wbg_ptr)}use_frame_interpolation(){return K.dotlottieplayerwasm_use_frame_interpolation(this.__wbg_ptr)!==0}reset_current_loop_count(){K.dotlottieplayerwasm_reset_current_loop_count(this.__wbg_ptr)}sm_override_current_state(e,t){let n=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),r=t2;return K.dotlottieplayerwasm_sm_override_current_state(this.__wbg_ptr,n,r,t)!==0}state_machine_load_from_id(e){let t=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),n=t2;return K.dotlottieplayerwasm_state_machine_load_from_id(this.__wbg_ptr,t,n)!==0}set_use_frame_interpolation(e){K.dotlottieplayerwasm_set_use_frame_interpolation(this.__wbg_ptr,e)}constructor(){return this.__wbg_ptr=K.dotlottieplayerwasm_new()>>>0,o3t.register(this,this.__wbg_ptr,this),this}mode(){return K.dotlottieplayerwasm_mode(this.__wbg_ptr)}play(){return K.dotlottieplayerwasm_play(this.__wbg_ptr)!==0}seek(e){return K.dotlottieplayerwasm_seek(this.__wbg_ptr,e)!==0}stop(){return K.dotlottieplayerwasm_stop(this.__wbg_ptr)!==0}tick(){return K.dotlottieplayerwasm_tick(this.__wbg_ptr)!==0}clear(){K.dotlottieplayerwasm_clear(this.__wbg_ptr)}pause(){return K.dotlottieplayerwasm_pause(this.__wbg_ptr)!==0}speed(){return K.dotlottieplayerwasm_speed(this.__wbg_ptr)}width(){return K.dotlottieplayerwasm_width(this.__wbg_ptr)>>>0}height(){return K.dotlottieplayerwasm_height(this.__wbg_ptr)>>>0}render(){return K.dotlottieplayerwasm_render(this.__wbg_ptr)!==0}resize(e,t){return K.dotlottieplayerwasm_resize(this.__wbg_ptr,e,t)!==0}markers(){return K.dotlottieplayerwasm_markers(this.__wbg_ptr)}sm_fire(e){let t=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),n=t2;return K.dotlottieplayerwasm_sm_fire(this.__wbg_ptr,t,n)!==0}sm_stop(){return K.dotlottieplayerwasm_sm_stop(this.__wbg_ptr)!==0}sm_tick(){return K.dotlottieplayerwasm_sm_tick(this.__wbg_ptr)!==0}autoplay(){return K.dotlottieplayerwasm_autoplay(this.__wbg_ptr)!==0}duration(){return K.dotlottieplayerwasm_duration(this.__wbg_ptr)}set_loop(e){K.dotlottieplayerwasm_set_loop(this.__wbg_ptr,e)}set_mode(e){K.dotlottieplayerwasm_set_mode(this.__wbg_ptr,e)}sm_start(e,t){let n=i3t(t,K.__wbindgen_malloc_command_export),r=t2;return K.dotlottieplayerwasm_sm_start(this.__wbg_ptr,e,n,r)!==0}theme_id(){let e=K.dotlottieplayerwasm_theme_id(this.__wbg_ptr),t;return e[0]!==0&&(t=e2(e[0],e[1]).slice(),K.__wbindgen_free_command_export(e[0],e[1]*1,1)),t}intersect(e,t,n){let r=r2(n,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),i=t2;return K.dotlottieplayerwasm_intersect(this.__wbg_ptr,e,t,r,i)!==0}is_loaded(){return K.dotlottieplayerwasm_is_loaded(this.__wbg_ptr)!==0}is_paused(){return K.dotlottieplayerwasm_is_paused(this.__wbg_ptr)!==0}load_font(e,t){let n=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),r=t2,i=r3t(t,K.__wbindgen_malloc_command_export),a=t2;return K.dotlottieplayerwasm_load_font(this.__wbg_ptr,n,r,i,a)!==0}set_frame(e){return K.dotlottieplayerwasm_set_frame(this.__wbg_ptr,e)!==0}set_speed(e){K.dotlottieplayerwasm_set_speed(this.__wbg_ptr,e)}set_theme(e){let t=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),n=t2;return K.dotlottieplayerwasm_set_theme(this.__wbg_ptr,t,n)!==0}sm_status(){let e,t;try{let n=K.dotlottieplayerwasm_sm_status(this.__wbg_ptr);return e=n[0],t=n[1],e2(n[0],n[1])}finally{K.__wbindgen_free_command_export(e,t,1)}}};async function c3t(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 l3t(){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(e2(e,t))}finally{K.__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 Q4t(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=r2(n,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),i=t2;a2().setInt32(e+4,i,!0),a2().setInt32(e+0,r,!0)},e.wbg.__wbindgen_init_externref_table=function(){let e=K.__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 K.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=e3t(r)?0:r2(r,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),a=t2;a2().setInt32(e+4,a,!0),a2().setInt32(e+0,i,!0)},e.wbg.__wbindgen_string_new=function(e,t){return e2(e,t)},e.wbg.__wbindgen_throw=function(e,t){throw Error(e2(e,t))},e}function u3t(e,t){return K=e.exports,d3t.__wbindgen_wasm_module=t,i2=null,o2=null,Q0=null,K.__wbindgen_start(),K}async function d3t(e){if(K!==void 0)return K;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=l3t();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await c3t(await e,t);return u3t(n,r)}var f3t=class{constructor(){X0(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()}},c2=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)}};X0(c2,`_observer`,null),X0(c2,`_observedCanvases`,new Map);var l2=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)}};X0(l2,`_observer`,null),X0(l2,`_observedCanvases`,new Map);function p3t(e){return/^#([\da-f]{6}|[\da-f]{8})$/iu.test(e)}function m3t(e){if(!p3t(e))return 0;let t=e.replace(`#`,``);return t=t.length===6?`${t}ff`:t,parseInt(t,16)}function h3t(e){if(e.byteLength<4)return!1;let t=new Uint8Array(e.slice(0,K4t.byteLength));for(let e=0;e<K4t.length;e+=1)if(K4t[e]!==t[e])return!1;return!0}function g3t(e){return q4t.every(t=>Object.hasOwn(e,t))}function _3t(e){if(typeof e==`string`)try{return g3t(JSON.parse(e))}catch{return!1}else return g3t(e)}function u2(){return 1+((Z0?window.devicePixelRatio:1)-1)*.75}function d2(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 f2(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 v3t(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 y3t(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 b3t=y3t(d3t,`https://cdn.jsdelivr.net/npm/${Y4t}@${J4t}/dist/dotlottie-player.wasm`,`https://unpkg.com/${Y4t}@${J4t}/dist/dotlottie-player.wasm`),x3t=e=>{switch(e){case`reverse`:return s2.Reverse;case`bounce`:return s2.Bounce;case`reverse-bounce`:return s2.ReverseBounce;default:return s2.Forward}},S3t=e=>{switch(e){case s2.Reverse:return`reverse`;case s2.Bounce:return`bounce`;case s2.ReverseBounce:return`reverse-bounce`;default:return`forward`}},C3t=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`}},w3t=class{constructor(e){X0(this,`_canvas`,null),X0(this,`_pendingLoad`,null),X0(this,`_context`,null),X0(this,`_eventManager`,void 0),X0(this,`_animationFrameId`,null),X0(this,`_frameManager`,void 0),X0(this,`_dotLottieCore`,null),X0(this,`_stateMachineId`,``),X0(this,`_stateMachineConfig`,null),X0(this,`_isStateMachineRunning`,!1),X0(this,`_renderConfig`,{}),X0(this,`_isFrozen`,!1),X0(this,`_backgroundColor`,null),X0(this,`_boundOnClick`,null),X0(this,`_boundOnPointerUp`,null),X0(this,`_boundOnPointerDown`,null),X0(this,`_boundOnPointerMove`,null),X0(this,`_boundOnPointerEnter`,null),X0(this,`_boundOnPointerLeave`,null),X0(this,`_bufferMismatchCount`,0),X0(this,`_lastExpectedBufferSize`,0),X0(this,`_marker`,``),this._canvas=e.canvas??null,this._eventManager=new f3t,this._frameManager=new G4t,this._renderConfig={...e.renderConfig,devicePixelRatio:e.renderConfig?.devicePixelRatio||u2(),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(x3t(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 b3t.load()}_createCore(){return new s3t}_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??``;Z0&&t.startsWith(`OpenUrl: `)?v3t(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 h3t(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(!_3t(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(!h3t(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(!_3t(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: ${C1(e)}`),!0;return!1}function nQt(e,t){return t?.length?aZt(e).some(e=>x1(e,t)):!1}function rQt(e,t){if(!t?.length)return!1;let n=e.transaction;return n?x1(n,t):!1}function iQt(e,t){if(!t?.length)return!1;let n=G1(e);return n?x1(n,t):!1}function aQt(e,t){if(!t?.length)return!0;let n=G1(e);return n?x1(n,t):!0}function oQt(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 G1(e){try{let t=[...e.exception?.values??[]].reverse().find(e=>e.mechanism?.parent_id===void 0&&e.stacktrace?.frames?.length)?.stacktrace?.frames;return t?oQt(t):null}catch{return W$&&Q$.error(`Cannot extract url for event ${C1(e)}`),null}}function sQt(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(e=>e.stacktrace||e.type&&e.type!==`Error`||e.value):!1}function cQt(e,t,n,r,i,a){if(!i.exception?.values||!a||!a1(a.originalException))return;let o=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;o&&(i.exception.values=lQt(e,t,r,a.originalException,n,i.exception.values,o,0))}function lQt(e,t,n,r,i,a,o,s){if(a.length>=n+1)return a;let c=[...a];if(a1(r[i])){dQt(o,s,r);let a=e(t,r[i]),l=c.length;fQt(a,i,l,s),c=lQt(e,t,n,r[i],i,[a,...c],a,l)}return uQt(r)&&r.errors.forEach((a,l)=>{if(a1(a)){dQt(o,s,r);let u=e(t,a),d=c.length;fQt(u,`errors[${l}]`,d,s),c=lQt(e,t,n,a,i,[u,...c],u,d)}}),c}function uQt(e){return Array.isArray(e.errors)}function dQt(e,t,n){e.mechanism={handled:!0,type:`auto.core.linked_errors`,...uQt(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function fQt(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:`chained`,source:t,exception_id:n,parent_id:r}}function pQt(e){return a1(e)&&`__sentry_fetch_url_host__`in e&&typeof e.__sentry_fetch_url_host__==`string`}function mQt(e){return pQt(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}var hQt=new Set([]);function gQt(e){let t=`console`,n=n1(t,e);return r1(t,vQt),n}var _Qt=new Set;function vQt(){`console`in G$&&RKt.forEach(function(e){_Qt.has(e)||!(e in G$.console)||(_Qt.add(e),p1(G$.console,e,function(t){return X$[e]=t,function(...t){let n=t[0],r=X$[e],i=hQt.size&&typeof n==`string`&&x1(n,hQt);i||i1(`console`,{args:t,level:e}),(!i||W$&&Q$.isEnabled())&&r?.apply(G$.console,t)}}))})}function yQt(e){return e===`warn`?`warning`:[`fatal`,`error`,`warning`,`log`,`info`,`debug`].includes(e)?e:`log`}var bQt=`Dedupe`,xQt=V1((()=>{let e;return{name:bQt,processEvent(t){if(t.type)return t;try{if(SQt(t,e))return W$&&Q$.warn(`Event dropped due to being a duplicate of previously captured event.`),null}catch{}return e=t}}}));function SQt(e,t){return t?!!(CQt(e,t)||wQt(e,t)):!1}function CQt(e,t){let n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!EQt(e,t)||!TQt(e,t))}function wQt(e,t){let n=DQt(t),r=DQt(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!EQt(e,t)||!TQt(e,t))}function TQt(e,t){let n=tqt(e),r=tqt(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 EQt(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 DQt(e){return e.exception?.values?.[0]}var OQt=`ConversationId`,kQt=V1((()=>({name:OQt,setup(e){e.on(`spanStart`,e=>{let t=j1().getScopeData(),n=M1().getScopeData(),r=t.conversationId||n.conversationId;if(r){let{op:t,data:n,description:i}=F1(e);if(!t?.startsWith(`gen_ai.`)&&!n[`ai.operationId`]&&!i?.startsWith(`ai.`))return;e.setAttribute(kJt,r)}})}})));function AQt(e){if(e!==void 0){if(e>=400&&e<500)return`warning`;if(e>=500)return`error`}}var K1=G$;function jQt(){return`history`in K1&&!!K1.history}function MQt(){if(!(`fetch`in K1))return!1;try{return new Headers,new Request(`data:,`),new Response,!0}catch{return!1}}function NQt(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function PQt(){if(typeof EdgeRuntime==`string`)return!0;if(!MQt())return!1;if(NQt(K1.fetch))return!0;let e=!1,t=K1.document;if(t&&typeof t.createElement==`function`)try{let n=t.createElement(`iframe`);n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=NQt(n.contentWindow.fetch)),t.head.removeChild(n)}catch(e){W$&&Q$.warn(`Could not create sandbox iframe for pure fetch check, bailing to window.fetch: `,e)}return e}function FQt(e,t){let n=`fetch`,r=n1(n,e);return r1(n,()=>IQt(void 0,t)),r}function IQt(e,t=!1){t&&!PQt()||p1(G$,`fetch`,function(t){return function(...n){let r=Error(),{method:i,url:a}=RQt(n),o={args:n,fetchData:{method:i,url:a},startTimestamp:E1()*1e3,virtualError:r,headers:zQt(n)};return e||i1(`fetch`,{...o}),t.apply(G$,n).then(async t=>(e?e(t):i1(`fetch`,{...o,endTimestamp:E1()*1e3,response:t}),t),e=>{i1(`fetch`,{...o,endTimestamp:E1()*1e3,error:e}),a1(e)&&e.stack===void 0&&(e.stack=r.stack,m1(e,`framesToPop`,1));let t=N1()?.getOptions().enhanceFetchErrorMessages??`always`;if(t!==!1&&a1(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})`:m1(e,`__sentry_fetch_url_host__`,n)}catch{}throw e})}})}function q1(e,t){return u1(e)&&!!e[t]}function LQt(e){return typeof e==`string`?e:e?q1(e,`url`)?e.url:e.toString?e.toString():``:``}function RQt(e){if(e.length===0)return{method:`GET`,url:``};if(e.length===2){let[t,n]=e;return{url:LQt(t),method:q1(n,`method`)?String(n.method).toUpperCase():gqt(t)&&q1(t,`method`)?String(t.method).toUpperCase():`GET`}}let t=e[0];return{url:LQt(t),method:q1(t,`method`)?String(t.method).toUpperCase():`GET`}}function zQt(e){let[t,n]=e;try{if(typeof n==`object`&&n&&`headers`in n&&n.headers)return new Headers(n.headers);if(gqt(t))return new Headers(t.headers)}catch{}}var BQt=G$;function VQt(){try{return BQt.document.location.href}catch{return``}}function HQt(e,t=5){if(!BQt.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 J1=G$,UQt=0;function WQt(){return UQt>0}function GQt(){UQt++,setTimeout(()=>{UQt--})}function Y1(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(vqt(e))return e}catch{return e}let r=function(...n){G$._sentryWrappedDepth=(G$._sentryWrappedDepth||0)+1;try{let r=n.map(e=>Y1(e,t));return e.apply(this,r)}catch(e){throw GQt(),CJt(r=>{r.addEventProcessor(e=>(t.mechanism&&(Vqt(e,void 0,void 0),w1(e,t.mechanism)),e.extra={...e.extra,arguments:n},e)),mXt(e)}),e}finally{G$._sentryWrappedDepth=(G$._sentryWrappedDepth||0)-1}};try{for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])}catch{}_qt(r,e),m1(e,`__sentry_wrapped__`,r);try{Object.getOwnPropertyDescriptor(r,`name`).configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function KQt(){let e=VQt(),{referrer:t}=J1.document||{},{userAgent:n}=J1.navigator||{};return{url:e,headers:{...t&&{Referer:t},...n&&{"User-Agent":n}}}}function qQt(e,t){let n=X1(e,t),r={type:e$t(t),value:t$t(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===``&&(r.value=`Unrecoverable error caught`),r}function JQt(e,t,n,r){let i=N1()?.getOptions().normalizeDepth,a=c$t(t),o={__serialized__:Oqt(t,i)};if(a)return{exception:{values:[qQt(e,a)]},extra:o};let s={exception:{values:[{type:d1(t)?t.constructor.name:r?`UnhandledRejection`:`Error`,value:o$t(t,{isUnhandledRejection:r})}]},extra:o};if(n){let t=X1(e,n);t.length&&(s.exception.values[0].stacktrace={frames:t})}return s}function YQt(e,t){return{exception:{values:[qQt(e,t)]}}}function X1(e,t){let n=t.stacktrace||t.stack||``,r=ZQt(t),i=QQt(t);try{return e(n,r,i)}catch{}return[]}var XQt=/Minified React error #\d+;/i;function ZQt(e){return e&&XQt.test(e.message)?1:0}function QQt(e){return typeof e.framesToPop==`number`?e.framesToPop:0}function $Qt(e){return typeof WebAssembly<`u`&&WebAssembly.Exception!==void 0?e instanceof WebAssembly.Exception:!1}function e$t(e){let t=e?.name;return!t&&$Qt(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:`WebAssembly.Exception`:t}function t$t(e){let t=e?.message;return $Qt(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:`wasm exception`:t?t.error&&typeof t.error.message==`string`?mQt(t.error):mQt(e):`No error message`}function n$t(e,t,n,r){let i=i$t(e,t,n?.syntheticException||void 0,r);return w1(i),i.level=`error`,n?.event_id&&(i.event_id=n.event_id),R1(i)}function r$t(e,t,n=`info`,r,i){let a=a$t(e,t,r?.syntheticException||void 0,i);return a.level=n,r?.event_id&&(a.event_id=r.event_id),R1(a)}function i$t(e,t,n,r,i){let a;if(uqt(t)&&t.error)return YQt(e,t.error);if(dqt(t)||fqt(t)){let i=t;if(`stack`in t){a=YQt(e,t);let i=a.exception?.values?.[0];if(r&&n&&i&&!i.stacktrace){let t=X1(e,n);t.length&&(i.stacktrace={frames:t},w1(a,{synthetic:!0}))}}else{let t=i.name||(dqt(i)?`DOMError`:`DOMException`),o=i.message?`${t}: ${i.message}`:t;a=a$t(e,o,n,r),Vqt(a,o)}return`code`in i&&(a.tags={...a.tags,"DOMException.code":`${i.code}`}),a}return a1(t)?YQt(e,t):l1(t)||d1(t)?(a=JQt(e,t,n,i),w1(a,{synthetic:!0}),a):(a=a$t(e,t,n,r),Vqt(a,`${t}`,void 0),w1(a,{synthetic:!0}),a)}function a$t(e,t,n,r){let i={};if(r&&n){let r=X1(e,n);r.length&&(i.exception={values:[{value:t,stacktrace:{frames:r}}]}),w1(i,{synthetic:!0})}if(pqt(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 o$t(e,{isUnhandledRejection:t}){let n=xqt(e),r=t?`promise rejection`:`exception`;return uqt(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:d1(e)?`Event \`${s$t(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function s$t(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function c$t(e){return Object.values(e).find(a1)}var l$t=class extends wZt{constructor(e){let t=u$t(e);GZt(t,`browser`,[`browser`],J1.SENTRY_SDK_SOURCE||PXt()),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;J1.document&&J1.document.addEventListener(`visibilitychange`,()=>{J1.document.visibilityState===`hidden`&&(r&&this._flushOutcomes(),queueMicrotask(()=>{this.flush()}))}),n&&this.on(`beforeSendSession`,WZt)}eventFromException(e,t){return n$t(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t=`info`,n){return r$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 u$t(e){return{release:`hedia-web@3.9.0+1220`,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}var d$t=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,Z1=G$;function f$t(e,t,n){Z1.document&&Z1.addEventListener(e,t,n)}function p$t(e,t,n){Z1.document&&Z1.removeEventListener(e,t,n)}var m$t=e=>{let t=!1;return()=>{t||=(e(),!0)}},h$t=e=>{let t=Z1.requestIdleCallback||Z1.setTimeout;Z1.document?.visibilityState===`hidden`?e():(e=m$t(e),f$t(`visibilitychange`,e,{once:!0,capture:!0}),f$t(`pagehide`,e,{once:!0,capture:!0}),t(()=>{e(),p$t(`visibilitychange`,e,{capture:!0}),p$t(`pagehide`,e,{capture:!0})}))},g$t=80,Q1={};try{typeof Node<`u`&&(Q1.parentNode=Object.getOwnPropertyDescriptor(Node.prototype,`parentNode`).get),typeof Element<`u`&&(Q1.tagName=Object.getOwnPropertyDescriptor(Element.prototype,`tagName`).get,Q1.id=Object.getOwnPropertyDescriptor(Element.prototype,`id`).get,Q1.className=Object.getOwnPropertyDescriptor(Element.prototype,`className`).get,Q1.getAttribute=Element.prototype.getAttribute),typeof HTMLElement<`u`&&(Q1.dataset=Object.getOwnPropertyDescriptor(HTMLElement.prototype,`dataset`).get)}catch{}function $1(e,t,n){let r=Q1[t];if(r)try{return r.call(e,n)}catch{}let i=e[t];return typeof i==`function`?i.call(e,n):i}function _$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||g$t;for(;n&&i++<5&&(o=v$t(n,s),!(o===`html`||i>1&&a+r.length*3+o.length>=c));)r.push(o),a+=o.length,n=$1(n,`parentNode`);return r.reverse().join(` > `)}catch{return`<unknown>`}}function v$t(e,t){let n=[],r=$1(e,`tagName`);if(!r)return``;if(typeof HTMLElement<`u`&&e instanceof HTMLElement){let t=$1(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=>$1(e,`getAttribute`,t)).map(t=>[t,$1(e,`getAttribute`,t)]):null;if(i?.length)i.forEach(e=>{n.push(`[${e[0]}="${e[1]}"]`)});else{let t=$1(e,`id`);t&&n.push(`#${t}`);let r=$1(e,`className`);if(r&&s1(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=$1(e,`getAttribute`,t);r&&n.push(`[${t}="${r}"]`)}return n.join(``)}var y$t=1e3,b$t,x$t,S$t;function C$t(e){n1(`dom`,e),r1(`dom`,w$t)}function w$t(){if(!Z1.document)return;let e=i1.bind(null,`dom`),t=D$t(e,!0);Z1.document.addEventListener(`click`,t,!1),Z1.document.addEventListener(`keypress`,t,!1),[`EventTarget`,`Node`].forEach(t=>{let n=Z1[t]?.prototype;n?.hasOwnProperty?.(`addEventListener`)&&(p1(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=D$t(e);a.handler=r,t.call(this,n,r,i)}a.refCount++}catch{}return t.call(this,n,r,i)}}),p1(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 T$t(e){if(e.type!==x$t)return!1;try{if(!e.target||e.target._sentryId!==S$t)return!1}catch{}return!0}function E$t(e,t){return e===`keypress`?t?.tagName?!(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable):!0:!1}function D$t(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;let r=O$t(n);if(E$t(n.type,r))return;m1(n,`_sentryCaptured`,!0),r&&!r._sentryId&&m1(r,`_sentryId`,S1());let i=n.type===`keypress`?`input`:n.type;T$t(n)||(e({event:n,name:i,global:t}),x$t=n.type,S$t=r?r._sentryId:void 0),clearTimeout(b$t),b$t=Z1.setTimeout(()=>{S$t=void 0,x$t=void 0},y$t)}}function O$t(e){try{return e.target}catch{return null}}var e0;function k$t(e){let t=`history`;n1(t,e),r1(t,A$t)}function A$t(){if(Z1.addEventListener(`popstate`,()=>{let e=Z1.location.href,t=e0;e0=e,t!==e&&i1(`history`,{from:t,to:e})}),!jQt())return;function e(e){return function(...t){let n=t.length>2?t[2]:void 0;if(n){let r=e0,i=j$t(String(n));if(e0=i,r===i)return e.apply(this,t);i1(`history`,{from:r,to:i})}return e.apply(this,t)}}p1(Z1.history,`pushState`,e),p1(Z1.history,`replaceState`,e)}function j$t(e){try{return new URL(e,Z1.location.origin).toString()}catch{return e}}var t0={};function M$t(e){let t=t0[e];if(t)return t;let n=Z1[e];if(NQt(n))return t0[e]=n.bind(Z1);let r=Z1.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){d$t&&Q$.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,t)}return n&&(t0[e]=n.bind(Z1))}function N$t(e){t0[e]=void 0}var n0=`__sentry_xhr_v3__`;function P$t(e){n1(`xhr`,e),r1(`xhr`,F$t)}function F$t(){if(!Z1.XMLHttpRequest)return;let e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(e,t,n){let r=Error(),i=E1()*1e3,a=s1(n[0])?n[0].toUpperCase():void 0,o=I$t(n[1]);if(!a||!o)return e.apply(t,n);t[n0]={method:a,url:o,request_headers:{}},a===`POST`&&o.match(/sentry_key/)&&(t.__sentry_own_request__=!0);let s=()=>{let e=t[n0];if(e&&t.readyState===4){try{e.status_code=t.status}catch{}i1(`xhr`,{endTimestamp:E1()*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[n0];return a&&s1(r)&&s1(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[n0];return r?(n[0]!==void 0&&(r.body=n[0]),i1(`xhr`,{startTimestamp:E1()*1e3,xhr:t}),e.apply(t,n)):e.apply(t,n)}})}function I$t(e){if(s1(e))return e;try{return e.toString()}catch{}}function L$t(e){if(typeof Element>`u`)return!1;try{return e instanceof Element}catch{return!1}}var R$t=40;function z$t(e,t=M$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 N$t(`fetch`),e}finally{n-=a,r--}}return rZt(e,i,ZXt(e.bufferSize||R$t))}var r0=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,B$t=30,V$t=50;function H$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 U$t=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,W$t=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,G$t=/\((\S*)(?::(\d+))(?::(\d+))\)/,K$t=/at (.+?) ?\(data:(.+?),/,q$t=[B$t,e=>{let t=e.match(K$t);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};let n=U$t.exec(e);if(n){let[,e,t,r]=n;return H$t(e,`?`,+t,+r)}let r=W$t.exec(e);if(r){if(r[2]?.indexOf(`eval`)===0){let e=G$t.exec(r[2]);e&&(r[2]=e[1],r[3]=e[2],r[4]=e[3])}let[e,t]=Z$t(r[1]||`?`,r[2]);return H$t(t,e,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}}],J$t=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Y$t=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,X$t=ZKt(q$t,[V$t,e=>{let t=J$t.exec(e);if(t){if(t[3]&&t[3].indexOf(` > eval`)>-1){let e=Y$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]=Z$t(n,e),H$t(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]),Z$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]},i0=1024,Q$t=`Breadcrumbs`,$$t=V1(((e={})=>{let t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:Q$t,setup(e){t.console&&gQt(n1t(e)),t.dom&&C$t(t1t(e,t.dom)),t.xhr&&P$t(r1t(e)),t.fetch&&FQt(i1t(e)),t.history&&k$t(a1t(e)),t.sentry&&e.on(`beforeSendEvent`,e1t(e))}}}));function e1t(e){return function(t){N1()===e&&W1({category:`sentry.${t.type===`transaction`?`transaction`:`event`}`,event_id:t.event_id,level:t.level,message:C1(t)},{event:t})}}function t1t(e,t){return function(n){if(N1()!==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>i0&&(r0&&Q$.warn(`\`dom.maxStringLength\` cannot exceed ${i0}, but a value of ${o} was configured. Sentry will use ${i0} instead.`),o=i0),typeof a==`string`&&(a=[a]);try{let e=n.event,t=o1t(e)?e.target:e;r=_$t(t,{keyAttrs:a,maxStringLength:o}),i=HQt(t)}catch{r=`<unknown>`}if(r.length===0)return;let s={category:`ui.${n.name}`,message:r};i&&(s.data={"ui.component_name":i}),W1(s,{event:n.event,name:n.name,global:n.global})}}function n1t(e){return function(t){if(N1()!==e)return;let n={category:`console`,data:{arguments:t.args,logger:`console`},level:yQt(t.level),message:Iqt(t.args,` `)};if(t.level===`assert`)if(t.args[0]===!1)n.message=`Assertion failed: ${Iqt(t.args.slice(1),` `)||`console.assert`}`,n.data.arguments=t.args.slice(1);else return;W1(n,{input:t.args,level:t.level})}}function r1t(e){return function(t){if(N1()!==e)return;let{startTimestamp:n,endTimestamp:r}=t,i=t.xhr[n0];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:AQt(s)};e.emit(`beforeOutgoingRequestBreadcrumb`,d,u),W1(d,u)}}function i1t(e){return function(t){if(N1()!==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),W1(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:AQt(a.status_code)};e.emit(`beforeOutgoingRequestBreadcrumb`,s,o),W1(s,o)}}}function a1t(e){return function(t){if(N1()!==e)return;let n=t.from,r=t.to,i=HZt(J1.location.href),a=n?HZt(n):void 0,o=HZt(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),W1({category:`navigation`,data:{from:n,to:r}})}}function o1t(e){return!!e&&!!e.target}var s1t=`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(`,`),c1t=`BrowserApiErrors`,l1t=V1(((e={})=>{let t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:c1t,setupOnce(){t.setTimeout&&p1(J1,`setTimeout`,u1t),t.setInterval&&p1(J1,`setInterval`,u1t),t.requestAnimationFrame&&p1(J1,`requestAnimationFrame`,d1t),t.XMLHttpRequest&&`XMLHttpRequest`in J1&&p1(XMLHttpRequest.prototype,`send`,f1t);let e=t.eventTarget;e&&(Array.isArray(e)?e:s1t).forEach(e=>p1t(e,t))}}}));function u1t(e){return function(...t){let n=t[0];return t[0]=Y1(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${e1(e)}`}}),e.apply(this,t)}}function d1t(e){return function(t){return e.apply(this,[Y1(t,{mechanism:{data:{handler:e1(e)},handled:!1,type:`auto.browser.browserapierrors.requestAnimationFrame`}})])}}function f1t(e){return function(...t){let n=this;return[`onload`,`onerror`,`onprogress`,`onreadystatechange`].forEach(e=>{e in n&&typeof n[e]==`function`&&p1(n,e,function(t){let n={mechanism:{data:{handler:e1(t)},handled:!1,type:`auto.browser.browserapierrors.xhr.${e}`}},r=vqt(t);return r&&(n.mechanism.data.handler=e1(r)),Y1(t,n)})}),e.apply(this,t)}}function p1t(e,t){let n=J1[e]?.prototype;n?.hasOwnProperty?.(`addEventListener`)&&(p1(n,`addEventListener`,function(n){return function(r,i,a){try{m1t(i)&&(i.handleEvent=Y1(i.handleEvent,{mechanism:{data:{handler:e1(i),target:e},handled:!1,type:`auto.browser.browserapierrors.handleEvent`}}))}catch{}return t.unregisterOriginalCallbacks&&h1t(this,r,i),n.apply(this,[r,Y1(i,{mechanism:{data:{handler:e1(i),target:e},handled:!1,type:`auto.browser.browserapierrors.addEventListener`}}),a])}}),p1(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 m1t(e){return typeof e.handleEvent==`function`}function h1t(e,t,n){e&&typeof e==`object`&&`removeEventListener`in e&&typeof e.removeEventListener==`function`&&e.removeEventListener(t,n)}var g1t=V1((e={})=>{let t=e.lifecycle??`route`;return{name:`BrowserSession`,setupOnce(){if(J1.document===void 0){r0&&Q$.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}vXt({ignoreDuration:!0});let e=!1;h$t(()=>{e||=(xXt(),!0)});let n=M1(),r=n.getUser();n.addScopeListener(t=>{let n=t.getUser();(r?.id!==n?.id||r?.ip_address!==n?.ip_address)&&(r=n,e&&xXt())}),t===`route`&&k$t(({from:t,to:n})=>{t!==n&&(vXt({ignoreDuration:!0}),xXt(),e=!0)})}}}),_1t=`CultureContext`,v1t=V1((()=>({name:_1t,preprocessEvent(e){let t=y1t();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})},processSegmentSpan(e){let t=y1t();t&&KYt(e,{"culture.locale":t.locale,"culture.timezone":t.timezone,"culture.calendar":t.calendar})}})));function y1t(){try{let e=J1.Intl;if(!e)return;let t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}var b1t=`GlobalHandlers`,x1t=V1(((e={})=>{let t={onerror:!0,onunhandledrejection:!0,...e};return{name:b1t,setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(S1t(e),D1t(`onerror`)),t.onunhandledrejection&&(C1t(e),D1t(`onunhandledrejection`))}}}));function S1t(e){iqt(t=>{let{stackParser:n,attachStacktrace:r}=O1t();if(N1()!==e||WQt())return;let{msg:i,url:a,line:o,column:s,error:c}=t,l=E1t(i$t(n,c||i,void 0,r,!1),a,o,s);l.level=`error`,hXt(l,{originalException:c,mechanism:{handled:!1,type:`auto.browser.global_handlers.onerror`}})})}function C1t(e){sqt(t=>{let{stackParser:n,attachStacktrace:r}=O1t();if(N1()!==e||WQt())return;let i=w1t(t),a=c1(i)?T1t(i):i$t(n,i,void 0,r,!0);a.level=`error`,hXt(a,{originalException:i,mechanism:{handled:!1,type:`auto.browser.global_handlers.onunhandledrejection`}})})}function w1t(e){if(c1(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 T1t(e){return{exception:{values:[{type:`UnhandledRejection`,value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function E1t(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:k1t(t)??VQt(),function:`?`,in_app:!0}),e}function D1t(e){r0&&Q$.log(`Global Handler attached: ${e}`)}function O1t(){return N1()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function k1t(e){if(!(!s1(e)||e.length===0))return e.startsWith(`data:`)?`<${UZt(e,!1)}>`:e}var A1t=V1(()=>({name:`HttpContext`,preprocessEvent(e){if(!J1.navigator&&!J1.location&&!J1.document)return;let t=KQt(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}},processSpan(e){if(!J1.navigator&&!J1.location&&!J1.document)return;let t=KQt();KYt(e,{[GYt]:t.headers[`User-Agent`],...e.is_segment&&{"url.full":e.attributes?.[`sentry.op`]===`http.client`?void 0:VZt(t.url),"http.request.header.referer":t.headers.Referer}})}})),j1t=`cause`,M1t=5,N1t=`LinkedErrors`,P1t=V1(((e={})=>{let t=e.limit||M1t,n=e.key||j1t;return{name:N1t,preprocessEvent(e,r,i){cQt(qQt,i.getOptions().stackParser,n,t,e,r)}}})),F1t=/^HTML(\w*)Element$/;function I1t(e){if(typeof window<`u`&&e===window)return`[Window]`;if(typeof document<`u`&&e===document)return`[Document]`;if(L$t(e)){let t=L1t(e);if(F1t.test(t))return`[HTMLElement: ${_$t(e)}]`}}function L1t(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:`null prototype`}function R1t(){return z1t()?(r0&&Z$(()=>{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 z1t(){if(J1.window===void 0)return!1;let e=J1;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;let t=VQt();return!(J1===J1.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(t))}function B1t(e){return[$Zt(),YZt(),kQt(),l1t(),$$t(),x1t(),P1t(),xQt(),A1t(),v1t(),g1t()]}function V1t(e={}){let t=!e.skipBrowserExtensionCheck&&R1t(),n=e.defaultIntegrations==null?B1t():e.defaultIntegrations,r={...e,enabled:t?!1:e.enabled,stackParser:QKt(e.stackParser||X$t),integrations:kXt({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||z$t};return Dqt(I1t),PZt(l$t,r)}function H1t(e){return l1(e)&&`nativeEvent`in e&&`preventDefault`in e&&`stopPropagation`in e}function U1t(e){let t={...e};GZt(t,`react`),gXt(`react`,{version:U.version});let n=V1t(t);return Dqt(W1t),n}function W1t(e){return H1t(e)?`[SyntheticEvent]`:I1t(e)}var a0=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(){}},o0=typeof window>`u`||`Deno`in globalThis;function s0(){}function G1t(e,t){return typeof e==`function`?e(t):e}function K1t(e){return typeof e==`number`&&e>=0&&e!==1/0}function q1t(e,t){return Math.max(e+(t||0)-Date.now(),0)}function c0(e,t){return typeof e==`function`?e(t):e}function l0(e,t){return typeof e==`function`?e(t):e}function J1t(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==X1t(o,t.options))return!1}else if(!d0(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 Y1t(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(u0(t.options.mutationKey)!==u0(a))return!1}else if(!d0(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function X1t(e,t){return(t?.queryKeyHashFn||u0)(e)}function u0(e){return JSON.stringify(e,(e,t)=>$1t(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function d0(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>d0(e[n],t[n])):!1}function Z1t(e,t){if(e===t)return e;let n=Q1t(e)&&Q1t(t);if(n||$1t(e)&&$1t(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]=Z1t(e[i],t[i]),s[i]===e[i]&&e[i]!==void 0&&l++)}return i===o&&l===i?e:s}return t}function f0(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 Q1t(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function $1t(e){if(!e0t(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!e0t(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function e0t(e){return Object.prototype.toString.call(e)===`[object Object]`}function t0t(e){return new Promise(t=>{setTimeout(t,e)})}function n0t(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Z1t(e,t)}function r0t(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function i0t(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var a0t=Symbol();function o0t(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===a0t?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function s0t(e,t){return typeof e==`function`?e(...t):!!e}var c0t=new class extends a0{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!o0&&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`}},p0=new class extends a0{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!o0&&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 l0t(){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 u0t(e){return Math.min(1e3*2**e,3e4)}function d0t(e){return(e??`online`)===`online`?p0.isOnline():!0}var f0t=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function p0t(e){return e instanceof f0t}function m0t(e){let t=!1,n=0,r=!1,i,a=l0t(),o=t=>{r||(f(new f0t(t)),e.abort?.())},s=()=>{t=!0},c=()=>{t=!1},l=()=>c0t.isFocused()&&(e.networkMode===`always`||p0.isOnline())&&e.canRun(),u=()=>d0t(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??(o0?0:3),o=e.retryDelay??u0t,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),t0t(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 h0t=e=>setTimeout(e,0);function g0t(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=h0t,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 m0=g0t(),_0t=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),K1t(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(o0?1/0:300*1e3))}clearGcTimeout(){this.#e&&=(clearTimeout(this.#e),void 0)}},v0t=class extends _0t{#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=b0t(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=n0t(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(s0).catch(s0):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>l0(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===a0t||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>c0(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:!q1t(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=o0t(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=>{p0t(e)&&e.silent||this.#s({type:`error`,error:e}),p0t(e)||(this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this)),this.scheduleGc()};return this.#i=m0t({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,...y0t(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 p0t(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),m0.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function y0t(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:d0t(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function b0t(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 x0t=class extends a0{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??X1t(r,t),a=this.get(i);return a||(a=new v0t({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(){m0.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=>J1t(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>J1t(e,t)):t}notify(e){m0.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){m0.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){m0.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},S0t=class extends _0t{#e;#t;#n;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||C0t(),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=m0t({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),m0.batch(()=>{this.#e.forEach(t=>{t.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:`updated`,action:e})})}};function C0t(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var w0t=class extends a0{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 S0t({mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=h0(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=h0(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=h0(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=h0(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){m0.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=>Y1t(t,e))}findAll(e={}){return this.getAll().filter(t=>Y1t(e,t))}notify(e){m0.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return m0.batch(()=>Promise.all(e.map(e=>e.continue().catch(s0))))}};function h0(e){return e.options.scope?.id}function T0t(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=o0t(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?i0t:r0t;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?D0t:E0t,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:E0t(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 E0t(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 D0t(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var O0t=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new x0t,this.#t=e.mutationCache||new w0t,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=c0t.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=p0.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(c0(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=G1t(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return m0.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;m0.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return m0.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=m0.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(s0).catch(s0)}invalidateQueries(e,t={}){return m0.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=m0.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(s0)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(s0)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(c0(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(s0).catch(s0)}fetchInfiniteQuery(e){return e.behavior=T0t(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(s0).catch(s0)}ensureInfiniteQueryData(e){return e.behavior=T0t(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return p0.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(u0(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{d0(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(u0(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{d0(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||=X1t(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===a0t&&(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()}},k0t=class extends a0{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=l0t(),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),j0t(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return M0t(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return M0t(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 l0(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&&!f0(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&N0t(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||l0(this.options.enabled,this.#t)!==l0(t.enabled,this.#t)||c0(this.options.staleTime,this.#t)!==c0(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||l0(this.options.enabled,this.#t)!==l0(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 F0t(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(s0)),t}#g(){this.#b();let e=c0(this.options.staleTime,this.#t);if(o0||this.#r.isStale||!K1t(e))return;let t=q1t(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,!(o0||l0(this.options.enabled,this.#t)===!1||!K1t(this.#p)||this.#p===0)&&(this.#f=setInterval(()=>{(this.options.refetchIntervalInBackground||c0t.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&&j0t(e,t),o=i&&N0t(e,n,t,r);(a||o)&&(l={...l,...y0t(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=n0t(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=n0t(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:P0t(e,t),refetch:this.refetch,promise:this.#o,isEnabled:l0(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=l0t())},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),!f0(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){m0.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function A0t(e,t){return l0(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&t.retryOnMount===!1)}function j0t(e,t){return A0t(e,t)||e.state.data!==void 0&&M0t(e,t,t.refetchOnMount)}function M0t(e,t,n){if(l0(t.enabled,e)!==!1&&c0(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&P0t(e,t)}return!1}function N0t(e,t,n,r){return(e!==t||l0(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&P0t(e,n)}function P0t(e,t){return l0(t.enabled,e)!==!1&&e.isStaleByTime(c0(t.staleTime,e))}function F0t(e,t){return!f0(e.getCurrentResult(),t)}var I0t=class extends a0{#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),f0(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&u0(t.mutationKey)!==u0(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??C0t();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){m0.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)})})}},L0t=U.createContext(void 0),g0=e=>{let t=U.useContext(L0t);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},R0t=({client:e,children:t})=>(U.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,G.jsx)(L0t.Provider,{value:e,children:t})),z0t=U.createContext(!1),B0t=()=>U.useContext(z0t);z0t.Provider;function V0t(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var H0t=U.createContext(V0t()),U0t=()=>U.useContext(H0t),W0t=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},G0t=e=>{U.useEffect(()=>{e.clearReset()},[e])},K0t=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||s0t(n,[e.error,r])),q0t=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))}},J0t=(e,t)=>e.isLoading&&e.isFetching&&!t,Y0t=(e,t)=>e?.suspense&&t.isPending,X0t=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Z0t(e,t,n){let r=B0t(),i=U0t(),a=g0(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o),o._optimisticResults=r?`isRestoring`:`optimistic`,q0t(o),W0t(o,i),G0t(i);let s=!a.getQueryCache().get(o.queryHash),[c]=U.useState(()=>new t(a,o)),l=c.getOptimisticResult(o),u=!r&&e.subscribed!==!1;if(U.useSyncExternalStore(U.useCallback(e=>{let t=u?c.subscribe(m0.batchCalls(e)):s0;return c.updateResult(),t},[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),U.useEffect(()=>{c.setOptions(o)},[o,c]),Y0t(o,l))throw X0t(o,c,i);if(K0t({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&&!o0&&J0t(l,r)&&(s?X0t(o,c,i):a.getQueryCache().get(o.queryHash)?.promise)?.catch(s0).finally(()=>{c.updateResult()}),o.notifyOnChangeProps?l:c.trackResult(l)}function _0(e,t){return Z0t(e,k0t,t)}function Q0t(e,t){let n=g0(t),[r]=U.useState(()=>new I0t(n,e));U.useEffect(()=>{r.setOptions(e)},[r,e]);let i=U.useSyncExternalStore(U.useCallback(e=>r.subscribe(m0.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=U.useCallback((e,t)=>{r.mutate(e,t).catch(s0)},[r]);if(i.error&&s0t(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}H();var v0=()=>{},y0={setDefaultMode:v0,setInputMode:v0,preload:v0,setTranslucent:v0,dismiss:v0,setFocusTo:v0,viewPositionInWindow:()=>Promise.resolve({x:0,y:0,width:0,height:0}),addListener:v0,removeListeners:v0,getConstants:()=>({keyboardBorderRadius:0})},b0={addListener:()=>({remove:v0})},$0t={addListener:()=>({remove:v0})},e2t={addListener:()=>({remove:v0})},t2t=V,n2t={synchronizeFocusedInputLayout:e=>{}},r2t=V,i2t=V,a2t=V;H();var x0=()=>{},o2t=()=>x0,s2t=e=>({value:e,addListener:x0,removeListener:x0,modify:x0,get:()=>e,set:x0}),c2t=s2t(0),l2t=s2t(null),u2t={enabled:!0,animated:{progress:new cf.Value(0),height:new cf.Value(0)},reanimated:{progress:c2t,height:c2t},layout:l2t,update:Promise.resolve,setKeyboardHandlers:o2t,setInputHandlers:o2t,setEnabled:x0},d2t=(0,U.createContext)(u2t),S0=()=>(0,U.useContext)(d2t),f2t=e=>e;H();function p2t(e){return t=>{let n=t,r=null,i=!1,a=()=>{if(i)return;let t=f2t(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 m2t(e,t){let n=(0,U.useRef)(null);return n.current===null&&(n.current=new cf.Value(e,t)),n.current}var C0=!0,h2t={height:0,duration:0,timestamp:new Date().getTime(),target:-1,type:`default`,appearance:`light`};b0.addListener(`keyboardDidHide`,e=>{C0=!0,h2t=e}),b0.addListener(`keyboardWillShow`,e=>{C0=!1,h2t=e});var w0={setDefaultMode:y0.setDefaultMode,setInputMode:y0.setInputMode,setFocusTo:y0.setFocusTo,preload:y0.preload,setTranslucent:y0.setTranslucent,dismiss:async e=>{let t=e?.keepFocus??!1,n=e?.animated??!0;return new Promise(e=>{if(C0){e();return}let r=b0.addListener(`keyboardDidHide`,()=>{e(void 0),r.remove()});y0.dismiss(t,n)})},isVisible:()=>!C0,state:()=>h2t};KQ();var g2t=()=>()=>{},_2t=g2t,v2t=g2t;H(),TOt(),KQ();var y2t=wOt(),b2t=GQ.createAnimatedComponent(cf.createAnimatedComponent(t2t)),x2t=z.create({container:{flex:1},hidden:{display:`none`,position:`absolute`}}),T0=B.OS,S2t=e=>{let{children:t,statusBarTranslucent:n,navigationBarTranslucent:r,preserveEdgeToEdge:i,enabled:a=!0,preload:o=!0}=e,s=(0,U.useRef)(null),[c,l]=(0,U.useState)(a),u=m2t(0),d=m2t(0),f=lQ(0),p=lQ(0),m=lQ(null),h=p2t(s),g=p2t(s),_=(0,U.useCallback)(async()=>{n2t.synchronizeFocusedInputLayout(s.current),await new Promise(e=>{let t=$0t.addListener(`layoutDidSynchronize`,()=>{t.remove(),e(null)})})},[]),v=(0,U.useMemo)(()=>({enabled:c,animated:{progress:u,height:cf.multiply(d,-1)},reanimated:{progress:f,height:p},layout:m,update:_,setKeyboardHandlers:h,setInputHandlers:g,setEnabled:l}),[c]),y=(0,U.useMemo)(()=>[x2t.hidden,{transform:[{translateX:d},{translateY:u}]}],[]),b=(0,U.useMemo)(()=>cf.event([{nativeEvent:{progress:u,height:d}}],{useNativeDriver:B.OS!==`web`}),[]),x=(e,t)=>{"worklet";t.includes(T0)&&(f.value=e.progress,p.value=-e.height)},S=_2t({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=v2t({onFocusedInputLayoutChanged:e=>{"worklet";e.target===-1?m.value=null:m.value=e}},[]);return(0,U.useEffect)(()=>{o&&w0.preload()},[o]),U.createElement(d2t.Provider,{value:v},U.createElement(b2t,{ref:s,enabled:c,navigationBarTranslucent:y2t||r,statusBarTranslucent:y2t||n,preserveEdgeToEdge:y2t||i,style:x2t.container,onKeyboardMoveReanimated:S,onKeyboardMoveStart:T0===`ios`?b:void 0,onKeyboardMove:T0===`android`?b:void 0,onKeyboardMoveInteractive:b,onKeyboardMoveEnd:T0===`android`?b:void 0,onFocusedInputLayoutChangedReanimated:C},t),U.createElement(cf.View,{style:y}))},C2t=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}({}),w2t=y0.getConstants().keyboardBorderRadius,E0=w2t>0;H();var T2t=Uo.get(`window`),E2t={width:T2t.width,height:T2t.height};e2t.addListener(`windowDidResize`,e=>{E2t=e});var D2t=()=>{let[e,t]=(0,U.useState)(E2t);return(0,U.useEffect)(()=>{let e=e2t.addListener(`windowDidResize`,e=>{t(e)});return t(E2t),()=>{e.remove()}},[]),e},O2t=[`keyboardWillShow`,`keyboardDidHide`],k2t=()=>({...w0.state(),isVisible:w0.isVisible()}),A2t=e=>e;function D0(e=A2t){let[t,n]=(0,U.useState)(()=>e(k2t()));return(0,U.useEffect)(()=>{let t=O2t.map(t=>b0.addListener(t,()=>n(e(k2t()))));return n(e(k2t())),()=>{t.forEach(e=>e.remove())}},[]),t}KQ();var j2t=()=>{(0,U.useEffect)(()=>(w0.setInputMode(C2t.SOFT_INPUT_ADJUST_RESIZE),()=>w0.setDefaultMode()),[])},M2t=()=>(j2t(),S0().reanimated);function N2t(e,t){let n=S0(),{doDependenciesDiffer:r}=vQ(e,t),i=gQ(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,U.useLayoutEffect)(()=>{let e=n.setKeyboardHandlers(i);return()=>e()},t)}function P2t(e,t){j2t(),N2t(e,t)}function F2t(){let e=S0();return{input:e.layout,update:e.update}}function I2t(e,t){let n=S0(),{doDependenciesDiffer:r}=vQ(e,t),i=gQ(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,U.useLayoutEffect)(()=>{let e=n.setInputHandlers(i);return()=>e()},t)}KQ();var L2t=(...e)=>(0,U.useCallback)(t=>{for(let n of e)n&&(typeof n==`function`?n(t):n.current=t)},e);H(),KQ(),B.OS,KQ(),KQ();function R2t(){return R2t=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},R2t.apply(null,arguments)}var z2t=(0,U.forwardRef)(({children:e,offset:{closed:t=0,opened:n=0}={},style:r,enabled:i=!0,...a},o)=>{let{height:s,progress:c}=M2t(),l=dQ(()=>{let e=DQ(c.value,[0,1],[t,n]);return{transform:[{translateY:i?s.value+e:t}]}},[t,n,i]),u=(0,U.useMemo)(()=>[r,l],[r,l]);return U.createElement(GQ.View,R2t({ref:o,style:u},a),e)});KQ();var B2t=[`onScroll`,`onScrollBeginDrag`,`onScrollEndDrag`,`onMomentumScrollBegin`,`onMomentumScrollEnd`],V2t=(e,t=0)=>{let n=lQ(t),r=lQ({width:0,height:0}),i=lQ({width:0,height:0}),a=p2t(e),o=gQ(e=>{"worklet";n.value=e.contentOffset.y,r.value=e.layoutMeasurement,i.value=e.contentSize},B2t);return(0,U.useEffect)(()=>{let e=a(o);return()=>{e()}},[]),{offset:n,layout:r,size:i,onLayout:(0,U.useCallback)(e=>{r.value={width:e.nativeEvent.layout.width,height:e.nativeEvent.layout.height}},[r]),onContentSizeChange:(0,U.useCallback)((e,t)=>{i.value={width:e,height:t}},[i])}};H();var H2t=z.create({container:{flexGrow:1,flexShrink:1}});H(),KQ();function U2t(){return U2t=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},U2t.apply(null,arguments)}var W2t=B.OS===`android`?GQ.createAnimatedComponent(i2t):i2t,G2t=(0,U.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=lQ(null);(0,U.useEffect)(()=>{o&&(o.value=f?.y??0)},[o,f?.y]);let m=bQ(()=>{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]);mQ(()=>m.value.effective,(e,t)=>{c&&(t&&e.top===t.top&&e.bottom===t.bottom&&e.left===t.left&&e.right===t.right||UQ(c)(e))},[c]);let h=pQ(()=>{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 U.createElement(W2t,{animatedProps:h,applyWorkaroundForContentInsetHitTestBug:s,style:H2t.container},U.createElement(e,U2t({ref:d,animatedProps:h},u),l))});H(),KQ();var O0=B.OS===`android`&&B.Version>=30||B.OS===`ios`,K2t={duration:250,easing:qX.bezier(.19919472913616398,.010644531250000006,.27920937042459737,.91025390625)},q2t=(e,t)=>{let n=(0,U.useMemo)(()=>e,t??[]),r=lQ(-1),i=lQ(0),a=lQ(0),o=lQ(0);mQ(()=>{if(!O0&&a.value!==0)return{duration:K2t.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]),P2t({onStart:e=>{"worklet";var t;if(!O0&&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),O0||(o.value=YX(e.height,K2t)),(t=n.onStart)==null||t.call(n,{...e,duration:O0?e.duration:K2t.duration})},onMove:e=>{"worklet";if(O0){var t;(t=n.onMove)==null||t.call(n,e)}},onEnd:e=>{"worklet";if(O0){var t;(t=n.onEnd)==null||t.call(n,e)}}},t)},J2t=(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)}},Y2t=(e,t)=>{"worklet";let n;return t&&(n=t.find(t=>t>=e)),n??e};KQ();function k0(){return k0=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},k0.apply(null,arguments)}var X2t=(0,U.forwardRef)(({children:e,onLayout:t,bottomOffset:n=0,disableScrollOnKeyboardHide:r=!1,enabled:i=!0,extraKeyboardSpace:a=0,mode:o=`insets`,ScrollViewComponent:s=GQ.ScrollView,snapToOffsets:c,...l},u)=>{let d=jFt(),f=U.useRef(null),p=L2t(d,f),m=lQ(null),h=lQ(0),{offset:g,layout:_,size:v}=V2t(d),y=lQ(0),b=lQ(0),x=lQ(!1),S=lQ(!1),C=lQ(-1),w=lQ(0),T=lQ(0),{input:E,update:D}=F2t(),O=lQ(null),k=lQ(null),A=lQ(-1),ee=lQ(!1),te=lQ(!1),ne=lQ(0),{height:re}=D2t(),ie=(0,U.useCallback)(async()=>{let e=f2t(d.current);if(m.value=e,e!==null)try{let{y:t}=await y0.viewPositionInWindow(e);ne.value=t}catch{}},[]),j=(0,U.useCallback)(e=>{ie(),t?.(e)},[t,ie]);(0,U.useEffect)(()=>{ie()},[ie]);let M=(0,U.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=DQ(e,[w.value,b.value],[0,Y2t(r+h.value,c)-h.value]);return zQ(d,0,Math.max(i,0)+h.value,t),i}if(a<ne.value){let e=r-n;zQ(d,0,h.value+a-e,t)}return 0},[n,i,re,c]),ae=(0,U.useCallback)(e=>{"worklet";return o===`layout`?!1:S.value&&A.value>0?(zQ(d,0,h.value-DQ(e,[w.value,b.value],[A.value,0]),!1),!0):!1},[o]),oe=(0,U.useCallback)(e=>{"worklet";let t=h.value;h.value=e,M(b.value,!0),h.value=t},[h,b,M]),N=(0,U.useCallback)(e=>{"worklet";y.value=DQ(e.height,[0,b.value],[0,b.value+a])},[a]),se=(0,U.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:kLt(t,0,E.value.layout.height)}},!0)},[E,k,O]),P=(0,U.useCallback)(()=>{"worklet";let e=O.value;se()&&(oe(g.value),O.value=e)},[oe]),F=(0,U.useCallback)(()=>{"worklet";P()},[P]),ce=(0,U.useMemo)(()=>J2t(F,200),[F]),le=(0,U.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,se(),!x.value&&b.value>0&&(g.value+=M(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 P();ce()},[P,ce,se,M]);I2t({onSelectionChange:le},[le]),q2t({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`&&N(e)),n&&(C.value=e.target,k.value?.target===e.target&&te.value?(se(),ee.value=!1):(k.value?.target===e.target?se():E.value&&(O.value=E.value),ee.value=!0),T.value=g.value),n&&!x.value&&(ee.value||(g.value+=M(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||ae(e.height)||(o===`layout`&&N(e),(!r||x.value)&&M(e.height))},onEnd:e=>{"worklet";e.height===0&&ae(e.height),b.value=e.height,h.value=g.value,e.height===0?te.value=!1:x.value&&(ee.value=!1),N(e)}},[o,M,ae,r,N]);let ue=(0,U.useCallback)(async()=>{await D(),requestAnimationFrame(()=>{WQ(()=>{"worklet";P()})()})},[D,P]);(0,U.useImperativeHandle)(u,()=>{let e=f.current;if(e){let t=e;return t.assureFocusedInputVisible=()=>{ue()},t}return{assureFocusedInputVisible:()=>{ue()}}},[ue]),(0,U.useEffect)(()=>{ue()},[n]),mQ(()=>E.value,(e,t)=>{e?.target===t?.target&&e?.layout.height!==t?.layout.height&&P()},[]);let de=bQ(()=>i?y.value:0,[i]),fe=dQ(()=>i&&o===`layout`?{paddingBottom:y.value+1}:{},[i,o]);return o===`layout`?U.createElement(s,k0({ref:p},l,{scrollEventThrottle:16,onLayout:j}),e,i&&U.createElement(GQ.View,{style:fe})):U.createElement(G2t,k0({ref:p},l,{bottomPadding:de,scrollEventThrottle:16,ScrollViewComponent:s,onLayout:j}),e)});H();var Z2t=({type:e,disabled:t,theme:n})=>{let r=D0(e=>e.appearance),i=(0,U.useMemo)(()=>({backgroundColor:t?n[r].disabled:n[r].primary}),[t,n,r]),a=(0,U.useMemo)(()=>[A0.arrowLeftLine,i],[i]),o=(0,U.useMemo)(()=>[A0.arrowRightLine,i],[i]);return U.createElement(V,{style:e===`next`?A0.arrowDownContainer:A0.arrowUpContainer},U.createElement(V,{style:A0.arrow},U.createElement(cf.View,{style:a}),U.createElement(cf.View,{style:o})))},Q2t={width:13,height:2,borderRadius:1},$2t={marginHorizontal:5,width:30,height:30,justifyContent:`center`,alignItems:`center`},A0=z.create({arrowUpContainer:$2t,arrowDownContainer:{...$2t,transform:[{rotate:`180deg`}]},arrow:{width:20,height:20,flexDirection:`row`,alignItems:`center`,justifyContent:`space-between`},arrowLeftLine:{...Q2t,transform:[{rotate:`-45deg`}],left:-.5},arrowRightLine:{...Q2t,transform:[{rotate:`45deg`}],left:-5.5}});H();var j0=B.select({android:({children:e,onPress:t,disabled:n,accessibilityLabel:r,accessibilityHint:i,testID:a,rippleRadius:o=18,style:s,theme:c})=>{let l=D0(e=>e.appearance),u=(0,U.useMemo)(()=>({disabled:n}),[n]),d=(0,U.useMemo)(()=>Xp.Ripple(c[l].ripple,!0,o),[l,o,c]);return U.createElement(Xp,{accessibilityHint:i,accessibilityLabel:r,accessibilityRole:`button`,accessibilityState:u,background:d,style:s,testID:a,onPress:t},U.createElement(V,{style:s},e))},default:({children:e,onPress:t,disabled:n,accessibilityLabel:r,accessibilityHint:i,testID:a,style:o})=>{let s=n?V:Jf,c=(0,U.useMemo)(()=>({disabled:n}),[n]);return U.createElement(s,{accessibilityHint:i,accessibilityLabel:r,accessibilityRole:`button`,accessibilityState:c,style:o,testID:a,onPress:t},e)}}),e4t={light:{primary:`#2c2c2c`,disabled:`#B0BEC5`,background:`#f3f3f4`,ripple:`#bcbcbcbc`},dark:{primary:`#fafafa`,disabled:`#707070`,background:`#2C2C2E`,ripple:`#F8F8F888`}},t4t=({children:e})=>U.createElement(U.Fragment,null,e),M0=`keyboard.toolbar`,n4t=`${M0}.previous`,r4t=`${M0}.next`,i4t=`${M0}.content`,a4t=`${M0}.done`,o4t=E0?-11:0;H();var N0=({children:e})=>U.createElement(V,{style:s4t.flex,testID:i4t},e),s4t=z.create({flex:{flex:1}}),c4t=(0,U.createContext)(void 0),l4t=()=>{let e=(0,U.useContext)(c4t);if(!e)throw Error(`KeyboardToolbar.* component must be used inside <KeyboardToolbar>`);return e};H();var u4t=({children:e,onPress:t,rippleRadius:n=28,text:r,button:i=j0})=>{let a=D0(e=>e.appearance),{theme:o}=l4t(),s=(0,U.useMemo)(()=>[d4t.doneButton,{color:o[a].primary}],[a,o]),c=(0,U.useCallback)(e=>{t?.(e),e.isDefaultPrevented()||w0.dismiss()},[t]);return U.createElement(i,{accessibilityHint:`Closes the keyboard`,accessibilityLabel:`Done`,rippleRadius:n,style:d4t.doneButtonContainer,testID:a4t,theme:o,onPress:c},U.createElement(gd,{maxFontSizeMultiplier:1.3,style:s},e??r??`Done`))},d4t=z.create({doneButton:{fontWeight:`600`,fontSize:15},doneButtonContainer:{marginRight:16,marginLeft:8}}),f4t=({children:e,onPress:t,disabled:n,rippleRadius:r,style:i,button:a=j0,icon:o=Z2t})=>{let{theme:s,isNextDisabled:c}=l4t(),l=n??c,u=(0,U.useCallback)(e=>{t?.(e),e.isDefaultPrevented()||w0.setFocusTo(`next`)},[t]);return U.createElement(a,{accessibilityHint:`Moves focus to the next field`,accessibilityLabel:`Next`,disabled:l,rippleRadius:r,style:i,testID:r4t,theme:s,onPress:u},e??U.createElement(o,{disabled:l,theme:s,type:`next`}))},p4t=({children:e,onPress:t,disabled:n,rippleRadius:r,style:i,button:a=j0,icon:o=Z2t})=>{let{theme:s,isPrevDisabled:c}=l4t(),l=n??c,u=(0,U.useCallback)(e=>{t?.(e),e.isDefaultPrevented()||w0.setFocusTo(`prev`)},[t]);return U.createElement(a,{accessibilityHint:`Moves focus to the previous field`,accessibilityLabel:`Previous`,disabled:l,rippleRadius:r,style:i,testID:n4t,theme:s,onPress:u},e??U.createElement(o,{disabled:l,theme:s,type:`prev`}))};H();function m4t(){return m4t=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},m4t.apply(null,arguments)}var P0=e=>{let{children:t,content:n,theme:r=e4t,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=D0(e=>e.appearance),[y,b]=(0,U.useState)({current:0,count:0}),x=y.current===0,S=y.current===y.count-1,C=a??j0,w=o??Z2t;(0,U.useEffect)(()=>$0t.addListener(`focusDidSet`,e=>{b(e)}).remove,[]);let T=(0,U.useMemo)(()=>[F0.toolbar,{backgroundColor:`${r[v].background}${f}`},E0?null:{paddingLeft:g?.left,paddingRight:g?.right},E0?F0.floating:null],[v,f,r,g]),E=(0,U.useMemo)(()=>[F0.sticky,E0?{left:(g?.left??0)+16,right:(g?.right??0)+16}:null],[g]),D=(0,U.useMemo)(()=>({closed:p+42,opened:m+o4t}),[p,m]),O=null,k=null,A=null,ee=null;if(t){let e=null,n=null,r=null,i=null,a=null;U.Children.forEach(t,t=>{if(!U.isValidElement(t))return;let o=t.type;o===t4t?a=t:o===N0?r=t:o===p4t?e=t:o===f4t?n=t:o===u4t&&(i=t)}),O=a,ee=i,k=e||n?U.createElement(V,{style:F0.arrows},e,n):null,A=r??U.createElement(N0,null,r)}else O=d,k=s?U.createElement(V,{style:F0.arrows},U.createElement(p4t,{button:C,icon:w,onPress:l}),U.createElement(f4t,{button:C,icon:w,onPress:c})):null,A=U.createElement(N0,null,n),ee=i?U.createElement(u4t,{button:C,text:i,onPress:u}):null;let te=(0,U.useMemo)(()=>({theme:r,isPrevDisabled:x,isNextDisabled:S}),[r,x,S]);return U.createElement(c4t.Provider,{value:te},U.createElement(z2t,{enabled:h,offset:D,style:E},U.createElement(V,m4t({},_,{style:T,testID:M0}),O,k,A,ee)))},F0=z.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`}});P0.Background=t4t,P0.Content=N0,P0.Prev=p4t,P0.Next=f4t,P0.Done=u4t,P0.Group=a2t,KQ(),KQ(),KQ(),`nativeFabricUIManager`in globalThis,H(),KQ(),B.OS,KQ(),H(),KQ(),cX(0),cX(0),z.create({commitView:{display:`none`,position:`absolute`}}),H(),z.create({container:{position:`absolute`,bottom:0,top:0,left:0,right:0,height:999},rounded:{borderTopLeftRadius:w2t,borderTopRightRadius:w2t,overflow:`hidden`}}),H(),z.create({absolute:{position:`absolute`},stretch:{top:0,bottom:0,left:0,right:0}}),H(),cf.createAnimatedComponent(r2t);function h4t({children:e,style:t,onInsetsChange:n}){return y4t.useEffect(()=>{if(typeof document>`u`)return;let e=v4t();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(g4t(),t),t(),()=>{document.body.removeChild(e),e.removeEventListener(g4t(),t)}},[n]),y4t.createElement(V,{style:t},e)}function g4t(){if(R0!=null)return R0;let e=document.createElement(`invalidtype`);R0=L0.Transition;for(let t in L0)if(e.style[t]!==void 0){R0=L0[t];break}return R0}function _4t(){if(z0!==null)return z0;let{CSS:e}=window;return z0=e&&e.supports&&e.supports(`top: constant(safe-area-inset-top)`)?`constant`:`env`,z0}function I0(e){return`${_4t()}(safe-area-inset-${e})`}function v4t(){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=I0(`top`),t.paddingBottom=I0(`bottom`),t.paddingLeft=I0(`left`),t.paddingRight=I0(`right`),e}var y4t,L0,R0,z0,b4t=o((()=>{y4t=u(p()),H(),L0={WebkitTransition:`webkitTransitionEnd`,Transition:`transitionEnd`,MozTransition:`transitionend`,MSTransition:`msTransitionEnd`,OTransition:`oTransitionEnd`},R0=null,z0=null}));function B0(){return B0=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},B0.apply(null,arguments)}function x4t({children:e,initialMetrics:t,initialSafeAreaInsets:n,style:r,...i}){let a=C4t(),o=w4t(),[s,c]=H0.useState(t?.insets??n??a??null),[l,u]=H0.useState(t?.frame??o??{x:0,y:0,width:Uo.get(`window`).width,height:Uo.get(`window`).height}),d=H0.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 H0.createElement(h4t,B0({style:[O4t.fill,r],onInsetsChange:d},i),s==null?null:H0.createElement(W0.Provider,{value:l},H0.createElement(U0.Provider,{value:s},e)))}function S4t({onChange:e,style:t,children:n,...r}){return H0.createElement(h4t,B0({},r,{style:[O4t.fill,t],onInsetsChange:t=>{e({insets:t.nativeEvent.insets,frame:t.nativeEvent.frame})}}),n)}function C4t(){return H0.useContext(U0)}function w4t(){return H0.useContext(W0)}function V0(){let e=H0.useContext(U0);if(e==null)throw Error(k4t);return e}function T4t(){let e=H0.useContext(W0);if(e==null)throw Error(k4t);return e}function E4t(e){return H0.forwardRef((t,n)=>{let r=V0();return H0.createElement(e,B0({},t,{insets:r,ref:n}))})}function D4t(){return V0()}var H0,U0,W0,O4t,k4t,A4t,j4t,M4t=o((()=>{H0=u(p()),H(),b4t(),U0=H0.createContext(null),W0=H0.createContext(null),O4t=z.create({fill:{flex:1}}),k4t="No safe area value available. Make sure you are rendering `<SafeAreaProvider>` at the top of your app.",A4t=U0.Consumer,j4t=U0}));function N4t(){return N4t=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},N4t.apply(null,arguments)}function G0(e,t,n){switch(n){case`maximum`:return Math.max(t,e);case`additive`:return t+e;default:return t}}var K0,P4t,q0,F4t=o((()=>{K0=u(p()),H(),M4t(),P4t={top:`additive`,left:`additive`,bottom:`additive`,right:`additive`},q0=K0.forwardRef(({style:e={},mode:t,edges:n,...r},i)=>{let a=V0(),o=K0.useMemo(()=>n==null?P4t:Array.isArray(n)?n.reduce((e,t)=>(e[t]=`additive`,e),{}):n,[n]),s=K0.useMemo(()=>{let n=z.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:G0(a.top,s,o.top),marginRight:G0(a.right,c,o.right),marginBottom:G0(a.bottom,l,o.bottom),marginLeft:G0(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:G0(a.top,s,o.top),paddingRight:G0(a.right,c,o.right),paddingBottom:G0(a.bottom,l,o.bottom),paddingLeft:G0(a.left,u,o.left)}]}},[o.bottom,o.left,o.right,o.top,a.bottom,a.left,a.right,a.top,t,e]);return K0.createElement(V,N4t({style:s},r,{ref:i}))})})),I4t=o((()=>{})),L4t=o((()=>{})),R4t=c({SafeAreaConsumer:()=>A4t,SafeAreaContext:()=>j4t,SafeAreaFrameContext:()=>W0,SafeAreaInsetsContext:()=>U0,SafeAreaListener:()=>S4t,SafeAreaProvider:()=>x4t,SafeAreaView:()=>q0,initialWindowMetrics:()=>null,initialWindowSafeAreaInsets:()=>null,useSafeArea:()=>D4t,useSafeAreaFrame:()=>T4t,useSafeAreaInsets:()=>V0,withSafeAreaInsets:()=>E4t}),J0=o((()=>{M4t(),F4t(),I4t(),L4t()}));J0();var z4t=new O0t({defaultOptions:{queries:{gcTime:1/0}}});H();function B4t(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:Xu.resolveAssetSource(e).uri}}function Y0(e){"@babel/helpers - typeof";return Y0=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},Y0(e)}function V4t(e,t){if(Y0(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Y0(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function H4t(e){var t=V4t(e,`string`);return Y0(t)==`symbol`?t:t+``}function X0(e,t,n){return(t=H4t(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var U4t=class{requestAnimationFrame(e){return requestAnimationFrame(e)}cancelAnimationFrame(e){cancelAnimationFrame(e)}},W4t=class{constructor(){X0(this,`_lastHandleId`,0),X0(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)}},G4t=class{constructor(){X0(this,`_strategy`,void 0),this._strategy=typeof requestAnimationFrame==`function`?new U4t:new W4t}requestAnimationFrame(e){return this._strategy.requestAnimationFrame(e)}cancelAnimationFrame(e){this._strategy.cancelAnimationFrame(e)}},Z0=typeof window<`u`&&window.document!==void 0,K4t=new Uint8Array([80,75,3,4]),q4t=[`v`,`ip`,`op`,`layers`,`fr`,`w`,`h`],J4t=`0.70.0`,Y4t=`@lottiefiles/dotlottie-web`,K,X4t=typeof TextDecoder<`u`?new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error(`TextDecoder not available`)}};typeof TextDecoder<`u`&&X4t.decode();var Q0=null;function $0(){return(Q0===null||Q0.byteLength===0)&&(Q0=new Uint8Array(K.memory.buffer)),Q0}function e2(e,t){return e>>>=0,X4t.decode($0().subarray(e,e+t))}function Z4t(e){let t=K.__externref_table_alloc_command_export();return K.__wbindgen_export_3.set(t,e),t}function Q4t(e,t){try{return e.apply(this,t)}catch(e){let t=Z4t(e);K.__wbindgen_exn_store_command_export(t)}}var t2=0,n2=typeof TextEncoder<`u`?new TextEncoder(`utf-8`):{encode:()=>{throw Error(`TextEncoder not available`)}},$4t=typeof n2.encodeInto==`function`?function(e,t){return n2.encodeInto(e,t)}:function(e,t){let n=n2.encode(e);return t.set(n),{read:e.length,written:n.length}};function r2(e,t,n){if(n===void 0){let n=n2.encode(e),r=t(n.length,1)>>>0;return $0().subarray(r,r+n.length).set(n),t2=n.length,r}let r=e.length,i=t(r,1)>>>0,a=$0(),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=$0().subarray(i+o,i+r),a=$4t(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return t2=o,i}var i2=null;function a2(){return(i2===null||i2.buffer.detached===!0||i2.buffer.detached===void 0&&i2.buffer!==K.memory.buffer)&&(i2=new DataView(K.memory.buffer)),i2}function e3t(e){return e==null}var o2=null;function t3t(){return(o2===null||o2.byteLength===0)&&(o2=new Float32Array(K.memory.buffer)),o2}function n3t(e,t){let n=t(e.length*4,4)>>>0;return t3t().set(e,n/4),t2=e.length,n}function r3t(e,t){let n=t(e.length*1,1)>>>0;return $0().set(e,n/1),t2=e.length,n}function i3t(e,t){let n=t(e.length*4,4)>>>0;for(let t=0;t<e.length;t++){let r=Z4t(e[t]);a2().setUint32(n+4*t,r,!0)}return t2=e.length,n}function a3t(e,t){let n=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),r=t2,i=r3t(t,K.__wbindgen_malloc_command_export),a=t2;return K.register_font(n,r,i,a)!==0}var s2=Object.freeze({Forward:0,0:`Forward`,Reverse:1,1:`Reverse`,Bounce:2,2:`Bounce`,ReverseBounce:3,3:`ReverseBounce`}),o3t=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>K.__wbg_dotlottieplayerwasm_free(e>>>0,1)),s3t=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,o3t.unregister(this),e}free(){let e=this.__destroy_into_raw();K.__wbg_dotlottieplayerwasm_free(e,0)}clear_slot(e){let t=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),n=t2;return K.dotlottieplayerwasm_clear_slot(this.__wbg_ptr,t,n)!==0}is_playing(){return K.dotlottieplayerwasm_is_playing(this.__wbg_ptr)!==0}is_stopped(){return K.dotlottieplayerwasm_is_stopped(this.__wbg_ptr)!==0}layout_fit(){let e,t;try{let n=K.dotlottieplayerwasm_layout_fit(this.__wbg_ptr);return e=n[0],t=n[1],e2(n[0],n[1])}finally{K.__wbindgen_free_command_export(e,t,1)}}loop_count(){return K.dotlottieplayerwasm_loop_count(this.__wbg_ptr)>>>0}poll_event(){return K.dotlottieplayerwasm_poll_event(this.__wbg_ptr)}reset_slot(e){let t=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),n=t2;return K.dotlottieplayerwasm_reset_slot(this.__wbg_ptr,t,n)!==0}set_layout(e,t,n){let r=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),i=t2;return K.dotlottieplayerwasm_set_layout(this.__wbg_ptr,r,i,t,n)!==0}set_marker(e){let t=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),n=t2;K.dotlottieplayerwasm_set_marker(this.__wbg_ptr,t,n)}clear_slots(){return K.dotlottieplayerwasm_clear_slots(this.__wbg_ptr)!==0}has_segment(){return K.dotlottieplayerwasm_has_segment(this.__wbg_ptr)!==0}is_complete(){return K.dotlottieplayerwasm_is_complete(this.__wbg_ptr)!==0}is_tweening(){return K.dotlottieplayerwasm_is_tweening(this.__wbg_ptr)!==0}reset_slots(){return K.dotlottieplayerwasm_reset_slots(this.__wbg_ptr)!==0}reset_theme(){return K.dotlottieplayerwasm_reset_theme(this.__wbg_ptr)!==0}segment_end(){return K.dotlottieplayerwasm_segment_end(this.__wbg_ptr)}set_quality(e){return K.dotlottieplayerwasm_set_quality(this.__wbg_ptr,e)!==0}set_segment(e,t){return K.dotlottieplayerwasm_set_segment(this.__wbg_ptr,e,t)!==0}static unload_font(e){let t=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),n=t2;return K.dotlottieplayerwasm_unload_font(t,n)!==0}animation_id(){let e=K.dotlottieplayerwasm_animation_id(this.__wbg_ptr),t;return e[0]!==0&&(t=e2(e[0],e[1]).slice(),K.__wbindgen_free_command_export(e[0],e[1]*1,1)),t}clear_marker(){K.dotlottieplayerwasm_clear_marker(this.__wbg_ptr)}emit_on_loop(){K.dotlottieplayerwasm_emit_on_loop(this.__wbg_ptr)}get_slot_ids(){return K.dotlottieplayerwasm_get_slot_ids(this.__wbg_ptr)}get_slot_str(e){let t=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),n=t2,r=K.dotlottieplayerwasm_get_slot_str(this.__wbg_ptr,t,n),i;return r[0]!==0&&(i=e2(r[0],r[1]).slice(),K.__wbindgen_free_command_export(r[0],r[1]*1,1)),i}marker_names(){return K.dotlottieplayerwasm_marker_names(this.__wbg_ptr)}set_autoplay(e){K.dotlottieplayerwasm_set_autoplay(this.__wbg_ptr,e)}set_slot_str(e,t){let n=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),r=t2,i=r2(t,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),a=t2;return K.dotlottieplayerwasm_set_slot_str(this.__wbg_ptr,n,r,i,a)!==0}set_viewport(e,t,n,r){return K.dotlottieplayerwasm_set_viewport(this.__wbg_ptr,e,t,n,r)!==0}total_frames(){return K.dotlottieplayerwasm_total_frames(this.__wbg_ptr)}clear_segment(){return K.dotlottieplayerwasm_clear_segment(this.__wbg_ptr)!==0}current_frame(){return K.dotlottieplayerwasm_current_frame(this.__wbg_ptr)}get_slot_type(e){let t=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),n=t2,r=K.dotlottieplayerwasm_get_slot_type(this.__wbg_ptr,t,n),i;return r[0]!==0&&(i=e2(r[0],r[1]).slice(),K.__wbindgen_free_command_export(r[0],r[1]*1,1)),i}get_slots_str(){let e,t;try{let n=K.dotlottieplayerwasm_get_slots_str(this.__wbg_ptr);return e=n[0],t=n[1],e2(n[0],n[1])}finally{K.__wbindgen_free_command_export(e,t,1)}}get_transform(){return K.dotlottieplayerwasm_get_transform(this.__wbg_ptr)}request_frame(){return K.dotlottieplayerwasm_request_frame(this.__wbg_ptr)}segment_start(){return K.dotlottieplayerwasm_segment_start(this.__wbg_ptr)}set_slots_str(e){let t=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),n=t2;return K.dotlottieplayerwasm_set_slots_str(this.__wbg_ptr,t,n)!==0}set_text_slot(e,t){let n=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),r=t2,i=r2(t,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),a=t2;return K.dotlottieplayerwasm_set_text_slot(this.__wbg_ptr,n,r,i,a)!==0}set_transform(e){let t=n3t(e,K.__wbindgen_malloc_command_export),n=t2;return K.dotlottieplayerwasm_set_transform(this.__wbg_ptr,t,n)!==0}sm_get_inputs(){return K.dotlottieplayerwasm_sm_get_inputs(this.__wbg_ptr)}sm_poll_event(){return K.dotlottieplayerwasm_sm_poll_event(this.__wbg_ptr)}sm_post_click(e,t){K.dotlottieplayerwasm_sm_post_click(this.__wbg_ptr,e,t)}animation_size(){return K.dotlottieplayerwasm_animation_size(this.__wbg_ptr)}current_marker(){let e=K.dotlottieplayerwasm_current_marker(this.__wbg_ptr),t;return e[0]!==0&&(t=e2(e[0],e[1]).slice(),K.__wbindgen_free_command_export(e[0],e[1]*1,1)),t}layout_align_x(){return K.dotlottieplayerwasm_layout_align_x(this.__wbg_ptr)}layout_align_y(){return K.dotlottieplayerwasm_layout_align_y(this.__wbg_ptr)}load_animation(e,t,n){let r=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),i=t2;return K.dotlottieplayerwasm_load_animation(this.__wbg_ptr,r,i,t,n)!==0}loop_animation(){return K.dotlottieplayerwasm_loop_animation(this.__wbg_ptr)!==0}set_color_slot(e,t,n,r){let i=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),a=t2;return K.dotlottieplayerwasm_set_color_slot(this.__wbg_ptr,i,a,t,n,r)!==0}set_loop_count(e){K.dotlottieplayerwasm_set_loop_count(this.__wbg_ptr,e)}set_theme_data(e){let t=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),n=t2;return K.dotlottieplayerwasm_set_theme_data(this.__wbg_ptr,t,n)!==0}sm_reset_input(e){let t=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),n=t2;K.dotlottieplayerwasm_sm_reset_input(this.__wbg_ptr,t,n)}manifest_string(){let e,t;try{let n=K.dotlottieplayerwasm_manifest_string(this.__wbg_ptr);return e=n[0],t=n[1],e2(n[0],n[1])}finally{K.__wbindgen_free_command_export(e,t,1)}}set_scalar_slot(e,t){let n=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),r=t2;return K.dotlottieplayerwasm_set_scalar_slot(this.__wbg_ptr,n,r,t)!==0}set_vector_slot(e,t,n){let r=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),i=t2;return K.dotlottieplayerwasm_set_vector_slot(this.__wbg_ptr,r,i,t,n)!==0}background_color(){return K.dotlottieplayerwasm_background_color(this.__wbg_ptr)>>>0}get_layer_bounds(e){let t=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),n=t2;return K.dotlottieplayerwasm_get_layer_bounds(this.__wbg_ptr,t,n)}get_pixel_buffer(){return K.dotlottieplayerwasm_get_pixel_buffer(this.__wbg_ptr)}segment_duration(){return K.dotlottieplayerwasm_segment_duration(this.__wbg_ptr)}sm_current_state(){let e,t;try{let n=K.dotlottieplayerwasm_sm_current_state(this.__wbg_ptr);return e=n[0],t=n[1],e2(n[0],n[1])}finally{K.__wbindgen_free_command_export(e,t,1)}}state_machine_id(){let e=K.dotlottieplayerwasm_state_machine_id(this.__wbg_ptr),t;return e[0]!==0&&(t=e2(e[0],e[1]).slice(),K.__wbindgen_free_command_export(e[0],e[1]*1,1)),t}get_state_machine(e){let t=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),n=t2,r=K.dotlottieplayerwasm_get_state_machine(this.__wbg_ptr,t,n),i;return r[0]!==0&&(i=e2(r[0],r[1]).slice(),K.__wbindgen_free_command_export(r[0],r[1]*1,1)),i}set_position_slot(e,t,n){let r=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),i=t2;return K.dotlottieplayerwasm_set_position_slot(this.__wbg_ptr,r,i,t,n)!==0}current_loop_count(){return K.dotlottieplayerwasm_current_loop_count(this.__wbg_ptr)>>>0}sm_framework_setup(){return K.dotlottieplayerwasm_sm_framework_setup(this.__wbg_ptr)}sm_post_pointer_up(e,t){K.dotlottieplayerwasm_sm_post_pointer_up(this.__wbg_ptr,e,t)}state_machine_load(e){let t=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),n=t2;return K.dotlottieplayerwasm_state_machine_load(this.__wbg_ptr,t,n)!==0}load_dotlottie_data(e,t,n){let r=r3t(e,K.__wbindgen_malloc_command_export),i=t2;return K.dotlottieplayerwasm_load_dotlottie_data(this.__wbg_ptr,r,i,t,n)!==0}sm_get_string_input(e){let t=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),n=t2,r=K.dotlottieplayerwasm_sm_get_string_input(this.__wbg_ptr,t,n),i;return r[0]!==0&&(i=e2(r[0],r[1]).slice(),K.__wbindgen_free_command_export(r[0],r[1]*1,1)),i}sm_set_string_input(e,t){let n=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),r=t2,i=r2(t,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),a=t2;return K.dotlottieplayerwasm_sm_set_string_input(this.__wbg_ptr,n,r,i,a)!==0}set_background_color(e){return K.dotlottieplayerwasm_set_background_color(this.__wbg_ptr,e)!==0}sm_get_boolean_input(e){let t=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),n=t2,r=K.dotlottieplayerwasm_sm_get_boolean_input(this.__wbg_ptr,t,n);return r===16777215?void 0:r!==0}sm_get_numeric_input(e){let t=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),n=t2,r=K.dotlottieplayerwasm_sm_get_numeric_input(this.__wbg_ptr,t,n);return r===4294967297?void 0:r}sm_post_pointer_down(e,t){K.dotlottieplayerwasm_sm_post_pointer_down(this.__wbg_ptr,e,t)}sm_post_pointer_exit(e,t){K.dotlottieplayerwasm_sm_post_pointer_exit(this.__wbg_ptr,e,t)}sm_post_pointer_move(e,t){K.dotlottieplayerwasm_sm_post_pointer_move(this.__wbg_ptr,e,t)}sm_set_boolean_input(e,t){let n=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),r=t2;return K.dotlottieplayerwasm_sm_set_boolean_input(this.__wbg_ptr,n,r,t)!==0}sm_set_numeric_input(e,t){let n=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),r=t2;return K.dotlottieplayerwasm_sm_set_numeric_input(this.__wbg_ptr,n,r,t)!==0}state_machine_unload(){K.dotlottieplayerwasm_state_machine_unload(this.__wbg_ptr)}sm_post_pointer_enter(e,t){K.dotlottieplayerwasm_sm_post_pointer_enter(this.__wbg_ptr,e,t)}clear_background_color(){return K.dotlottieplayerwasm_clear_background_color(this.__wbg_ptr)!==0}load_animation_from_id(e,t,n){let r=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),i=t2;return K.dotlottieplayerwasm_load_animation_from_id(this.__wbg_ptr,r,i,t,n)!==0}sm_poll_internal_event(){return K.dotlottieplayerwasm_sm_poll_internal_event(this.__wbg_ptr)}use_frame_interpolation(){return K.dotlottieplayerwasm_use_frame_interpolation(this.__wbg_ptr)!==0}reset_current_loop_count(){K.dotlottieplayerwasm_reset_current_loop_count(this.__wbg_ptr)}sm_override_current_state(e,t){let n=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),r=t2;return K.dotlottieplayerwasm_sm_override_current_state(this.__wbg_ptr,n,r,t)!==0}state_machine_load_from_id(e){let t=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),n=t2;return K.dotlottieplayerwasm_state_machine_load_from_id(this.__wbg_ptr,t,n)!==0}set_use_frame_interpolation(e){K.dotlottieplayerwasm_set_use_frame_interpolation(this.__wbg_ptr,e)}constructor(){return this.__wbg_ptr=K.dotlottieplayerwasm_new()>>>0,o3t.register(this,this.__wbg_ptr,this),this}mode(){return K.dotlottieplayerwasm_mode(this.__wbg_ptr)}play(){return K.dotlottieplayerwasm_play(this.__wbg_ptr)!==0}seek(e){return K.dotlottieplayerwasm_seek(this.__wbg_ptr,e)!==0}stop(){return K.dotlottieplayerwasm_stop(this.__wbg_ptr)!==0}tick(){return K.dotlottieplayerwasm_tick(this.__wbg_ptr)!==0}clear(){K.dotlottieplayerwasm_clear(this.__wbg_ptr)}pause(){return K.dotlottieplayerwasm_pause(this.__wbg_ptr)!==0}speed(){return K.dotlottieplayerwasm_speed(this.__wbg_ptr)}width(){return K.dotlottieplayerwasm_width(this.__wbg_ptr)>>>0}height(){return K.dotlottieplayerwasm_height(this.__wbg_ptr)>>>0}render(){return K.dotlottieplayerwasm_render(this.__wbg_ptr)!==0}resize(e,t){return K.dotlottieplayerwasm_resize(this.__wbg_ptr,e,t)!==0}markers(){return K.dotlottieplayerwasm_markers(this.__wbg_ptr)}sm_fire(e){let t=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),n=t2;return K.dotlottieplayerwasm_sm_fire(this.__wbg_ptr,t,n)!==0}sm_stop(){return K.dotlottieplayerwasm_sm_stop(this.__wbg_ptr)!==0}sm_tick(){return K.dotlottieplayerwasm_sm_tick(this.__wbg_ptr)!==0}autoplay(){return K.dotlottieplayerwasm_autoplay(this.__wbg_ptr)!==0}duration(){return K.dotlottieplayerwasm_duration(this.__wbg_ptr)}set_loop(e){K.dotlottieplayerwasm_set_loop(this.__wbg_ptr,e)}set_mode(e){K.dotlottieplayerwasm_set_mode(this.__wbg_ptr,e)}sm_start(e,t){let n=i3t(t,K.__wbindgen_malloc_command_export),r=t2;return K.dotlottieplayerwasm_sm_start(this.__wbg_ptr,e,n,r)!==0}theme_id(){let e=K.dotlottieplayerwasm_theme_id(this.__wbg_ptr),t;return e[0]!==0&&(t=e2(e[0],e[1]).slice(),K.__wbindgen_free_command_export(e[0],e[1]*1,1)),t}intersect(e,t,n){let r=r2(n,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),i=t2;return K.dotlottieplayerwasm_intersect(this.__wbg_ptr,e,t,r,i)!==0}is_loaded(){return K.dotlottieplayerwasm_is_loaded(this.__wbg_ptr)!==0}is_paused(){return K.dotlottieplayerwasm_is_paused(this.__wbg_ptr)!==0}load_font(e,t){let n=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),r=t2,i=r3t(t,K.__wbindgen_malloc_command_export),a=t2;return K.dotlottieplayerwasm_load_font(this.__wbg_ptr,n,r,i,a)!==0}set_frame(e){return K.dotlottieplayerwasm_set_frame(this.__wbg_ptr,e)!==0}set_speed(e){K.dotlottieplayerwasm_set_speed(this.__wbg_ptr,e)}set_theme(e){let t=r2(e,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),n=t2;return K.dotlottieplayerwasm_set_theme(this.__wbg_ptr,t,n)!==0}sm_status(){let e,t;try{let n=K.dotlottieplayerwasm_sm_status(this.__wbg_ptr);return e=n[0],t=n[1],e2(n[0],n[1])}finally{K.__wbindgen_free_command_export(e,t,1)}}};async function c3t(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 l3t(){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(e2(e,t))}finally{K.__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 Q4t(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=r2(n,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),i=t2;a2().setInt32(e+4,i,!0),a2().setInt32(e+0,r,!0)},e.wbg.__wbindgen_init_externref_table=function(){let e=K.__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 K.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=e3t(r)?0:r2(r,K.__wbindgen_malloc_command_export,K.__wbindgen_realloc_command_export),a=t2;a2().setInt32(e+4,a,!0),a2().setInt32(e+0,i,!0)},e.wbg.__wbindgen_string_new=function(e,t){return e2(e,t)},e.wbg.__wbindgen_throw=function(e,t){throw Error(e2(e,t))},e}function u3t(e,t){return K=e.exports,d3t.__wbindgen_wasm_module=t,i2=null,o2=null,Q0=null,K.__wbindgen_start(),K}async function d3t(e){if(K!==void 0)return K;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=l3t();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await c3t(await e,t);return u3t(n,r)}var f3t=class{constructor(){X0(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()}},c2=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)}};X0(c2,`_observer`,null),X0(c2,`_observedCanvases`,new Map);var l2=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)}};X0(l2,`_observer`,null),X0(l2,`_observedCanvases`,new Map);function p3t(e){return/^#([\da-f]{6}|[\da-f]{8})$/iu.test(e)}function m3t(e){if(!p3t(e))return 0;let t=e.replace(`#`,``);return t=t.length===6?`${t}ff`:t,parseInt(t,16)}function h3t(e){if(e.byteLength<4)return!1;let t=new Uint8Array(e.slice(0,K4t.byteLength));for(let e=0;e<K4t.length;e+=1)if(K4t[e]!==t[e])return!1;return!0}function g3t(e){return q4t.every(t=>Object.hasOwn(e,t))}function _3t(e){if(typeof e==`string`)try{return g3t(JSON.parse(e))}catch{return!1}else return g3t(e)}function u2(){return 1+((Z0?window.devicePixelRatio:1)-1)*.75}function d2(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 f2(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 v3t(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 y3t(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 b3t=y3t(d3t,`https://cdn.jsdelivr.net/npm/${Y4t}@${J4t}/dist/dotlottie-player.wasm`,`https://unpkg.com/${Y4t}@${J4t}/dist/dotlottie-player.wasm`),x3t=e=>{switch(e){case`reverse`:return s2.Reverse;case`bounce`:return s2.Bounce;case`reverse-bounce`:return s2.ReverseBounce;default:return s2.Forward}},S3t=e=>{switch(e){case s2.Reverse:return`reverse`;case s2.Bounce:return`bounce`;case s2.ReverseBounce:return`reverse-bounce`;default:return`forward`}},C3t=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`}},w3t=class{constructor(e){X0(this,`_canvas`,null),X0(this,`_pendingLoad`,null),X0(this,`_context`,null),X0(this,`_eventManager`,void 0),X0(this,`_animationFrameId`,null),X0(this,`_frameManager`,void 0),X0(this,`_dotLottieCore`,null),X0(this,`_stateMachineId`,``),X0(this,`_stateMachineConfig`,null),X0(this,`_isStateMachineRunning`,!1),X0(this,`_renderConfig`,{}),X0(this,`_isFrozen`,!1),X0(this,`_backgroundColor`,null),X0(this,`_boundOnClick`,null),X0(this,`_boundOnPointerUp`,null),X0(this,`_boundOnPointerDown`,null),X0(this,`_boundOnPointerMove`,null),X0(this,`_boundOnPointerEnter`,null),X0(this,`_boundOnPointerLeave`,null),X0(this,`_bufferMismatchCount`,0),X0(this,`_lastExpectedBufferSize`,0),X0(this,`_marker`,``),this._canvas=e.canvas??null,this._eventManager=new f3t,this._frameManager=new G4t,this._renderConfig={...e.renderConfig,devicePixelRatio:e.renderConfig?.devicePixelRatio||u2(),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(x3t(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 b3t.load()}_createCore(){return new s3t}_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??``;Z0&&t.startsWith(`OpenUrl: `)?v3t(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 h3t(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(!_3t(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(!h3t(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(!_3t(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: ${C1(e)}`),!0;return!1}function nQt(e,t){return t?.length?aZt(e).some(e=>
|
|
|
877
877
|
`,`\r`],!1,!1),se=we([`+`,`-`],!1,!1),P=we([[`0`,`9`]],!1,!1),F=Ce(`.`,!1),ce=Ce(`e`,!1),le=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},ue=function(e,t,n,r,i,a,o,s,c){return{matrix:[e,t,n,r,i,a,o,s,c]}},de=function(e,t){return t==null?{translate:e}:{translate:[e,t]}},fe=function(e,t){return t==null?{scale:e}:[{scaleX:e},{scaleY:t}]},pe=function(e,t){return t===null?[{rotate:`${e}deg`}]:{rotate:`${e}deg`}},me=function(e,t){return[e,t]},he=function(e){return[{skewX:`${e}deg`}]},I=function(e){return[{skewY:`${e}deg`}]},ge=function(){return parseFloat(Se())},L=t.peg$currPos|0,_e=L,ve=[{line:1,column:1}],ye=L,be=t.peg$maxFailExpected||[],R=t.peg$silentFails|0,xe;if(t.startRule){if(!(t.startRule in a))throw Error(`Can't start parsing from rule "`+t.startRule+`".`);o=a[t.startRule]}function Se(){return e.substring(_e,L)}function Ce(e,t){return{type:`literal`,text:e,ignoreCase:t}}function we(e,t,n){return{type:`class`,parts:e,inverted:t,ignoreCase:n}}function Te(){return{type:`end`}}function Ee(e){return{type:`other`,description:e}}function De(t){var n=ve[t],r;if(n)return n;if(t>=ve.length)r=ve.length-1;else for(r=t;!ve[--r];);for(n=ve[r],n={line:n.line,column:n.column};r<t;)e.charCodeAt(r)===10?(n.line++,n.column=1):n.column++,r++;return ve[t]=n,n}function Oe(e,t,n){var r=De(e),a=De(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 ke(e){L<ye||(L>ye&&(ye=L,be=[]),be.push(e))}function Ae(e,t,n){return new r(r.buildMessage(e,t),e,t,n)}function je(){var e;return R++,e=Me(),R--,e===n&&R===0&&ke(b),e}function Me(){var e,t,r,i,a,o;if(R++,e=L,t=Ne(),t!==n){for(r=[],i=L,a=He(),o=Ne(),o===n?(L=i,i=n):(a=[a,o],i=a);i!==n;)r.push(i),i=L,a=He(),o=Ne(),o===n?(L=i,i=n):(a=[a,o],i=a);_e=e,e=le(t,r)}else L=e,e=n;return R--,e===n&&(t=n,R===0&&ke(x)),e}function Ne(){var e;return R++,e=Pe(),e===n&&(e=Fe(),e===n&&(e=Ie(),e===n&&(e=Le(),e===n&&(e=ze(),e===n&&(e=Be()))))),R--,e===n&&R===0&&ke(S),e}function Pe(){var t,r,i,a,o,l,u,d,f,p,m,h;return R++,t=L,He(),e.substr(L,7)===s?(r=s,L+=7):(r=n,R===0&&ke(w)),r===n?(L=t,t=n):(He(),i=Ue(),i===n?(L=t,t=n):(Ve(),a=Ue(),a===n?(L=t,t=n):(Ve(),o=Ue(),o===n?(L=t,t=n):(Ve(),l=Ue(),l===n?(L=t,t=n):(Ve(),u=Ue(),u===n?(L=t,t=n):(Ve(),d=Ue(),d===n?(L=t,t=n):(Ve(),f=Ue(),f===n?(L=t,t=n):(Ve(),p=Ue(),p===n?(L=t,t=n):(Ve(),m=Ue(),m===n?(L=t,t=n):(He(),e.charCodeAt(L)===41?(h=c,L++):(h=n,R===0&&ke(T)),h===n?(L=t,t=n):(He(),_e=t,t=ue(i,a,o,l,u,d,f,p,m)))))))))))),R--,t===n&&R===0&&ke(C),t}function Fe(){var t,r,i,a,o;return R++,t=L,He(),e.substr(L,10)===l?(r=l,L+=10):(r=n,R===0&&ke(D)),r===n?(L=t,t=n):(He(),i=Ue(),i===n?(L=t,t=n):(Ve(),a=Ue(),a===n&&(a=null),He(),e.charCodeAt(L)===41?(o=c,L++):(o=n,R===0&&ke(T)),o===n?(L=t,t=n):(He(),_e=t,t=de(i,a)))),R--,t===n&&R===0&&ke(E),t}function Ie(){var t,r,i,a,o;return R++,t=L,He(),e.substr(L,6)===u?(r=u,L+=6):(r=n,R===0&&ke(k)),r===n?(L=t,t=n):(He(),i=Ue(),i===n?(L=t,t=n):(Ve(),a=Ue(),a===n&&(a=null),He(),e.charCodeAt(L)===41?(o=c,L++):(o=n,R===0&&ke(T)),o===n?(L=t,t=n):(He(),_e=t,t=fe(i,a)))),R--,t===n&&R===0&&ke(O),t}function Le(){var t,r,i,a,o;return R++,t=L,He(),e.substr(L,7)===d?(r=d,L+=7):(r=n,R===0&&ke(ee)),r===n?(L=t,t=n):(He(),i=Ue(),i===n?(L=t,t=n):(a=Re(),a===n&&(a=null),He(),e.charCodeAt(L)===41?(o=c,L++):(o=n,R===0&&ke(T)),o===n?(L=t,t=n):(He(),_e=t,t=pe(i,a)))),R--,t===n&&R===0&&ke(A),t}function Re(){var e,t,r;return R++,e=L,Ve(),t=Ue(),t===n?(L=e,e=n):(Ve(),r=Ue(),r===n?(L=e,e=n):(_e=e,e=me(t,r))),R--,e===n&&R===0&&ke(te),e}function ze(){var t,r,i,a;return R++,t=L,He(),e.substr(L,6)===f?(r=f,L+=6):(r=n,R===0&&ke(re)),r===n?(L=t,t=n):(He(),i=Ue(),i===n?(L=t,t=n):(He(),e.charCodeAt(L)===41?(a=c,L++):(a=n,R===0&&ke(T)),a===n?(L=t,t=n):(He(),_e=t,t=he(i)))),R--,t===n&&R===0&&ke(ne),t}function Be(){var t,r,i,a;return R++,t=L,He(),e.substr(L,6)===p?(r=p,L+=6):(r=n,R===0&&ke(j)),r===n?(L=t,t=n):(He(),i=Ue(),i===n?(L=t,t=n):(He(),e.charCodeAt(L)===41?(a=c,L++):(a=n,R===0&&ke(T)),a===n?(L=t,t=n):(He(),_e=t,t=I(i)))),R--,t===n&&R===0&&ke(ie),t}function Ve(){var t,r;for(R++,t=[],r=e.charAt(L),g.test(r)?L++:(r=n,R===0&&ke(ae));r!==n;)t.push(r),r=e.charAt(L),g.test(r)?L++:(r=n,R===0&&ke(ae));return R--,r=n,R===0&&ke(M),t}function He(){var t,r;for(R++,t=[],r=e.charAt(L),_.test(r)?L++:(r=n,R===0&&ke(N));r!==n;)t.push(r),r=e.charAt(L),_.test(r)?L++:(r=n,R===0&&ke(N));return R--,r=n,R===0&&ke(oe),t}function Ue(){var t=L,r=e.charAt(L),i,a,o,s,c,l;for(v.test(r)?L++:(r=n,R===0&&ke(se)),r===n&&(r=null),i=L,a=[],o=e.charAt(L),y.test(o)?L++:(o=n,R===0&&ke(P));o!==n;)a.push(o),o=e.charAt(L),y.test(o)?L++:(o=n,R===0&&ke(P));if(e.charCodeAt(L)===46?(o=m,L++):(o=n,R===0&&ke(F)),o!==n){if(s=[],c=e.charAt(L),y.test(c)?L++:(c=n,R===0&&ke(P)),c!==n)for(;c!==n;)s.push(c),c=e.charAt(L),y.test(c)?L++:(c=n,R===0&&ke(P));else s=n;s===n?(L=i,i=n):(a=[a,o,s],i=a)}else L=i,i=n;if(i===n)if(i=[],a=e.charAt(L),y.test(a)?L++:(a=n,R===0&&ke(P)),a!==n)for(;a!==n;)i.push(a),a=e.charAt(L),y.test(a)?L++:(a=n,R===0&&ke(P));else i=n;if(i!==n){if(a=L,e.charCodeAt(L)===101?(o=h,L++):(o=n,R===0&&ke(ce)),o!==n){if(s=e.charAt(L),v.test(s)?L++:(s=n,R===0&&ke(se)),s===n&&(s=null),c=[],l=e.charAt(L),y.test(l)?L++:(l=n,R===0&&ke(P)),l!==n)for(;l!==n;)c.push(l),l=e.charAt(L),y.test(l)?L++:(l=n,R===0&&ke(P));else c=n;c===n?(L=a,a=n):(o=[o,s,c],a=o)}else L=a,a=n;a===n&&(a=null),_e=t,t=ge()}else L=t,t=n;return t}if(xe=o(),t.peg$library)return{peg$result:xe,peg$currPos:L,peg$FAILED:n,peg$maxFailExpected:be,peg$maxFailPos:ye};if(xe!==n&&L===e.length)return xe;throw xe!==n&&L<e.length&&ke(Te()),Ae(be,ye<e.length?e.charAt(ye):null,ye<e.length?Oe(ye,ye+1):Oe(ye,ye))}t.exports={StartRules:[`start`],SyntaxError:r,parse:a}}));function h8t(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,g8t=o((()=>{f8t(),p8t(),m8t(),v4=e=>{if(e.endsWith(`rad`))return 180/Math.PI*parseFloat(e);if(e.endsWith(`deg`))return parseFloat(e)}}));function _8t(e,t){let n=[];if(t&&n.push(...v8t(t)),Array.isArray(e))if(typeof e[0]==`number`)n.push(`matrix(${e.join(` `)})`);else{let t=h8t(e).split(` `);n.push(...t)}else typeof e==`string`&&n.push(e);return n.length?n.join(` `):void 0}function v8t(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 y8t=o((()=>{g8t()}));function b8t(e,t){return e?z?[e,t]:e[Symbol.iterator]?Object.assign({},...e,t):Object.assign({},e,t):t}var x8t=o((()=>{H()})),S8t=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 C8t(e){let t={};if(typeof e==`number`){let n=(0,w8t.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=Lu.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(T8t);if(e){let[,n,r]=e;return t.uri=`${n}${encodeURIComponent(r)}`,t}}return t}var w8t,T8t,E8t=o((()=>{H(),w8t=S8t(),T8t=/^(data:image\/svg\+xml;utf8,)(.*)/})),D8t,O8t=o((()=>{d8t(),y8t(),x8t(),E8t(),D8t=(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={...u8t(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 _=_8t(n,t);_&&(g.transform=_);let v=_8t(f);v&&(g.gradientTransform=v);let y=_8t(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=b8t(u,b),m!==null&&(g.onClick=t.onPress),t.href!==null&&t.href!==void 0&&(g.href=C8t(t.href)?.uri),g}}));function k8t(e){return`rgba(${e>>16&255},${e>>8&255},${e&255},${((e>>24&255)/255).toFixed(2)})`}var A8t=o((()=>{})),j8t,M8t,N8t,P8t,F8t,I8t,L8t,R8t,z8t,B8t,y4,V8t,H8t,U8t,W8t=o((()=>{H(),j8t={top:20,left:20,right:20,bottom:30},{Mixin:M8t}=qp,{touchableHandleStartShouldSetResponder:N8t,touchableHandleResponderTerminationRequest:P8t,touchableHandleResponderGrant:F8t,touchableHandleResponderMove:I8t,touchableHandleResponderRelease:L8t,touchableHandleResponderTerminate:R8t,touchableGetInitialState:z8t}=M8t,B8t={...M8t,touchableHandleStartShouldSetResponder(e){let{onStartShouldSetResponder:t}=this.props;return t?t(e):N8t.call(this,e)},touchableHandleResponderTerminationRequest(e){let{onResponderTerminationRequest:t}=this.props;return t?t(e):P8t.call(this,e)},touchableHandleResponderGrant(e){let{onResponderGrant:t}=this.props;return t?t(e):F8t.call(this,e)},touchableHandleResponderMove(e){let{onResponderMove:t}=this.props;return t?t(e):I8t.call(this,e)},touchableHandleResponderRelease(e){let{onResponderRelease:t}=this.props;return t?t(e):L8t.call(this,e)},touchableHandleResponderTerminate(e){let{onResponderTerminate:t}=this.props;return t?t(e):R8t.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||j8t},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(B8t),V8t=y4.map(e=>B8t[e]),H8t=y4.length,U8t=e=>{for(let t=0;t<H8t;t++){let n=y4[t],r=V8t[t];typeof r==`function`?e[n]=r.bind(e):e[n]=r}e.state=z8t()}})),G8t,b4,K8t=o((()=>{G8t=u(p()),H(),O8t(),A8t(),l8t(),d8t(),W8t(),b4=class extends G8t.Component{prepareProps(e){return e}elementRef=G8t.createRef();lastMergedProps={};setNativeProps(e){let t=Object.assign({},this.props,this.lastMergedProps,e.style);this.lastMergedProps=t;let n=D8t(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`,k8t(e.payload))}break;case`stroke`:if(t&&typeof t==`object`){let e=t;r.setAttribute(`stroke`,k8t(e.payload))}break;default:r.setAttribute(c8t(e),t);break}}}constructor(e){super(e),u8t(e)&&U8t(this),this._remeasureMetricsOnActivation=r8t.bind(this)}render(){if(!this.tag)throw Error("When extending `WebShape` you need to overwrite either `tag` or `render`!");return this.lastMergedProps={},Yr(this.tag,D8t(this,this.prepareProps(this.props)))}}})),x4,q8t,S4,J8t,Y8t,X8t,Z8t,Q8t,$8t,e5t,t5t,n5t,r5t,i5t,a5t,o5t,s5t,c5t,l5t,u5t,d5t,f5t,p5t,m5t,h5t,g5t,_5t,v5t,y5t,b5t,x5t,S5t,C5t,w5t,C4,T5t,E5t,w4,D5t,O5t,k5t,A5t,j5t,T4,E4,M5t,N5t,D4,P5t,F5t,I5t=o((()=>{l8t(),K8t(),x4=class extends b4{tag=`circle`},q8t=class extends b4{tag=`clipPath`},S4=class extends b4{tag=`defs`},J8t=class extends b4{tag=`ellipse`},Y8t=class extends b4{tag=`feBlend`},X8t=class extends b4{tag=`feColorMatrix`},Z8t=class extends b4{tag=`feComponentTransfer`},Q8t=class extends b4{tag=`feComposite`},$8t=class extends b4{tag=`feConvolveMatrix`},e5t=class extends b4{tag=`feDiffuseLighting`},t5t=class extends b4{tag=`feDisplacementMap`},n5t=class extends b4{tag=`feDistantLight`},r5t=class extends b4{tag=`feDropShadow`},i5t=class extends b4{tag=`feFlood`},a5t=class extends b4{tag=`feFuncA`},o5t=class extends b4{tag=`feFuncB`},s5t=class extends b4{tag=`feFuncG`},c5t=class extends b4{tag=`feFuncR`},l5t=class extends b4{tag=`feGaussianBlur`},u5t=class extends b4{tag=`feImage`},d5t=class extends b4{tag=`feMerge`},f5t=class extends b4{tag=`feMergeNode`},p5t=class extends b4{tag=`feMorphology`},m5t=class extends b4{tag=`feOffset`},h5t=class extends b4{tag=`fePointLight`},g5t=class extends b4{tag=`feSpecularLighting`},_5t=class extends b4{tag=`feSpotLight`},v5t=class extends b4{tag=`feTile`},y5t=class extends b4{tag=`feTurbulence`},b5t=class extends b4{tag=`filter`},x5t=class extends b4{tag=`foreignObject`},S5t=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}},C5t=class extends b4{tag=`image`},w5t=class extends b4{tag=`line`},C4=class extends b4{tag=`linearGradient`},T5t=class extends b4{tag=`marker`},E5t=class extends b4{tag=`mask`},w4=class extends b4{tag=`path`},D5t=class extends b4{tag=`pattern`},O5t=class extends b4{tag=`polygon`},k5t=class extends b4{tag=`polyline`},A5t=class extends b4{tag=`radialGradient`},j5t=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,${i8t(new window.XMLSerializer().serializeToString(o))}`}},M5t=class extends b4{tag=`symbol`},N5t=class extends b4{tag=`tspan`},D4=class extends b4{tag=`text`},P5t=class extends b4{tag=`textPath`},F5t=class extends b4{tag=`use`}})),L5t,R5t=o((()=>{I5t(),L5t={circle:x4,clipPath:q8t,defs:S4,ellipse:J8t,filter:b5t,feBlend:Y8t,feColorMatrix:X8t,feComponentTransfer:Z8t,feComposite:Q8t,feConvolveMatrix:$8t,feDiffuseLighting:e5t,feDisplacementMap:t5t,feDistantLight:n5t,feDropShadow:r5t,feFlood:i5t,feGaussianBlur:l5t,feImage:u5t,feMerge:d5t,feMergeNode:f5t,feMorphology:p5t,feOffset:m5t,fePointLight:h5t,feSpecularLighting:g5t,feSpotLight:_5t,feTile:v5t,feTurbulence:y5t,foreignObject:x5t,g:S5t,image:C5t,line:w5t,linearGradient:C4,marker:T5t,mask:E5t,path:w4,pattern:D5t,polygon:O5t,polyline:k5t,radialGradient:A5t,rect:j5t,stop:T4,svg:E4,symbol:M5t,text:D4,textPath:P5t,tspan:N5t,use:F5t}}));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 z5t(){return null}function B5t({ast:e,override:t}){if(!e)return null;let{props:n,children:r}=e,i=L5t.svg;return k4.createElement(i,O4({},n,t),r)}function V5t(e){let{onError:t=j4,xml:n,override:r,fallback:i}=e;try{let t=(0,A4.useMemo)(()=>n===null?null:q5t(n),[n]);return k4.createElement(B5t,{ast:t,override:r||e})}catch(e){return t(e),i??null}}function H5t(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?Q6t(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(V5t,{xml:a,override:e,fallback:i})}function U5t(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 W5t(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(W5t))}return e}function G5t(e,t){let n=``;for(;t--;)n+=e;return n}function K5t(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+/,Z5t),s=/(^|\n).*$/.exec(o),c=s&&s[0]||``,l=e.slice(t),u=/.*(\n|$)/.exec(l),d=`${c}${u&&u[0]}\n${G5t(` `,c.length)}^`;return{line:a,column:i,snippet:d}}function q5t(e,t){let n=e.length,r=null,i=l,a=null,o,s=[];function c(t){let{line:n,column:r,snippet:i}=K5t(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]!==`<`||!(Q5t.test(e[S+1])||$5t.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:L5t[n]||z5t};r?a.push(l):o=l,_(i);let{style:d}=i;typeof d==`string`&&(l.styles=d,i.style=U5t(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&&Q5t.test(r=e[S]);)t+=r,S+=1;return t}function _(t){for(;S<n;){if(!e7t.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 t7t.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&&e7t.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(W5t),r=e;return r.children=n,r}return null}var k4,A4,j4,J5t,Y5t,X5t,M4,Z5t,Q5t,$5t,e7t,t7t,n7t=o((()=>{k4=u(p()),A4=u(p()),n8t(),R5t(),j4=console.error.bind(console),J5t=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?q5t(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(B5t,{ast:t,override:e.override||e})}},Y5t=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 Q6t(e):null})}catch(e){console.error(e)}}render(){let{props:e,state:{xml:t}}=this;return k4.createElement(J5t,{xml:t,override:e,onError:e.onError})}},X5t=(e,t)=>t.toUpperCase(),M4=e=>e.replace(/[:-]([a-z])/g,X5t),Z5t=e=>G5t(` `,e.length),Q5t=/[a-zA-Z0-9:_-]/,$5t=/<!--/,e7t=/[\s\t\r\n]/,t7t=/['"]/}));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 r7t(){N4(`SvgCss`,`component`)}function i7t(){N4(`SvgCssUri`,`component`)}function a7t(){N4(`SvgWithCss`,`component`)}function o7t(){N4(`SvgWithCssUri`,`component`)}function s7t(){N4(`inlineStyles`,`function`)}function c7t(){N4(`LocalSvg`,`component`)}function l7t(){N4(`WithLocalSvg`,`component`)}function u7t(){N4(`loadLocalRawResource`,`function`)}var d7t=o((()=>{})),f7t=o((()=>{})),p7t=o((()=>{n7t(),n8t(),d7t(),f7t(),I5t(),I5t()})),P4=c({Circle:()=>x4,ClipPath:()=>q8t,Defs:()=>S4,Ellipse:()=>J8t,FeBlend:()=>Y8t,FeColorMatrix:()=>X8t,FeComponentTransfer:()=>Z8t,FeComposite:()=>Q8t,FeConvolveMatrix:()=>$8t,FeDiffuseLighting:()=>e5t,FeDisplacementMap:()=>t5t,FeDistantLight:()=>n5t,FeDropShadow:()=>r5t,FeFlood:()=>i5t,FeFuncA:()=>a5t,FeFuncB:()=>o5t,FeFuncG:()=>s5t,FeFuncR:()=>c5t,FeGaussianBlur:()=>l5t,FeImage:()=>u5t,FeMerge:()=>d5t,FeMergeNode:()=>f5t,FeMorphology:()=>p5t,FeOffset:()=>m5t,FePointLight:()=>h5t,FeSpecularLighting:()=>g5t,FeSpotLight:()=>_5t,FeTile:()=>v5t,FeTurbulence:()=>y5t,Filter:()=>b5t,ForeignObject:()=>x5t,G:()=>S5t,Image:()=>C5t,Line:()=>w5t,LinearGradient:()=>C4,LocalSvg:()=>c7t,Marker:()=>T5t,Mask:()=>E5t,Path:()=>w4,Pattern:()=>D5t,Polygon:()=>O5t,Polyline:()=>k5t,RadialGradient:()=>A5t,Rect:()=>j5t,Stop:()=>T4,Svg:()=>E4,SvgAst:()=>B5t,SvgCss:()=>r7t,SvgCssUri:()=>i7t,SvgFromUri:()=>Y5t,SvgFromXml:()=>J5t,SvgUri:()=>H5t,SvgWithCss:()=>a7t,SvgWithCssUri:()=>o7t,SvgXml:()=>V5t,Symbol:()=>M5t,TSpan:()=>N5t,Text:()=>D4,TextPath:()=>P5t,Use:()=>F5t,WithLocalSvg:()=>l7t,camelCase:()=>M4,default:()=>E4,fetchText:()=>Q6t,inlineStyles:()=>s7t,loadLocalRawResource:()=>u7t,parse:()=>q5t}),F4=o((()=>{p7t(),p7t()})),Z=D2();F4(),H();function Q(e){let{COLORS:t}=Y();return(0,G.jsx)(gd,{maxFontSizeMultiplier:S2.s3,...e,style:[m7t.text,{color:t.labelPrimary},e.style],children:e.children})}var m7t=z.create({text:{...X.Poppins.regular_Base}});H();var h7t={[x2.PoppinsBold]:`700`,[x2.PoppinsSemiBold]:`600`,[x2.PoppinsMedium]:`500`,[x2.PoppinsRegular]:`400`},g7t=12,_7t=({text:e,font:t,gradientId:n,italic:r=!1,style:i})=>{let[a,o]=(0,U.useState)(0),s=h7t[t.fontFamily]??`400`,c=Math.round((t.lineHeight-t.fontSize)/2+t.fontSize*.8),l=r?Math.ceil(t.fontSize*Math.tan(g7t*Math.PI/180)):0,u=Math.ceil(t.fontSize*.15);return(0,G.jsxs)(V,{style:[v7t.gradientText,{height:t.lineHeight},i],children:[(0,G.jsx)(Q,{numberOfLines:1,onLayout:e=>o(e.nativeEvent.layout.width),style:[{fontFamily:t.fontFamily,fontWeight:s,fontSize:t.fontSize,lineHeight:t.lineHeight},v7t.gradientMeasure],children:e}),a>0&&(0,G.jsxs)(E4,{transform:[{translateX:0},{translateY:-t.lineHeight}],width:a+l*2+u,height:t.lineHeight,children:[(0,G.jsx)(S4,{children:(0,G.jsxs)(C4,{id:n,x1:`0`,y1:`0`,x2:`1`,y2:`0`,children:[(0,G.jsx)(T4,{offset:`0`,stopColor:v2[0]}),(0,G.jsx)(T4,{offset:`1`,stopColor:v2[1]})]})}),(0,G.jsx)(D4,{x:l,y:c,fontFamily:t.fontFamily,fontWeight:s,fontSize:t.fontSize,fill:`url(#${n})`,transform:r?`skewX(-${g7t})`:void 0,children:e})]})]})},v7t=z.create({gradientText:{alignSelf:`flex-start`},gradientMeasure:{alignSelf:`flex-start`,opacity:0}});H();var y7t=Tq?{outlineStyle:`none`}:{},b7t=Tq?{onClick:e=>e.stopPropagation()}:{},x7t=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}=Y(),s=(0,U.useCallback)(e=>{n(x7t(e))},[n]),c=(0,U.useCallback)(()=>{r?.(!0)},[r]),l=(0,U.useCallback)(()=>{r?.(!1)},[r]);return(0,G.jsx)(Ip,{cursorColor:o.iconBrand,placeholder:`-`,placeholderTextColor:o.labelSecondary,maxLength:3,inputMode:`numeric`,enterKeyHint:`done`,ref:e,maxFontSizeMultiplier:S2.s3,style:[t,{includeFontPadding:!1},y7t],onFocus:c,onBlur:l,autoCorrect:!1,autoFocus:i??r!==void 0,...b7t,...a,onChangeText:s})};H();var S7t=110,C7t=38,w7t=Tq?{width:0}:null,T7t=({amount:e,onChangeAmount:t,unit:n,icon:r,carbs:i,autoFocus:a=!1,onFocusChange:o,testID:s})=>{let{t:c}=Sq(),{COLORS:l}=Y(),{fontScale:u}=$p(),[d,f]=(0,U.useState)(!1),p=(0,U.useRef)(null),m=Math.min(u,S2.s3),h=(0,U.useCallback)(()=>{d||p.current?.focus()},[d]),g=(0,U.useCallback)(e=>{f(e),o?.(e)},[o]);return(0,G.jsxs)(V,{style:[L4.amountColumn,{minWidth:S7t*m}],children:[(0,G.jsx)(Q,{style:[L4.amountLabel,{color:l.labelSecondary}],children:c(`foodAmountInputField_weight`)}),(0,G.jsxs)(Cp,{accessible:!1,onPress:h,style:[L4.inputBox,{height:Math.round(C7t*m),backgroundColor:l.bgVsInput,borderColor:d?l.borderInputFocus:l.border}],children:[r,(0,G.jsxs)(V,{style:L4.inputValue,children:[(0,G.jsx)(I4,{ref:p,value:e,onChangeText:t,onFocusChange:g,autoFocus:a,selectTextOnFocus:!0,style:[L4.input,w7t,{color:l.labelPrimary}],testID:`${s}-amount-input`}),(0,G.jsx)(Q,{style:[L4.inputUnit,{color:l.labelSecondary}],children:n})]})]}),(0,G.jsxs)(Q,{style:[L4.carbsResult,{color:l.labelSecondary}],children:[`= `,(0,G.jsx)(Q,{style:[L4.carbsResultValue,{color:l.labelPrimary}],children:e?i:``}),` `+c(`my_food_add_unit`)]})]})},L4=z.create({amountColumn:{gap:2},amountLabel:{...X.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:{...X.Poppins.medium_XL,lineHeight:B.select({ios:0,default:X.Poppins.medium_XL.lineHeight}),includeFontPadding:!1,flex:1,textAlign:`right`,paddingVertical:0},inputUnit:{...X.Poppins.regular_Base},carbsResult:{...X.Poppins.regular_SM,alignSelf:`stretch`,textAlign:`center`},carbsResultValue:{...X.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=(H(),d(em));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}));H();var z4=u(R4());KQ(),JY();var E7t=GQ.createAnimatedComponent(z4.default),D7t=1200;function O7t({children:e,isAnimated:t,onAnimationFinished:n,style:r}){let{COLORS:i}=Y(),{width:a}=$p(),o=lQ(-a),s=lQ(1),c=dQ(()=>({transform:[{translateX:o.value}]}),Tq?[o]:void 0),l=dQ(()=>({borderColor:MLt(s.value,[0,1],[i.borderInputFocus,i.bgTransparent])}),Tq?[i.bgTransparent,i.borderInputFocus,s]:void 0);return(0,U.useEffect)(()=>{t&&(o.value=-a,s.value=0,o.value=YX(a,{duration:D7t,easing:qX.linear},()=>{o.value=-a,XDt(n)}),s.value=YX(1,{duration:D7t,easing:qX.linear}))},[t,a,n,o,s]),(0,G.jsxs)(GQ.View,{style:[k7t.container,l,r],children:[e,(0,G.jsx)(E7t,{colors:[i.bgTransparent,i.paginationActive],start:{x:0,y:1},end:{x:1,y:1},style:[k7t.gradient,c]})]})}var k7t=z.create({container:{position:`relative`,overflow:`hidden`,borderRadius:16,borderWidth:1},gradient:{position:`absolute`,top:0,bottom:0,right:0,left:0,borderRadius:20}});KQ();var A7t={duration:70,easing:qX.inOut(qX.ease)},j7t=3,M7t=4;function B4({isAnimated:e,message:t,type:n=`error`,children:r}){let i=lQ(0),a=(0,U.useCallback)(()=>{i.value=BX(YX(j7t,A7t),yjt(YX(-3,A7t),M7t,!0),YX(0,A7t))},[i]);(0,U.useEffect)(()=>{e&&a()},[e,a]);let o=dQ(()=>({transform:[{translateX:i.value}]}),Tq?[i]:void 0);return(0,G.jsxs)(GQ.View,{style:o,children:[r,e&&!!t&&(0,G.jsx)(m3,{message:t,type:n})]})}H();function V4(e){let{COLORS:t}=Y();return(0,G.jsx)(V,{style:[N7t.backdropWrapper,{backgroundColor:t.bgTransparent}],children:(0,G.jsx)(rWt,{...e,disappearsOnIndex:-1,appearsOnIndex:0,pressBehavior:`none`})})}var N7t=z.create({backdropWrapper:{position:`absolute`,top:0,left:0,right:0,bottom:0}});H();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}=Y();return(0,G.jsxs)(Cp,{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,G.jsx)(V,{style:W4.leftIcon,children:o}),(0,G.jsx)(Q,{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,G.jsx)(V,{style:W4.rightIcon,children:s})]})}var W4=z.create({button:{paddingHorizontal:16,paddingVertical:12,borderRadius:16,flexDirection:`row`,alignItems:`center`,justifyContent:`center`},small:{paddingVertical:8},text:{...X.Poppins.semiBold_Base,textAlign:`center`},smallText:{...X.Poppins.semiBold_SM},leftIcon:{marginRight:8},rightIcon:{marginLeft:8}});H();function P7t(){let{COLORS:e}=Y(),t=Array.from({length:20},(e,t)=>`dot-${t}`);return(0,G.jsx)(V,{style:[F7t.container,{backgroundColor:e.bgTransparent}],children:t.map(t=>(0,G.jsx)(V,{testID:t,style:[F7t.line,{backgroundColor:e.divider}]},t))})}var F7t=z.create({container:{flexDirection:`row`,justifyContent:`space-between`,alignItems:`center`,width:`100%`},line:{width:8,height:1,borderRadius:4}});F4();var I7t=e=>{let{COLORS:t}=Y();return(0,G.jsxs)(E4,{width:20,height:20,viewBox:`0 0 20 20`,fill:`none`,...e,children:[(0,G.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,G.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 L7t=e=>{let{COLORS:t}=Y();return(0,G.jsx)(E4,{width:28,height:28,viewBox:`0 0 28 28`,fill:`none`,...e,children:(0,G.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 R7t(e){let{COLORS:t}=Y();return(0,G.jsxs)(E4,{width:23,height:20,viewBox:`0 0 23 20`,fill:`none`,...e,children:[(0,G.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,G.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,G.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,G.jsx)(S4,{children:(0,G.jsxs)(C4,{id:`paint0_linear_14232_28129`,x1:16.1406,y1:3.43043,x2:23.0014,y2:3.43043,gradientUnits:`userSpaceOnUse`,children:[(0,G.jsx)(T4,{stopColor:v2[0]}),(0,G.jsx)(T4,{offset:.490385,stopColor:v2[1]}),(0,G.jsx)(T4,{offset:1,stopColor:v2[2]})]})})]})}F4();var z7t=e=>{let{COLORS:t}=Y();return(0,G.jsxs)(E4,{width:`40`,height:`84`,viewBox:`0 0 40 84`,...e,children:[(0,G.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,G.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,G.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,G.jsx)(w4,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M38.5714 58.4286H1.42857V82H38.5714V58.4286ZM0 57V83.4286H40V57H0Z`,fill:t.labelPrimary}),(0,G.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,G.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}=Y();return(0,G.jsx)(E4,{width:16,height:16,viewBox:`0 0 16 16`,fill:`none`,...e,children:(0,G.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 B7t=e=>{let{COLORS:t}=Y();return(0,G.jsx)(E4,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,G.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 V7t=e=>{let{COLORS:t}=Y();return(0,G.jsx)(E4,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,G.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 H7t=e=>{let{COLORS:t}=Y();return(0,G.jsx)(E4,{width:28,height:28,viewBox:`0 0 28 28`,fill:`none`,...e,children:(0,G.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}=Y();return(0,G.jsx)(E4,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,G.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 U7t=e=>{let{COLORS:t}=Y();return(0,G.jsx)(E4,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,G.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 W7t=e=>{let{COLORS:t}=Y();return(0,G.jsx)(E4,{width:28,height:28,viewBox:`0 0 28 28`,fill:`none`,...e,children:(0,G.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 G7t=e=>{let{COLORS:t}=Y();return(0,G.jsx)(E4,{width:28,height:28,viewBox:`0 0 28 28`,fill:`none`,...e,children:(0,G.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 K7t=e=>{let{COLORS:t}=Y();return(0,G.jsx)(E4,{width:16,height:16,viewBox:`0 0 16 16`,fill:`none`,...e,children:(0,G.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 q7t=e=>{let{COLORS:t}=Y();return(0,G.jsxs)(E4,{width:48,height:48,viewBox:`0 0 48 48`,fill:`none`,...e,children:[(0,G.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,G.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,G.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,G.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,G.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 J7t=e=>{let{COLORS:t}=Y();return(0,G.jsxs)(E4,{width:24,height:24,viewBox:`0 0 28 28`,...e,children:[(0,G.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,G.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,G.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 Y7t=e=>{let{COLORS:t}=Y();return(0,G.jsxs)(E4,{width:96,height:96,viewBox:`0 0 96 96`,fill:`none`,...e,children:[(0,G.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,G.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,G.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,G.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,G.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,G.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 X7t=e=>{let{COLORS:t}=Y();return(0,G.jsx)(E4,{width:64,height:64,viewBox:`0 0 64 64`,fill:`none`,...e,children:(0,G.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 Z7t=e=>{let{COLORS:t}=Y();return(0,G.jsxs)(E4,{width:`40`,height:`29`,viewBox:`0 0 40 29`,...e,children:[(0,G.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,G.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,G.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 Q7t=e=>{let{COLORS:t}=Y();return(0,G.jsx)(E4,{width:`41`,height:`38`,viewBox:`0 0 41 38`,fill:e?.color,...e,children:(0,G.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 $7t=e=>{let{COLORS:t}=Y();return(0,G.jsx)(E4,{width:97,height:96,viewBox:`0 0 97 96`,fill:`none`,...e,children:(0,G.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 e9t(e){let{COLORS:t}=Y();return(0,G.jsxs)(E4,{width:e.width??16,height:e.height??16,viewBox:`0 0 20 20`,fill:`none`,...e,children:[(0,G.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,G.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 t9t(e){let{COLORS:t}=Y();return(0,G.jsxs)(E4,{width:20,height:20,viewBox:`0 0 20 20`,fill:`none`,...e,children:[(0,G.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,G.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,G.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,G.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 n9t=e=>{let{COLORS:t}=Y();return(0,G.jsx)(E4,{width:20,height:20,viewBox:`0 0 20 20`,fill:`none`,...e,children:(0,G.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 r9t=e=>{let{COLORS:t}=Y();return(0,G.jsx)(E4,{width:39,height:25,viewBox:`0 0 39 25`,fill:`none`,...e,children:(0,G.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 i9t=e=>{let{COLORS:t}=Y();return(0,G.jsxs)(E4,{width:`41`,height:`26`,viewBox:`0 0 41 26`,...e,children:[(0,G.jsx)(w4,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M38.731 1.43448H1.43448V24.5655H38.731V1.43448ZM0 0V26H40.1655V0H0Z`,fill:t.labelPrimary}),(0,G.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,G.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,G.jsx)(w4,{d:`M31.978 19.3655V6.40173H34.5955V19.3655H31.978Z`,fill:t.labelPrimary})]})};F4();var a9t=e=>{let{COLORS:t}=Y();return(0,G.jsxs)(E4,{width:`82`,height:`28`,viewBox:`0 0 82 28`,...e,children:[(0,G.jsx)(w4,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M40.2613 1.10811H1.10811V26.2252H40.2613V1.10811ZM0 0V27.3333H41.3694V0H0Z`,fill:t.labelPrimary}),(0,G.jsx)(w4,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M80.8919 1.10811H41.3693V26.2252H80.8919V1.10811ZM40.2612 0V27.3333H82V0H40.2612Z`,fill:t.labelPrimary}),(0,G.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,G.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,G.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,G.jsx)(w4,{d:`M57.0621 19.5766V8.20728H65.4921V10.1306H59.3577V12.6511H65.0656V14.5666H59.3577V17.661H65.7093V19.5766H57.0621Z`,fill:t.labelPrimary}),(0,G.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 o9t=e=>(0,G.jsx)(E4,{width:28,height:28,viewBox:`0 0 28 28`,fill:`none`,...e,children:(0,G.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 s9t(e){let{COLORS:t}=Y();return(0,G.jsxs)(E4,{width:28,height:28,viewBox:`0 0 28 28`,fill:`none`,...e,children:[(0,G.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,G.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 c9t=e=>{let{COLORS:t}=Y();return(0,G.jsx)(E4,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,G.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 l9t(e){let{COLORS:t}=Y(),n=e?.color??t.labelPrimary;return(0,G.jsx)(E4,{width:14,height:14,viewBox:`0 0 14 14`,fill:`none`,...e,children:(0,G.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 u9t(e){let{COLORS:t}=Y(),n=e?.color??t.labelPrimary;return(0,G.jsx)(E4,{width:14,height:14,viewBox:`0 0 14 14`,fill:`none`,...e,children:(0,G.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})})}H(),KQ();var d9t=({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}=Sq(),{COLORS:_}=Y(),v=dIt(),y=(Number(o)||0)>0;return(0,G.jsx)(GQ.View,{layout:v?void 0:RQ.duration(300),children:(0,G.jsxs)(Jf,{style:[q4.card,{backgroundColor:_.bgSecondary}],disabled:!u,onPress:u,testID:m,children:[(0,G.jsxs)(V,{style:q4.cardRow,children:[(0,G.jsxs)(V,{style:q4.cardText,children:[(0,G.jsxs)(V,{children:[(0,G.jsx)(Q,{style:[q4.name,{color:_.labelPrimary}],numberOfLines:2,children:e}),(0,G.jsx)(Q,{style:[q4.carbsSubtitle,{color:_.labelSecondary}],children:g(`food_card_carb`,{value:(Math.round(t*10)/10).toString()})})]}),c!==void 0&&s&&(a||y)&&(0,G.jsx)(GQ.View,{entering:v?void 0:LQ.duration(300),children:(0,G.jsx)(_7t,{text:c===null?g(`visualSearch_suggestion_weightUnknown`):`${g(`visualSearch_suggestion_amount`)} ${c.min}${n} - ${c.max}${n}`,font:X.Poppins.semiBold_SM,gradientId:s,italic:!0})})]}),!!l&&(0,G.jsx)(Xu,{source:{uri:l},style:q4.thumbnail,resizeMode:`cover`,testID:`${m}-thumbnail`}),i&&(0,G.jsx)(G.Fragment,{children:a||y?(0,G.jsx)(GQ.View,{entering:v?void 0:LQ.duration(300),children:(0,G.jsx)(T7t,{amount:o,onChangeAmount:f,unit:n,icon:n===`g`?(0,G.jsx)(l9t,{}):(0,G.jsx)(u9t,{}),carbs:r,autoFocus:a,onFocusChange:p,testID:m})}):(0,G.jsx)(Cp,{onPress:d,testID:`${m}-add`,style:({pressed:e})=>[q4.addPill,{backgroundColor:_.bgVsAddButton},e&&q4.pressed],children:(0,G.jsx)(Q,{style:[q4.addLabel,{color:_.textLink}],children:g(`button_add`)})})})]}),h]})})},q4=z.create({card:{padding:16,borderRadius:16},cardRow:{flexDirection:`row`,alignItems:`flex-start`,gap:10},cardText:{flex:1,gap:6},name:{...X.Poppins.medium_Base},carbsSubtitle:{...X.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:{...X.Poppins.semiBold_SM},pressed:{opacity:.5}});H();var J4=function(e){return e.Single=`Single`,e.ListItem=`ListItem`,e}({}),f9t=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}=Y(),_={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,G.jsxs)(Jf,{testID:d,disabled:!u,onPress:u,style:f,accessibilityRole:u?`button`:`none`,children:[(0,G.jsxs)(V,{style:[_[a].Single,_[a][i],(!!n||!!r)&&X4.fieldWithSubtitle,!!c&&{borderColor:g.borderInputDanger},X4.gap,h],children:[o&&(0,G.jsx)(V,{style:X4.leftSlot,children:o()}),e!==void 0&&(0,G.jsxs)(V,{style:X4.flexibleContainer,children:[(0,G.jsxs)(V,{style:X4.textContainer,children:[!!r&&(0,G.jsx)(Q,{style:X4.subtitle,children:r}),(0,G.jsx)(Q,{style:[X4.title,{color:g.labelPrimary},m],children:e}),!!n&&(0,G.jsx)(Q,{style:[X4.subtitle,{color:g.labelSecondary}],children:n})]}),!!t&&(0,G.jsx)(Q,{style:[X4.value,{color:g.labelSecondary},p],children:t})]}),s&&(0,G.jsx)(V,{style:X4.rightSlot,children:s()})]}),!!c&&(0,G.jsx)(m3,{message:c,type:`error`}),!!l&&(0,G.jsx)(m3,{message:l,type:`warning`})]})}function p9t({children:e,testID:t,displayStyle:n=`Card`,containerStyle:r}){return(0,G.jsxs)(V,{testID:t,style:[X4.container,r],children:[U.Children.map(e,e=>U.isValidElement(e)?e.type===Y4?U.cloneElement(e,{displayType:`ListItem`,displayStyle:n}):U.cloneElement(e):null),(0,G.jsx)(V,{style:{marginTop:-1}})]})}Y4.Container=p9t;var X4=z.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:{...X.Poppins.regular_Base},value:{...X.Poppins.regular_Base},leftSlot:{flex:1,minWidth:0},rightSlot:{marginRight:-8,flexShrink:0},subtitle:{...X.Poppins.regular_SM},gap:{gap:8}});H();var m9t=({isActive:e,isError:t,title:n,testID:r,onPress:i})=>{let{COLORS:a}=Y();return(0,G.jsx)(Jf,{style:[h9t.button,{backgroundColor:a.bgSegmentContainer},e&&{backgroundColor:a.bgSegmentPrimary},t&&{backgroundColor:a.bgInputActive}],testID:r,onPress:i,children:(0,G.jsx)(Q,{style:[h9t.text,{color:e?a.textLabelActive:a.textLabelInactive}],children:n})})},h9t=z.create({button:{flex:1,borderRadius:16},text:{...X.Poppins.medium_Base,paddingVertical:4,paddingHorizontal:20,textAlign:`center`}});H();var g9t=Tq?{outlineStyle:`none`}:{};function _9t(e){let{value:t,type:n=`Text`,placeholder:r,error:i=!1,errorText:a,renderLeftIcon:o,renderRightIcon:s,containerStyle:c,...l}=e,{COLORS:u}=Y(),[d,f]=(0,U.useState)(!1),p=(0,U.useCallback)(()=>{f(!0)},[]),m=(0,U.useCallback)(()=>{f(!1)},[]),h=(0,U.useMemo)(()=>i||t?u.labelPrimary:u.labelSecondary,[i,t,u.labelPrimary,u.labelSecondary]);return(0,G.jsxs)(V,{style:Z4.inputWrapper,children:[(0,G.jsxs)(V,{style:[Z4.inputContainer,{backgroundColor:u.bgInputActive,borderColor:u.bgInputActive},d&&{borderColor:u.borderInputFocus},i&&{borderColor:u.borderInputDanger},c],children:[o&&(0,G.jsx)(V,{style:Z4.leftIcon,children:o(h)}),(0,G.jsx)(Ip,{cursorColor:u.iconBrand,value:t,placeholder:r,placeholderTextColor:i?u.textInputDanger:u.labelSecondary,maxFontSizeMultiplier:S2.s3,style:[Z4.input,{color:u.labelPrimary}],onFocus:p,onBlur:m,secureTextEntry:n===`Password`,autoComplete:`off`,...l}),s&&(0,G.jsx)(V,{style:Z4.rightIcon,children:s()})]}),!!a&&(0,G.jsx)(m3,{message:a})]})}var Z4=z.create({inputWrapper:{marginBottom:16},inputContainer:{flexDirection:`row`,alignItems:`center`,borderRadius:16,borderWidth:2},input:{flex:1,paddingHorizontal:14,paddingVertical:12,borderRadius:16,...X.Poppins.regular_Base,lineHeight:B.select({ios:0,default:X.Poppins.regular_Base.lineHeight}),includeFontPadding:!1,...g9t},leftIcon:{marginRight:14},rightIcon:{marginLeft:14}}),v9t=16,y9t=24,b9t=vvt?8:0,x9t=47;function Q4(){let e=V0(),t=Math.max(e.bottom+b9t,v9t),n=Math.max(e.top,y9t);return{...e,bottom:t,bottomWithFooterButton:t+x9t+24,bottomWithScroll:t+16,top:n,topInsideModal:Eq?16:n}}var S9t=365.2425,C9t=6048e5,w9t=864e5,T9t=6e4,E9t=36e5,D9t=1e3,O9t=3600*24;O9t*7,O9t*S9t/12*3;var k9t=Symbol.for(`constructDateFrom`);function $4(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&k9t in e?e[k9t](t):e instanceof Date?new e.constructor(t):new Date(t)}function e3(e,t){return $4(t||e,e)}function A9t(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*T9t),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 j9t(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 M9t,N9t=new Uint8Array(16);function P9t(){if(!M9t){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);M9t=crypto.getRandomValues.bind(crypto)}return M9t(N9t)}var F9t={randomUUID:typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function I9t(e,t,n){if(F9t.randomUUID&&!t&&!e)return F9t.randomUUID();e||={};let r=e.random??e.rng?.()??P9t();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 j9t(r)}var i3=()=>I9t(),L9t=()=>{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 R9t(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)),z9t=(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},B9t=(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}H();var V9t=({buttons:e})=>(0,G.jsx)(V,{style:H9t.container,children:e.map(({type:e,title:t,onPress:n,disabled:r,testID:i,rightIcon:a})=>(0,G.jsx)(U4,{testID:i,onPress:n,title:t,type:e,disabled:r,rightIcon:a},t))}),H9t=z.create({container:{paddingHorizontal:16,paddingTop:16,gap:8}});H();var U9t=({title:e,message:t,icon:n,children:r,enableScroll:i,buttons:a})=>{let{COLORS:o}=Y(),{bottom:s}=Q4(),[c,l]=(0,U.useState)(0),u=(0,U.useCallback)(e=>{l(e.nativeEvent.layout.height)},[]),d=a?c+s:s,f=n||e||t?32:0,p=(0,G.jsxs)(G.Fragment,{children:[n&&(0,G.jsx)(V,{style:l3.iconContainer,children:(0,G.jsx)(n,{})}),(!!e||!!t)&&(0,G.jsxs)(V,{style:l3.textContainer,children:[!!e&&(0,G.jsx)(Q,{testID:`modal_content_title`,style:[l3.title,{color:o.labelPrimary}],children:e}),!!t&&(0,G.jsx)(Q,{testID:`modal_content_message`,style:{color:o.labelSecondary},children:t})]}),r]});return(0,G.jsxs)(G.Fragment,{children:[i?(0,G.jsx)(ds,{contentContainerStyle:[l3.content,{paddingTop:f,paddingBottom:d}],children:p}):(0,G.jsx)(V,{style:[l3.content,{paddingTop:f,paddingBottom:d}],children:p}),a&&(0,G.jsxs)(V,{style:[l3.footer,{bottom:s}],onLayout:u,children:[(0,G.jsx)(z4.default,{colors:[c3(o.bgModal,0),o.bgModal],style:[l3.footerFade,{bottom:-s}]}),(0,G.jsx)(V9t,{buttons:a})]})]})},l3=z.create({content:{flexGrow:1,paddingHorizontal:16},iconContainer:{marginTop:8,marginBottom:24},textContainer:{gap:8},title:{...X.Poppins.semiBold_2XL},footer:{position:`absolute`,left:0,right:0,pointerEvents:`box-none`},footerFade:{position:`absolute`,top:-24,left:0,right:0,pointerEvents:`none`}}),W9t=(0,U.memo)(U9t);H();var G9t=B.select({ios:300,android:150,web:300});function K9t({isHiding:e}){let{COLORS:t}=Y(),n=(0,U.useRef)(new cf.Value(0)).current;(0,U.useEffect)(()=>{cf.timing(n,{toValue:+!e,duration:G9t,easing:$d.out($d.cubic),useNativeDriver:!Tq}).start()},[e,n]);let r=(0,U.useMemo)(()=>[z.absoluteFill,{backgroundColor:t.bgOverlay}],[t.bgOverlay]);return(0,G.jsx)(cf.View,{style:[r,{opacity:n}]})}var q9t=U.memo(K9t);H();var J9t=300;function Y9t({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}=Y(),{height:h}=$p(),g=(0,U.useMemo)(()=>Math.ceil(h/100*85),[h]),[_,v]=(0,U.useState)(!1),[y,b]=(0,U.useState)(!1),x=(0,U.useRef)(g),S=(0,U.useRef)(!1),C=(0,U.useRef)(new cf.Value(g)).current,w=(0,U.useCallback)(()=>{v(!1),b(!1),n?.()},[n]),T=(0,U.useCallback)(()=>{C.setValue(x.current),cf.timing(C,{toValue:0,duration:J9t,easing:$d.out($d.cubic),useNativeDriver:!Tq}).start(e=>{e.finished&&r?.()})},[C,r]),E=(0,U.useCallback)(()=>{S.current=!0,v(!0)},[]),D=(0,U.useCallback)(()=>{S.current=!1,b(!0),cf.timing(C,{toValue:x.current,duration:J9t,easing:$d.out($d.cubic),useNativeDriver:!Tq}).start(e=>{e.finished&&w()})},[C,w]);(0,U.useEffect)(()=>{_!==t&&(t?E():D())},[t,_,E,D]);let O=(0,U.useCallback)(e=>{x.current=e.nativeEvent.layout.height,S.current&&(S.current=!1,T())},[T]);return(0,G.jsxs)(hae,{visible:_,transparent:!0,accessibilityRole:`alert`,accessibilityLabel:o??a,onRequestClose:i,children:[p&&(0,G.jsx)(q9t,{isHiding:y}),(0,G.jsx)(cf.View,{style:[X9t.container,{transform:[{translateY:C}]}],children:(0,G.jsx)(V,{testID:e,onLayout:O,style:[X9t.modal,{backgroundColor:m.bgModal},l],children:(0,G.jsx)(W9t,{title:a,message:s,icon:u,enableScroll:d,buttons:c,children:f})})})]})}var X9t=z.create({container:{...z.absoluteFill,justifyContent:`flex-end`,pointerEvents:`box-none`},modal:{width:`100%`,maxHeight:`85%`,borderTopRightRadius:36,borderTopLeftRadius:36,overflow:`hidden`}}),u3=U.memo(Y9t);H(),z.create({pagesIndicators:{flexDirection:`row`,justifyContent:`center`,marginVertical:12},dot:{width:8,height:8,borderRadius:4,marginHorizontal:4}}),H();var Z9t=({onPress:e,text:t,style:n})=>{let{COLORS:r}=Y();return(0,G.jsxs)(Cp,{testID:`scan-food-button`,onPress:e,style:({pressed:e})=>[{opacity:e?.5:1},n],children:[(0,G.jsx)(z4.default,{colors:v2,start:{x:0,y:0},end:{x:1,y:1},style:[z.absoluteFill,{borderRadius:t?16:100}]}),(0,G.jsxs)(V,{style:[Q9t.scanFoodButtonContent,{backgroundColor:r.bgButtonSecondary,borderRadius:t?15:100}],children:[(0,G.jsx)(R7t,{}),t&&(0,G.jsx)(Q,{style:[Q9t.title,{color:r.textButtonSecondary}],children:t})]})]})},Q9t=z.create({scanFoodButtonContent:{flex:1,flexDirection:`row`,alignItems:`center`,justifyContent:`center`,gap:8,margin:1,paddingHorizontal:15,paddingVertical:7},title:{...X.Poppins.medium_SM,alignSelf:`center`}});H();var d3=({title:e})=>{let{COLORS:t}=Y();return(0,G.jsx)(V,{style:$9t.container,children:(0,G.jsx)(Q,{style:[$9t.title,{color:t.labelPrimary}],children:e})})},$9t=z.create({container:{gap:8,marginBottom:8},title:{...X.Poppins.medium_SM}});H();function f3({title:e,message:t,value:n,testID:r,onValueChange:i,style:a}){let{COLORS:o}=Y();return(0,G.jsx)(V,{style:[p3.container,a],children:(0,G.jsxs)(V,{style:p3.row,children:[(0,G.jsxs)(V,{style:p3.textContainer,accessible:!0,children:[(0,G.jsx)(Q,{style:[p3.title,{color:o.labelPrimary}],children:e}),(0,G.jsx)(Q,{style:[p3.description,{color:o.labelSecondary}],children:t})]}),(0,G.jsx)(Mp,{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=z.create({container:{justifyContent:`space-between`,padding:16,borderRadius:16},row:{flexDirection:`row`,justifyContent:`space-between`},textContainer:{flex:1},title:{...X.Poppins.semiBold_Base,marginBottom:8},description:{...X.Poppins.regular_SM}});H();function m3({message:e,type:t=`error`}){let{COLORS:n}=Y();return(0,G.jsx)(V,{style:een.container,children:(0,G.jsx)(Q,{style:[een.text,{color:t===`error`?n.textInputDanger:n.textWarning}],children:e})})}var een=z.create({container:{marginTop:8},text:{...X.Poppins.regular_SM,marginHorizontal:16,textAlign:`left`}}),ten={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,nen={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},ren={"2g":_3[`2g`],"3g":_3[`3g`],"4g":_3[`4g`],"slow-2g":_3[`2g`]},ien=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?nen[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:ren[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}}},aen=[],oen=[],sen={addListener(e,t){switch(e){case h3:{let e=()=>{t(ien())};y3?y3.addEventListener(`change`,e):v3&&(window.addEventListener(`online`,e,!1),window.addEventListener(`offline`,e,!1)),aen.push(t),oen.push(e);break}}},removeListeners(e,t){switch(e){case h3:{let e=aen.indexOf(t),n=oen[e];y3?y3.removeEventListener(`change`,n):v3&&(window.removeEventListener(`online`,n),window.removeEventListener(`offline`,n)),aen.splice(e,1),oen.splice(e,1);break}}},async getCurrentState(e){return ien(e)},configure(){}};H();var cen=new Df;sen.addListener(h3,e=>{cen.emit(h3,e)});var len={...sen,eventEmitter:cen};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 uen=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 den=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 len.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 uen(e,this._handleInternetReachabilityUpdate),this._nativeEventSubscription=len.eventEmitter.addListener(h3,this._handleNativeStateUpdate),this._fetchCurrentState()}};H();var fen=ten,S3=null,C3=()=>new den(fen),w3=!1,pen=[];function men(e){fen={...ten,...e},S3&&=(S3.tearDown(),C3()),B.OS===`ios`&&len.configure(e)}function hen(e){return S3||=C3(),S3.latest(e)}function gen(){return S3||=C3(),w3?new Promise(e=>{pen.push(e)}):(w3=!0,S3._fetchCurrentState().then(e=>(pen.forEach(t=>t(e)),pen=[],e)).finally(()=>{w3=!1}))}function _en(e){return S3||=C3(),S3.add(e),()=>{S3&&S3.remove(e)}}function ven(e){e&&men(e);let[t,n]=(0,U.useState)({type:g3.unknown,isConnected:null,isInternetReachable:null,details:null});return(0,U.useEffect)(()=>{let e=_en(n);return()=>e()},[]),t}function yen(e=!1,t){let[n,r]=(0,U.useState)(),[i,a]=(0,U.useState)({type:g3.unknown,isConnected:null,isInternetReachable:null,details:null});return(0,U.useEffect)(()=>{if(e)return;let n=new den({...ten,...t});return r(n),n.add(a),n.tearDown},[e,t]),{netInfo:i,refresh:(0,U.useCallback)(()=>{n&&!w3&&(w3=!0,n._fetchCurrentState().finally(()=>{w3=!1}))},[n])}}var ben={configure:men,fetch:hen,refresh:gen,addEventListener:_en,useNetInfo:ven,useNetInfoInstance:yen},xen=Z.Milliseconds.Minute,T3=async(e,t,n=xen)=>{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)}},Sen=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(``)}})),Cen=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}})),wen=s((e=>{var t=Sen(),n=Cen(),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(be(e,ArrayBuffer)||e&&be(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<`u`&&(be(e,SharedArrayBuffer)||e&&be(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(be(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`||R(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(be(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),be(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(be(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)||be(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 ge(e).length;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return n*2;case`hex`:return n>>>1;case`base64`:return ve(e).length;default:if(i)return r?-1:ge(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(be(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,R(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(R(r))return o;e[n+o]=r}return o}function T(e,t,n,r){return ye(ge(t,e.length-n),e,n,r)}function E(e,t,n,r){return ye(L(t),e,n,r)}function D(e,t,n,r){return ye(ve(t),e,n,r)}function O(e,t,n,r){return ye(_e(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+=xe[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 M(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||M(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||M(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||M(e,1,this.length),this[e]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||M(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||M(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||M(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||M(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readBigUInt64LE=Se(function(e){e>>>=0,pe(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&me(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=Se(function(e){e>>>=0,pe(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&me(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||M(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||M(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||M(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||M(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||M(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||M(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||M(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readBigInt64LE=Se(function(e){e>>>=0,pe(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&me(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=Se(function(e){e>>>=0,pe(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&me(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||M(e,4,this.length),n.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||M(e,4,this.length),n.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||M(e,8,this.length),n.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||M(e,8,this.length),n.read(this,e,!1,52,8)};function ae(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;ae(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;ae(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||ae(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||ae(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||ae(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||ae(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||ae(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 oe(e,t,n,r,i){fe(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 N(e,t,n,r,i){fe(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=Se(function(e,t=0){return oe(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),s.prototype.writeBigUInt64BE=Se(function(e,t=0){return N(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);ae(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);ae(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||ae(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||ae(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||ae(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||ae(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||ae(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=Se(function(e,t=0){return oe(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))}),s.prototype.writeBigInt64BE=Se(function(e,t=0){return N(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))});function se(e,t,n,r,i,a){if(n+r>e.length||n<0)throw RangeError(`Index out of range`)}function P(e,t,r,i,a){return t=+t,r>>>=0,a||se(e,t,r,4,34028234663852886e22,-34028234663852886e22),n.write(e,t,r,i,23,4),r+4}s.prototype.writeFloatLE=function(e,t,n){return P(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return P(this,e,t,!1,n)};function F(e,t,r,i,a){return t=+t,r>>>=0,a||se(e,t,r,8,17976931348623157e292,-17976931348623157e292),n.write(e,t,r,i,52,8),r+8}s.prototype.writeDoubleLE=function(e,t,n){return F(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return F(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 ce={};function le(e,t,n){ce[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}`}}}le(`ERR_BUFFER_OUT_OF_BOUNDS`,function(e){return e?`${e} is outside of buffer bounds`:`Attempt to access memory outside buffer bounds`},RangeError),le(`ERR_INVALID_ARG_TYPE`,function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),le(`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=ue(String(n)):typeof n==`bigint`&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=ue(i)),i+=`n`),r+=` It must be ${t}. Received ${i}`,r},RangeError);function ue(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 de(e,t,n){pe(t,`offset`),(e[t]===void 0||e[t+n]===void 0)&&me(t,e.length-(n+1))}function fe(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 ce.ERR_OUT_OF_RANGE(`value`,i,e)}de(r,i,a)}function pe(e,t){if(typeof e!=`number`)throw new ce.ERR_INVALID_ARG_TYPE(t,`number`,e)}function me(e,t,n){throw Math.floor(e)===e?t<0?new ce.ERR_BUFFER_OUT_OF_BOUNDS:new ce.ERR_OUT_OF_RANGE(n||`offset`,`>= ${+!!n} and <= ${t}`,e):(pe(e,n),new ce.ERR_OUT_OF_RANGE(n||`offset`,`an integer`,e))}var he=/[^+/0-9A-Za-z-_]/g;function I(e){if(e=e.split(`=`)[0],e=e.trim().replace(he,``),e.length<2)return``;for(;e.length%4!=0;)e+=`=`;return e}function ge(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 L(e){let t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n)&255);return t}function _e(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 ve(e){return t.toByteArray(I(e))}function ye(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 be(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function R(e){return e!==e}var xe=(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 Se(e){return typeof BigInt>`u`?Ce:e}function Ce(){throw Error(`BigInt not supported`)}}))(),Ten=Z.Milliseconds.Second*15,Een=async e=>T3(new URL(_q.OAUTH_BASE_URL+`/token`).toString(),{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`,Authorization:`Basic `+wen.Buffer.from(encodeURIComponent(_q.OAUTH_CLIENT_ID)).toString(`base64`),...Dq},body:new URLSearchParams({grant_type:`refresh_token`,refresh_token:e}).toString()},Ten),Den=async()=>{let e=`/hda/api/v1/session`,t=await fetch(e,{method:Z.HTTPRequestMethod.GET,headers:{Accept:`application/json`}});return await E2(t,Z.StatusCode.OK,e),t.json()},Oen={accessToken:void 0,refreshToken:void 0,isOnboardingFinished:void 0,hasCompletedSetupFlow:!1,notificationPermissionsStatus:`unknown`,pinCode:void 0,settingsUnlockedTimestamp:null,isPinSetupShouldBeShown:!1,isElevatedAuthConfirmed:!1},ken={...Oen,accessToken:vq.getString(`access_token`),refreshToken:vq.getString(`refresh_token`),isOnboardingFinished:vq.getBoolean(`isOnboardingFinished`)},E3=pq()(hq(e=>({...ken,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(Oen)}}),{name:`AUTH_STORE`,storage:mq(yq),partialize:({settingsUnlockedTimestamp:e,isElevatedAuthConfirmed:t,...n})=>n})),Aen=class extends Error{constructor(e){super(e),this.name=`SignedOutError`}};async function jen(e){if(_q.TRACKING_ENABLED!==`true`)return;let t={...e,uuid:void 0},n={headers:{Accept:`application/json`,"Content-Type":`application/json`,...Dq},body:JSON.stringify(t),method:Z.HTTPRequestMethod.POST},r=Tq?`/events`:`/projects/${_q.TRACKING_PROJECT_ID}/events`,i=`${_q.TRACKING_BASE_URL}/api/v1${r}`;await E2(await T3(i,n),Z.StatusCode.CREATED,i,Z.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 Men={};function k3(){return typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof globalThis<`u`?globalThis:typeof self<`u`?self:Men}var Nen=Object.assign,A3=Object.getOwnPropertyDescriptor,j3=Object.defineProperty,M3=Object.prototype,Pen=[];Object.freeze(Pen);var Fen={};Object.freeze(Fen);var Ien=typeof Proxy<`u`,Len=Object.toString();function Ren(){Ien||O3(`Proxy not available`)}function zen(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()===Len}function Ben(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 Ven(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 Hen(e){return Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(e)))===null}function V3(e){return e!=null&&Object.prototype.toString.call(e)===`[object Set]`}var Uen=Object.getOwnPropertySymbols!==void 0;function Wen(e){var t=Object.keys(e);if(!Uen)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:Uen?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function Gen(e){return e===null?null:typeof e==`object`?``+e:e}function U3(e,t){return M3.hasOwnProperty.call(e,t)}var Ken=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 qen(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 Jen(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,Qen(r.key),r)}}function K3(e,t,n){return t&&Jen(e.prototype,t),n&&Jen(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=$en(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 Yen(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Xen(e,t)}function Xen(e,t){return Xen=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Xen(e,t)}function Zen(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 Qen(e){var t=Zen(e,`string`);return typeof t==`symbol`?t:t+``}function $en(e,t){if(e){if(typeof e==`string`)return qen(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)?qen(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])),utn(n)||(e[Y3][t]=n)}function etn(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 xnn(this)},t.reportChanged=function(){w6(),Snn(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 ttn=z3(`Atom`,e6);function ntn(e,t,n){t===void 0&&(t=N3),n===void 0&&(n=N3);var r=new e6(e);return t!==N3&&Knn(r,t),n!==N3&&qnn(r,n),r}function rtn(e,t){return e===t}function itn(e,t){return Grn(e,t)}function atn(e,t){return Grn(e,t,1)}function otn(e,t){return Object.is?Object.is(e,t):e===t?e!==0||1/e==1/t:e!==e&&t!==t}var t6={identity:rtn,structural:itn,default:otn,shallow:atn};function n6(e,t,n){return crn(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)?Ben(e)?N6(e):A6(n,e):e}function stn(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 ctn(e,t){return Grn(e,t)?t:e}var ltn=`override`;function utn(e){return e.annotationType_===ltn}function i6(e,t){return{annotationType_:e,options_:t,make_:dtn,extend_:ftn,decorate_20223_:ptn}}function dtn(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,htn(e,this,t,n,!1)),2)}function ftn(e,t,n,r){var i=htn(e,this,t,n);return e.defineProperty_(t,i,r)}function ptn(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 mtn(e,t,n,r){t.annotationType_,r.value}function htn(e,t,n,r,i){var a,o;i===void 0&&(i=C6.safeDescriptors),mtn(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 gtn(e,t){return{annotationType_:e,options_:t,make_:_tn,extend_:vtn,decorate_20223_:ytn}}function _tn(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,xtn(e,this,t,n,!1,!1)),2)}function vtn(e,t,n,r){var i=xtn(e,this,t,n,this.options_?.bound);return e.defineProperty_(t,i,r)}function ytn(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 btn(e,t,n,r){t.annotationType_,r.value}function xtn(e,t,n,r,i,a){a===void 0&&(a=C6.safeDescriptors),btn(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 Stn(e,t){return{annotationType_:e,options_:t,make_:Ctn,extend_:wtn,decorate_20223_:Ttn}}function Ctn(e,t,n){return this.extend_(e,t,n,!1)===null?0:1}function wtn(e,t,n,r){return Etn(e,this,t,n),e.defineComputedProperty_(t,J3({},this.options_,{get:n.get,set:n.set}),r)}function Ttn(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 Etn(e,t,n,r){t.annotationType_,r.get}function a6(e,t){return{annotationType_:e,options_:t,make_:Dtn,extend_:Otn,decorate_20223_:ktn}}function Dtn(e,t,n){return this.extend_(e,t,n,!1)===null?0:1}function Otn(e,t,n,r){return Atn(e,this,t,n),e.defineObservableProperty_(t,n.value,this.options_?.enhancer??n6,r)}function ktn(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 Atn(e,t,n,r){t.annotationType_}var jtn=`true`,Mtn=Ntn();function Ntn(e){return{annotationType_:jtn,options_:e,make_:Ptn,extend_:Ftn,decorate_20223_:Itn}}function Ptn(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(Ben(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 Ftn(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 Itn(e,t){O3(`'`+this.annotationType_+`' cannot be used as a decorator`)}var Ltn=`observable`,Rtn=`observable.ref`,ztn=`observable.shallow`,Btn=`observable.struct`,Vtn={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(Vtn);function o6(e){return e||Vtn}var Htn=a6(Ltn),Utn=a6(Rtn,{enhancer:r6}),Wtn=a6(ztn,{enhancer:stn}),Gtn=a6(Btn,{enhancer:ctn}),Ktn=X3(Htn);function s6(e){return e.deep===!0?n6:e.deep===!1?r6:Jtn(e.defaultDecorator)}function qtn(e){return e?e.defaultDecorator??Ntn(e):void 0}function Jtn(e){return e?e.options_?.enhancer??n6:n6}function Ytn(e,t,n){if(Q3(t))return Htn.decorate_20223_(e,t);if(F3(t)){Z3(e,t,Htn);return}return crn(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)}Nen(Ytn,Ktn);var c6=Nen(Ytn,{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?Vrn:grn)(e,s6(n),n.name)},map:function(e,t){var n=o6(t);return new brn(e,s6(n),n.name)},set:function(e,t){var n=o6(t);return new wrn(e,s6(n),n.name)},object:function(e,t,n){return n8(function(){return Qnn(C6.useProxies===!1||n?.proxy===!1?$6({},n):urn({},n),e,t)})},ref:X3(Utn),shallow:X3(Wtn),deep:Ktn,struct:X3(Gtn)}),Xtn=`computed`,Ztn=`computed.struct`,Qtn=Stn(Xtn),$tn=Stn(Ztn,{equals:t6.structural}),l6=function(e,t){if(Q3(t))return Qtn.decorate_20223_(e,t);if(F3(t))return Z3(e,t,Qtn);if(L3(e))return X3(Stn(Xtn,e));var n=L3(t)?t:{};return n.get=e,n.name||=e.name||``,new p6(n)};Object.assign(l6,Qtn),l6.struct=X3($tn);var u6=0,enn=1,tnn=A3(function(){},`name`)?.configurable??!1,nnn={value:`action`,configurable:!0,writable:!1,enumerable:!1};function d6(e,t,n,r){n===void 0&&(n=!1);function i(){return rnn(e,n,t,r||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},tnn&&(nnn.value=e,j3(i,`name`,nnn)),i}function rnn(e,t,n,r,i){var a=inn(e,t,r,i);try{return n.apply(r,i)}catch(e){throw a.error_=e,e}finally{ann(a)}}function inn(e,t,n,r){var i=!1,a=0,o=C6.trackingDerivation,s=!t||!o;w6();var c=C6.allowStateChanges;s&&(v6(),c=onn(!0));var l=mnn(!0),u={runAsAction_:s,prevDerivation_:o,prevAllowStateChanges_:c,prevAllowStateReads_:l,notifySpy_:i,startTime_:a,actionId_:enn++,parentActionId_:u6};return u6=u.actionId_,u}function ann(e){u6!==e.actionId_&&O3(30),u6=e.parentActionId_,e.error_!==void 0&&(C6.suppressReactionErrors=!0),snn(e.prevAllowStateChanges_),b6(e.prevAllowStateReads_),T6(),e.runAsAction_&&y6(e.prevDerivation_),C6.suppressReactionErrors=!1}function onn(e){var t=C6.allowStateChanges;return C6.allowStateChanges=e,t}function snn(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}Yen(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 Gen(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_=cnn.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(){wnn(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_)lnn(this)&&(this.warnAboutUntrackedRead_(),w6(),this.value_=this.computeValue_(!1),T6());else if(xnn(this),lnn(this)){var e=C6.trackingContext;this.keepAlive_&&!e&&(C6.trackingContext=this),this.trackAndCompute()&&Cnn(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=onn(!1),n;if(e)n=unn(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 snn(t),this.isComputing=!1,n},t.suspend_=function(){this.keepAlive_||(fnn(this),this.value_=void 0)},t.observe_=function(e,t){var n=this,r=!0,i=void 0;return Vnn(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 Gen(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 cnn;(function(e){e[e.NONE=0]=`NONE`,e[e.LOG=1]=`LOG`,e[e.BREAK=2]=`BREAK`})(cnn||={});var g6=function(e){this.cause=void 0,this.cause=e};function _6(e){return e instanceof g6}function lnn(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=mnn(!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 hnn(e),y6(n),b6(t),!1}}function unn(e,t,n){var r=mnn(!0);hnn(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,dnn(e),b6(r),a}function dnn(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&&ynn(c,e),c.diffValue=0}for(;i--;){var l=n[i];l.diffValue===1&&(l.diffValue=0,vnn(l,e))}r!==h6.UP_TO_DATE_&&(e.dependenciesState_=r,e.onBecomeStale_())}function fnn(e){var t=e.observing_;e.observing_=[];for(var n=t.length;n--;)ynn(t[n],e);e.dependenciesState_=h6.NOT_TRACKING_}function pnn(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 mnn(e){var t=C6.allowStateReads;return C6.allowStateReads=e,t}function b6(e){C6.allowStateReads=e}function hnn(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,gnn=!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(){gnn||O3(35)},1),new x6)}();function _nn(){if((C6.pendingReactions.length||C6.inBatch||C6.isRunningReactions)&&O3(36),gnn=!0,S6){var e=k3();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),C6=new x6}}function vnn(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function ynn(e,t){e.observers_.delete(t),e.observers_.size===0&&bnn(e)}function bnn(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,C6.pendingUnobservations.push(e))}function w6(){C6.inBatch++}function T6(){if(--C6.inBatch===0){Dnn();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 xnn(e){var t=C6.trackingDerivation;return t===null?(e.observers_.size===0&&C6.inBatch>0&&bnn(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 Snn(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 Cnn(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 wnn(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_=cnn.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),Dnn())},t.runReaction_=function(){if(!this.isDisposed){w6(),this.isScheduled=!1;var e=C6.trackingContext;if(C6.trackingContext=this,lnn(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=unn(this,e,void 0);C6.trackingContext=t,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&fnn(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(),fnn(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 Tnn=100,Enn=function(e){return e()};function Dnn(){C6.inBatch>0||C6.isRunningReactions||Enn(Onn)}function Onn(){C6.isRunningReactions=!0;for(var e=C6.pendingReactions,t=0;e.length>0;){++t===Tnn&&(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 knn(e){var t=Enn;Enn=function(n){return e(function(){return t(n)})}}function O6(){return!1}function Ann(e){return console.warn(`[mobx.spy] Is a no-op in production builds`),function(){}}var jnn=`action`,Mnn=`action.bound`,Nnn=`autoAction`,Pnn=`autoAction.bound`,Fnn=`<unnamed action>`,Inn=i6(jnn),Lnn=i6(Mnn,{bound:!0}),Rnn=i6(Nnn,{autoAction:!0}),znn=i6(Pnn,{autoAction:!0,bound:!0});function Bnn(e){return function(t,n){if(P3(t))return d6(t.name||Fnn,t,e);if(P3(n))return d6(t,n,e);if(Q3(n))return(e?Rnn:Inn).decorate_20223_(t,n);if(F3(n))return Z3(t,n,e?Rnn:Inn);if(F3(t))return X3(i6(e?Nnn:jnn,{name:t,autoAction:e}))}}var k6=Bnn(!1);Object.assign(k6,Inn);var A6=Bnn(!0);Object.assign(A6,Rnn),k6.bound=X3(Lnn),A6.bound=X3(znn);function j6(e){return P3(e)&&e.isMobxAction===!0}function Vnn(e,t){var n;t===void 0&&(t=Fen);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=Unn(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 Hnn=function(e){return e()};function Unn(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:Hnn}var Wnn=`onBO`,Gnn=`onBUO`;function Knn(e,t,n){return Jnn(Wnn,e,t,n)}function qnn(e,t,n){return Jnn(Gnn,e,t,n)}function Jnn(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 Ynn=`never`,M6=`always`,Xnn=`observed`;function Znn(e){e.isolateGlobalState===!0&&_nn();var t=e.useProxies,n=e.enforceActions;if(t!==void 0&&(C6.useProxies=t===M6?!0:t===Ynn?!1:typeof Proxy<`u`),t===`ifavailable`&&(C6.verifyProxies=!0),n!==void 0){var r=n===M6?M6:n===Xnn;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&&knn(e.reactionScheduler)}function Qnn(e,t,n,r){var i=Ken(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 $nn(e,t){return ern(t8(e,t))}function ern(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=trn(e.observing_).map(ern)),t}function trn(e){return Array.from(new Set(e))}var nrn=0;function rrn(){this.message=`FLOW_CANCELLED`}rrn.prototype=Object.create(Error.prototype);var irn=gtn(`flow`),arn=gtn(`flow.bound`,{bound:!0}),N6=Object.assign(function(e,t){if(Q3(t))return irn.decorate_20223_(e,t);if(F3(t))return Z3(e,t,irn);var n=e,r=n.name||`<unnamed flow>`,i=function(){var e=this,t=arguments,i=++nrn,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&&orn(s);var e=a.return(void 0),t=Promise.resolve(e.value);t.then(N3,N3),orn(t),o(new rrn)}catch(e){o(e)}}),c};return i.isMobXFlow=!0,i},irn);N6.bound=X3(arn);function orn(e){P3(e.cancel)&&e.cancel()}function P6(e){return e?.isMobXFlow===!0}function srn(e,t){return e?t===void 0?e8(e)||!!e[$3]||ttn(e)||D6(e)||m6(e):e8(e)?e[$3].values_.has(t):!1:!1}function crn(e){return srn(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 lrn={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 urn(e,t){var n;return Ren(),e=$6(e,t),(n=e[$3]).proxy_??(n.proxy_=new Proxy(e,lrn))}function L6(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function R6(e,t){var n=e.interceptors_||=[];return n.push(t),zen(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),zen(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 drn(e,t,n){return n8(function(){var r=$6(e,n)[$3];t??=etn(e),H3(t).forEach(function(e){return r.make_(e,t[e])})}),e}var frn=`splice`,U6=`update`,prn=1e4,mrn={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)}},hrn=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&&Brn(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=Pen),L6(this)){var a=z6(this,{object:this.proxy_,type:frn,index:e,removedCount:t,added:n});if(!a)return Pen;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<prn){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:frn,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 grn(e,t,n,r){return n===void 0&&(n=`ObservableArray`),r===void 0&&(r=!1),Ren(),n8(function(){var i=new hrn(n,t,r,!1);Ven(i.values_,$3,i);var a=new Proxy(i.values_,mrn);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`,_rn),G6(`reduceRight`,_rn);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 _rn(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 vrn=z3(`ObservableArrayAdministration`,hrn);function J6(e){return I3(e)&&vrn(e[$3])}var yrn={},Y6=`add`,X6=`delete`,brn=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]=yrn,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_=ntn(`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),qnn(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 xrn({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 xrn({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)?Wen(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)?(Hen(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(){pnn(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=Srn(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`,brn);function xrn(e){return e[Symbol.toStringTag]=`MapIterator`,Yrn(e)}function Srn(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 Crn={},wrn=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]=Crn,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_=ntn(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(){pnn(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 Trn({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 Trn({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`,wrn);function Trn(e){return e[Symbol.toStringTag]=`SetIterator`,Yrn(e)}var Ern=Object.create(null),Drn=`remove`,Orn=function(){function e(e,t,n,r){t===void 0&&(t=new Map),r===void 0&&(r=Mtn),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)}jrn(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&&jrn(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=Arn(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=Arn(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:Drn}))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_),Snn(a)),this.keysAtom_.reportChanged(),(n=this.pendingKeys_)==null||(n=n.get(e))==null||n.set(e in this.target_),r||i){var s={type:Drn,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 Orn(e,new Map,String(n),qtn(t))),e}var krn=z3(`ObservableObjectAdministration`,Orn);function Arn(e){return Ern[e]||(Ern[e]={get:function(){return this[$3].getObservablePropValue_(e)},set:function(t){return this[$3].setObservablePropValue_(e,t)}})}function e8(e){return I3(e)?krn(e[$3]):!1}function jrn(e,t,n){var r;(r=e.target_[Y3])==null||delete r[n]}var Mrn=Rrn(0),Nrn=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1}(),Prn=0,Frn=function(){};function Irn(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__===void 0?e.prototype=t:e.prototype.__proto__=t}Irn(Frn,Array.prototype);var Lrn=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 hrn(r,n,i,!0);e.proxy_=a,Ven(a,$3,e),t&&t.length&&a.spliceWithArray(0,0,t),Nrn&&Object.defineProperty(a,"0",Mrn)}),a}Yen(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 Yrn({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`}}])}(Frn);Object.entries(W6).forEach(function(e){var t=e[0],n=e[1];t!==`concat`&&R3(Lrn.prototype,t,n)});function Rrn(e){return{enumerable:!1,configurable:!0,get:function(){return this[$3].get_(e)},set:function(t){this[$3].set_(e,t)}}}function zrn(e){j3(Lrn.prototype,``+e,Rrn(e))}function Brn(e){if(e>Prn){for(var t=Prn;t<e+100;t++)zrn(t);Prn=e}}Brn(1e3);function Vrn(e,t,n){return new Lrn(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,Urn(e)),n}if(e8(e)){if(!t)return O3(26);var r=e[$3].values_.get(t);return r||O3(27,t,Urn(e)),r}if(ttn(e)||m6(e)||D6(e))return e}else if(P3(e)&&D6(e[$3]))return e[$3];O3(28)}function Hrn(e,t){if(e||O3(29),t!==void 0)return Hrn(t8(e,t));if(ttn(e)||m6(e)||D6(e)||Z6(e)||Q6(e))return e;if(e[$3])return e[$3];O3(24,e)}function Urn(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)?Hrn(e):t8(e);return n.name_}function n8(e){var t=v6(),n=onn(!0);w6();try{return e()}finally{T6(),snn(n),y6(t)}}var Wrn=M3.toString;function Grn(e,t,n){return n===void 0&&(n=-1),Krn(e,t,n)}function Krn(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=Wrn.call(e);if(o!==Wrn.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=qrn(e),t=qrn(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(!Krn(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)&&Krn(e[m],t[m],n-1,r,i)))return!1}}return r.pop(),i.pop(),!0}function qrn(e){return J6(e)?e.slice():B3(e)||Z6(e)||V3(e)||Q6(e)?Array.from(e.entries()):e}var Jrn=k3().Iterator?.prototype||{};function Yrn(e){return e[Symbol.iterator]=Xrn,Object.assign(Object.create(Jrn),e)}function Xrn(){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:Ann,extras:{getDebugName:Urn},$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 Zrn=/\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`&&Zrn.exec(n)&&(e[t]=new Date(n))}return e}function o8(e){return typeof e==`object`&&!!e&&!r8(e)}var Qrn=class{storageName;schema;constructor(e,t){this.storageName=`${e}Storage`,this.schema=JSON.parse(JSON.stringify(t))}get(){let e=vq.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),vq.set(this.storageName,JSON.stringify(n)),n}set(e){return this.isT(e),vq.set(this.storageName,JSON.stringify(e)),e}clear(){return vq.delete(this.storageName),this.instantiateData(void 0)}instantiateData(e){let t=e??JSON.stringify(this.schema);return vq.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}},$rn=class{persistenceManager;schema;data;constructor(e,t){this.schema=JSON.parse(JSON.stringify(t)),this.data=JSON.parse(JSON.stringify(t)),this.persistenceManager=new Qrn(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 $rn{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 jen(n)}catch{t.push(n)}super.set(t),super.save(!1)}},c8=`3.9.0`,ein=`2026-10-09`,tin=1218,nin=`05700002209597`;H();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}({}),rin=()=>{let{email:e,id:t,country:n=``}=Can.get();return{id:t,isTester:e.includes(`@hedia`),country:n,uuid:i3(),timestamp:new Date().toISOString(),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,platform:B.OS}},u8=(e,t)=>{let{id:n,isTester:r,country:i,uuid:a,timestamp:o,timezone:s,platform:c}=rin(),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)},iin=e=>{let{id:t,isTester:n,country:r,uuid:i,timestamp:a,timezone:o,platform:s}=rin(),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=xen,r=0)=>{if(Tq)return fetch(e,t);let{accessToken:i}=E3.getState();if(!i)throw new Aen(`[hediaFetch] Missing access token`);let a={...t?.headers,Authorization:`Bearer ${i}`,...Dq},o=await T3(e,{...t,headers:a},n);if([Z.StatusCode.UNAUTHORIZED,Z.StatusCode.FORBIDDEN].includes(o.status)){if(r<1)return await oin(),d8(e,t,n,r+1);throw new T2(`[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,ain=async()=>{let{accessToken:e,refreshToken:t,setTokens:n}=E3.getState();if(!t&&!e)throw new Aen(`[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 Een(t);if(r.status===Z.StatusCode.BAD_REQUEST)throw u8(l8.ErrorLogOut),n({accessToken:void 0,refreshToken:void 0}),new Aen(`[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})},oin=()=>(f8===null&&(f8=ain().finally(()=>{f8=null})),f8),sin=async()=>{let e={headers:{Accept:`application/json`,"Content-Type":`application/json`},method:Z.HTTPRequestMethod.GET},t=`${_q.HEDIA_SERVER_BASE_URL}/api/v3/user`,n=await d8(t,e);return await E2(n,Z.StatusCode.OK,t),n.json()},cin={email:``},lin={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`}},uin=(e,t,n)=>{let r,i=lin[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 din={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`})},fin={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`},pin=(e,t,n,r)=>fin[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 min={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)?gin(s,e=>e.test(o)):hin(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 hin(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function gin(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 _in={code:`da`,formatDistance:uin,formatLong:din,formatRelative:pin,localize:min,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}},vin={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`}}},yin=(e,t,n)=>{let r,i=n?.addSuffix?vin[e].withPreposition:vin[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},bin={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`})},xin={lastWeek:`'letzten' eeee 'um' p`,yesterday:`'gestern um' p`,today:`'heute um' p`,tomorrow:`'morgen um' p`,nextWeek:`eeee 'um' p`,other:`P`},Sin=(e,t,n,r)=>xin[e],Cin={narrow:[`v.Chr.`,`n.Chr.`],abbreviated:[`v.Chr.`,`n.Chr.`],wide:[`vor Christus`,`nach Christus`]},win={narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1. Quartal`,`2. Quartal`,`3. Quartal`,`4. Quartal`]},Tin={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`]},Ein={narrow:Tin.narrow,abbreviated:[`Jan.`,`Feb.`,`März`,`Apr.`,`Mai`,`Juni`,`Juli`,`Aug.`,`Sep.`,`Okt.`,`Nov.`,`Dez.`],wide:Tin.wide},Din={code:`de`,formatDistance:yin,formatLong:bin,formatRelative:Sin,localize:{ordinalNumber:e=>Number(e)+`.`,era:m8({values:Cin,defaultWidth:`wide`}),quarter:m8({values:win,defaultWidth:`wide`,argumentCallback:e=>e-1}),month:m8({values:Tin,formattingValues:Ein,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}},Oin={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`}},kin=(e,t,n)=>{let r,i=Oin[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},Ain={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},jin=(e,t,n,r)=>Ain[e],Min={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`})},Nin={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`})},Pin={code:`en-GB`,formatDistance:kin,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:jin,localize:Min,match:Nin,options:{weekStartsOn:1,firstWeekContainsDate:4}},Fin={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`}},Iin=(e,t,n)=>{let r,i=Fin[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},Lin={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`})},Rin={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`},zin={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`},Bin={code:`es`,formatDistance:Iin,formatLong:Lin,formatRelative:(e,t,n,r)=>t.getHours()===1?Rin[e]:zin[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}},Vin={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`}},Hin=(e,t,n)=>{let r,i=Vin[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},Uin={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`})},Win={lastWeek:`eeee 'dernier à' p`,yesterday:`'hier à' p`,today:`'aujourd’hui à' p`,tomorrow:`'demain à' p'`,nextWeek:`eeee 'prochain à' p`,other:`P`},Gin=(e,t,n,r)=>Win[e],Kin={narrow:[`av. J.-C`,`ap. J.-C`],abbreviated:[`av. J.-C`,`ap. J.-C`],wide:[`avant Jésus-Christ`,`après Jésus-Christ`]},qin={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`]},Jin={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`]},Yin={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`]},Xin={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`}},Zin=(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},Qin=[`MMM`,`MMMM`],$in={code:`fr`,formatDistance:Hin,formatLong:Uin,formatRelative:Gin,localize:{preprocessor:(e,t)=>e.getDate()===1||!t.some(e=>e.isToken&&Qin.includes(e.value))?t:t.map(e=>e.isToken&&e.value===`do`?{isToken:!0,value:`d`}:e),ordinalNumber:Zin,era:m8({values:Kin,defaultWidth:`wide`}),quarter:m8({values:qin,defaultWidth:`wide`,argumentCallback:e=>e-1}),month:m8({values:Jin,defaultWidth:`wide`}),day:m8({values:Yin,defaultWidth:`wide`}),dayPeriod:m8({values:Xin,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}},ean={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`}},tan=(e,t,n)=>{let r,i=ean[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},nan={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 ran={};function v8(){return ran}function ian(e){ran=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 aan(e,t,n){let[r,i]=_8(n?.in,e,t);return+y8(r,n)==+y8(i,n)}var oan=[`domenica`,`lunedì`,`martedì`,`mercoledì`,`giovedì`,`venerdì`,`sabato`];function san(e){switch(e){case 0:return`'domenica scorsa alle' p`;default:return`'`+oan[e]+` scorso alle' p`}}function can(e){return`'`+oan[e]+` alle' p`}function lan(e){switch(e){case 0:return`'domenica prossima alle' p`;default:return`'`+oan[e]+` prossimo alle' p`}}var uan={lastWeek:(e,t,n)=>{let r=e.getDay();return aan(e,t,n)?can(r):san(r)},yesterday:`'ieri alle' p`,today:`'oggi alle' p`,tomorrow:`'domani alle' p`,nextWeek:(e,t,n)=>{let r=e.getDay();return aan(e,t,n)?can(r):lan(r)},other:`P`},dan={code:`it`,formatDistance:tan,formatLong:nan,formatRelative:(e,t,n,r)=>{let i=uan[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}},fan={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`}},pan=[`noll`,`en`,`två`,`tre`,`fyra`,`fem`,`sex`,`sju`,`åtta`,`nio`,`tio`,`elva`,`tolv`],man=(e,t,n)=>{let r,i=fan[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t<13?pan[t]:String(t)),n?.addSuffix?n.comparison&&n.comparison>0?`om `+r:r+` sedan`:r},han={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`})},gan={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`},_an={code:`sv`,formatDistance:man,formatLong:han,formatRelative:(e,t,n,r)=>gan[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 van(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]);ian(t)}var yan=R9t(Z.Languages,Z.Languages.en);function ban(e){let t={da:_in,de:Din,es:Bin,fr:$in,it:dan,enGB:Pin,sv:_an};van({locale:e===`en`?t.enGB:t[e]})}function xan(e){return e??yan}function San(e){let{language:t,set:n}=bq.getState();n(e),ban(e),e!==t&&z4t.invalidateQueries({queryKey:[`foods`]})}var Can=new class extends $rn{constructor(){super(`userDetails`,cin)}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 sin();San(xan(e.language)),super.set(e),super.save()}migrateData(){throw Error(`[UserDetailsManager::migrateData] Purposefully not implemented.`)}},wan=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=D2();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}})),Tan=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=wan()})),b8=Tan(),Ean=class{create=async(e,t)=>{try{e.overwrittenByUUID=void 0;let n=Oan();n.eventUpdates.push({...e,uuidOld:t}),vq.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 Tq?(await this.sync(),r(e,t)):(r(e,t),K8.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()-Z.Milliseconds.Minute*90-i.durationSeconds*Z.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=Oan(),t={method:Z.HTTPRequestMethod.POST,body:JSON.stringify(e),headers:{"Content-Type":`application/json`}},n=`${_q.HEDIA_SERVER_BASE_URL}/api/v2/events`,r=await d8(n,t);await E2(r,Z.StatusCode.OK,n,Z.HTTPRequestMethod.POST);let{lastSyncTimestamp:i,eventUpdates:a}=await r.json();for(let e of a)this.saveLocally(e);let o=Oan(),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))};vq.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=vq.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(Dan(e.uuid),vq.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]),vq.set(`event/index`,JSON.stringify(t))}}},Dan=e=>{let t=x8();t=t.filter(t=>t[0]!==e),vq.set(`event/index`,JSON.stringify(t))},x8=()=>{let e=vq.getString(`event/index`);return e===void 0?[]:JSON.parse(e)},Oan=()=>{let e=vq.getString(`event/pendingChanges`);return e===void 0?{lastSyncTimestamp:new Date(0).toJSON(),eventUpdates:[],deletedEvents:[]}:JSON.parse(e)},S8=new Ean,C8=(e,t,n)=>Math.round(e*t*n/100),kan=e=>e.source!==`packaged`,Aan=async()=>{let e=new URLSearchParams({source:`personal`,limit:`100`,sort:`title`}),t=await d8(`${_q.FOOD_BASE_URL}/api/v1/foods?${e.toString()}`,{headers:{Accept:`application/json`}});return t.ok?await t.json():(console.warn(`[listPersonalFoods] server error`),[])},jan=async e=>{let t=new URLSearchParams({source:`curated`,limit:`100`,sort:`title`});e!==void 0&&t.set(`categoryId`,e);let n=`${_q.FOOD_BASE_URL}/api/v1/foods?${t.toString()}`,r=await d8(n,{headers:{Accept:`application/json`}});return await E2(r,Z.StatusCode.OK,n,Z.HTTPRequestMethod.GET),r.json()},Man=async()=>{let e=new URLSearchParams({usedWithinDays:`30`}),t=`${_q.FOOD_BASE_URL}/api/v1/foods?${e.toString()}`,n=await d8(t,{headers:{Accept:`application/json`}});return await E2(n,Z.StatusCode.OK,t,Z.HTTPRequestMethod.GET),(await n.json()).filter(kan)},Nan=async e=>{let t=new URLSearchParams({search:e,limit:`100`}),n=`${_q.FOOD_BASE_URL}/api/v1/foods?${t.toString()}`,r=await d8(n,{headers:{Accept:`application/json`}});return await E2(r,Z.StatusCode.OK,n,Z.HTTPRequestMethod.GET),(await r.json()).filter(kan)},Pan=async e=>{let t=`${_q.FOOD_BASE_URL}/api/v1/foods/${e}`,n=await d8(t,{headers:{Accept:`application/json`}});if(n.status===Z.StatusCode.NOT_FOUND)return null;await E2(n,Z.StatusCode.OK,t,Z.HTTPRequestMethod.GET);let r=await n.json();return!kan(r)||r.deleted?null:r},Fan=async(e,t)=>{let n=`${_q.FOOD_BASE_URL}/api/v1/foods/personal/${e}`,r=await d8(n,{method:Z.HTTPRequestMethod.PATCH,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:JSON.stringify(t)});return await E2(r,Z.StatusCode.OK,n,Z.HTTPRequestMethod.PATCH),r.json()},Ian=async e=>{let t=`${_q.FOOD_BASE_URL}/api/v1/foods/personal/${e}`;await E2(await d8(t,{method:Z.HTTPRequestMethod.DELETE}),Z.StatusCode.NO_CONTENT,t,Z.HTTPRequestMethod.DELETE)},Lan=async e=>{let t=`${_q.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 E2(n,Z.StatusCode.CREATED,t,Z.HTTPRequestMethod.POST),await n.json()},Ran=async e=>{let t=new URLSearchParams({language:e}),n=`${_q.FOOD_BASE_URL}/api/v1/categories?${t.toString()}`,r=await d8(n,{headers:{Accept:`application/json`}});return await E2(r,Z.StatusCode.OK,n,Z.HTTPRequestMethod.GET),r.json()},zan=async e=>{let t=`${_q.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 E2(n,Z.StatusCode.CREATED,t,Z.HTTPRequestMethod.POST),await n.json()},Ban=async e=>{let t=`${_q.FOOD_BASE_URL}/api/v1/food-intakes/${e}`;await E2(await d8(t,{method:Z.HTTPRequestMethod.DELETE}),Z.StatusCode.NO_CONTENT,t,Z.HTTPRequestMethod.DELETE)},Van=o3(Z.CONSTANTS.ACTIVITY_TARGET_GLUCOSE_MIN,Z.CONSTANTS.ACTIVITY_TARGET_GLUCOSE_MAX),Han=a3(90,250),Uan=8,Wan={fromZero:1,fromThirty:.75,fromFortysix:.5,fromSixtyone:null},Gan={fromZero:1,fromThirty:.5,fromFortysix:.25,fromSixtyone:null},Kan={fromZero:1,fromThirty:.25,fromFortysix:null,fromSixtyone:null},qan={fromZero:1,fromThirty:.5,fromFortysix:.5,fromSixtyone:null};function w8(){return{target:Uan,light:Wan,moderate:Gan,hard:Kan,post:qan}}function Jan(){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 Yan(){return{startTime:`00:00`,target:6}}function Xan(){return{targetBGLIntervals:Jan(),overallTargetBGL:Yan(),use:Z.Usage.Intervals}}var Zan=()=>({min:Z.CONSTANTS.TARGET_GLUCOSE_MIN,max:Z.CONSTANTS.TARGET_GLUCOSE_MAX}),Qan=()=>({min:79,max:180}),$an=`19:00`,eon=1.5;function ton(){return{medicineNotification:{toggle:!1,dailyReminderTime:$an},remeasurementNotification:{toggle:!0,remeasurement:eon}}}var T8=new class{get=()=>{let e=vq.getString(`userSettings`),t=this.safeParse(e);return this.migrateAndClean(t)??{}};write=e=>{let t=this.migrateAndClean(e)??{};vq.set(`userSettings`,JSON.stringify(t))};getPending=()=>{let e=vq.getString(`pendingSettingsChanges`);return(this.safeParse(e)??[]).map(e=>this.migrateAndClean(e)??{})};addPending=e=>{let t=this.getPending();t.push(this.migrateAndClean(e)??{}),vq.set(`pendingSettingsChanges`,JSON.stringify(t))};removePending=e=>{let t=e.map(e=>e.uuid),n=this.getPending().filter(e=>!t.includes(e.uuid));vq.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),drn(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 Tq&&_q.IS_PRODUCTION!==`true`&&e instanceof T2&&[Z.StatusCode.UNAVAILABLE_FOR_LEGAL_REASONS,Z.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?Z.HTTPRequestMethod.POST:Z.HTTPRequestMethod.GET,n={headers:{"Content-Type":`application/json`},body:e?JSON.stringify(e):void 0,method:t},r=`${_q.HEDIA_SERVER_BASE_URL}/api/v2/settings`,i=await d8(r,n);return await E2(i,Z.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(_q.IS_PRODUCTION===`true`)throw Error(`[UserSettingsManager::updateMockUserSettings] - This method should only be used outside production environments`);this._uuid=i3(),this._treatmentParameters=O8(2,10,Z.Usage.Overall),this._activity=w8(),this._notifications=ton(),this._glucoseLevelTargets=Xan(),this._glucoseUnit=Z.BloodGlucoseUnit.MMOL_L,this._fastActingInsulin=Z.FastActingInsulin.Apidra,this._longActingInsulin=Z.LongActingInsulin.Lantus,this._injectionMethod=Z.InjectionMethod.Pump,this._diabetesType=Z.DiabetesType.Type1,this._birthDate=`1975-12-31T23:00:00.000Z`,this._biologicalSex=Z.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,non={code:`en-US`,formatDistance:kin,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:jin,localize:Min,match:Nin,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 ron(e,t){let n=e3(e,t?.in);return n.setHours(0,0,0,0),n}function ion(e,t,n){let[r,i]=_8(n?.in,e,t),a=ron(r),o=ron(i),s=+a-A8(a),c=+o-A8(o);return Math.round((s-c)/w9t)}function aon(e,t){let n=e3(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function oon(e,t){let n=e3(e,t?.in);return ion(n,aon(n))+1}function j8(e,t){return y8(e,{...t,weekStartsOn:1})}function son(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 con(e,t){let n=son(e,t),r=$4(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),j8(r)}function lon(e,t){let n=e3(e,t?.in),r=j8(n)-+con(n);return Math.round(r/C9t)+1}function uon(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 don(e,t){let n=v8(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=uon(e,t),a=$4(t?.in||e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),y8(a,t)}function fon(e,t){let n=e3(e,t?.in),r=y8(n,t)-+don(n,t);return Math.round(r/C9t)+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`},pon={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=uon(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(son(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=fon(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):M8(i,t.length)},I:function(e,t,n){let r=lon(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=oon(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 hon(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 hon(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`+mon(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`+mon(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 mon(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 hon(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 gon=(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`})}},_on=(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`})}},von={p:_on,P:(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return gon(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}}`,gon(r,t)).replace(`{{time}}`,_on(i,t))}},yon=/^D+$/,bon=/^Y+$/,xon=[`D`,`DD`,`YY`,`YYYY`];function Son(e){return yon.test(e)}function Con(e){return bon.test(e)}function won(e,t,n){let r=Ton(e,t,n);if(console.warn(r),xon.includes(e))throw RangeError(r)}function Ton(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 Eon(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function Don(e){return!(!Eon(e)&&typeof e!=`number`||isNaN(+e3(e)))}var Oon=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,kon=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Aon=/^'([^]*?)'?$/,jon=/''/g,Mon=/[a-zA-Z]/;function I8(e,t,n){let r=v8(),i=n?.locale??r.locale??non,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(!Don(s))throw RangeError(`Invalid time value`);let c=t.match(kon).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=von[t];return n(e,i.formatLong)}return e}).join(``).match(Oon).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:Non(e)};if(pon[t])return{isToken:!0,value:e};if(t.match(Mon))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&&Con(a)||!n?.useAdditionalDayOfYearTokens&&Son(a))&&won(a,t,String(e));let o=pon[a[0]];return o(s,a,i.localize,l)}).join(``)}function Non(e){let t=e.match(Aon);return t?t[1].replace(jon,`'`):e}var Pon=`mmol/L`,Fon=`mg/dL`,Ion=[0,30],Lon=[0,540],Ron={low:3.9,high:10},zon={low:70,high:180},L8=e=>{if(e===Z.BloodGlucoseUnit.MMOL_L)return{text:Pon,graphLimits:Ion,inputMin:Z.CONSTANTS.GLUCOSE_INPUT_MIN_MMOLL,inputMax:Z.CONSTANTS.GLUCOSE_INPUT_MAX_MMOLL,decimalPlaces:1,placeholder:`-.-`,targetInterval:{low:Ron.low,high:Ron.high}};if(e===Z.BloodGlucoseUnit.MG_DL)return{text:Fon,graphLimits:Lon,inputMin:20,inputMax:600,decimalPlaces:0,placeholder:`-`,targetInterval:{low:zon.low,high:zon.high}};throw Error(`[glucose::getBGConstants] Unsupported glucose unit! ${e}`)};function Bon(e,t,n){return $4(n?.in||e,+e3(e)+t)}function Von(e,t,n){return Bon(e,t*E9t,n)}function Hon(e){return t=>{let n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function Uon(e,t){return e3(e)-+e3(t)}function Won(e,t,n){let r=Uon(e,t)/T9t;return Hon(n?.roundingMethod)(r)}function Gon(e){return e<=29?`0-29`:e<=45?`30-45`:e<=60?`46-60`:`61-120`}function Kon(e,t){let n=new Date,r=Won(t3(Von(new Date(e),1.5),t),n),i=Math.floor(r/60),a=r%60;return i>0?`${i}${xq(`activity_card__active_hour`)} ${a}${xq(`activity_card__active_min`)}`:`${a} ${xq(`activity_card__active_min`)}`}var R8={light:()=>xq(`activity_intensity_1`),moderate:()=>xq(`activity_intensity_2`),hard:()=>xq(`activity_intensity_3`)},qon=Pon,Jon=0,Yon=8,Xon=1,Zon=()=>({displayUnit:qon,inputMin:Jon,inputMax:Yon,decimalPlaces:Xon});F3t.base900,_2.noRisk,_2.lowRisk,_2.moderateRisk,_2.highRisk;function z8(e,t,n){if(t===n)return e;switch(n){case Z.BloodGlucoseUnit.MG_DL:return e*Z.CONSTANTS.MGDL_PER_MMOLL_BGL;case Z.BloodGlucoseUnit.MMOL_L:return e*Z.CONSTANTS.MMOLL_PER_MGDL_BGL;default:throw Error(`[conversionGlucose::convertBGL] Unsupported glucose unit! ${n}`)}}function Qon(e,t){let{decimalPlaces:n}=L8(t);return(Math.round(e*10)/10).toFixed(n)}function B8(e,t,n){return Qon(z8(e,t,n),n)}var $on=X6t({entry_timestamp:g4([J6t(),q6t()]),settings_uuid:q6t(),insulin_entered_units:g4([m4(),h4()]),carbohydrates_entered_grams:g4([m4(),h4()]),blood_glucose_millimolar:g4([m4(),h4()]),blood_ketones_millimolar:g4([m4(),h4(),Y6t()]),event_uuid:g4([q6t(),h4(),Y6t()])});`${w2.textPdf}${w2.textPdf}${w2.textPdf}${w2.textPdf}`;var esn=e=>{$on.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(Z.BloodGlucoseUnit.MMOL_L),{inputMax:s}=Zon();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},tsn=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}),nsn=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}),rsn=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}),isn=new Set,asn=e=>{isn.forEach(t=>{try{t(e)}catch(e){console.error(`[logbookEvents] listener failed`,e)}})},osn=e=>{asn({type:`created`,entry:e})},ssn=(e,t)=>{asn({type:`updated`,oldEntry:e,newEntry:t})},csn=e=>{asn({type:`deleted`,entry:e})};H();var lsn=e=>{let t={...e};return delete t.carbohydrates_modified_suggested_grams,delete t.mood,delete t.smart_pen_sync_timestamp,t},usn=class{constructor(){vq.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=`${B.OS} ${B.Version}`;let r=U8();if(t)e.settings_uuid=this.getLogbookByUUID(t).settings_uuid,r.edited.push({oldUUID:t,newUUID:e.uuid}),H8(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=L9t(),e.timezone=Intl.DateTimeFormat().resolvedOptions().timeZone,r.created.push(e),vq.set(`logbook/pendingChanges`,JSON.stringify(r)),V8(e),n===null?osn(e):ssn(n,e),Tq?await this.syncWeb():K8.syncAll().catch(console.error),e}catch(r){return console.error(r),Tq&&(t?(H8(e.uuid),n!==null&&V8(n),W8(e.uuid,t)):(H8(e.uuid),W8(e.uuid))),null}}deleteLogbook=async e=>{let t=this.getLogbookByUUID(e);try{t.food_intake_id&&await Ban(t.food_intake_id).catch(console.error);let n=U8();return n.deleted.push(e),vq.set(`logbook/pendingChanges`,JSON.stringify(n)),H8(e),csn(t),Tq?await this.syncWeb():K8.syncAll().catch(console.error),!0}catch(n){return console.error(n),Tq&&(V8(t),W8(e)),!1}};syncWeb=async()=>{let e=U8(),t=e=>({method:Z.HTTPRequestMethod.POST,body:JSON.stringify(e),headers:{"Content-Type":`application/json`}}),n=`${_q.HEDIA_SERVER_BASE_URL}/api/v2/logbooks`,r=await d8(n,t(e));await E2(r,Z.StatusCode.OK,n,Z.HTTPRequestMethod.POST);let{created:i,last_sync_timestamp:a}=await r.json();for(let e of i)V8(e);let o={last_sync_timestamp:a,created:[],deleted:[],edited:[]};vq.set(`logbook/pendingChanges`,JSON.stringify(o))};sync=async()=>{let e=U8(),{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=`${_q.HEDIA_SERVER_BASE_URL}/api/v2/logbooks`,n=await d8(t,{method:Z.HTTPRequestMethod.POST,body:JSON.stringify(e),headers:{"Content-Type":`application/json`}});await E2(n,Z.StatusCode.OK,t,Z.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=U8(),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))};vq.set(`logbook/pendingChanges`,JSON.stringify(_));for(let e of c)V8(e);for(let e of l)H8(e)};getRecentBoluses=(e=new Date(Date.now()-Z.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=dsn();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{esn(t),r.push(t)}catch(t){console.error(t),W8(e),H8(e)}}catch(e){console.error(e)}return r};getLogbookByUUID=e=>{let t=vq.getString(`logbook/${e}`);if(!t)throw Error(`LogbookManager::getLogbookByUUID - could not find logbook in local storage`);let n=lsn(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)}}},V8=e=>{let{uuid:t}=e;if(!t)throw Error(`[LogbookManager::saveLocally] uuid must be defined`);H8(t);let n=dsn();n.push([t,new Date(e.entry_timestamp).getTime()]),n.sort((e,t)=>t[1]-e[1]),vq.set(`logbook/index`,JSON.stringify(n)),vq.set(`logbook/${e.uuid}`,JSON.stringify(e))},H8=e=>{let t=dsn().filter(([t])=>t!==e);vq.set(`logbook/index`,JSON.stringify(t)),vq.delete(`logbook/${e}`)},U8=()=>{let e=vq.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=>lsn(e))}},W8=(e,t)=>{let{created:n,deleted:r,edited:i,last_sync_timestamp:a}=U8(),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)};vq.set(`logbook/pendingChanges`,JSON.stringify(o))},dsn=()=>{let e=vq.getString(`logbook/index`);return e===void 0?[]:JSON.parse(e)},G8=new usn,K8=new class{currentIsConnected=null;isSynchronizing=!1;isListenerAttached=!1;constructor(){this.setListener()}syncAll=async()=>{let e=!Tq&&!E3.getState().accessToken;if(!(this.isSynchronizing||e))try{this.isSynchronizing=!0,await k8.getUserSettings().catch(console.error),await S8.sync().catch(console.error),await G8.sync().catch(console.error),await Can.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&&!Tq&&(ben.addEventListener(this.handleConnectivity),this.isListenerAttached=!0)}};H();var{add:fsn,multiply:psn}=cf;function q8(e,t,n){return fsn(psn(e,t),psn(e.interpolate({inputRange:[0,1],outputRange:[1,0]}),n))}H();var{add:msn,multiply:J8}=cf;function hsn({current:e,next:t,inverted:n,layouts:{screen:r}}){let i=J8(e.progress.interpolate({inputRange:[0,1],outputRange:[r.width,0],extrapolate:`clamp`}),n),a=t?J8(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 gsn({inverted:e,...t}){return hsn({...t,inverted:cf.multiply(e,-1)})}function _sn({current:e,inverted:t,layouts:{screen:n}}){return{cardStyle:{transform:[{translateY:J8(e.progress.interpolate({inputRange:[0,1],outputRange:[n.height,0],extrapolate:`clamp`}),t)}]}}}function vsn({index:e,current:t,next:n,inverted:r,layouts:{screen:i},insets:a}){let o=B.OS===`ios`&&!B.isPad&&!B.isTV&&a.top>20,s=i.width>i.height,c=s?0:10,l=a.top,u=i.height/i.width,d=msn(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=J8(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 ysn({current:e,inverted:t,layouts:{screen:n},closing:r}){let i=J8(e.progress.interpolate({inputRange:[0,1],outputRange:[n.height*.08,0],extrapolate:`clamp`}),t);return{cardStyle:{opacity:q8(r,e.progress,e.progress.interpolate({inputRange:[0,.5,.9,1],outputRange:[0,.25,.7,1],extrapolate:`clamp`})),transform:[{translateY:i}]}}}function bsn({current:e,next:t,inverted:n,layouts:{screen:r}}){let i=J8(e.progress.interpolate({inputRange:[0,1],outputRange:[r.height,0],extrapolate:`clamp`}),n),a=J8(e.progress.interpolate({inputRange:[0,1],outputRange:[r.height*(95.9/100)*-1,0],extrapolate:`clamp`}),n),o=t?J8(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 xsn({current:e,next:t,closing:n}){let r=msn(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:q8(n,e.progress.interpolate({inputRange:[0,1],outputRange:[.925,1],extrapolate:`clamp`}),r.interpolate({inputRange:[0,1,2],outputRange:[.85,1,1.075]}))}]}}}function Ssn({current:e,next:t,inverted:n,closing:r}){let i=J8(e.progress.interpolate({inputRange:[0,1],outputRange:[96,0],extrapolate:`clamp`}),n),a=t?J8(t.progress.interpolate({inputRange:[0,1],outputRange:[0,-96],extrapolate:`clamp`}),n):0;return{cardStyle:{opacity:q8(r,e.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:`clamp`}),e.progress),transform:[{translateX:i},{translateX:a}]}}}function Csn({current:e,inverted:t,layouts:{screen:n},closing:r}){let i=J8(e.progress.interpolate({inputRange:[0,1],outputRange:[n.height*.8,0],extrapolate:`clamp`}),t),a=q8(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 wsn({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 Tsn(){return{}}H();var{add:Y8,multiply:Esn}=cf;function X8({current:e,next:t}){let n=Y8(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 Dsn({current:e,next:t,direction:n,layouts:{screen:r}}){let i=n===`rtl`,a=[{translateX:Y8(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 Osn({current:e,next:t,direction:n,layouts:{screen:r}}){let i=n===`rtl`,a=[{translateX:Y8(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 ksn({current:e,next:t,layouts:{header:n}}){let r=[{translateY:Y8(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 Asn(){return{}}H();var Z8={animation:`spring`,config:{stiffness:1e3,damping:500,mass:3,overshootClamping:!0,restDisplacementThreshold:10,restSpeedThreshold:10}},jsn={animation:`timing`,config:{duration:350,easing:$d.out($d.poly(5))}},Msn={animation:`timing`,config:{duration:150,easing:$d.in($d.linear)}},Nsn={animation:`timing`,config:{duration:425,easing:$d.bezier(.20833,.82,.25,1)}},Psn={animation:`timing`,config:{duration:400,easing:$d.bezier(.20833,.82,.25,1)}};$d.bezier(.20833,.82,.25,1),$d.bezier(.20833,.82,.25,1);var Fsn={animation:`timing`,config:{duration:250,easing:e=>Math.cos((e+1)*Math.PI)/2+.5}},Isn={animation:`timing`,config:{duration:200,easing:e=>e===1?1:e**2}};H();var Lsn=28,Rsn=29,zsn=34,Q8={gestureDirection:`horizontal`,transitionSpec:{open:Z8,close:Z8},cardStyleInterpolator:hsn,headerStyleInterpolator:X8},Bsn={gestureDirection:`vertical`,transitionSpec:{open:Z8,close:Z8},cardStyleInterpolator:_sn,headerStyleInterpolator:X8},Vsn={gestureDirection:`vertical`,transitionSpec:{open:Z8,close:Z8},cardStyleInterpolator:vsn,headerStyleInterpolator:X8},Hsn={gestureDirection:`vertical`,transitionSpec:{open:jsn,close:Msn},cardStyleInterpolator:ysn,headerStyleInterpolator:X8},Usn={gestureDirection:`vertical`,transitionSpec:{open:Nsn,close:Nsn},cardStyleInterpolator:bsn,headerStyleInterpolator:X8},Wsn={gestureDirection:`horizontal`,transitionSpec:{open:Psn,close:Psn},cardStyleInterpolator:xsn,headerStyleInterpolator:X8},Gsn={gestureDirection:`horizontal`,transitionSpec:{open:jsn,close:Msn},cardStyleInterpolator:Ssn,headerStyleInterpolator:X8},Ksn={gestureDirection:`vertical`,transitionSpec:{open:Fsn,close:Isn},cardStyleInterpolator:Csn,headerStyleInterpolator:X8},qsn={gestureDirection:`vertical`,transitionSpec:{open:Fsn,close:Isn},cardStyleInterpolator:wsn,headerStyleInterpolator:X8},$8=B.select({ios:Q8,android:Number(B.Version)>=zsn?Gsn:Number(B.Version)>=Rsn?Wsn:Number(B.Version)>=Lsn?Usn:Hsn,default:Wsn}),Jsn=B.select({ios:Vsn,default:Ksn}),Ysn={...Q8,cardStyleInterpolator:gsn},Xsn=`/assets/png/back-icon.png`,Zsn=`/assets/png/back-icon-mask.png`,Qsn=`/assets/png/clear-icon.png`,$sn=`/assets/png/close-icon.png`,ecn=`/assets/png/search-icon.png`,tcn=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]}})),ncn=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`)}})),rcn=s(((e,t)=>{var n=ncn(),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))}}})),icn=s(((e,t)=>{var n=tcn(),r=rcn(),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}})),acn=s(((e,t)=>{var n=tcn(),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]}})),ocn=s(((e,t)=>{var n=acn();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}})),scn=s(((e,t)=>{var n=acn(),r=ocn(),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})),ccn=s(((e,t)=>{var n=icn(),r=scn(),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}));H();var lcn=cf.createAnimatedComponent(Cp),ucn=B.OS===`android`&&B.Version>=21,dcn=B.OS!==`web`;function fcn({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}=L$(),[p]=U.useState(()=>new cf.Value(1)),m=(e,t)=>{ucn||cf.timing(p,{toValue:e,duration:t,easing:$d.inOut($d.quad),useNativeDriver:dcn}).start()};return(0,G.jsxs)(lcn,{ref:d,accessible:!0,role:B.OS===`web`&&u.href!=null?`link`:`button`,onPress:e?void 0:e=>{if(B.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:ucn&&!e?{color:a===void 0?f?`rgba(255, 255, 255, .32)`:`rgba(0, 0, 0, .32)`:a,...i}:void 0,style:[{cursor:(B.OS===`web`||B.OS===`ios`)&&!e?`pointer`:`auto`,opacity:!ucn&&!e?p:1},c],...u,children:[e?null:(0,G.jsx)(hcn,{...s}),l]})}var e5=U.forwardRef(fcn);e5.displayName=`PlatformPressable`;var pcn=String.raw,t5=`__react-navigation_elements_Pressable_hover`,mcn=pcn`
|
|
880
|
+
'`+a.annotationType_+`' can only be used on properties with a function value.`))}function mtn(e,t,n,r){t.annotationType_,r.value}function htn(e,t,n,r,i){var a,o;i===void 0&&(i=C6.safeDescriptors),mtn(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 gtn(e,t){return{annotationType_:e,options_:t,make_:_tn,extend_:vtn,decorate_20223_:ytn}}function _tn(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,xtn(e,this,t,n,!1,!1)),2)}function vtn(e,t,n,r){var i=xtn(e,this,t,n,this.options_?.bound);return e.defineProperty_(t,i,r)}function ytn(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 btn(e,t,n,r){t.annotationType_,r.value}function xtn(e,t,n,r,i,a){a===void 0&&(a=C6.safeDescriptors),btn(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 Stn(e,t){return{annotationType_:e,options_:t,make_:Ctn,extend_:wtn,decorate_20223_:Ttn}}function Ctn(e,t,n){return this.extend_(e,t,n,!1)===null?0:1}function wtn(e,t,n,r){return Etn(e,this,t,n),e.defineComputedProperty_(t,J3({},this.options_,{get:n.get,set:n.set}),r)}function Ttn(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 Etn(e,t,n,r){t.annotationType_,r.get}function a6(e,t){return{annotationType_:e,options_:t,make_:Dtn,extend_:Otn,decorate_20223_:ktn}}function Dtn(e,t,n){return this.extend_(e,t,n,!1)===null?0:1}function Otn(e,t,n,r){return Atn(e,this,t,n),e.defineObservableProperty_(t,n.value,this.options_?.enhancer??n6,r)}function ktn(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 Atn(e,t,n,r){t.annotationType_}var jtn=`true`,Mtn=Ntn();function Ntn(e){return{annotationType_:jtn,options_:e,make_:Ptn,extend_:Ftn,decorate_20223_:Itn}}function Ptn(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(Ben(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 Ftn(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 Itn(e,t){O3(`'`+this.annotationType_+`' cannot be used as a decorator`)}var Ltn=`observable`,Rtn=`observable.ref`,ztn=`observable.shallow`,Btn=`observable.struct`,Vtn={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(Vtn);function o6(e){return e||Vtn}var Htn=a6(Ltn),Utn=a6(Rtn,{enhancer:r6}),Wtn=a6(ztn,{enhancer:stn}),Gtn=a6(Btn,{enhancer:ctn}),Ktn=X3(Htn);function s6(e){return e.deep===!0?n6:e.deep===!1?r6:Jtn(e.defaultDecorator)}function qtn(e){return e?e.defaultDecorator??Ntn(e):void 0}function Jtn(e){return e?e.options_?.enhancer??n6:n6}function Ytn(e,t,n){if(Q3(t))return Htn.decorate_20223_(e,t);if(F3(t)){Z3(e,t,Htn);return}return crn(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)}Nen(Ytn,Ktn);var c6=Nen(Ytn,{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?Vrn:grn)(e,s6(n),n.name)},map:function(e,t){var n=o6(t);return new brn(e,s6(n),n.name)},set:function(e,t){var n=o6(t);return new wrn(e,s6(n),n.name)},object:function(e,t,n){return n8(function(){return Qnn(C6.useProxies===!1||n?.proxy===!1?$6({},n):urn({},n),e,t)})},ref:X3(Utn),shallow:X3(Wtn),deep:Ktn,struct:X3(Gtn)}),Xtn=`computed`,Ztn=`computed.struct`,Qtn=Stn(Xtn),$tn=Stn(Ztn,{equals:t6.structural}),l6=function(e,t){if(Q3(t))return Qtn.decorate_20223_(e,t);if(F3(t))return Z3(e,t,Qtn);if(L3(e))return X3(Stn(Xtn,e));var n=L3(t)?t:{};return n.get=e,n.name||=e.name||``,new p6(n)};Object.assign(l6,Qtn),l6.struct=X3($tn);var u6=0,enn=1,tnn=A3(function(){},`name`)?.configurable??!1,nnn={value:`action`,configurable:!0,writable:!1,enumerable:!1};function d6(e,t,n,r){n===void 0&&(n=!1);function i(){return rnn(e,n,t,r||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},tnn&&(nnn.value=e,j3(i,`name`,nnn)),i}function rnn(e,t,n,r,i){var a=inn(e,t,r,i);try{return n.apply(r,i)}catch(e){throw a.error_=e,e}finally{ann(a)}}function inn(e,t,n,r){var i=!1,a=0,o=C6.trackingDerivation,s=!t||!o;w6();var c=C6.allowStateChanges;s&&(v6(),c=onn(!0));var l=mnn(!0),u={runAsAction_:s,prevDerivation_:o,prevAllowStateChanges_:c,prevAllowStateReads_:l,notifySpy_:i,startTime_:a,actionId_:enn++,parentActionId_:u6};return u6=u.actionId_,u}function ann(e){u6!==e.actionId_&&O3(30),u6=e.parentActionId_,e.error_!==void 0&&(C6.suppressReactionErrors=!0),snn(e.prevAllowStateChanges_),b6(e.prevAllowStateReads_),T6(),e.runAsAction_&&y6(e.prevDerivation_),C6.suppressReactionErrors=!1}function onn(e){var t=C6.allowStateChanges;return C6.allowStateChanges=e,t}function snn(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}Yen(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 Gen(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_=cnn.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(){wnn(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_)lnn(this)&&(this.warnAboutUntrackedRead_(),w6(),this.value_=this.computeValue_(!1),T6());else if(xnn(this),lnn(this)){var e=C6.trackingContext;this.keepAlive_&&!e&&(C6.trackingContext=this),this.trackAndCompute()&&Cnn(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=onn(!1),n;if(e)n=unn(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 snn(t),this.isComputing=!1,n},t.suspend_=function(){this.keepAlive_||(fnn(this),this.value_=void 0)},t.observe_=function(e,t){var n=this,r=!0,i=void 0;return Vnn(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 Gen(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 cnn;(function(e){e[e.NONE=0]=`NONE`,e[e.LOG=1]=`LOG`,e[e.BREAK=2]=`BREAK`})(cnn||={});var g6=function(e){this.cause=void 0,this.cause=e};function _6(e){return e instanceof g6}function lnn(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=mnn(!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 hnn(e),y6(n),b6(t),!1}}function unn(e,t,n){var r=mnn(!0);hnn(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,dnn(e),b6(r),a}function dnn(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&&ynn(c,e),c.diffValue=0}for(;i--;){var l=n[i];l.diffValue===1&&(l.diffValue=0,vnn(l,e))}r!==h6.UP_TO_DATE_&&(e.dependenciesState_=r,e.onBecomeStale_())}function fnn(e){var t=e.observing_;e.observing_=[];for(var n=t.length;n--;)ynn(t[n],e);e.dependenciesState_=h6.NOT_TRACKING_}function pnn(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 mnn(e){var t=C6.allowStateReads;return C6.allowStateReads=e,t}function b6(e){C6.allowStateReads=e}function hnn(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,gnn=!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(){gnn||O3(35)},1),new x6)}();function _nn(){if((C6.pendingReactions.length||C6.inBatch||C6.isRunningReactions)&&O3(36),gnn=!0,S6){var e=k3();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),C6=new x6}}function vnn(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function ynn(e,t){e.observers_.delete(t),e.observers_.size===0&&bnn(e)}function bnn(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,C6.pendingUnobservations.push(e))}function w6(){C6.inBatch++}function T6(){if(--C6.inBatch===0){Dnn();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 xnn(e){var t=C6.trackingDerivation;return t===null?(e.observers_.size===0&&C6.inBatch>0&&bnn(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 Snn(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 Cnn(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 wnn(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_=cnn.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),Dnn())},t.runReaction_=function(){if(!this.isDisposed){w6(),this.isScheduled=!1;var e=C6.trackingContext;if(C6.trackingContext=this,lnn(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=unn(this,e,void 0);C6.trackingContext=t,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&fnn(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(),fnn(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 Tnn=100,Enn=function(e){return e()};function Dnn(){C6.inBatch>0||C6.isRunningReactions||Enn(Onn)}function Onn(){C6.isRunningReactions=!0;for(var e=C6.pendingReactions,t=0;e.length>0;){++t===Tnn&&(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 knn(e){var t=Enn;Enn=function(n){return e(function(){return t(n)})}}function O6(){return!1}function Ann(e){return console.warn(`[mobx.spy] Is a no-op in production builds`),function(){}}var jnn=`action`,Mnn=`action.bound`,Nnn=`autoAction`,Pnn=`autoAction.bound`,Fnn=`<unnamed action>`,Inn=i6(jnn),Lnn=i6(Mnn,{bound:!0}),Rnn=i6(Nnn,{autoAction:!0}),znn=i6(Pnn,{autoAction:!0,bound:!0});function Bnn(e){return function(t,n){if(P3(t))return d6(t.name||Fnn,t,e);if(P3(n))return d6(t,n,e);if(Q3(n))return(e?Rnn:Inn).decorate_20223_(t,n);if(F3(n))return Z3(t,n,e?Rnn:Inn);if(F3(t))return X3(i6(e?Nnn:jnn,{name:t,autoAction:e}))}}var k6=Bnn(!1);Object.assign(k6,Inn);var A6=Bnn(!0);Object.assign(A6,Rnn),k6.bound=X3(Lnn),A6.bound=X3(znn);function j6(e){return P3(e)&&e.isMobxAction===!0}function Vnn(e,t){var n;t===void 0&&(t=Fen);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=Unn(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 Hnn=function(e){return e()};function Unn(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:Hnn}var Wnn=`onBO`,Gnn=`onBUO`;function Knn(e,t,n){return Jnn(Wnn,e,t,n)}function qnn(e,t,n){return Jnn(Gnn,e,t,n)}function Jnn(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 Ynn=`never`,M6=`always`,Xnn=`observed`;function Znn(e){e.isolateGlobalState===!0&&_nn();var t=e.useProxies,n=e.enforceActions;if(t!==void 0&&(C6.useProxies=t===M6?!0:t===Ynn?!1:typeof Proxy<`u`),t===`ifavailable`&&(C6.verifyProxies=!0),n!==void 0){var r=n===M6?M6:n===Xnn;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&&knn(e.reactionScheduler)}function Qnn(e,t,n,r){var i=Ken(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 $nn(e,t){return ern(t8(e,t))}function ern(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=trn(e.observing_).map(ern)),t}function trn(e){return Array.from(new Set(e))}var nrn=0;function rrn(){this.message=`FLOW_CANCELLED`}rrn.prototype=Object.create(Error.prototype);var irn=gtn(`flow`),arn=gtn(`flow.bound`,{bound:!0}),N6=Object.assign(function(e,t){if(Q3(t))return irn.decorate_20223_(e,t);if(F3(t))return Z3(e,t,irn);var n=e,r=n.name||`<unnamed flow>`,i=function(){var e=this,t=arguments,i=++nrn,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&&orn(s);var e=a.return(void 0),t=Promise.resolve(e.value);t.then(N3,N3),orn(t),o(new rrn)}catch(e){o(e)}}),c};return i.isMobXFlow=!0,i},irn);N6.bound=X3(arn);function orn(e){P3(e.cancel)&&e.cancel()}function P6(e){return e?.isMobXFlow===!0}function srn(e,t){return e?t===void 0?e8(e)||!!e[$3]||ttn(e)||D6(e)||m6(e):e8(e)?e[$3].values_.has(t):!1:!1}function crn(e){return srn(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 lrn={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 urn(e,t){var n;return Ren(),e=$6(e,t),(n=e[$3]).proxy_??(n.proxy_=new Proxy(e,lrn))}function L6(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function R6(e,t){var n=e.interceptors_||=[];return n.push(t),zen(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),zen(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 drn(e,t,n){return n8(function(){var r=$6(e,n)[$3];t??=etn(e),H3(t).forEach(function(e){return r.make_(e,t[e])})}),e}var frn=`splice`,U6=`update`,prn=1e4,mrn={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)}},hrn=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&&Brn(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=Pen),L6(this)){var a=z6(this,{object:this.proxy_,type:frn,index:e,removedCount:t,added:n});if(!a)return Pen;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<prn){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:frn,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 grn(e,t,n,r){return n===void 0&&(n=`ObservableArray`),r===void 0&&(r=!1),Ren(),n8(function(){var i=new hrn(n,t,r,!1);Ven(i.values_,$3,i);var a=new Proxy(i.values_,mrn);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`,_rn),G6(`reduceRight`,_rn);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 _rn(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 vrn=z3(`ObservableArrayAdministration`,hrn);function J6(e){return I3(e)&&vrn(e[$3])}var yrn={},Y6=`add`,X6=`delete`,brn=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]=yrn,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_=ntn(`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),qnn(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 xrn({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 xrn({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)?Wen(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)?(Hen(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(){pnn(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=Srn(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`,brn);function xrn(e){return e[Symbol.toStringTag]=`MapIterator`,Yrn(e)}function Srn(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 Crn={},wrn=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]=Crn,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_=ntn(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(){pnn(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 Trn({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 Trn({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`,wrn);function Trn(e){return e[Symbol.toStringTag]=`SetIterator`,Yrn(e)}var Ern=Object.create(null),Drn=`remove`,Orn=function(){function e(e,t,n,r){t===void 0&&(t=new Map),r===void 0&&(r=Mtn),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)}jrn(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&&jrn(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=Arn(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=Arn(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:Drn}))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_),Snn(a)),this.keysAtom_.reportChanged(),(n=this.pendingKeys_)==null||(n=n.get(e))==null||n.set(e in this.target_),r||i){var s={type:Drn,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 Orn(e,new Map,String(n),qtn(t))),e}var krn=z3(`ObservableObjectAdministration`,Orn);function Arn(e){return Ern[e]||(Ern[e]={get:function(){return this[$3].getObservablePropValue_(e)},set:function(t){return this[$3].setObservablePropValue_(e,t)}})}function e8(e){return I3(e)?krn(e[$3]):!1}function jrn(e,t,n){var r;(r=e.target_[Y3])==null||delete r[n]}var Mrn=Rrn(0),Nrn=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1}(),Prn=0,Frn=function(){};function Irn(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__===void 0?e.prototype=t:e.prototype.__proto__=t}Irn(Frn,Array.prototype);var Lrn=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 hrn(r,n,i,!0);e.proxy_=a,Ven(a,$3,e),t&&t.length&&a.spliceWithArray(0,0,t),Nrn&&Object.defineProperty(a,"0",Mrn)}),a}Yen(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 Yrn({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`}}])}(Frn);Object.entries(W6).forEach(function(e){var t=e[0],n=e[1];t!==`concat`&&R3(Lrn.prototype,t,n)});function Rrn(e){return{enumerable:!1,configurable:!0,get:function(){return this[$3].get_(e)},set:function(t){this[$3].set_(e,t)}}}function zrn(e){j3(Lrn.prototype,``+e,Rrn(e))}function Brn(e){if(e>Prn){for(var t=Prn;t<e+100;t++)zrn(t);Prn=e}}Brn(1e3);function Vrn(e,t,n){return new Lrn(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,Urn(e)),n}if(e8(e)){if(!t)return O3(26);var r=e[$3].values_.get(t);return r||O3(27,t,Urn(e)),r}if(ttn(e)||m6(e)||D6(e))return e}else if(P3(e)&&D6(e[$3]))return e[$3];O3(28)}function Hrn(e,t){if(e||O3(29),t!==void 0)return Hrn(t8(e,t));if(ttn(e)||m6(e)||D6(e)||Z6(e)||Q6(e))return e;if(e[$3])return e[$3];O3(24,e)}function Urn(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)?Hrn(e):t8(e);return n.name_}function n8(e){var t=v6(),n=onn(!0);w6();try{return e()}finally{T6(),snn(n),y6(t)}}var Wrn=M3.toString;function Grn(e,t,n){return n===void 0&&(n=-1),Krn(e,t,n)}function Krn(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=Wrn.call(e);if(o!==Wrn.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=qrn(e),t=qrn(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(!Krn(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)&&Krn(e[m],t[m],n-1,r,i)))return!1}}return r.pop(),i.pop(),!0}function qrn(e){return J6(e)?e.slice():B3(e)||Z6(e)||V3(e)||Q6(e)?Array.from(e.entries()):e}var Jrn=k3().Iterator?.prototype||{};function Yrn(e){return e[Symbol.iterator]=Xrn,Object.assign(Object.create(Jrn),e)}function Xrn(){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:Ann,extras:{getDebugName:Urn},$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 Zrn=/\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`&&Zrn.exec(n)&&(e[t]=new Date(n))}return e}function o8(e){return typeof e==`object`&&!!e&&!r8(e)}var Qrn=class{storageName;schema;constructor(e,t){this.storageName=`${e}Storage`,this.schema=JSON.parse(JSON.stringify(t))}get(){let e=vq.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),vq.set(this.storageName,JSON.stringify(n)),n}set(e){return this.isT(e),vq.set(this.storageName,JSON.stringify(e)),e}clear(){return vq.delete(this.storageName),this.instantiateData(void 0)}instantiateData(e){let t=e??JSON.stringify(this.schema);return vq.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}},$rn=class{persistenceManager;schema;data;constructor(e,t){this.schema=JSON.parse(JSON.stringify(t)),this.data=JSON.parse(JSON.stringify(t)),this.persistenceManager=new Qrn(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 $rn{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 jen(n)}catch{t.push(n)}super.set(t),super.save(!1)}},c8=`3.9.0`,ein=`2026-10-15`,tin=1220,nin=`05700002209597`;H();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}({}),rin=()=>{let{email:e,id:t,country:n=``}=Can.get();return{id:t,isTester:e.includes(`@hedia`),country:n,uuid:i3(),timestamp:new Date().toISOString(),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,platform:B.OS}},u8=(e,t)=>{let{id:n,isTester:r,country:i,uuid:a,timestamp:o,timezone:s,platform:c}=rin(),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)},iin=e=>{let{id:t,isTester:n,country:r,uuid:i,timestamp:a,timezone:o,platform:s}=rin(),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=xen,r=0)=>{if(Tq)return fetch(e,t);let{accessToken:i}=E3.getState();if(!i)throw new Aen(`[hediaFetch] Missing access token`);let a={...t?.headers,Authorization:`Bearer ${i}`,...Dq},o=await T3(e,{...t,headers:a},n);if([Z.StatusCode.UNAUTHORIZED,Z.StatusCode.FORBIDDEN].includes(o.status)){if(r<1)return await oin(),d8(e,t,n,r+1);throw new T2(`[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,ain=async()=>{let{accessToken:e,refreshToken:t,setTokens:n}=E3.getState();if(!t&&!e)throw new Aen(`[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 Een(t);if(r.status===Z.StatusCode.BAD_REQUEST)throw u8(l8.ErrorLogOut),n({accessToken:void 0,refreshToken:void 0}),new Aen(`[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})},oin=()=>(f8===null&&(f8=ain().finally(()=>{f8=null})),f8),sin=async()=>{let e={headers:{Accept:`application/json`,"Content-Type":`application/json`},method:Z.HTTPRequestMethod.GET},t=`${_q.HEDIA_SERVER_BASE_URL}/api/v3/user`,n=await d8(t,e);return await E2(n,Z.StatusCode.OK,t),n.json()},cin={email:``},lin={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`}},uin=(e,t,n)=>{let r,i=lin[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 din={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`})},fin={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`},pin=(e,t,n,r)=>fin[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 min={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)?gin(s,e=>e.test(o)):hin(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 hin(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function gin(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 _in={code:`da`,formatDistance:uin,formatLong:din,formatRelative:pin,localize:min,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}},vin={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`}}},yin=(e,t,n)=>{let r,i=n?.addSuffix?vin[e].withPreposition:vin[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},bin={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`})},xin={lastWeek:`'letzten' eeee 'um' p`,yesterday:`'gestern um' p`,today:`'heute um' p`,tomorrow:`'morgen um' p`,nextWeek:`eeee 'um' p`,other:`P`},Sin=(e,t,n,r)=>xin[e],Cin={narrow:[`v.Chr.`,`n.Chr.`],abbreviated:[`v.Chr.`,`n.Chr.`],wide:[`vor Christus`,`nach Christus`]},win={narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1. Quartal`,`2. Quartal`,`3. Quartal`,`4. Quartal`]},Tin={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`]},Ein={narrow:Tin.narrow,abbreviated:[`Jan.`,`Feb.`,`März`,`Apr.`,`Mai`,`Juni`,`Juli`,`Aug.`,`Sep.`,`Okt.`,`Nov.`,`Dez.`],wide:Tin.wide},Din={code:`de`,formatDistance:yin,formatLong:bin,formatRelative:Sin,localize:{ordinalNumber:e=>Number(e)+`.`,era:m8({values:Cin,defaultWidth:`wide`}),quarter:m8({values:win,defaultWidth:`wide`,argumentCallback:e=>e-1}),month:m8({values:Tin,formattingValues:Ein,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}},Oin={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`}},kin=(e,t,n)=>{let r,i=Oin[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},Ain={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},jin=(e,t,n,r)=>Ain[e],Min={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`})},Nin={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`})},Pin={code:`en-GB`,formatDistance:kin,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:jin,localize:Min,match:Nin,options:{weekStartsOn:1,firstWeekContainsDate:4}},Fin={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`}},Iin=(e,t,n)=>{let r,i=Fin[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},Lin={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`})},Rin={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`},zin={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`},Bin={code:`es`,formatDistance:Iin,formatLong:Lin,formatRelative:(e,t,n,r)=>t.getHours()===1?Rin[e]:zin[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}},Vin={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`}},Hin=(e,t,n)=>{let r,i=Vin[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},Uin={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`})},Win={lastWeek:`eeee 'dernier à' p`,yesterday:`'hier à' p`,today:`'aujourd’hui à' p`,tomorrow:`'demain à' p'`,nextWeek:`eeee 'prochain à' p`,other:`P`},Gin=(e,t,n,r)=>Win[e],Kin={narrow:[`av. J.-C`,`ap. J.-C`],abbreviated:[`av. J.-C`,`ap. J.-C`],wide:[`avant Jésus-Christ`,`après Jésus-Christ`]},qin={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`]},Jin={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`]},Yin={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`]},Xin={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`}},Zin=(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},Qin=[`MMM`,`MMMM`],$in={code:`fr`,formatDistance:Hin,formatLong:Uin,formatRelative:Gin,localize:{preprocessor:(e,t)=>e.getDate()===1||!t.some(e=>e.isToken&&Qin.includes(e.value))?t:t.map(e=>e.isToken&&e.value===`do`?{isToken:!0,value:`d`}:e),ordinalNumber:Zin,era:m8({values:Kin,defaultWidth:`wide`}),quarter:m8({values:qin,defaultWidth:`wide`,argumentCallback:e=>e-1}),month:m8({values:Jin,defaultWidth:`wide`}),day:m8({values:Yin,defaultWidth:`wide`}),dayPeriod:m8({values:Xin,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}},ean={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`}},tan=(e,t,n)=>{let r,i=ean[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},nan={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 ran={};function v8(){return ran}function ian(e){ran=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 aan(e,t,n){let[r,i]=_8(n?.in,e,t);return+y8(r,n)==+y8(i,n)}var oan=[`domenica`,`lunedì`,`martedì`,`mercoledì`,`giovedì`,`venerdì`,`sabato`];function san(e){switch(e){case 0:return`'domenica scorsa alle' p`;default:return`'`+oan[e]+` scorso alle' p`}}function can(e){return`'`+oan[e]+` alle' p`}function lan(e){switch(e){case 0:return`'domenica prossima alle' p`;default:return`'`+oan[e]+` prossimo alle' p`}}var uan={lastWeek:(e,t,n)=>{let r=e.getDay();return aan(e,t,n)?can(r):san(r)},yesterday:`'ieri alle' p`,today:`'oggi alle' p`,tomorrow:`'domani alle' p`,nextWeek:(e,t,n)=>{let r=e.getDay();return aan(e,t,n)?can(r):lan(r)},other:`P`},dan={code:`it`,formatDistance:tan,formatLong:nan,formatRelative:(e,t,n,r)=>{let i=uan[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}},fan={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`}},pan=[`noll`,`en`,`två`,`tre`,`fyra`,`fem`,`sex`,`sju`,`åtta`,`nio`,`tio`,`elva`,`tolv`],man=(e,t,n)=>{let r,i=fan[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t<13?pan[t]:String(t)),n?.addSuffix?n.comparison&&n.comparison>0?`om `+r:r+` sedan`:r},han={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`})},gan={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`},_an={code:`sv`,formatDistance:man,formatLong:han,formatRelative:(e,t,n,r)=>gan[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 van(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]);ian(t)}var yan=R9t(Z.Languages,Z.Languages.en);function ban(e){let t={da:_in,de:Din,es:Bin,fr:$in,it:dan,enGB:Pin,sv:_an};van({locale:e===`en`?t.enGB:t[e]})}function xan(e){return e??yan}function San(e){let{language:t,set:n}=bq.getState();n(e),ban(e),e!==t&&z4t.invalidateQueries({queryKey:[`foods`]})}var Can=new class extends $rn{constructor(){super(`userDetails`,cin)}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 sin();San(xan(e.language)),super.set(e),super.save()}migrateData(){throw Error(`[UserDetailsManager::migrateData] Purposefully not implemented.`)}},wan=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=D2();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}})),Tan=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=wan()})),b8=Tan(),Ean=class{create=async(e,t)=>{try{e.overwrittenByUUID=void 0;let n=Oan();n.eventUpdates.push({...e,uuidOld:t}),vq.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 Tq?(await this.sync(),r(e,t)):(r(e,t),K8.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()-Z.Milliseconds.Minute*90-i.durationSeconds*Z.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=Oan(),t={method:Z.HTTPRequestMethod.POST,body:JSON.stringify(e),headers:{"Content-Type":`application/json`}},n=`${_q.HEDIA_SERVER_BASE_URL}/api/v2/events`,r=await d8(n,t);await E2(r,Z.StatusCode.OK,n,Z.HTTPRequestMethod.POST);let{lastSyncTimestamp:i,eventUpdates:a}=await r.json();for(let e of a)this.saveLocally(e);let o=Oan(),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))};vq.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=vq.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(Dan(e.uuid),vq.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]),vq.set(`event/index`,JSON.stringify(t))}}},Dan=e=>{let t=x8();t=t.filter(t=>t[0]!==e),vq.set(`event/index`,JSON.stringify(t))},x8=()=>{let e=vq.getString(`event/index`);return e===void 0?[]:JSON.parse(e)},Oan=()=>{let e=vq.getString(`event/pendingChanges`);return e===void 0?{lastSyncTimestamp:new Date(0).toJSON(),eventUpdates:[],deletedEvents:[]}:JSON.parse(e)},S8=new Ean,C8=(e,t,n)=>Math.round(e*t*n/100),kan=e=>e.source!==`packaged`,Aan=async()=>{let e=new URLSearchParams({source:`personal`,limit:`100`,sort:`title`}),t=await d8(`${_q.FOOD_BASE_URL}/api/v1/foods?${e.toString()}`,{headers:{Accept:`application/json`}});return t.ok?await t.json():(console.warn(`[listPersonalFoods] server error`),[])},jan=async e=>{let t=new URLSearchParams({source:`curated`,limit:`100`,sort:`title`});e!==void 0&&t.set(`categoryId`,e);let n=`${_q.FOOD_BASE_URL}/api/v1/foods?${t.toString()}`,r=await d8(n,{headers:{Accept:`application/json`}});return await E2(r,Z.StatusCode.OK,n,Z.HTTPRequestMethod.GET),r.json()},Man=async()=>{let e=new URLSearchParams({usedWithinDays:`30`}),t=`${_q.FOOD_BASE_URL}/api/v1/foods?${e.toString()}`,n=await d8(t,{headers:{Accept:`application/json`}});return await E2(n,Z.StatusCode.OK,t,Z.HTTPRequestMethod.GET),(await n.json()).filter(kan)},Nan=async e=>{let t=new URLSearchParams({search:e,limit:`100`}),n=`${_q.FOOD_BASE_URL}/api/v1/foods?${t.toString()}`,r=await d8(n,{headers:{Accept:`application/json`}});return await E2(r,Z.StatusCode.OK,n,Z.HTTPRequestMethod.GET),(await r.json()).filter(kan)},Pan=async e=>{let t=`${_q.FOOD_BASE_URL}/api/v1/foods/${e}`,n=await d8(t,{headers:{Accept:`application/json`}});if(n.status===Z.StatusCode.NOT_FOUND)return null;await E2(n,Z.StatusCode.OK,t,Z.HTTPRequestMethod.GET);let r=await n.json();return!kan(r)||r.deleted?null:r},Fan=async(e,t)=>{let n=`${_q.FOOD_BASE_URL}/api/v1/foods/personal/${e}`,r=await d8(n,{method:Z.HTTPRequestMethod.PATCH,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:JSON.stringify(t)});return await E2(r,Z.StatusCode.OK,n,Z.HTTPRequestMethod.PATCH),r.json()},Ian=async e=>{let t=`${_q.FOOD_BASE_URL}/api/v1/foods/personal/${e}`;await E2(await d8(t,{method:Z.HTTPRequestMethod.DELETE}),Z.StatusCode.NO_CONTENT,t,Z.HTTPRequestMethod.DELETE)},Lan=async e=>{let t=`${_q.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 E2(n,Z.StatusCode.CREATED,t,Z.HTTPRequestMethod.POST),await n.json()},Ran=async e=>{let t=new URLSearchParams({language:e}),n=`${_q.FOOD_BASE_URL}/api/v1/categories?${t.toString()}`,r=await d8(n,{headers:{Accept:`application/json`}});return await E2(r,Z.StatusCode.OK,n,Z.HTTPRequestMethod.GET),r.json()},zan=async e=>{let t=`${_q.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 E2(n,Z.StatusCode.CREATED,t,Z.HTTPRequestMethod.POST),await n.json()},Ban=async e=>{let t=`${_q.FOOD_BASE_URL}/api/v1/food-intakes/${e}`;await E2(await d8(t,{method:Z.HTTPRequestMethod.DELETE}),Z.StatusCode.NO_CONTENT,t,Z.HTTPRequestMethod.DELETE)},Van=o3(Z.CONSTANTS.ACTIVITY_TARGET_GLUCOSE_MIN,Z.CONSTANTS.ACTIVITY_TARGET_GLUCOSE_MAX),Han=a3(90,250),Uan=8,Wan={fromZero:1,fromThirty:.75,fromFortysix:.5,fromSixtyone:null},Gan={fromZero:1,fromThirty:.5,fromFortysix:.25,fromSixtyone:null},Kan={fromZero:1,fromThirty:.25,fromFortysix:null,fromSixtyone:null},qan={fromZero:1,fromThirty:.5,fromFortysix:.5,fromSixtyone:null};function w8(){return{target:Uan,light:Wan,moderate:Gan,hard:Kan,post:qan}}function Jan(){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 Yan(){return{startTime:`00:00`,target:6}}function Xan(){return{targetBGLIntervals:Jan(),overallTargetBGL:Yan(),use:Z.Usage.Intervals}}var Zan=()=>({min:Z.CONSTANTS.TARGET_GLUCOSE_MIN,max:Z.CONSTANTS.TARGET_GLUCOSE_MAX}),Qan=()=>({min:79,max:180}),$an=`19:00`,eon=1.5;function ton(){return{medicineNotification:{toggle:!1,dailyReminderTime:$an},remeasurementNotification:{toggle:!0,remeasurement:eon}}}var T8=new class{get=()=>{let e=vq.getString(`userSettings`),t=this.safeParse(e);return this.migrateAndClean(t)??{}};write=e=>{let t=this.migrateAndClean(e)??{};vq.set(`userSettings`,JSON.stringify(t))};getPending=()=>{let e=vq.getString(`pendingSettingsChanges`);return(this.safeParse(e)??[]).map(e=>this.migrateAndClean(e)??{})};addPending=e=>{let t=this.getPending();t.push(this.migrateAndClean(e)??{}),vq.set(`pendingSettingsChanges`,JSON.stringify(t))};removePending=e=>{let t=e.map(e=>e.uuid),n=this.getPending().filter(e=>!t.includes(e.uuid));vq.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),drn(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 Tq&&_q.IS_PRODUCTION!==`true`&&e instanceof T2&&[Z.StatusCode.UNAVAILABLE_FOR_LEGAL_REASONS,Z.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?Z.HTTPRequestMethod.POST:Z.HTTPRequestMethod.GET,n={headers:{"Content-Type":`application/json`},body:e?JSON.stringify(e):void 0,method:t},r=`${_q.HEDIA_SERVER_BASE_URL}/api/v2/settings`,i=await d8(r,n);return await E2(i,Z.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(_q.IS_PRODUCTION===`true`)throw Error(`[UserSettingsManager::updateMockUserSettings] - This method should only be used outside production environments`);this._uuid=i3(),this._treatmentParameters=O8(2,10,Z.Usage.Overall),this._activity=w8(),this._notifications=ton(),this._glucoseLevelTargets=Xan(),this._glucoseUnit=Z.BloodGlucoseUnit.MMOL_L,this._fastActingInsulin=Z.FastActingInsulin.Apidra,this._longActingInsulin=Z.LongActingInsulin.Lantus,this._injectionMethod=Z.InjectionMethod.Pump,this._diabetesType=Z.DiabetesType.Type1,this._birthDate=`1975-12-31T23:00:00.000Z`,this._biologicalSex=Z.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,non={code:`en-US`,formatDistance:kin,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:jin,localize:Min,match:Nin,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 ron(e,t){let n=e3(e,t?.in);return n.setHours(0,0,0,0),n}function ion(e,t,n){let[r,i]=_8(n?.in,e,t),a=ron(r),o=ron(i),s=+a-A8(a),c=+o-A8(o);return Math.round((s-c)/w9t)}function aon(e,t){let n=e3(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function oon(e,t){let n=e3(e,t?.in);return ion(n,aon(n))+1}function j8(e,t){return y8(e,{...t,weekStartsOn:1})}function son(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 con(e,t){let n=son(e,t),r=$4(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),j8(r)}function lon(e,t){let n=e3(e,t?.in),r=j8(n)-+con(n);return Math.round(r/C9t)+1}function uon(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 don(e,t){let n=v8(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=uon(e,t),a=$4(t?.in||e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),y8(a,t)}function fon(e,t){let n=e3(e,t?.in),r=y8(n,t)-+don(n,t);return Math.round(r/C9t)+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`},pon={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=uon(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(son(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=fon(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):M8(i,t.length)},I:function(e,t,n){let r=lon(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=oon(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 hon(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 hon(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`+mon(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`+mon(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 mon(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 hon(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 gon=(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`})}},_on=(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`})}},von={p:_on,P:(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return gon(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}}`,gon(r,t)).replace(`{{time}}`,_on(i,t))}},yon=/^D+$/,bon=/^Y+$/,xon=[`D`,`DD`,`YY`,`YYYY`];function Son(e){return yon.test(e)}function Con(e){return bon.test(e)}function won(e,t,n){let r=Ton(e,t,n);if(console.warn(r),xon.includes(e))throw RangeError(r)}function Ton(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 Eon(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function Don(e){return!(!Eon(e)&&typeof e!=`number`||isNaN(+e3(e)))}var Oon=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,kon=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Aon=/^'([^]*?)'?$/,jon=/''/g,Mon=/[a-zA-Z]/;function I8(e,t,n){let r=v8(),i=n?.locale??r.locale??non,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(!Don(s))throw RangeError(`Invalid time value`);let c=t.match(kon).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=von[t];return n(e,i.formatLong)}return e}).join(``).match(Oon).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:Non(e)};if(pon[t])return{isToken:!0,value:e};if(t.match(Mon))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&&Con(a)||!n?.useAdditionalDayOfYearTokens&&Son(a))&&won(a,t,String(e));let o=pon[a[0]];return o(s,a,i.localize,l)}).join(``)}function Non(e){let t=e.match(Aon);return t?t[1].replace(jon,`'`):e}var Pon=`mmol/L`,Fon=`mg/dL`,Ion=[0,30],Lon=[0,540],Ron={low:3.9,high:10},zon={low:70,high:180},L8=e=>{if(e===Z.BloodGlucoseUnit.MMOL_L)return{text:Pon,graphLimits:Ion,inputMin:Z.CONSTANTS.GLUCOSE_INPUT_MIN_MMOLL,inputMax:Z.CONSTANTS.GLUCOSE_INPUT_MAX_MMOLL,decimalPlaces:1,placeholder:`-.-`,targetInterval:{low:Ron.low,high:Ron.high}};if(e===Z.BloodGlucoseUnit.MG_DL)return{text:Fon,graphLimits:Lon,inputMin:20,inputMax:600,decimalPlaces:0,placeholder:`-`,targetInterval:{low:zon.low,high:zon.high}};throw Error(`[glucose::getBGConstants] Unsupported glucose unit! ${e}`)};function Bon(e,t,n){return $4(n?.in||e,+e3(e)+t)}function Von(e,t,n){return Bon(e,t*E9t,n)}function Hon(e){return t=>{let n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function Uon(e,t){return e3(e)-+e3(t)}function Won(e,t,n){let r=Uon(e,t)/T9t;return Hon(n?.roundingMethod)(r)}function Gon(e){return e<=29?`0-29`:e<=45?`30-45`:e<=60?`46-60`:`61-120`}function Kon(e,t){let n=new Date,r=Won(t3(Von(new Date(e),1.5),t),n),i=Math.floor(r/60),a=r%60;return i>0?`${i}${xq(`activity_card__active_hour`)} ${a}${xq(`activity_card__active_min`)}`:`${a} ${xq(`activity_card__active_min`)}`}var R8={light:()=>xq(`activity_intensity_1`),moderate:()=>xq(`activity_intensity_2`),hard:()=>xq(`activity_intensity_3`)},qon=Pon,Jon=0,Yon=8,Xon=1,Zon=()=>({displayUnit:qon,inputMin:Jon,inputMax:Yon,decimalPlaces:Xon});F3t.base900,_2.noRisk,_2.lowRisk,_2.moderateRisk,_2.highRisk;function z8(e,t,n){if(t===n)return e;switch(n){case Z.BloodGlucoseUnit.MG_DL:return e*Z.CONSTANTS.MGDL_PER_MMOLL_BGL;case Z.BloodGlucoseUnit.MMOL_L:return e*Z.CONSTANTS.MMOLL_PER_MGDL_BGL;default:throw Error(`[conversionGlucose::convertBGL] Unsupported glucose unit! ${n}`)}}function Qon(e,t){let{decimalPlaces:n}=L8(t);return(Math.round(e*10)/10).toFixed(n)}function B8(e,t,n){return Qon(z8(e,t,n),n)}var $on=X6t({entry_timestamp:g4([J6t(),q6t()]),settings_uuid:q6t(),insulin_entered_units:g4([m4(),h4()]),carbohydrates_entered_grams:g4([m4(),h4()]),blood_glucose_millimolar:g4([m4(),h4()]),blood_ketones_millimolar:g4([m4(),h4(),Y6t()]),event_uuid:g4([q6t(),h4(),Y6t()])});`${w2.textPdf}${w2.textPdf}${w2.textPdf}${w2.textPdf}`;var esn=e=>{$on.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(Z.BloodGlucoseUnit.MMOL_L),{inputMax:s}=Zon();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},tsn=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}),nsn=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}),rsn=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}),isn=new Set,asn=e=>{isn.forEach(t=>{try{t(e)}catch(e){console.error(`[logbookEvents] listener failed`,e)}})},osn=e=>{asn({type:`created`,entry:e})},ssn=(e,t)=>{asn({type:`updated`,oldEntry:e,newEntry:t})},csn=e=>{asn({type:`deleted`,entry:e})};H();var lsn=e=>{let t={...e};return delete t.carbohydrates_modified_suggested_grams,delete t.mood,delete t.smart_pen_sync_timestamp,t},usn=class{constructor(){vq.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=`${B.OS} ${B.Version}`;let r=U8();if(t)e.settings_uuid=this.getLogbookByUUID(t).settings_uuid,r.edited.push({oldUUID:t,newUUID:e.uuid}),H8(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=L9t(),e.timezone=Intl.DateTimeFormat().resolvedOptions().timeZone,r.created.push(e),vq.set(`logbook/pendingChanges`,JSON.stringify(r)),V8(e),n===null?osn(e):ssn(n,e),Tq?await this.syncWeb():K8.syncAll().catch(console.error),e}catch(r){return console.error(r),Tq&&(t?(H8(e.uuid),n!==null&&V8(n),W8(e.uuid,t)):(H8(e.uuid),W8(e.uuid))),null}}deleteLogbook=async e=>{let t=this.getLogbookByUUID(e);try{t.food_intake_id&&await Ban(t.food_intake_id).catch(console.error);let n=U8();return n.deleted.push(e),vq.set(`logbook/pendingChanges`,JSON.stringify(n)),H8(e),csn(t),Tq?await this.syncWeb():K8.syncAll().catch(console.error),!0}catch(n){return console.error(n),Tq&&(V8(t),W8(e)),!1}};syncWeb=async()=>{let e=U8(),t=e=>({method:Z.HTTPRequestMethod.POST,body:JSON.stringify(e),headers:{"Content-Type":`application/json`}}),n=`${_q.HEDIA_SERVER_BASE_URL}/api/v2/logbooks`,r=await d8(n,t(e));await E2(r,Z.StatusCode.OK,n,Z.HTTPRequestMethod.POST);let{created:i,last_sync_timestamp:a}=await r.json();for(let e of i)V8(e);let o={last_sync_timestamp:a,created:[],deleted:[],edited:[]};vq.set(`logbook/pendingChanges`,JSON.stringify(o))};sync=async()=>{let e=U8(),{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=`${_q.HEDIA_SERVER_BASE_URL}/api/v2/logbooks`,n=await d8(t,{method:Z.HTTPRequestMethod.POST,body:JSON.stringify(e),headers:{"Content-Type":`application/json`}});await E2(n,Z.StatusCode.OK,t,Z.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=U8(),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))};vq.set(`logbook/pendingChanges`,JSON.stringify(_));for(let e of c)V8(e);for(let e of l)H8(e)};getRecentBoluses=(e=new Date(Date.now()-Z.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=dsn();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{esn(t),r.push(t)}catch(t){console.error(t),W8(e),H8(e)}}catch(e){console.error(e)}return r};getLogbookByUUID=e=>{let t=vq.getString(`logbook/${e}`);if(!t)throw Error(`LogbookManager::getLogbookByUUID - could not find logbook in local storage`);let n=lsn(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)}}},V8=e=>{let{uuid:t}=e;if(!t)throw Error(`[LogbookManager::saveLocally] uuid must be defined`);H8(t);let n=dsn();n.push([t,new Date(e.entry_timestamp).getTime()]),n.sort((e,t)=>t[1]-e[1]),vq.set(`logbook/index`,JSON.stringify(n)),vq.set(`logbook/${e.uuid}`,JSON.stringify(e))},H8=e=>{let t=dsn().filter(([t])=>t!==e);vq.set(`logbook/index`,JSON.stringify(t)),vq.delete(`logbook/${e}`)},U8=()=>{let e=vq.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=>lsn(e))}},W8=(e,t)=>{let{created:n,deleted:r,edited:i,last_sync_timestamp:a}=U8(),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)};vq.set(`logbook/pendingChanges`,JSON.stringify(o))},dsn=()=>{let e=vq.getString(`logbook/index`);return e===void 0?[]:JSON.parse(e)},G8=new usn,K8=new class{currentIsConnected=null;isSynchronizing=!1;isListenerAttached=!1;constructor(){this.setListener()}syncAll=async()=>{let e=!Tq&&!E3.getState().accessToken;if(!(this.isSynchronizing||e))try{this.isSynchronizing=!0,await k8.getUserSettings().catch(console.error),await S8.sync().catch(console.error),await G8.sync().catch(console.error),await Can.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&&!Tq&&(ben.addEventListener(this.handleConnectivity),this.isListenerAttached=!0)}};H();var{add:fsn,multiply:psn}=cf;function q8(e,t,n){return fsn(psn(e,t),psn(e.interpolate({inputRange:[0,1],outputRange:[1,0]}),n))}H();var{add:msn,multiply:J8}=cf;function hsn({current:e,next:t,inverted:n,layouts:{screen:r}}){let i=J8(e.progress.interpolate({inputRange:[0,1],outputRange:[r.width,0],extrapolate:`clamp`}),n),a=t?J8(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 gsn({inverted:e,...t}){return hsn({...t,inverted:cf.multiply(e,-1)})}function _sn({current:e,inverted:t,layouts:{screen:n}}){return{cardStyle:{transform:[{translateY:J8(e.progress.interpolate({inputRange:[0,1],outputRange:[n.height,0],extrapolate:`clamp`}),t)}]}}}function vsn({index:e,current:t,next:n,inverted:r,layouts:{screen:i},insets:a}){let o=B.OS===`ios`&&!B.isPad&&!B.isTV&&a.top>20,s=i.width>i.height,c=s?0:10,l=a.top,u=i.height/i.width,d=msn(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=J8(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 ysn({current:e,inverted:t,layouts:{screen:n},closing:r}){let i=J8(e.progress.interpolate({inputRange:[0,1],outputRange:[n.height*.08,0],extrapolate:`clamp`}),t);return{cardStyle:{opacity:q8(r,e.progress,e.progress.interpolate({inputRange:[0,.5,.9,1],outputRange:[0,.25,.7,1],extrapolate:`clamp`})),transform:[{translateY:i}]}}}function bsn({current:e,next:t,inverted:n,layouts:{screen:r}}){let i=J8(e.progress.interpolate({inputRange:[0,1],outputRange:[r.height,0],extrapolate:`clamp`}),n),a=J8(e.progress.interpolate({inputRange:[0,1],outputRange:[r.height*(95.9/100)*-1,0],extrapolate:`clamp`}),n),o=t?J8(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 xsn({current:e,next:t,closing:n}){let r=msn(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:q8(n,e.progress.interpolate({inputRange:[0,1],outputRange:[.925,1],extrapolate:`clamp`}),r.interpolate({inputRange:[0,1,2],outputRange:[.85,1,1.075]}))}]}}}function Ssn({current:e,next:t,inverted:n,closing:r}){let i=J8(e.progress.interpolate({inputRange:[0,1],outputRange:[96,0],extrapolate:`clamp`}),n),a=t?J8(t.progress.interpolate({inputRange:[0,1],outputRange:[0,-96],extrapolate:`clamp`}),n):0;return{cardStyle:{opacity:q8(r,e.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:`clamp`}),e.progress),transform:[{translateX:i},{translateX:a}]}}}function Csn({current:e,inverted:t,layouts:{screen:n},closing:r}){let i=J8(e.progress.interpolate({inputRange:[0,1],outputRange:[n.height*.8,0],extrapolate:`clamp`}),t),a=q8(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 wsn({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 Tsn(){return{}}H();var{add:Y8,multiply:Esn}=cf;function X8({current:e,next:t}){let n=Y8(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 Dsn({current:e,next:t,direction:n,layouts:{screen:r}}){let i=n===`rtl`,a=[{translateX:Y8(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 Osn({current:e,next:t,direction:n,layouts:{screen:r}}){let i=n===`rtl`,a=[{translateX:Y8(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 ksn({current:e,next:t,layouts:{header:n}}){let r=[{translateY:Y8(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 Asn(){return{}}H();var Z8={animation:`spring`,config:{stiffness:1e3,damping:500,mass:3,overshootClamping:!0,restDisplacementThreshold:10,restSpeedThreshold:10}},jsn={animation:`timing`,config:{duration:350,easing:$d.out($d.poly(5))}},Msn={animation:`timing`,config:{duration:150,easing:$d.in($d.linear)}},Nsn={animation:`timing`,config:{duration:425,easing:$d.bezier(.20833,.82,.25,1)}},Psn={animation:`timing`,config:{duration:400,easing:$d.bezier(.20833,.82,.25,1)}};$d.bezier(.20833,.82,.25,1),$d.bezier(.20833,.82,.25,1);var Fsn={animation:`timing`,config:{duration:250,easing:e=>Math.cos((e+1)*Math.PI)/2+.5}},Isn={animation:`timing`,config:{duration:200,easing:e=>e===1?1:e**2}};H();var Lsn=28,Rsn=29,zsn=34,Q8={gestureDirection:`horizontal`,transitionSpec:{open:Z8,close:Z8},cardStyleInterpolator:hsn,headerStyleInterpolator:X8},Bsn={gestureDirection:`vertical`,transitionSpec:{open:Z8,close:Z8},cardStyleInterpolator:_sn,headerStyleInterpolator:X8},Vsn={gestureDirection:`vertical`,transitionSpec:{open:Z8,close:Z8},cardStyleInterpolator:vsn,headerStyleInterpolator:X8},Hsn={gestureDirection:`vertical`,transitionSpec:{open:jsn,close:Msn},cardStyleInterpolator:ysn,headerStyleInterpolator:X8},Usn={gestureDirection:`vertical`,transitionSpec:{open:Nsn,close:Nsn},cardStyleInterpolator:bsn,headerStyleInterpolator:X8},Wsn={gestureDirection:`horizontal`,transitionSpec:{open:Psn,close:Psn},cardStyleInterpolator:xsn,headerStyleInterpolator:X8},Gsn={gestureDirection:`horizontal`,transitionSpec:{open:jsn,close:Msn},cardStyleInterpolator:Ssn,headerStyleInterpolator:X8},Ksn={gestureDirection:`vertical`,transitionSpec:{open:Fsn,close:Isn},cardStyleInterpolator:Csn,headerStyleInterpolator:X8},qsn={gestureDirection:`vertical`,transitionSpec:{open:Fsn,close:Isn},cardStyleInterpolator:wsn,headerStyleInterpolator:X8},$8=B.select({ios:Q8,android:Number(B.Version)>=zsn?Gsn:Number(B.Version)>=Rsn?Wsn:Number(B.Version)>=Lsn?Usn:Hsn,default:Wsn}),Jsn=B.select({ios:Vsn,default:Ksn}),Ysn={...Q8,cardStyleInterpolator:gsn},Xsn=`/assets/png/back-icon.png`,Zsn=`/assets/png/back-icon-mask.png`,Qsn=`/assets/png/clear-icon.png`,$sn=`/assets/png/close-icon.png`,ecn=`/assets/png/search-icon.png`,tcn=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]}})),ncn=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`)}})),rcn=s(((e,t)=>{var n=ncn(),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))}}})),icn=s(((e,t)=>{var n=tcn(),r=rcn(),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}})),acn=s(((e,t)=>{var n=tcn(),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]}})),ocn=s(((e,t)=>{var n=acn();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}})),scn=s(((e,t)=>{var n=acn(),r=ocn(),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})),ccn=s(((e,t)=>{var n=icn(),r=scn(),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}));H();var lcn=cf.createAnimatedComponent(Cp),ucn=B.OS===`android`&&B.Version>=21,dcn=B.OS!==`web`;function fcn({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}=L$(),[p]=U.useState(()=>new cf.Value(1)),m=(e,t)=>{ucn||cf.timing(p,{toValue:e,duration:t,easing:$d.inOut($d.quad),useNativeDriver:dcn}).start()};return(0,G.jsxs)(lcn,{ref:d,accessible:!0,role:B.OS===`web`&&u.href!=null?`link`:`button`,onPress:e?void 0:e=>{if(B.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:ucn&&!e?{color:a===void 0?f?`rgba(255, 255, 255, .32)`:`rgba(0, 0, 0, .32)`:a,...i}:void 0,style:[{cursor:(B.OS===`web`||B.OS===`ios`)&&!e?`pointer`:`auto`,opacity:!ucn&&!e?p:1},c],...u,children:[e?null:(0,G.jsx)(hcn,{...s}),l]})}var e5=U.forwardRef(fcn);e5.displayName=`PlatformPressable`;var pcn=String.raw,t5=`__react-navigation_elements_Pressable_hover`,mcn=pcn`
|
|
881
881
|
.${t5} {
|
|
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
|
`,hcn=({color:e,hoverOpacity:t=.08,activeOpacity:n=.16})=>B.OS!==`web`||e==null?null:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`style`,{href:t5,precedence:`elements`,children:mcn}),(0,G.jsx)(`div`,{className:t5,style:{"--overlay-color":e,"--overlay-hover-opacity":t,"--overlay-active-opacity":n}})]});H();function gcn({style:e,...t}){let{colors:n,fonts:r}=L$();return(0,G.jsx)(gd,{...t,style:[{color:n.text},r.regular,e]})}H();function _cn(e,t,n){let r,i=B.OS===`ios`&&n>50?n-(5+1/Lu.get()):n,a=e.width>e.height;return r=B.OS===`ios`?B.isPad||B.isTV?t?56:50:a?32:t?56:44:64,r+i}function vcn(e,t){return typeof e.headerTitle==`string`?e.headerTitle:e.title===void 0?t:e.title}var ycn=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}})),bcn=s(((e,t)=>{t.exports=ycn()}));H();var xcn=bcn(),Scn=U.createContext(void 0);function Ccn(e,t){let n=U.useContext(Scn);if(n==null)throw Error(`useFrameSize must be used within a FrameSizeProvider`);return(0,xcn.useSyncExternalStoreWithSelector)(t?n.subscribeThrottled:n.subscribe,n.getCurrent,n.getCurrent,e)}function wcn({initialFrame:e,render:t}){let n=U.useRef({width:e.width,height:e.height}),r=U.useRef(new Set),i=S$(()=>n.current),a=S$(e=>(r.current.add(e),()=>{r.current.delete(e)})),o=S$(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=U.useMemo(()=>({getCurrent:i,subscribe:a,subscribeThrottled:o}),[a,o,i]),c=S$(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=U.useRef(null);return U.useEffect(()=>{B.OS!==`web`&&l.current?.measure((e,t,n,r)=>{c({width:n,height:r})})},[c]),(0,G.jsxs)(Scn.Provider,{value:s,children:[B.OS===`web`?(0,G.jsx)(Tcn,{onChange:c}):null,t({ref:l,onLayout:e=>{let{width:t,height:n}=e.nativeEvent.layout;c({width:t,height:n})}})]})}function Tcn({onChange:e}){let t=U.useRef(null);return U.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,G.jsx)(`div`,{ref:t,style:{position:`absolute`,left:0,right:0,top:0,bottom:0,pointerEvents:`none`,visibility:`hidden`}})}function Ecn({children:e}){return e}H();function Dcn({disabled:e,onPress:t,pressColor:n,pressOpacity:r,accessibilityLabel:i,testID:a,style:o,href:s,children:c},l){return(0,G.jsx)(e5,{ref:l,disabled:e,href:s,"aria-label":i,testID:a,onPress:t,pressColor:n,pressOpacity:r,android_ripple:Ocn,style:[kcn.container,e&&kcn.disabled,o],hitSlop:B.select({ios:void 0,default:{top:16,right:16,bottom:16,left:16}}),children:c})}var n5=U.forwardRef(Dcn);n5.displayName=`HeaderButton`;var Ocn={borderless:!0,foreground:B.OS===`android`&&B.Version>=23,radius:20},kcn=z.create({container:{flexDirection:`row`,alignItems:`center`,paddingHorizontal:8,borderRadius:10,borderCurve:`continuous`},disabled:{opacity:.5}});H();function r5({source:e,style:t,...n}){let{colors:r}=L$(),{direction:i}=U$();return(0,G.jsx)(Xu,{source:e,resizeMode:`contain`,fadeDuration:0,tintColor:r.text,style:[Mcn.icon,i===`rtl`&&Mcn.flip,t],...n})}var Acn=B.OS===`ios`?21:24,jcn=B.OS===`ios`?8:3,Mcn=z.create({icon:{width:Acn,height:Acn,margin:jcn},flip:{transform:`scaleX(-1)`}});H();function Ncn({disabled:e,allowFontScaling:t,backImage:n,label:r,labelStyle:i,displayMode:a=B.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}=L$(),{direction:b}=U$(),[x,S]=U.useState(null),[C,w]=U.useState(null);return(0,G.jsx)(n5,{disabled:e,href:_,accessibilityLabel:m,testID:h,onPress:()=>{s&&requestAnimationFrame(()=>s())},pressColor:c,pressOpacity:l,style:[i5.container,g],children:(0,G.jsxs)(U.Fragment,{children:[n?n({tintColor:d??v.text}):(0,G.jsx)(r5,{source:Xsn,tintColor:d,style:[i5.icon,a!==`minimal`&&i5.iconWithLabel]}),(()=>{if(a===`minimal`)return null;let e=f&&u?(u.width-f.width)/2-(Pcn+jcn):null,s=a==="default"?r:p,c=e&&x&&C?e>x?s:e>C?p:null:s,l=[y.regular,i5.label,i],m=[l,{position:`absolute`,top:0,left:0,opacity:0}],h=(0,G.jsxs)(V,{style:i5.labelWrapper,children:[r&&a==="default"?(0,G.jsx)(cf.Text,{style:m,numberOfLines:1,onLayout:e=>S(e.nativeEvent.layout.width),children:r}):null,p?(0,G.jsx)(cf.Text,{style:m,numberOfLines:1,onLayout:e=>w(e.nativeEvent.layout.width),children:p}):null,c?(0,G.jsx)(cf.Text,{accessible:!1,onLayout:o,style:[d?{color:d}:null,l],numberOfLines:1,allowFontScaling:!!t,children:c}):null]});return n||B.OS!==`ios`?h:(0,G.jsx)(Ecn,{maskElement:(0,G.jsxs)(V,{style:[i5.iconMaskContainer,u?{minWidth:u.width/2-27}:null],children:[(0,G.jsx)(Xu,{source:Zsn,resizeMode:`contain`,style:[i5.iconMask,b===`rtl`&&i5.flip]}),(0,G.jsx)(V,{style:i5.iconMaskFillerRect})]}),children:h})})()]})})}var Pcn=B.OS===`ios`?13:24,Fcn=B.OS===`ios`?22:3,i5=z.create({container:{paddingHorizontal:0,minWidth:z.hairlineWidth,...B.select({ios:null,default:{marginVertical:3,marginHorizontal:11}})},label:{fontSize:17,letterSpacing:.35},labelWrapper:{flexDirection:`row`,alignItems:`flex-start`,marginEnd:jcn},icon:{width:Pcn,marginEnd:Fcn},iconWithLabel:B.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)`}});H();function Icn({style:e,...t}){let{colors:n,dark:r}=L$();return(0,G.jsx)(cf.View,{style:[Lcn.container,{backgroundColor:n.card,borderBottomColor:n.border,...B.OS===`ios`&&{shadowColor:r?`rgba(255, 255, 255, 0.45)`:`rgba(0, 0, 0, 1)`}},e],...t})}var Lcn=z.create({container:{flex:1,...B.select({android:{elevation:4},ios:{shadowOpacity:.3,shadowRadius:0,shadowOffset:{width:0,height:z.hairlineWidth}},default:{borderBottomWidth:z.hairlineWidth}})}}),a5=u(ccn());H();var Rcn={text:`text`,number:`numeric`,phone:`tel`,email:`email`},zcn=B.OS!==`web`;function Bcn({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=A$(),{dark:m,colors:h,fonts:g}=L$(),[_,v]=U.useState(``),[y,b]=U.useState(e),[x]=U.useState(()=>new cf.Value(+!!e)),[S]=U.useState(()=>new cf.Value(0)),C=U.useRef(e),w=U.useRef(!1),T=U.useRef(null);U.useEffect(()=>{if(e!==C.current)return cf.timing(x,{toValue:+!!e,duration:100,useNativeDriver:zcn}).start(({finished:t})=>{t&&(b(e),C.current=e)}),()=>{x.stopAnimation()}},[e,x]);let E=_!==``;U.useEffect(()=>{w.current!==E&&cf.timing(S,{toValue:+!!E,duration:100,useNativeDriver:zcn}).start(({finished:e})=>{e&&(w.current=E)})},[S,E]);let D=U.useCallback(()=>{T.current?.clear(),T.current?.focus(),v(``)},[]),O=U.useCallback(()=>{D(),s?.({nativeEvent:{text:``}})},[D,s]),k=U.useCallback(()=>{O(),c()},[O,c]);if(U.useEffect(()=>p?.addListener(`blur`,k),[k,p]),U.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,G.jsxs)(cf.View,{pointerEvents:e?`auto`:`none`,"aria-live":`polite`,"aria-hidden":!e,style:[o5.container,{opacity:x},u],children:[(0,G.jsxs)(V,{style:o5.searchbarContainer,children:[(0,G.jsx)(r5,{source:ecn,tintColor:A,style:o5.inputSearchIcon}),(0,G.jsx)(Ip,{...d,ref:T,onChange:s,onChangeText:v,autoFocus:n,autoCapitalize:r===`systemDefault`?void 0:r,inputMode:Rcn[t??`text`],enterKeyHint:o,placeholder:i,placeholderTextColor:(0,a5.default)(A).alpha(.5).string(),cursorColor:h.primary,selectionHandleColor:h.primary,selectionColor:(0,a5.default)(h.primary).alpha(.3).string(),style:[g.regular,o5.searchbar,{backgroundColor:B.select({ios:m?`rgba(255, 255, 255, 0.1)`:`rgba(0, 0, 0, 0.1)`,default:`transparent`}),color:A,borderBottomColor:(0,a5.default)(A).alpha(.2).string()}]}),B.OS===`ios`?(0,G.jsx)(e5,{onPress:O,style:[{opacity:S,transform:[{scale:S}]},o5.clearButton],children:(0,G.jsx)(Xu,{source:Qsn,resizeMode:`contain`,tintColor:A,style:o5.clearIcon})}):null]}),B.OS===`ios`?null:(0,G.jsx)(n5,{onPress:()=>{_?O():c()},style:o5.closeButton,children:(0,G.jsx)(r5,{source:$sn,tintColor:A})}),B.OS===`ios`?(0,G.jsx)(e5,{onPress:k,style:o5.cancelButton,children:(0,G.jsx)(gcn,{style:[g.regular,{color:l??h.primary},o5.cancelText],children:a})}):null]})}var o5=z.create({container:{flex:1,flexDirection:`row`,alignItems:`stretch`},inputSearchIcon:{position:`absolute`,opacity:.5,left:B.select({ios:16,default:4}),top:B.select({ios:-1,default:17}),...B.select({ios:{height:18,width:18},default:{}})},closeButton:{position:`absolute`,opacity:.5,right:B.select({ios:0,default:8}),top:B.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:B.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}})}),Vcn=U.forwardRef(Bcn),s5=`__react_navigation__elements_contexts`;globalThis[s5]=globalThis[s5]??new Map;function Hcn(e,t){let n=globalThis[s5].get(e);return n||(n=U.createContext(t),n.displayName=e,globalThis[s5].set(e,n),n)}var c5=Hcn(`HeaderShownContext`,!1);H();function Ucn({tintColor:e,style:t,...n}){let{colors:r,fonts:i}=L$();return(0,G.jsx)(cf.Text,{role:`heading`,"aria-level":`1`,numberOfLines:1,...n,style:[{color:e===void 0?r.text:e},B.select({ios:i.bold,default:i.medium}),Wcn.title,t]})}var Wcn=z.create({title:B.select({ios:{fontSize:17},android:{fontSize:20},default:{fontSize:18}})});H(),J0();var Gcn=414;function Kcn(e){let t=V0(),n=Ccn(e=>e,!0),{colors:r}=L$(),i=A$(),a=U.useContext(c5),[o,s]=U.useState(!1),[c,l]=U.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=B.OS===`ios`?`center`:`left`,headerLeft:_=p?e=>(0,G.jsx)(Ncn,{...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=B.OS===`ios`?`default`:`minimal`,headerBackTitleStyle:k,headerBackgroundContainerStyle:A,headerStyle:ee,headerShadowVisible:te,headerPressColor:ne,headerPressOpacity:re,headerStatusBarHeight:ie=a?0:t.top}=e,j=_cn(d,f,ie),{height:M=j,maxHeight:ae,minHeight:oe,backfaceVisibility:N,backgroundColor:se,borderBlockColor:P,borderBlockEndColor:F,borderBlockStartColor:ce,borderBottomColor:le,borderBottomEndRadius:ue,borderBottomLeftRadius:de,borderBottomRightRadius:fe,borderBottomStartRadius:pe,borderBottomWidth:me,borderColor:he,borderCurve:I,borderEndColor:ge,borderEndEndRadius:L,borderEndStartRadius:_e,borderEndWidth:ve,borderLeftColor:ye,borderLeftWidth:be,borderRadius:R,borderRightColor:xe,borderRightWidth:Se,borderStartColor:Ce,borderStartEndRadius:we,borderStartStartRadius:Te,borderStartWidth:Ee,borderStyle:De,borderTopColor:Oe,borderTopEndRadius:ke,borderTopLeftRadius:Ae,borderTopRightRadius:je,borderTopStartRadius:Me,borderTopWidth:Ne,borderWidth:Pe,boxShadow:Fe,elevation:Ie,filter:Le,mixBlendMode:Re,opacity:ze,shadowColor:Be,shadowOffset:Ve,shadowOpacity:He,shadowRadius:Ue,transform:We,transformOrigin:Ge,...Ke}=z.flatten(ee||{}),qe={backfaceVisibility:N,backgroundColor:se,borderBlockColor:P,borderBlockEndColor:F,borderBlockStartColor:ce,borderBottomColor:le,borderBottomEndRadius:ue,borderBottomLeftRadius:de,borderBottomRightRadius:fe,borderBottomStartRadius:pe,borderBottomWidth:me,borderColor:he,borderCurve:I,borderEndColor:ge,borderEndEndRadius:L,borderEndStartRadius:_e,borderEndWidth:ve,borderLeftColor:ye,borderLeftWidth:be,borderRadius:R,borderRightColor:xe,borderRightWidth:Se,borderStartColor:Ce,borderStartEndRadius:we,borderStartStartRadius:Te,borderStartWidth:Ee,borderStyle:De,borderTopColor:Oe,borderTopEndRadius:ke,borderTopLeftRadius:Ae,borderTopRightRadius:je,borderTopStartRadius:Me,borderTopWidth:Ne,borderWidth:Pe,boxShadow:Fe,elevation:Ie,filter:Le,mixBlendMode:Re,opacity:ze,shadowColor:Be,shadowOffset:Ve,shadowOpacity:He,shadowRadius:Ue,transform:We,transformOrigin:Ge};for(let e in qe)qe[e]===void 0&&delete qe[e];let Je={...y&&{backgroundColor:`transparent`},...(y||te===!1)&&{borderBottomWidth:0,...B.select({android:{elevation:0},web:{boxShadow:`none`},default:{shadowOpacity:0}})},...qe},Ye=b??B.select({ios:r.primary,default:r.text}),Xe=_?_({tintColor:Ye,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,Ze=S?S({tintColor:Ye,pressColor:ne,pressOpacity:re,canGoBack:!!p}):null,Qe=typeof h==`function`?h:e=>(0,G.jsx)(Ucn,{...e});return(0,G.jsxs)(cf.View,{pointerEvents:`box-none`,style:[{height:M,minHeight:oe,maxHeight:ae,opacity:ze,transform:We}],children:[(0,G.jsx)(cf.View,{pointerEvents:`box-none`,style:[z.absoluteFill,A],children:x?x({style:Je}):(0,G.jsx)(Icn,{pointerEvents:y&&(Je.backgroundColor===`transparent`||(0,a5.default)(Je.backgroundColor).alpha()===0)?`none`:`auto`,style:Je})}),(0,G.jsx)(V,{pointerEvents:`none`,style:{height:ie}}),(0,G.jsxs)(V,{pointerEvents:`box-none`,style:[l5.content,B.OS===`ios`&&n.width>=Gcn?l5.large:null],children:[(0,G.jsx)(cf.View,{pointerEvents:`box-none`,style:[l5.start,!o&&g===`center`&&l5.expand,{marginStart:t.left},T],children:Xe}),B.OS===`ios`||!o?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(cf.View,{pointerEvents:`box-none`,style:[l5.title,{maxWidth:g===`center`?d.width-((Xe?O===`minimal`?32:80:16)+(Ze||v?16:0)+Math.max(t.left,t.right))*2:d.width-((Xe?52:16)+(Ze||v?52:16)+t.left-t.right)},g===`left`&&Xe?{marginStart:4}:{marginHorizontal:16},D],children:Qe({children:m,allowFontScaling:C,tintColor:b,onLayout:u,style:w})}),(0,G.jsxs)(cf.View,{pointerEvents:`box-none`,style:[l5.end,l5.expand,{marginEnd:t.right},E],children:[Ze,v?(0,G.jsx)(n5,{tintColor:Ye,pressColor:ne,pressOpacity:re,onPress:()=>{s(!0),v?.onOpen?.()},children:(0,G.jsx)(r5,{source:ecn,tintColor:Ye})}):null]})]}):null,B.OS===`ios`||o?(0,G.jsx)(Vcn,{...v,visible:o,onClose:()=>{s(!1),v?.onClose?.()},tintColor:b,style:[B.OS===`ios`?[z.absoluteFill,{paddingTop:ie?0:4},{backgroundColor:se??r.card}]:!Xe&&{marginStart:8}]}):null]})]})}var l5=z.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}}),qcn=Hcn(`HeaderBackContext`,void 0),Jcn=Hcn(`HeaderHeightContext`,void 0);function Ycn(){let e=U.useContext(Jcn);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}H(),J0();var{width:Xcn=0,height:Zcn=0}=Uo.get(`window`),Qcn=(B.OS,{frame:{x:0,y:0,width:Xcn,height:Zcn},insets:{top:0,left:0,right:0,bottom:0}});function $cn({children:e,style:t}){let n=U.useContext(U0);return(0,G.jsx)(wcn,{initialFrame:Qcn.frame,render:({ref:r,onLayout:i})=>n?(0,G.jsx)(V,{ref:r,onLayout:i,style:[eln.container,t],children:e}):(0,G.jsx)(x4t,{initialMetrics:Qcn,style:t,onLayout:i,children:e})})}$cn.initialMetrics=Qcn;var eln=z.create({container:{flex:1}}),tln=U.createContext(!1);H();var nln=({children:e})=>(0,G.jsx)(G.Fragment,{children:e}),rln=V,u5={UNDETERMINED:0,FAILED:1,BEGAN:2,CANCELLED:3,ACTIVE:4,END:5};function iln(e,t){let n;return function(...r){n??=(e.apply(this,r),setTimeout(()=>{n=void 0},t))}}H();function aln(e){let{direction:t}=U$(),[n,r]=U.useState(void 0),[i,a]=U.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,G.jsx)(Ncn,{...e}):void 0,headerRight:h,headerBackImage:g,headerBackTitle:_,headerBackButtonDisplayMode:v=B.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=_cn(l,u,k),{height:ne=te}=z.flatten(O||{}),re=typeof ne==`number`?ne:te,{titleStyle:ie,leftButtonStyle:j,leftLabelStyle:M,rightButtonStyle:ae,backgroundStyle:oe}=U.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,G.jsx)(Kcn,{modal:u,layout:l,headerTitle:typeof p==`function`?e=>p({...e,onLayout:o}):e=>(0,G.jsx)(Ucn,{...e,onLayout:o}),headerLeft:m?e=>m({...e,href:f,backImage:g,accessibilityLabel:b,testID:x,allowFontScaling:S,onPress:d,label:_,truncatedLabel:y,labelStyle:[M,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:[ae,E],headerBackButtonDisplayMode:v,headerBackgroundContainerStyle:[oe,D],headerStyle:O,headerStatusBarHeight:k,...ee})}J0();var oln=U.memo(function({back:e,layout:t,progress:n,options:r,route:i,navigation:a,styleInterpolator:o}){let s=V0(),c;r.headerBackTitle===void 0?e&&(c=e.title):c=r.headerBackTitle;let l=U.useCallback(iln(()=>{a.isFocused()&&a.canGoBack()&&a.dispatch({...x$.pop(),source:i.key})},50),[a,i.key]),u=U.useContext(tln),d=U.useContext(c5),f=r.headerStatusBarHeight===void 0?u||d?0:s.top:r.headerStatusBarHeight;return(0,G.jsx)(aln,{...r,title:vcn(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})});H();function sln({mode:e,scenes:t,layout:n,getPreviousScene:r,getFocusedRoute:i,onContentHeightChange:a,style:o}){let s=i(),c=U.useContext(qcn),{buildHref:l}=LKt();return(0,G.jsx)(V,{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:vcn(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`?ksn:C===`horizontal-inverted`?Osn:Dsn:m:Asn};return(0,G.jsx)(WWt,{route:t.descriptor.route,navigation:t.descriptor.navigation,children:(0,G.jsx)(V,{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?cln.header:null,children:u===void 0?(0,G.jsx)(oln,{...T}):u(T)})},t.descriptor.route.key)})})}var cln=z.create({header:{position:`absolute`,top:0,start:0,end:0}});function lln(e,t){for(let n=e.length-1;n>=0;n--)if(t(e[n]))return n;return-1}function d5(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 f5(e,t,n){let r=d5(t,n);switch(t){case`vertical`:case`vertical-inverted`:return e.height*r;case`horizontal`:case`horizontal-inverted`:return e.width*r}}var uln=(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 dln(e=!0){m5=e,p5&&m5&&!gi.getViewManagerConfig(`RNSScreen`)&&console.error(`Screen native module hasn't been linked. Please check the react-native-screens README for more details`)}function fln(e=!0){p5&&(hln=e)}function pln(){return m5}function mln(){return hln}var p5,m5,hln,gln=o((()=>{H(),p5=B.OS===`ios`||B.OS===`android`||B.OS===`windows`,m5=p5,hln=!1}));function _ln(){return _ln=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},_ln.apply(null,arguments)}var h5,vln,yln,g5,bln,xln=o((()=>{H(),h5=u(p()),gln(),vln=V,yln=class extends h5.Component{render(){let{active:e,activityState:t,style:n,enabled:r=pln(),...i}=this.props;return r?(e!==void 0&&t===void 0&&(t=e===0?0:2),h5.createElement(V,_ln({hidden:t===0,style:[n,{display:t===0?`none`:`flex`}]},i))):h5.createElement(V,i)}},g5=cf.createAnimatedComponent(yln),bln=h5.createContext(g5)}));function Sln(){return Sln=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},Sln.apply(null,arguments)}var _5,Cln,wln,Tln,Eln,Dln,Oln,kln,Aln=o((()=>{H(),_5=u(p()),Cln=e=>_5.createElement(V,null,_5.createElement(Xu,Sln({resizeMode:`center`,fadeDuration:0},e))),wln=e=>_5.createElement(V,e),Tln=e=>_5.createElement(V,e),Eln=e=>_5.createElement(V,e),Dln=e=>_5.createElement(V,e),Oln=e=>_5.createElement(V,e),kln=V})),jln,Mln=o((()=>{H(),jln=V})),Nln,Pln=o((()=>{H(),Nln=V})),Fln,Iln=o((()=>{H(),Fln=V})),Lln=s(((e,t)=>{function n(e,...t){}t.exports=n})),Rln,zln=o((()=>{H(),Rln=V}));function Bln(e){return Vln.createElement(Rln,e)}var Vln,Hln=o((()=>{Vln=u(p()),zln()})),Uln,Wln,Gln=o((()=>{Uln=u(p()),Wln=Uln.createContext(null)})),Kln,qln,Jln=o((()=>{H(),Kln=V,qln=V})),Yln,Xln=o((()=>{H(),Yln=V})),Zln,Qln,$ln,eun,tun,nun,run,iun,v5,y5,aun,oun,sun,cun,lun,uun,dun,fun,b5,pun=o((()=>{Zln=!0,Qln=!0,$ln=!0,eun=!1,tun=!0,nun=!0,run=!1,iun={isNewBackTitleImplementation:!0,usesHeaderFlexboxImplementation:!0,usesNewAndroidHeaderHeightImplementation:!0,usesStableTabsApi:!0},v5={experiment:{synchronousScreenUpdatesEnabled:Zln,synchronousHeaderConfigUpdatesEnabled:Qln,synchronousHeaderSubviewUpdatesEnabled:$ln,androidLegacyTopInsetBehavior:eun,androidResetScreenShadowStateOnOrientationChangeEnabled:tun,iosOrientationInheritanceFixEnabled:nun},stable:{debugLogging:run}},y5=(e,t)=>({get(){return v5.experiment[e]},set(n){n!==v5.experiment[e]&&v5.experiment[e]!==t&&console.error(`[RNScreens] ${e} feature flag modified for a second time; this might lead to unexpected effects`),v5.experiment[e]=n}}),aun=(e,t)=>({get(){return v5.stable[e]},set(n){n!==v5.stable[e]&&v5.stable[e]!==t&&console.error(`[RNScreens] ${e} feature flag modified for a second time; this might lead to unexpected effects`),v5.stable[e]=n}}),oun=y5(`synchronousScreenUpdatesEnabled`,Zln),sun=y5(`synchronousHeaderConfigUpdatesEnabled`,Qln),cun=y5(`synchronousHeaderSubviewUpdatesEnabled`,$ln),lun=y5(`androidLegacyTopInsetBehavior`,eun),uun=y5(`androidResetScreenShadowStateOnOrientationChangeEnabled`,tun),dun=y5(`iosOrientationInheritanceFixEnabled`,nun),fun=aun(`debugLogging`,run),b5={experiment:{get synchronousScreenUpdatesEnabled(){return oun.get()},set synchronousScreenUpdatesEnabled(e){oun.set(e)},get synchronousHeaderConfigUpdatesEnabled(){return sun.get()},set synchronousHeaderConfigUpdatesEnabled(e){sun.set(e)},get synchronousHeaderSubviewUpdatesEnabled(){return cun.get()},set synchronousHeaderSubviewUpdatesEnabled(e){cun.set(e)},get androidLegacyTopInsetBehavior(){return lun.get()},set androidLegacyTopInsetBehavior(e){lun.set(e)},get androidResetScreenShadowStateOnOrientationChangeEnabled(){return uun.get()},set androidResetScreenShadowStateOnOrientationChangeEnabled(e){uun.set(e)},get iosOrientationInheritanceFixEnabled(){return dun.get()},set iosOrientationInheritanceFixEnabled(e){dun.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 fun.get()},set debugLogging(e){fun.set(e)}}}})),mun,hun=o((()=>{H(),mun=B.OS===`ios`&&parseInt(B.Version,10)>=26}));function gun(e,t,n,r,i){let{topAlreadyApplied:a,leftDisabled:o,rightDisabled:s,bottomDisabled:c}=x5.useContext(vun),l=b5.experiment?.androidLegacyTopInsetBehavior??!1,u=l||!a&&e,d=u&&!t,f=o||n,p=s||r,m=c||i,h=x5.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 x5,_un,vun,yun=o((()=>{x5=u(p()),pun(),_un={topAlreadyApplied:!1,leftDisabled:!1,rightDisabled:!1,bottomDisabled:!1},vun=x5.createContext(_un)}));function bun(){return bun=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},bun.apply(null,arguments)}function xun({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}=gun(!t?.hidden,t?.disableTopInsetApplication??!1,t?.disableLeftInsetApplication??!1,t?.disableRightInsetApplication??!1,t?.disableBottomInsetApplication??!1),h=S5.useRef(null),g=S5.useContext(Wln);S5.useImperativeHandle(p,()=>h.current);let _=i??`push`,v=t?.hidden??!1,y=B.OS===`android`?!1:_!==`push`&&v===!1,b=S5.useRef(v);S5.useEffect(()=>{(0,Tun.default)(B.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,Tun.default)(x&&S&&mun,"[RNScreens] Using both `blurEffect` and `scrollEdgeEffects` simultaneously may cause overlapping effects.");let C=Sun(a,_),w;if(_===`formSheet`&&B.OS===`ios`&&o){let{screenStyles:e,contentWrapperStyles:t}=Cun(o);w=e,o=t}let T=mun,E=S5.createElement(S5.Fragment,null,S5.createElement(vun.Provider,{value:m},S5.createElement(Bln,{contentStyle:o,style:C,stackPresentation:_},T?S5.createElement(Yln,{edges:wun(t)},e):e)),S5.createElement(Oln,t),_===`formSheet`&&d&&S5.createElement(qln,null,d()));return S5.createElement(g5,bun({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?S5.createElement(Fln,{style:C5.container},S5.createElement(g5,{enabled:!0,isNativeStack:!0,activityState:n,shouldFreeze:r,hasLargeHeader:t?.largeTitle??!1,scrollEdgeEffects:u,style:z.absoluteFill,onHeaderHeightChange:l},E)):E)}function Sun(e,t){let n=B.OS===`ios`;return t===`formSheet`?n?e!==`fitToContents`&&b5.experiment.synchronousScreenUpdatesEnabled?C5.container:C5.absoluteWithNoBottom:e===`fitToContents`?C5.absoluteWithNoBottom:C5.container:C5.container}function Cun(e){let{backgroundColor:t,...n}=z.flatten(e);return{screenStyles:{backgroundColor:t},contentWrapperStyles:n}}function wun(e){if(B.OS!==`ios`||parseInt(B.Version,10)<26)return{};let t;return t=e?.translucent||e?.hidden?{}:{top:!0},t}var S5,Tun,Eun,C5,Dun=o((()=>{S5=u(p()),H(),Tun=u(Lln()),Hln(),Aln(),xln(),Iln(),Gln(),Jln(),Xln(),pun(),hun(),yun(),Eun=S5.forwardRef(xun),C5=z.create({container:{flex:1},absoluteWithNoBottom:{position:`absolute`,top:0,start:0,end:0}})})),Oun,kun=o((()=>{H(),Oun=V}));function Aun(){return Sf.exitApp(),!0}var jun,Mun=o((()=>{H(),jun=[`ios`,`android`].includes(B.OS),B.OS})),Nun,Pun,Fun=o((()=>{Nun=u(p()),Pun=Nun.createContext(void 0)}));function Iun(){let e=Lun.useContext(Pun);if(e===void 0)throw Error(`Couldn't find values for transition progress. Are you inside a screen in Native Stack?`);return e}var Lun,Run=o((()=>{Lun=u(p()),Fun()})),zun,Bun=o((()=>{H(),zun=V})),Vun=o((()=>{Bun()})),Hun,Uun=o((()=>{H(),Hun=V})),Wun=o((()=>{Uun()})),Gun,Kun=o((()=>{Vun(),Wun(),Gun={Host:zun,Screen:Hun}})),qun=c({FullWindowOverlay:()=>Oun,InnerScreen:()=>vln,Screen:()=>g5,ScreenContainer:()=>Nln,ScreenContentWrapper:()=>Rln,ScreenContext:()=>bln,ScreenFooter:()=>Kln,ScreenStack:()=>Fln,ScreenStackHeaderBackButtonImage:()=>Cln,ScreenStackHeaderCenterView:()=>Eln,ScreenStackHeaderConfig:()=>Oln,ScreenStackHeaderLeftView:()=>Tln,ScreenStackHeaderRightView:()=>wln,ScreenStackHeaderSearchBarView:()=>Dln,ScreenStackHeaderSubview:()=>kln,ScreenStackItem:()=>Eun,SearchBar:()=>jln,Tabs:()=>Gun,compatibilityFlags:()=>iun,enableFreeze:()=>fln,enableScreens:()=>dln,executeNativeBackPress:()=>Aun,featureFlags:()=>b5,freezeEnabled:()=>mln,isSearchBarAvailableForCurrentPlatform:()=>jun,screensEnabled:()=>pln,useTransitionProgress:()=>Iun}),Jun=o((()=>{gln(),xln(),Aln(),Mln(),Pln(),Iln(),Dun(),kun(),Jln(),zln(),Mun(),pun(),Run(),Kun()}));H();var w5;try{w5=(Jun(),d(qun))}catch{}var Yun=({enabled:e,...t})=>w5==null?(0,G.jsx)(V,{...t}):(0,G.jsx)(w5.ScreenContainer,{enabled:e,...t}),Xun=({enabled:e,active:t,...n})=>w5==null?(0,G.jsx)(V,{...n}):(0,G.jsx)(w5.Screen,{enabled:e,activityState:t,...n});H();function Zun({enabled:e,focused:t}){let n=U.useRef(void 0),r=U.useRef(0),i=U.useRef(void 0),a=U.useRef(e),o=U.useCallback(()=>{i.current!==void 0&&(clearTimeout(i.current),i.current=void 0)},[]),s=U.useCallback(()=>{if(!a.current)return;o();let e=Ip.State.currentlyFocusedInput();e?.blur(),n.current=e,r.current=Date.now()},[o]),c=U.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=U.useCallback(({gesture:e,active:t,closing:r})=>{if(a.current){if(!r){c();return}o(),e?t&&n.current?.blur():wf.dismiss(),n.current=void 0}},[o,c]);return U.useLayoutEffect(()=>{a.current&&!t&&wf.dismiss()},[t]),U.useLayoutEffect(()=>{a.current=e}),U.useEffect(()=>()=>o(),[o]),{onPageChangeStart:s,onPageChangeConfirm:l,onPageChangeCancel:c}}var Qun=U.createContext(void 0),$un=50,edn=135,tdn=({direction:e,gestureDirection:t,gestureResponseDistance:n,layout:r})=>{let i=n===void 0?t===`vertical`||t===`vertical-inverted`?edn:$un: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 d5(t,e===`rtl`)===1?{minOffsetX:5,maxDeltaY:20,hitSlop:{right:n},enableTrackpadTwoFingerGesture:!0}:{minOffsetX:-5,maxDeltaY:20,hitSlop:{left:n},enableTrackpadTwoFingerGesture:!0}}};H();function ndn({offset:e,radius:t,opacity:n,color:r=`#000`}){return B.select({web:{boxShadow:`${e.width}px ${e.height}px ${t}px ${(0,a5.default)(r).alpha(n).toString()}`},default:{shadowOffset:e,shadowRadius:t,shadowColor:r,shadowOpacity:n}})}H();function rdn({enabled:e,layout:t,style:n,...r}){let[i,a]=U.useState(!1);return U.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,G.jsx)(V,{...r,pointerEvents:`box-none`,style:[e&&i?idn.page:idn.card,n]})}var idn=z.create({page:{minHeight:`100%`},card:{flex:1,overflow:`hidden`}});H();var adn=.3,odn=1,T5=0,sdn=B.OS!==`web`,cdn=e=>{if(e){let t=z.flatten(e);return`opacity`in t&&t.opacity!=null}return!1},ldn=({closing:e,layout:t,gestureDirection:n,direction:r,preloaded:i})=>!e&&!i?0:f5(t,n,r===`rtl`),udn=({style:e})=>e?(0,G.jsx)(cf.View,{pointerEvents:`none`,style:[E5.overlay,e]}):null;function ddn({shadowEnabled:e=!1,gestureEnabled:t=!0,gestureVelocityImpact:n=adn,overlay:r=udn,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=U.useRef(!1),ee=U.useRef(void 0),te=U.useRef(void 0),ne=U.useRef(void 0),re=U.useRef(void 0),ie=U.useRef(void 0),[j]=U.useState(()=>new cf.Value(T5)),[M]=U.useState(()=>new cf.Value(d5(h,p===`rtl`))),[ae]=U.useState(()=>({width:new cf.Value(d.width),height:new cf.Value(d.height)})),[oe]=U.useState(()=>new cf.Value(T5)),N=S$(()=>{te.current===void 0&&(te.current=ws.createInteractionHandle())}),se=S$(()=>{te.current!==void 0&&(ws.clearInteractionHandle(te.current),te.current=void 0)}),P=S$(({closing:e,velocity:t})=>{let n=ldn({closing:e,layout:d,gestureDirection:h,direction:p,preloaded:E});ee.current=n,j.setValue(e?odn:T5);let r=e?T.close:T.open,a=r.animation===`spring`?cf.spring:cf.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(()=>{ue()})};i?(N(),a(u,{...r.config,velocity:t,toValue:n,useNativeDriver:sdn,isInteraction:!1}).start(({finished:e})=>{se(),clearTimeout(re.current),e&&o()})):o()}),F=S$(({nativeEvent:e})=>{switch(e.state){case u5.ACTIVE:clearTimeout(re.current),clearTimeout(ie.current),oe.setValue(odn),N(),y?.();break;case u5.CANCELLED:case u5.FAILED:oe.setValue(T5),se(),P({closing:s,velocity:h===`vertical`||h===`vertical-inverted`?e.velocityY:e.velocityX}),b?.();break;case u5.END:{oe.setValue(T5);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)*d5(h,p===`rtl`)>t/2?i!==0||r!==0:s;P({closing:a,velocity:i}),a&&(re.current=setTimeout(()=>{_(),ie.current=setTimeout(()=>{ue()},32)},16)),x?.();break}}});U.useLayoutEffect(()=>{ae.width.setValue(d.width),ae.height.setValue(d.height),M.setValue(d5(h,p===`rtl`))},[h,p,M,ae.width,ae.height,d.width,d.height]);let ce=U.useRef(null);U.useEffect(()=>()=>{se(),ne.current&&cancelAnimationFrame(ne.current),clearTimeout(re.current),clearTimeout(ie.current)},[]);let le=U.useRef(void 0),ue=S$(()=>{if(clearTimeout(re.current),clearTimeout(ie.current),!A.current)clearTimeout(le.current),le.current=setTimeout(()=>{A.current=!0,P({closing:s})},0);else{let e=ce.current?.opening,t=ce.current?ldn(ce.current):null,n=ldn({closing:s,layout:d,gestureDirection:h,direction:p,preloaded:E});t!==n||ee.current!==n?P({closing:s}):typeof e==`boolean`&&o&&!e&&(u.setValue(f5(d,h,p===`rtl`)),P({closing:s}))}});U.useEffect(()=>{E||(ue(),ce.current={opening:o,closing:s,layout:d,gestureDirection:h,direction:p,preloaded:E})},[P,s,p,u,h,d,o,E,ue]);let de=U.useMemo(()=>({index:a,current:{progress:l},next:c&&{progress:c},closing:j,swiping:oe,inverted:M,layouts:{screen:d},insets:{top:f.top,right:f.right,bottom:f.bottom,left:f.left}}),[a,l,c,j,oe,M,d,f.top,f.right,f.bottom,f.left]),{containerStyle:fe,cardStyle:pe,overlayStyle:me,shadowStyle:he}=U.useMemo(()=>D(de),[D,de]),I=U.useMemo(()=>t?cf.event([{nativeEvent:h===`vertical`||h===`vertical-inverted`?{translationY:u}:{translationX:u}}],{useNativeDriver:sdn}):void 0,[u,h,t]),{backgroundColor:ge}=z.flatten(k||{}),L=typeof ge==`string`?(0,a5.default)(ge).alpha()===0:!1;return(0,G.jsxs)(Qun.Provider,{value:de,children:[B.OS===`web`?null:(0,G.jsx)(cf.View,{style:{opacity:l},collapsable:!1}),C?(0,G.jsx)(V,{pointerEvents:`box-none`,style:z.absoluteFill,children:r({style:me})}):null,(0,G.jsx)(cf.View,{pointerEvents:`box-none`,style:[E5.container,fe,O],children:(0,G.jsx)(nln,{enabled:d.width!==0&&t,onGestureEvent:I,onHandlerStateChange:F,...tdn({layout:d,direction:p,gestureDirection:h,gestureResponseDistance:w}),children:(0,G.jsxs)(cf.View,{pointerEvents:`box-none`,needsOffscreenAlphaCompositing:cdn(pe),style:[E5.container,pe],children:[e&&he&&!L?(0,G.jsx)(cf.View,{pointerEvents:`none`,style:[E5.shadow,h===`horizontal`?[E5.shadowHorizontal,E5.shadowStart]:h===`horizontal-inverted`?[E5.shadowHorizontal,E5.shadowEnd]:h===`vertical`?[E5.shadowVertical,E5.shadowTop]:[E5.shadowVertical,E5.shadowBottom],{backgroundColor:ge},he]}):null,(0,G.jsx)(rdn,{enabled:m,layout:d,style:k,children:S})]})})})]})}var E5=z.create({container:{flex:1},overlay:{flex:1,backgroundColor:`#000`},shadow:{position:`absolute`},shadowHorizontal:{top:0,bottom:0,width:3,...ndn({offset:{width:-1,height:1},radius:5,opacity:.3})},shadowStart:{start:0},shadowEnd:{end:0},shadowVertical:{start:0,end:0,height:3,...ndn({offset:{width:1,height:-1},radius:5,opacity:.3})},shadowTop:{top:0},shadowBottom:{bottom:0}});H();var fdn=U.forwardRef(({focused:e,active:t,animated:n,isNextScreenTransparent:r,detachCurrentScreen:i,children:a},o)=>{let[s,c]=U.useState(!1);U.useImperativeHandle(o,()=>({setInert:c}),[]);let l=!n&&r===!1&&i!==!1&&!e;return(0,G.jsx)(V,{"aria-hidden":!e,pointerEvents:(n?s:!e)?`none`:`box-none`,style:[z.absoluteFill,{overflow:t?void 0:`hidden`,display:B.OS!==`web`&&l?`none`:`flex`,visibility:l?`hidden`:`visible`}],collapsable:!1,children:a})});fdn.displayName=`CardA11yWrapper`,H();var pdn=.1;function mdn({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=U.useRef(null),{direction:te}=U$(),ne=U.useContext(Jcn),{options:re}=A.descriptor,{onPageChangeStart:ie,onPageChangeCancel:j,onPageChangeConfirm:M}=Zun({enabled:o&&re.keyboardHandlingEnabled!==!1,focused:o}),ae=()=>{let{route:e}=A.descriptor;S({route:e},!1),v({route:e})},oe=()=>{let{route:e}=A.descriptor;S({route:e},!0),_({route:e})},N=()=>{let{route:e}=A.descriptor;ie(),x({route:e})},se=()=>{let{route:e}=A.descriptor;j(),y({route:e})},P=()=>{let{route:e}=A.descriptor;b({route:e})},F=({closing:e,gesture:t})=>{ee.current?.setInert(e);let{route:r}=A.descriptor;M?.({gesture:t,active:n,closing:e}),C?.({route:r},e)},ce={top:k,right:O,bottom:E,left:D},{colors:le}=L$();U.useEffect(()=>{let e=A.progress.next?.addListener?.(({value:e})=>{ee.current?.setInert(e>pdn)});return()=>{e&&A.progress.next?.removeListener?.(e)}},[A.progress.next]);let{presentation:ue,animation:de,cardOverlay:fe,cardOverlayEnabled:pe,cardShadowEnabled:me,cardStyle:he,cardStyleInterpolator:I,gestureDirection:ge,gestureEnabled:L,gestureResponseDistance:_e,gestureVelocityImpact:ve,headerMode:ye,headerShown:be,headerTransparent:R,transitionSpec:xe}=A.descriptor.options,{buildHref:Se}=LKt(),Ce=c({route:A.descriptor.route}),we,Te;if(Ce){let{options:e,route:t}=Ce.descriptor;we=vcn(e,t.name),Te=Se(t.name,t.params)}let Ee=Ce!=null,De=U.useMemo(()=>{if(Ee)return{href:Te,title:we}},[Ee,we,Te]),Oe=de!==`none`;return(0,G.jsx)(fdn,{ref:ee,focused:o,active:n,animated:Oe,isNextScreenTransparent:m,detachCurrentScreen:h,children:(0,G.jsx)(ddn,{animated:Oe,interpolationIndex:e,gestureDirection:ge,layout:g,insets:ce,direction:te,gesture:a,current:A.progress.current,next:A.progress.next,opening:r,closing:i,onOpen:ae,onClose:oe,overlay:fe,overlayEnabled:pe,shadowEnabled:me,onTransition:F,onGestureBegin:N,onGestureCanceled:se,onGestureEnd:P,gestureEnabled:t===0?!1:L,gestureResponseDistance:_e,gestureVelocityImpact:ve,transitionSpec:xe,styleInterpolator:I,pageOverflowEnabled:ye!==`float`&&ue!==`modal`,preloaded:w,containerStyle:u&&ye!==`screen`?{marginTop:d}:null,contentStyle:[{backgroundColor:ue===`transparentModal`?`transparent`:le.background},he],children:(0,G.jsx)(V,{style:gdn.container,children:(0,G.jsxs)(tln.Provider,{value:s,children:[ye===`float`?null:T({mode:`screen`,layout:g,scenes:[Ce,A],getPreviousScene:c,getFocusedRoute:l,onContentHeightChange:f,style:[gdn.header,R?{minHeight:d}:null]}),(0,G.jsx)(V,{style:gdn.scene,children:(0,G.jsx)(qcn.Provider,{value:De,children:(0,G.jsx)(c5.Provider,{value:p||be!==!1,children:(0,G.jsx)(Jcn.Provider,{value:be===!1?ne??0:d,children:A.descriptor.render()})})})})]})})})})}var hdn=U.memo(mdn),gdn=z.create({container:{flex:1},header:{zIndex:1},scene:{flex:1}});H();var _dn={default:$8,fade:qsn,fade_from_bottom:Hsn,fade_from_right:Gsn,none:$8,reveal_from_bottom:Usn,scale_from_center:Wsn,slide_from_left:Ysn,slide_from_right:Q8,slide_from_bottom:B.select({ios:Bsn,default:Ksn})},vdn=1e-5,D5=0,ydn=1,bdn=2,xdn=Object.freeze({options:{}}),Sdn=(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},O5=e=>e===vsn||e.name===`forModalPresentationIOS`,Cdn=(e,t,n)=>{if(n)return!0;let{cardStyleInterpolator:r}=e.descriptor.options;return O5(r)&&t!==0},wdn=(e,t,n,r,i,a)=>e.reduce((o,s,c)=>{let{headerStatusBarHeight:l=n?0:t.top,headerStyle:u}=s.descriptor.options,d=z.flatten(u||{}),f=`height`in d&&typeof d.height==`number`?d.height:a[s.route.key],p=Cdn(s,Sdn(e,c),r);return o[s.route.key]=typeof f==`number`?f:_cn(i,p,l),o},{}),Tdn=(e,t,n)=>{if(t?.gestureDirection)return f5(e,t.gestureDirection,n);let r=t?.presentation===`modal`?Jsn.gestureDirection:$8.gestureDirection;return f5(e,t?.animation?_dn[t?.animation]?.gestureDirection:r,n)},Edn=(e,t,n,r)=>{let i=Tdn({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 Ddn(e){let t=B.OS!==`web`&&B.OS!==`windows`&&B.OS!==`macos`;return e??(t?`default`:`none`)}function Odn(e){return Ddn(e)!==`none`}var kdn=class extends U.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 cf.Value(e.openingRouteKeys.includes(r.key)&&Odn(a)||e.state.preloadedRoutes.includes(r)?Tdn(t.layout,i?.options,e.direction===`rtl`):0),n},{}),r=uln([...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:xdn),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=Ddn(_.animation),b=Odn(y),x=y==="default"?_.presentation===`transparentModal`?qsn:_.presentation===`modal`||v?Jsn:$8:_dn[y],{gestureEnabled:S=B.OS===`ios`&&b,gestureDirection:C=x.gestureDirection,transitionSpec:w=x.transitionSpec,cardStyleInterpolator:T=b?x.cardStyleInterpolator:Tsn,headerStyleInterpolator:E=x.headerStyleInterpolator,cardOverlayEnabled:D=B.OS!==`ios`&&_.presentation!==`transparentModal`||O5(T)}=_,O=m.options.headerMode??(!(_.presentation===`modal`||_.presentation===`transparentModal`||h?.presentation===`modal`||h?.presentation===`transparentModal`||O5(T))&&B.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:Edn(d,t.layout,m.options,k),next:p&&h?.presentation!==`transparentModal`?Edn(p,t.layout,h,k):void 0,previous:f?Edn(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:O5(r.cardStyleInterpolator)?t!==lln(i,e=>{let{cardStyleInterpolator:t}=e.descriptor.options;return t===vsn||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===D5&&!c)o=D5;else{let e=i[a.length-1],t=r===a.length-1?bdn:c?ydn:D5;o=e?e.progress.current.interpolate({inputRange:[0,1-vdn,1],outputRange:[1,1,t],extrapolate:`clamp`}):ydn}return o})}return{routes:e.routes,scenes:i,gestures:n,descriptors:e.descriptors,activeStates:a,headerHeights:wdn(i,e.insets,e.isParentHeaderShown,e.isParentModal,t.layout,t.headerHeights)}}constructor(e){super(e),this.state={routes:[],scenes:[],gestures:{},layout:$cn.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:wdn(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=B.OS===`web`||B.OS===`android`||B.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,G.jsxs)(V,{style:k5.container,children:[s({mode:`float`,layout:_,scenes:g,getPreviousScene:this.getPreviousScene,getFocusedRoute:this.getFocusedRoute,onContentHeightChange:this.handleHeaderLayout,style:[k5.floating,C&&[{height:S},k5.absolute]]}),(0,G.jsx)(Yun,{enabled:h,style:k5.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,M=k===!1?0:b[S.key],ae=Sdn(g,w),oe=Cdn(D,ae,l),N=g[w+1]?.descriptor.options.presentation===`transparentModal`,se=g[w+1]?.descriptor.options.detachPreviousScreen!==!1,P=O?D5:y[w];return(0,G.jsx)(Xun,{style:[z.absoluteFill],enabled:h,active:P,freezeOnBlur:ee,shouldFreeze:P===D5&&!O,homeIndicatorHidden:te,pointerEvents:`box-none`,children:(0,G.jsx)(hdn,{index:w,interpolationIndex:ae,modal:oe,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:M,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:N,detachCurrentScreen:se,preloaded:O})},S.key)})})]})}},k5=z.create({container:{flex:1},absolute:{position:`absolute`,top:0,start:0,end:0},floating:{zIndex:1}});H(),J0();var Adn=rln??V,jdn=(e,t)=>e.length===t.length&&e.every((e,n)=>Object.is(e,t[n])),Mdn=class extends U.Component{static getDerivedStateFromProps(e,t){let n=[...e.state.routes,...e.state.preloadedRoutes],r=t.previousState?[...t.previousState.routes,...t.previousState.preloadedRoutes]:[];if(jdn(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),!jdn(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=>Odn((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,G.jsx)(sln,{...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 v$({...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({...x$.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,G.jsx)(Adn,{style:Ndn.container,children:(0,G.jsx)($cn,{children:(0,G.jsx)(U0.Consumer,{children:t=>(0,G.jsx)(tln.Consumer,{children:c=>(0,G.jsx)(c5.Consumer,{children:l=>(0,G.jsx)(kdn,{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})})})})})})}},Ndn=z.create({container:{flex:1}});function Pdn({id:e,initialRouteName:t,UNSTABLE_routeNamesChangeBehavior:n,children:r,layout:i,screenListeners:a,screenOptions:o,screenLayout:s,UNSTABLE_router:c,...l}){let{direction:u}=U$(),{state:d,describe:f,descriptors:p,navigation:m,NavigationContent:h}=vKt(hWt,{id:e,initialRouteName:t,UNSTABLE_routeNamesChangeBehavior:n,children:r,layout:i,screenListeners:a,screenOptions:o,screenLayout:s,UNSTABLE_router:c});return U.useEffect(()=>m.addListener?.(`tabPress`,e=>{let t=m.isFocused();requestAnimationFrame(()=>{d.index>0&&t&&!e.defaultPrevented&&m.dispatch({...x$.popToTop(),target:d.key})})}),[m,d.index,d.key]),(0,G.jsx)(h,{children:(0,G.jsx)(Mdn,{...l,direction:u,state:d,describe:f,descriptors:p,navigation:m})})}function A5(e){return YWt(Pdn)(e)}H();var Fdn={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%)`},Idn=`blur(5px)`,Ldn=({direction:e,style:t})=>{let n=Fdn[e];return(0,G.jsx)(V,{style:[t,{backdropFilter:Idn,WebkitBackdropFilter:Idn,maskImage:n,WebkitMaskImage:n}],pointerEvents:`none`})};H();var Rdn=50,j5=44,zdn=44,Bdn=10,Vdn=54,Hdn=6;function M5(e=!1){let{top:t}=Q4();return(e?16:t)+Vdn}var Udn=(0,U.memo)(function({title:e,LeftButton:t,RightButton:n,BottomContent:r,hasHeaderRow:i,style:a}){let[o,s]=(0,U.useState)(j5),[c,l]=(0,U.useState)(j5),{COLORS:u}=Y(),d=(0,U.useMemo)(()=>Math.max(o,c,j5),[o,c]),f=(0,U.useCallback)(e=>{let t=Math.round(e.nativeEvent.layout.width);t&&t!==o&&s(t)},[o]),p=(0,U.useCallback)(e=>{let t=Math.round(e.nativeEvent.layout.width);t&&t!==c&&l(t)},[c]);return(0,G.jsxs)(V,{style:a,children:[i&&(0,G.jsxs)(V,{style:N5.headerRow,children:[(0,G.jsx)(V,{style:[N5.sideContainer,{minWidth:d}],onLayout:f,children:t??(0,G.jsx)(V,{style:{minWidth:d}})}),e?(0,G.jsx)(Q,{style:[N5.headerTitle,{color:u.textNavigationBar}],numberOfLines:1,allowFontScaling:!1,children:e}):(0,G.jsx)(V,{style:N5.placeHolderTitle}),(0,G.jsx)(V,{style:[N5.sideContainer,{minWidth:d}],onLayout:p,children:n??(0,G.jsx)(V,{style:{minWidth:d}})})]}),r]})});function Wdn({title:e,LeftButton:t,RightButton:n,BottomContent:r,extraBlurSize:i=0,skipTopInset:a=!1,color:o,overlay:s=!1}){let{COLORS:c}=Y(),{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?Rdn+i:0+i,h=(0,U.useMemo)(()=>({backdrop:{height:u+Vdn+Hdn+m},container:{marginTop:u}}),[u,m]),g=Tq&&s?N5.overlay:void 0;return Eq||Tq?(0,G.jsxs)(V,{style:g,children:[(0,G.jsxs)(V,{style:{pointerEvents:`none`},children:[(0,G.jsx)(z4.default,{colors:[d,f],style:[N5.gradient,h.backdrop]}),(0,G.jsx)(Ldn,{direction:`blurredTopClearBottom`,style:[N5.blur,h.backdrop],fallbackColor:d})]}),(0,G.jsx)(Udn,{title:e,LeftButton:t,RightButton:n,BottomContent:r,style:h.container,hasHeaderRow:p})]}):(0,G.jsxs)(V,{children:[(0,G.jsx)(z4.default,{colors:[d,f],style:[N5.gradient,h.backdrop,{pointerEvents:`none`}]}),(0,G.jsx)(Udn,{title:e,LeftButton:t,RightButton:n,BottomContent:r,style:h.container,hasHeaderRow:p})]})}var N5=z.create({headerRow:{flexDirection:`row`,alignItems:`center`,paddingHorizontal:16,justifyContent:`space-between`,paddingBottom:Bdn},sideContainer:{minWidth:j5,minHeight:zdn,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:{...X.Poppins.medium_Base,flex:1,textAlign:`center`,paddingHorizontal:16},placeHolderTitle:{flex:1}}),P5=(0,U.memo)(Wdn),F5=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.ConfirmPINCode=`ConfirmPINCode`,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.LicensingStatus=`LicensingStatus`,e.LicensingWebView=`LicensingWebView`,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}({}),Gdn=async e=>{let t=`${_q.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 E2(n,Z.StatusCode.CREATED,t,Z.HTTPRequestMethod.POST),await n.json()},Kdn=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)},qdn={foodIntakeItems:[],visualSearchIds:[],foodIntakeCarbsAmount:0,manualCarbsInput:0},L5=pq()((e,t)=>({...qdn,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=Kdn(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:Kdn(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 zan({startDate:o,endDate:o,visualSearchIds:a,items:[...s,...c]});try{return{sampleId:(await Gdn({type:`carbohydrates`,startDate:o,endDate:o,quantity:{unit:`g`,value:r+i},metadata:{foodIntakeId:l.id}})).id,foodIntakeId:l.id}}catch(e){throw await Ban(l.id).catch(console.error),e}},clear:()=>{e(qdn)}})),Jdn={availableGlucoseReadings:[],selectedReadingId:null},R5=pq()((e,t)=>({...Jdn,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(Jdn)}}})),Ydn={isGoToSettingsPressed:!1,isNoBGModalVisible:!1,showCalculationInfoModal:!1,showDiscardCalculationModal:!1,showDiscardSmartPenSetupModal:!1,showSyncErrorModal:!1},z5=pq()(e=>({...Ydn,modalStoreActions:{set:t=>{e(e=>({...e,...t}))},clear:()=>{e(Ydn)}}})),Xdn={noteId:null,noteBody:``,displayImageUri:null},B5=pq()(e=>({...Xdn,noteStoreActions:{set:t=>{e(e=>({...e,...t}))},clear:()=>{e(Xdn)}}}));H();var V5={top:10,bottom:10,left:20,right:20},H5=()=>{let{goBack:e}=A$(),{COLORS:t}=Y();return(0,G.jsx)(Cp,{onPress:e,testID:`header-back-button`,style:({pressed:e})=>[G5.button,{opacity:e?.5:1,backgroundColor:t.bgBtnSecondary,borderColor:t.border}],hitSlop:V5,children:(0,G.jsx)(H7t,{height:28,width:28})})},U5=({onPress:e})=>{let{pop:t}=A$(),{COLORS:n}=Y();return(0,G.jsx)(Cp,{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,G.jsx)(W7t,{height:28,width:28})})},Zdn=({style:e})=>{let{navigate:t}=A$(),{COLORS:n}=Y(),r=(0,U.useRef)(0);return(0,G.jsx)(Cp,{onPress:(0,U.useCallback)(()=>{let e=Date.now();e-r.current<500||(r.current=e,u8(l8.SettingsTabPress),Tq?(L5.getState().clear(),R5.getState().glucoseStoreActions.clear(),B5.getState().noteStoreActions.clear(),t(F5.ConfirmPINCode)):t(F5.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,G.jsx)(s9t,{})})},Qdn=({onPress:e,testID:t=`header-info-button`,style:n})=>{let{COLORS:r}=Y(),{modalStoreActions:i}=z5();return(0,G.jsx)(Cp,{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,G.jsx)(J7t,{height:28,width:28})})},W5=({onPress:e,disabled:t=!1})=>{let{COLORS:n}=Y();return(0,G.jsx)(Cp,{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,G.jsx)(G4,{height:28,width:28,color:n.iconButtonPrimary})})},$dn=({onPress:e})=>{let{COLORS:t}=Y();return(0,G.jsx)(Cp,{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,G.jsx)(K7t,{height:28,width:28})})},efn=({onPress:e,isLocked:t})=>{let{COLORS:n}=Y();return(0,G.jsx)(Cp,{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,G.jsx)(X7t,{height:28,width:28}):(0,G.jsx)(o9t,{height:28,width:28})})},G5=z.create({button:{padding:8,borderRadius:22,borderWidth:1}});({...X.Poppins.medium_Base});var K5={cardStyle:{flex:1},headerShown:!0,headerLeft:H5,headerTitleStyle:{...X.Poppins.medium_Base},headerTitleAlign:`center`,headerTitleAllowFontScaling:!1,title:``},tfn={...K5,animation:`slide_from_bottom`,presentation:`modal`,headerLeft:U5,headerLeftContainerStyle:{flex:1},headerTitleContainerStyle:{flex:3,alignItems:`center`},headerRightContainerStyle:{flex:1}},nfn=async e=>{let t=`${_q.ASSET_BASE_URL}/api/v1/assets/${e}`,n=await d8(t,{method:`GET`,headers:{Accept:`application/json`}});return await E2(n,Z.StatusCode.OK,t),n.json()},rfn=async e=>{let t=`${_q.ASSET_BASE_URL}/api/v1/assets/${e}`;await E2(await d8(t,{method:`DELETE`}),Z.StatusCode.NO_CONTENT,t,Z.HTTPRequestMethod.DELETE)},q5=[`foods`,`personal`],ifn=()=>{let{data:e=[],isLoading:t,isError:n,refetch:r}=_0({queryKey:q5,queryFn:Aan,staleTime:1e3*60*5,networkMode:`offlineFirst`,retry:3});return{personalFoods:e,isPersonalFoodsLoading:t,isPersonalFoodsError:n,refetchPersonalFoods:r}},afn=()=>{let e=g0(),{mutateAsync:t,isPending:n,isError:r,error:i}=Q0t({mutationFn:Lan,onSuccess:()=>{e.invalidateQueries({queryKey:q5})}});return{createPersonalFood:t,isCreatingPersonalFood:n,createPersonalFoodError:r?i:null}},ofn=e=>[`foods`,`item`,e],sfn=e=>{let{data:t=null,isLoading:n,isError:r,refetch:i}=_0({queryKey:ofn(e),queryFn:()=>Pan(e),staleTime:1e3*60*5,networkMode:`offlineFirst`,retry:3});return{food:t,isFoodLoading:n,isFoodError:r,refetchFood:i}},J5=[`foods`,`search`],cfn=e=>[...J5,e],lfn=e=>{let{data:t=[],isLoading:n,isError:r,refetch:i}=_0({queryKey:cfn(e),queryFn:()=>Nan(e),enabled:e.length>2,staleTime:1e3*60*5,networkMode:`offlineFirst`,retry:3});return{foodSearchResults:t,isFoodSearchLoading:n,isFoodSearchError:r,refetchFoodSearch:i}},ufn=()=>{let e=g0(),{mutateAsync:t,isPending:n}=Q0t({mutationFn:e=>Ian(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(ofn(n),null),e.invalidateQueries({queryKey:q5}),e.invalidateQueries({queryKey:J5})}});return{deletePersonalFood:t,isDeletingPersonalFood:n}},dfn=()=>{let e=g0(),{mutateAsync:t,isPending:n}=Q0t({mutationFn:({foodId:e,request:t})=>Fan(e,t),onSuccess:t=>{e.setQueryData(ofn(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}};H();var ffn={outlineStyle:`none`};function pfn({value:e,onChangeText:t,imageUri:n,containerStyle:r,testID:i,autoFocus:a,maxLength:o=1024}){let{COLORS:s}=Y(),{t:c}=Sq(),l=(0,U.useRef)(null);return(0,U.useEffect)(()=>{if(!a)return;let e=setTimeout(()=>{l.current?.focus()},300);return()=>{clearTimeout(e)}},[a]),(0,G.jsxs)(V,{style:[mfn.container,{backgroundColor:s.bgInputActive},r],testID:i,children:[(0,G.jsx)(Ip,{ref:l,value:e,onChangeText:t,placeholder:c(`notes_placeholder`),placeholderTextColor:s.labelTertiary,multiline:!0,maxLength:o,style:[mfn.input,{color:s.labelPrimary},ffn],cursorColor:s.iconBrand,testID:`${i}-input`}),!!n&&(0,G.jsx)(Xu,{source:{uri:n},style:mfn.image,resizeMode:`cover`,testID:`${i}-image`})]})}var mfn=z.create({container:{borderRadius:16,padding:16,minHeight:160},input:{...X.Poppins.regular_Base,flex:1,marginBottom:16,textAlignVertical:`top`,maxHeight:300},image:{width:`100%`,height:234,borderRadius:12,marginTop:12}});H();function hfn({onPress:e}){let{t}=Sq(),{COLORS:n}=Y();return(0,G.jsx)(Cp,{accessibilityRole:`button`,style:[gfn.button,{backgroundColor:n.iosKeyboardPicker}],onPress:e,testID:`wheel-picker-modal-cancel`,children:(0,G.jsx)(gd,{maxFontSizeMultiplier:S2.s3,style:[gfn.buttonText,{color:n.textKeyboardButtons}],children:t(`button_cancel`)})})}var gfn=z.create({button:{borderRadius:13},buttonText:{fontSize:17,fontWeight:`600`,paddingHorizontal:16,paddingVertical:15,textAlign:`center`}}),Y5=U.memo(hfn);H();function _fn({onPress:e}){let{t}=Sq(),{COLORS:n}=Y();return(0,G.jsx)(Cp,{accessibilityRole:`button`,style:[vfn.button,{backgroundColor:n.iosKeyboardPicker}],onPress:e,testID:`wheel-picker-modal-confirm`,children:(0,G.jsx)(gd,{maxFontSizeMultiplier:S2.s3,style:[vfn.buttonText,{color:n.textKeyboardButtons}],children:t(`button_confirm`)})})}var vfn=z.create({button:{borderBottomLeftRadius:13,borderBottomRightRadius:13},buttonText:{fontSize:17,fontWeight:`400`,paddingHorizontal:16,paddingVertical:15,textAlign:`center`}}),X5=U.memo(_fn),yfn=c({HapticFeedbackTypes:()=>xfn,default:()=>Sfn,triggerHaptic:()=>bfn});function bfn(e=`selection`,t){}var xfn,Sfn,Cfn=o((()=>{xfn=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}({}),Sfn={trigger:(e,t)=>{}}}));Cfn(),H();var wfn=22,Tfn=26;function Efn({textStyle:e,style:t,height:n,fontScale:r,option:i,onItemPress:a}){let{COLORS:o}=Y();return(0,G.jsx)(V,{style:[Dfn.item,t,{height:n}],children:(0,G.jsx)(Cp,{style:Dfn.itemPressable,onPress:a,children:(0,G.jsx)(gd,{allowFontScaling:!1,style:[e,Dfn.itemText,{fontSize:wfn*r,lineHeight:Tfn*r,color:o.labelPrimary}],children:i})})})}var Dfn=z.create({item:{alignItems:`center`,justifyContent:`center`,zIndex:100},itemPressable:{width:`100%`},itemText:{textAlign:`center`,fontWeight:`400`}}),Ofn=U.memo(Efn);H();function kfn({itemHeight:e,visibleRest:t}){let{COLORS:n}=Y(),r=e*t;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(z4.default,{colors:[n.iosKeyboardPicker+`FF`,n.iosKeyboardPicker+`4D`],style:[Afn.mask,{top:0,height:r}]}),(0,G.jsx)(z4.default,{colors:[n.iosKeyboardPicker+`4D`,n.iosKeyboardPicker+`FF`],style:[Afn.mask,{bottom:0,height:r}]})]})}var Afn=z.create({mask:{position:`absolute`,left:0,right:0,pointerEvents:`none`}}),jfn=(0,U.memo)(kfn);H();function Mfn({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}=Sq(),{COLORS:g}=Y(),{width:_,fontScale:v}=$p(),y=Math.min(v,S2.s3),b=Math.round(c*y),x=(1+l*2)*b,S=(0,U.useRef)(null),C=(0,U.useRef)(null);(0,U.useImperativeHandle)(m,()=>({scrollToIndex(e){S.current?.scrollToIndex({index:e,animated:!0})}}),[]);let[w]=(0,U.useState)(new cf.Value(0)),T=(0,U.useMemo)(()=>{let e=[...n];for(let t=0;t<l;t++)e.unshift(null),e.push(null);return e},[n,l]),E=(0,U.useMemo)(()=>[...Array(T.length)].map((e,t)=>t*b),[T,b]),D=(0,U.useCallback)(e=>{Tq||C.current!==e&&(C.current=e)},[]),O=(0,U.useCallback)(e=>{let t=e.nativeEvent.contentOffset.y,i=Math.min(n.length-1,Math.max(0,Math.round(t/b)));D(i),Tq&&(r(i),S.current?.scrollToIndex({index:i,animated:!0}))},[D,b,r,n.length]),k=z3t((...e)=>{let t=e[0];O(t)},100),A=(0,U.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,G.jsxs)(V,{accessible:!0,accessibilityHint:h(`wheelpicker_accessibility_label`),accessibilityLabel:p,accessibilityRole:`adjustable`,style:[Nfn.container,{backgroundColor:g.iosKeyboardPicker,height:x,width:_},a],...d,children:[(0,G.jsx)(V,{style:[Nfn.selectedIndicator,{backgroundColor:g.iosSelectorKeyboard},{transform:[{translateY:-b/2}],height:b,width:_-32-20},i]}),(0,G.jsx)(cf.FlatList,{...f,testID:e,ref:S,showsVerticalScrollIndicator:!1,removeClippedSubviews:vvt,onScroll:cf.event([{nativeEvent:{contentOffset:{y:w}}}],{useNativeDriver:!Tq,listener:Tq?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,G.jsx)(Ofn,{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,G.jsx)(jfn,{itemHeight:b,visibleRest:l})]})}var Nfn=z.create({container:{borderTopLeftRadius:13,borderTopRightRadius:13,alignSelf:`center`},selectedIndicator:{position:`absolute`,borderRadius:7,top:`50%`,alignSelf:`center`}}),Z5=U.memo(Mfn);H();function Pfn({items:e,isVisible:t,onCancel:n,onConfirm:r,onModalHide:i,initialScrollIndex:a,accessibilityLabel:o,testID:s}){let{COLORS:c}=Y(),[l,u]=(0,U.useState)(a),{width:d}=$p();(0,U.useEffect)(()=>{u(a)},[a]);let f=(0,U.useCallback)(e=>{u(e)},[]),p=(0,U.useCallback)(()=>{r(parseFloat(e[l]),l)},[e,r,l]),m=(0,U.useCallback)(()=>{u(a),n()},[a,n]);return(0,G.jsx)(u3,{isVisible:t,containerStyle:{backgroundColor:c.bgTransparent},onModalHide:i,children:(0,G.jsxs)(V,{children:[(0,G.jsx)(V,{style:Ffn.pickersContainer,children:(0,G.jsx)(Z5,{testID:s,initialScrollIndex:a,options:e,onChange:f,accessibilityLabel:o,containerStyle:{width:d-32}})}),(0,G.jsxs)(V,{style:Ffn.buttonContainer,children:[(0,G.jsx)(X5,{onPress:p}),(0,G.jsx)(Y5,{onPress:m})]})]})})}var Q5=U.memo(Pfn),Ffn=z.create({pickersContainer:{flexDirection:`row`,borderTopLeftRadius:13,borderTopRightRadius:13,overflow:`hidden`},buttonContainer:{gap:8}});function $5(e){let t=g0(),[n,r]=(0,U.useState)(null);return(0,U.useEffect)(()=>{if(!e){r(null);return}(async()=>{r((await t.fetchQuery({queryKey:[`asset`,e],queryFn:()=>nfn(e),staleTime:Z.Milliseconds.Minute*5})).downloadUrl)})().catch(console.error)},[e,t]),n}H();var Ifn=({isLiquid:e,setSelected:t})=>{let{COLORS:n}=Y();return(0,G.jsxs)(V,{style:[e7.container,{backgroundColor:n.bgSegmentContainer,borderColor:n.buttonBorder}],children:[(0,G.jsx)(Cp,{style:[e7.segment,!e&&{backgroundColor:n.bgSegmentPrimary}],onPress:()=>{t(!1)},testID:`food-type-food-${e}`,children:(0,G.jsx)(Q,{style:[e7.value,{color:e?n.textLabelInactive:n.textLabelActive}],maxFontSizeMultiplier:S2.s0,children:`g`})}),(0,G.jsx)(Cp,{style:[e7.segment,e&&{backgroundColor:n.bgSegmentPrimary}],onPress:()=>{t(!0)},testID:`food-type-drink-${e}`,children:(0,G.jsx)(Q,{style:[e7.value,{color:e?n.textLabelActive:n.textLabelInactive}],maxFontSizeMultiplier:S2.s0,children:`ml`})})]})},e7=z.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:{...X.Poppins.medium_Base}}),t7=({onModalHide:e})=>{let{t}=Sq(),n=UWt(),{showSyncErrorModal:r,modalStoreActions:i}=z5();return(0,G.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})}}]})};H();var Lfn={title:``,carbohydrates:null,measure:`g`,description:``},Rfn=e=>e?{title:e.title,carbohydrates:e.nutritionPer100g.carbohydrates.value,measure:e.measures[0]?.unit,description:e.description??``}:Lfn,zfn=a3(0,100),Bfn=`create-food`,Vfn=()=>{let{t:e}=Sq(),{COLORS:t}=Y(),{createPersonalFood:n,isCreatingPersonalFood:r}=afn(),{updatePersonalFood:i,isUpdatingPersonalFood:a}=dfn(),{deletePersonalFood:o,isDeletingPersonalFood:s}=ufn(),{removeFoodIntakeItem:c}=L5(),l=M$(),u=l.params?.personalFoodId,{personalFoods:d}=ifn(),f=u?d.find(e=>e.id===u):void 0,{modalStoreActions:p}=z5(),m=A$(),h=M5(),{bottomWithScroll:g}=Q4(),[_,v]=(0,U.useState)(()=>Rfn(f)),y=(0,U.useRef)(_),b=(0,U.useRef)(!!f);(0,U.useEffect)(()=>{if(b.current||!f||(b.current=!0,_!==y.current))return;let e=Rfn(f);y.current=e,v(e)},[f,_]);let[x,S]=(0,U.useState)(!1),[C,w]=(0,U.useState)(0),[T,E]=(0,U.useState)(!1),[D,O]=(0,U.useState)(!1),k=(0,U.useRef)(!1),[A,ee]=(0,U.useState)(!1),te=(0,U.useRef)(!1),ne=$5(f?.imageId??null),re=_.title.trim().length>0&&_.carbohydrates!==null,ie=T||r||a||s,j=y.current,M=_.title!==j.title||_.carbohydrates!==j.carbohydrates||_.measure!==j.measure||_.description!==j.description,ae=(0,U.useCallback)(()=>{if(!M){m.pop();return}ee(!0)},[M,m]);(0,U.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,G.jsx)(P5,{title:_.title||e(`add_food_segment_food`),LeftButton:(0,G.jsx)(U5,{onPress:ae}),RightButton:ie?(0,G.jsx)(Nf,{size:`small`,color:t.iconBrand,style:n7.activityIndicator}):(0,G.jsx)(W5,{onPress:r,disabled:!M||!re}),overlay:!0})})},[re,M,m,_,p,ie,t.iconBrand,n,i,o,c,j.carbohydrates,j.measure,f?.imageId,u,l.key,ae,e]);let oe=(0,U.useCallback)(()=>{wf.dismiss(),w(Math.max(0,_.carbohydrates??0)),S(!0)},[_.carbohydrates]),N=(0,U.useCallback)(e=>{v(t=>({...t,carbohydrates:e})),S(!1)},[]),se=(0,U.useCallback)(e=>{v(t=>({...t,description:e}))},[]),P=(0,U.useCallback)(()=>{te.current=!0,ee(!1)},[]),F=(0,U.useCallback)(()=>{te.current&&(te.current=!1,m.pop())},[m]),ce=(0,U.useCallback)(()=>{k.current=!0,O(!1)},[]),le=(0,U.useCallback)(async()=>{if(!(!k.current||!f)){k.current=!1;try{f.imageId&&await rfn(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,G.jsxs)(ds,{testID:`${Bfn}-scroll`,keyboardDismissMode:`on-drag`,keyboardShouldPersistTaps:`always`,contentContainerStyle:{paddingTop:h+8,paddingBottom:g},style:{backgroundColor:t.bgSheet},children:[(0,G.jsxs)(V,{style:n7.container,children:[(0,G.jsxs)(V,{style:n7.mandatorySection,children:[(0,G.jsx)(_9t,{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:`${Bfn}-name`,autoFocus:!u}),(0,G.jsx)(Y4,{title:e(`food_add_library_item_carbs`),onPress:oe,renderRightSlot:()=>(0,G.jsxs)(Q,{style:[n7.rightSlot,{color:t.labelPrimary}],testID:`${Bfn}-carbohydrates`,children:[_.carbohydrates??`-`,` / 100g`]})})]}),(0,G.jsxs)(V,{style:n7.measurementSection,children:[(0,G.jsx)(Q,{style:[n7.measurementQuestion,{color:t.labelPrimary}],children:e(`food_unitToggle_title`)}),(0,G.jsx)(Ifn,{isLiquid:_.measure===`mL`,setSelected:e=>{v(t=>({...t,measure:e?`mL`:`g`}))}})]}),(0,G.jsx)(pfn,{value:_.description,onChangeText:se,maxLength:255,imageUri:ne,testID:`create-food-notes`}),!!f&&(0,G.jsx)(U4,{type:H4.ErrorSecondary,title:e(`button_delete_food`),testID:`delete_food_button`,disabled:ie,onPress:()=>O(!0),style:n7.deleteButton})]}),(0,G.jsx)(Q5,{isVisible:x,items:zfn,initialScrollIndex:C,onCancel:()=>S(!1),onConfirm:N,testID:`create-food-wheel-picker`}),(0,G.jsx)(u3,{isVisible:A,title:e(`logbook_personal_modal_discard_title`),onModalHide:F,buttons:[{title:e(`button_discard_changes`),type:H4.Error,testID:`discard-button`,onPress:P},{title:e(`button_keep_editing`),type:H4.Secondary,testID:`keep-button`,onPress:()=>ee(!1)}]}),(0,G.jsx)(u3,{isVisible:D,title:e(`food_modal_delete_food_title`),onModalHide:le,buttons:[{title:e(`button_delete_food`),type:H4.Error,testID:`delete_modal_delete_button`,onPress:ce},{title:e(`button_cancel`),type:H4.Secondary,testID:`delete_modal_cancel_button`,onPress:()=>O(!1)}]}),(0,G.jsx)(t7,{})]})},n7=z.create({container:{flex:1,paddingHorizontal:16,gap:16},mandatorySection:{gap:8},measurementSection:{gap:10},measurementQuestion:{...X.Poppins.regular_SM},rightSlot:{...X.Poppins.regular_Base,marginRight:8},deleteButton:{marginTop:8},activityIndicator:{width:44,height:44}});function Hfn({uri:e,style:t,onLoadEnd:n}){let r=(0,U.useRef)(null);return(0,U.useEffect)(()=>{let e=r.current;if(!(!n||!e))return e.addEventListener(`load`,n),()=>{e.removeEventListener(`load`,n)}},[r,n]),(0,G.jsx)(`iframe`,{ref:r,src:e,style:t})}function Ufn(){let{language:e}=bq.getState();return`https://pdf.hedia.io/IFU/${e}/Hedia-IFU-${c8}`}H();var Wfn=()=>(0,G.jsx)(Hfn,{style:Gfn.iframe,uri:Ufn()}),Gfn=z.create({iframe:{flex:1}}),Kfn=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})),qfn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.default=(H(),d(em)).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`}})})),Jfn=u(s((e=>{var t=Kfn();Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.WebView=void 0,t(p());var n=(H(),d(em)),r=t(qfn()),i=PJ();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.`})})}}))());H(),KQ(),J0();function Yfn({url:e,testID:t,incognito:n=!0,onNavigationStateChange:r,spinnerSize:i=15,style:a}){let{t:o}=Sq(),{COLORS:s}=Y(),{colorScheme:c}=g2(),l=C2(c),{bottom:u}=V0(),[d,f]=(0,U.useState)(!1),[p,m]=(0,U.useState)(null),[h,g]=(0,U.useState)(null),_=(0,U.useMemo)(()=>`document.cookie = "theme=${l}; path=/; SameSite=Lax";`,[l]);return e?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Jfn.default,{source:{uri:e},testID:t,incognito:n,startInLoadingState:!0,renderLoading:()=>(0,G.jsx)(V,{style:r7.centerContainer,children:(0,G.jsx)(p2,{source:m2.LOADING_SPINNER,autoPlay:!0,style:{height:`${i}%`}})}),setSupportMultipleWindows:!1,onHttpError:()=>{f(!0),m(o(`global_modal_swr_title`)),g(o(`global_modal_swr_body`)),console.error(`WebViewLoader onHttpError: `,e)},onError:t=>{let n=t.nativeEvent.description;f(!0),n.includes(`ERR_INTERNET_DISCONNECTED`)?(m(o(`settings_modal_no_internet_title`)),g(o(`settings_modal_no_internet_body`))):(m(o(`global_modal_swr_title`)),g(o(`global_modal_swr_body`))),console.error(`WebViewLoader onError: `,e,n)},injectedJavaScriptBeforeContentLoaded:_,onNavigationStateChange:r,style:{backgroundColor:s.bgPrimary},containerStyle:[r7.container,{backgroundColor:s.bgPrimary,paddingBottom:u},a]}),d&&(0,G.jsxs)(GQ.View,{entering:LQ.duration(300).delay(2e3),style:r7.centerContainer,children:[(0,G.jsx)(Q,{style:[r7.errorTitle,{color:s.labelPrimary}],children:p}),(0,G.jsx)(Q,{style:[r7.errorSubtitle,{color:s.labelSecondary}],children:h})]})]}):null}var r7=z.create({container:{height:`100%`},centerContainer:{height:`100%`,justifyContent:`center`,marginHorizontal:16},errorTitle:{...X.Poppins.semiBold_2XL,textAlign:`center`},errorSubtitle:{...X.Poppins.regular_Base,textAlign:`center`}});H();function Xfn(){let e=Ycn();return Tq?(0,G.jsx)(Hfn,{style:Zfn.iframe,uri:`https://www.hedia.com/support/partner`}):(0,G.jsx)(Yfn,{url:`https://www.hedia.com/support/native`,testID:`support-webview`,style:{paddingTop:e}})}var Zfn=z.create({iframe:{flex:1}}),Qfn=()=>({min:Z.CONSTANTS.CARBOHYDRATES_INPUT_MIN,max:Z.CONSTANTS.CARBOHYDRATES_INPUT_MAX});a3(Z.CONSTANTS.CARBOHYDRATES_INPUT_MIN,Z.CONSTANTS.CARBOHYDRATES_INPUT_MAX),H();function $fn({children:e,offset:t=47}){let{COLORS:n}=Y(),{bottom:r}=Q4();return(0,G.jsxs)(V,{children:[(0,G.jsx)(z4.default,{colors:[c3(n.bgPrimary,0),n.bgPrimary],style:[epn.gradient,{height:r+t+16}],pointerEvents:`none`}),(0,G.jsx)(V,{style:[{paddingBottom:r},epn.contentContainer],children:e})]})}var epn=z.create({gradient:{position:`absolute`,bottom:0,left:0,right:0},contentContainer:{position:`absolute`,bottom:0,left:0,right:0,marginHorizontal:16}}),tpn=(0,U.memo)($fn);H();var npn=()=>{let{t:e}=Sq(),{COLORS:t}=Y(),{showCalculationInfoModal:n,modalStoreActions:r}=z5(),i=(0,U.useMemo)(()=>[{testID:`close-button`,title:e(`button_close`),onPress:()=>{r.set({showCalculationInfoModal:!1})}}],[r,e]);return(0,G.jsxs)(u3,{testID:`calculation_info_modal`,isVisible:n,title:e(`calcflow_modal_info_title`),buttons:i,enableScroll:!0,containerStyle:i7.modal,children:[(0,G.jsx)(Q,{style:[i7.header,{color:t.labelPrimary}],children:e(`calcflow_modal_info_insulin_title`)}),(0,G.jsx)(Q,{style:[i7.text,{color:t.labelSecondary}],children:e(`calcflow_modal_info_insulin_body`)}),(0,G.jsx)(Q,{style:[i7.header,{color:t.labelPrimary}],children:e(`calcflow_modal_info_glucose_title`)}),(0,G.jsx)(Q,{style:[i7.text,{color:t.labelSecondary}],children:e(`calcflow_modal_info_glucose_body`)}),(0,G.jsx)(Q,{style:[i7.header,{color:t.labelPrimary}],children:e(`calcflow_modal_info_carbohydrates_title`)}),(0,G.jsx)(Q,{style:[i7.text,{color:t.labelSecondary}],children:e(`calcflow_modal_info_carbohydrates_body`)}),(0,G.jsx)(Q,{style:[i7.header,{color:t.labelPrimary}],children:e(`calcflow_modal_info_activity_title`)}),(0,G.jsx)(Q,{style:[i7.text,{color:t.labelSecondary}],children:e(`calcflow_modal_info_activity_body`)}),(0,G.jsx)(Q,{style:[i7.header,{color:t.labelPrimary}],children:e(`calcflow_modal_info_notes_title`)}),(0,G.jsx)(Q,{style:[i7.text,{color:t.labelSecondary}],children:e(`calcflow_modal_info_notes_body`)}),(0,G.jsx)(Q,{style:[i7.header,{color:t.labelPrimary}],children:e(`calcflow_modal_info_calculate_title`)}),(0,G.jsx)(Q,{style:[i7.text,{color:t.labelSecondary}],children:e(`calcflow_modal_info_calculate_body`)})]},`calculation_info_modal`)},i7=z.create({modal:{maxHeight:`92%`},header:{...X.Poppins.semiBold_Base,marginTop:16},text:{...X.Poppins.regular_Base}}),rpn=async e=>{let t=`${_q.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 E2(n,Z.StatusCode.CREATED,t,Z.HTTPRequestMethod.POST),n.json()},ipn=async e=>{let t=`${_q.NOTE_BASE_URL}/api/v1/notes/${e}`,n=await d8(t,{method:`GET`,headers:{Accept:`application/json`}});return await E2(n,Z.StatusCode.OK,t),n.json()},apn=async(e,t)=>{let n=`${_q.NOTE_BASE_URL}/api/v1/notes/${e}`,r=await d8(n,{method:Z.HTTPRequestMethod.PATCH,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:JSON.stringify(t)});return await E2(r,Z.StatusCode.OK,n,Z.HTTPRequestMethod.PATCH),r.json()},opn=async e=>{let t=`${_q.NOTE_BASE_URL}/api/v1/notes/${e}`;await E2(await d8(t,{method:`DELETE`}),Z.StatusCode.NO_CONTENT,t,Z.HTTPRequestMethod.DELETE)};function spn(){let e=g0(),[t,n]=(0,U.useState)(``),[r,i]=(0,U.useState)(!1),[a,o]=(0,U.useState)(!1),s=(0,U.useRef)(null),c=(0,U.useRef)(``),l=(0,U.useRef)(null),u=(0,U.useRef)(t);u.current=t;let d=(0,U.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:()=>ipn(t),staleTime:Z.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,U.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,U.useCallback)(async()=>{let t=u.current;if(!t.trim())return s.current&&=(await opn(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 apn(s.current,{body:t});return e.setQueryData([`note`,n.id],n),s.current}let n=await rpn({body:t});return s.current=n.id,e.setQueryData([`note`,n.id],n),n.id},[e]),deleteNoteAndAssets:(0,U.useCallback)(async t=>{try{let n=await e.fetchQuery({queryKey:[`note`,t],queryFn:()=>ipn(t),staleTime:Z.Milliseconds.Minute*5});for(let t of n.assetIds)await rfn(t).catch(console.error),e.removeQueries({queryKey:[`asset`,t]});await opn(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,U.useMemo)(()=>!a&&t.trim().length>0,[t,a]),isNoteModified:(0,U.useMemo)(()=>t!==c.current,[t])}}var cpn={selectedEventUUID:null,activityDurationSeconds:0},a7=pq()(e=>({...cpn,activityStoreActions:{set:t=>{e(e=>({...e,...t}))},clear:()=>{e(cpn)}}})),lpn={setupCalculatorSettings:{},totalDailyDosage:null},upn=pq()(e=>({...lpn,setupCalculatorActions:{setSetupCalculatorStoreValues:t=>{e(e=>({setupCalculatorSettings:{...e.setupCalculatorSettings,...t}}))},setTotalDailyDosage:t=>{e({totalDailyDosage:t})},clear:()=>{e(lpn)}}})),o7=()=>upn(e=>e.setupCalculatorActions),s7=()=>upn(e=>e.setupCalculatorSettings),dpn=()=>upn(e=>e.totalDailyDosage),fpn={privacyNoticeAccepted:!1,extraFoodItems:[],visualSearchId:null},c7=pq()(hq(e=>({...fpn,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(fpn)}}),{name:`VISUAL_SEARCH_STORE`,storage:mq(yq)})),l7=()=>{L5.getState().clear(),R5.getState().glucoseStoreActions.clear(),a7.getState().activityStoreActions.clear(),B5.getState().noteStoreActions.clear()},ppn=()=>{let{t:e}=Sq(),{showDiscardCalculationModal:t,modalStoreActions:n,isGoToSettingsPressed:r}=z5(),{deleteNoteAndAssets:i}=spn(),a=A$(),o=(0,U.useRef)(!1),s=(0,U.useCallback)(()=>{let e=B5.getState().noteId;e&&i(e).catch(console.error),l7(),o.current=!0,n.set({showDiscardCalculationModal:!1})},[i,n]),c=(0,U.useCallback)(()=>{o.current&&(o.current=!1,a.pop()),r&&((vvt||Eq)&&a.reset({index:1,routes:[{name:F5.MainBottomTabs},{name:F5.SettingsStack,state:{routes:[{name:F5.Settings},{name:F5.ActivitySettings}],index:1}}]}),n.set({isGoToSettingsPressed:!1}))},[r,n,a]),l=(0,U.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,G.jsx)(u3,{testID:`discard_calculation_modal`,isVisible:t,title:e(`calcflow_modal_discard_cal_title`),onModalHide:c,buttons:l},`discard_calculation_modal`)};function mpn(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 hpn(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=mpn(o);return r.setMonth(t,Math.min(a,s)),r}function gpn(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=hpn(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 _pn(e,t,n){return Von(e,-t,n)}var u7=function(e){return e.Create=`Create`,e.Edit=`Edit`,e.Delete=`Delete`,e}({});function vpn(){let e=gpn(_pn(new Date,4),{seconds:0,milliseconds:0});return G8.getLogbooks(e).map(e=>({uuid:e.uuid,time:e.entry_timestamp,insulinValue:e.insulin_entered_units?.toString()??``}))}function ypn(){let[e,t]=(0,U.useState)(vpn),[n,r]=(0,U.useState)(null),[i,a]=(0,U.useState)(!1),[o,s]=(0,U.useState)(`Create`),[c,l]=(0,U.useState)(void 0),u=(0,U.useCallback)(()=>{t(vpn())},[]);return(0,U.useEffect)(()=>{n&&u()},[n,u]),R$((0,U.useCallback)(()=>{u()},[u])),(0,U.useEffect)(()=>{K8.syncAll().catch(console.error).finally(()=>{u()})},[u]),{entries:e,animatedEntryId:n,isInfoModalVisible:i,setIsInfoModalVisible:a,registerInsulinAction:o,editingInsulinEntry:c,refresh:u,handleEditInsulinEntry:(0,U.useCallback)(t=>{let n=e.find(e=>e.uuid===t);n&&(s(`Edit`),l(n))},[e]),handleEntryAnimationFinished:(0,U.useCallback)(()=>{r(null)},[]),handleRegisterInsulinPressed:(0,U.useCallback)(()=>{s(`Create`),l(void 0)},[]),handleRegisterInsulinClose:(0,U.useCallback)(e=>{r(e||`deleted-${Date.now()}`)},[])}}if(!U.useState)throw Error(`mobx-react-lite requires React with Hooks support`);if(!drn)throw Error(`mobx-react-lite@3 requires mobx at least version 6 to be available`);var d7=_();function bpn(e){e()}function xpn(e){e||=bpn,Znn({reactionScheduler:e})}function Spn(e){return $nn(e)}var Cpn=!1;function wpn(){return Cpn}var Tpn=1e4,Epn=1e4,Dpn=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=Tpn),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,Epn))}}),e}(),Opn=new(typeof FinalizationRegistry<`u`?FinalizationRegistry:Dpn)(function(e){var t;(t=e.reaction)==null||t.dispose(),e.reaction=null}),kpn=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})),Apn=s(((e,t)=>{t.exports=kpn()}))();function jpn(e){e.reaction=new E6(`observer${e.name}`,function(){var t;e.stateVersion=Symbol(),(t=e.onStoreChange)==null||t.call(e)})}function Mpn(e,t){if(t===void 0&&(t=`observed`),wpn())return e();var n=U.useRef(null);if(!n.current){var r={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:t,subscribe:function(e){return Opn.unregister(r),r.onStoreChange=e,r.reaction||(jpn(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||(jpn(i),Opn.register(n,i,i)),U.useDebugValue(i.reaction,Spn),(0,Apn.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 Npn=typeof Symbol==`function`&&Symbol.for,Ppn=Object.getOwnPropertyDescriptor(function(){},`name`)?.configurable??!1,Fpn=Npn?Symbol.for(`react.forward_ref`):typeof U.forwardRef==`function`&&(0,U.forwardRef)(function(e){return null}).$$typeof,Ipn=Npn?Symbol.for(`react.memo`):typeof U.memo==`function`&&(0,U.memo)(function(e){return null}).$$typeof;function f7(e,t){if(Ipn&&e.$$typeof===Ipn)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(wpn())return e;var n=t?.forwardRef??!1,r=e,i=e.displayName||e.name;if(Fpn&&e.$$typeof===Fpn&&(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 Mpn(function(){return r(e,t)},i)};return a.displayName=e.displayName,Ppn&&Object.defineProperty(a,"name",{value:e.name,writable:!0,configurable:!0}),e.contextTypes&&(a.contextTypes=e.contextTypes),n&&(a=(0,U.forwardRef)(a)),a=(0,U.memo)(a),Rpn(e,a),a}var Lpn={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function Rpn(e,t){Object.keys(e).forEach(function(n){Lpn[n]||Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}function zpn(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`?Mpn(r):null}zpn.displayName=`Observer`,xpn(d7.unstable_batchedUpdates),Opn.finalizeAllImmediately,H();function Bpn(){return U.useEffect(()=>{console.warn(`DateTimePicker is not supported on: ${B.OS}`)},[]),null}var Vpn=Bpn;H();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 Hpn({isVisible:e,initialValue:t,min:n,max:r,onCancel:i,onConfirm:a,onModalHide:o}){let{COLORS:s}=Y(),{width:c}=$p(),l=(0,U.useRef)(null),u=(0,U.useRef)(null),[d,f]=(0,U.useState)(t),p=(0,U.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(B9t(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,U.useMemo)(()=>p.map(e=>I8(e.date,`HH`)),[p]),h=(0,U.useMemo)(()=>{let[e]=I8(t,`HH:mm`).split(`:`);return p7(m,e)},[t,m]),g=(0,U.useMemo)(()=>{let[,e]=I8(t,`HH:mm`).split(`:`);return p7(h7,e)},[t]),_=(0,U.useMemo)(()=>{let[e]=I8(d,`HH:mm`).split(`:`);return p7(m,e)},[d,m]),v=(0,U.useMemo)(()=>{let[,e]=I8(d,`HH:mm`).split(`:`);return p7(h7,e)},[d]),y=(0,U.useMemo)(()=>n?p7(m,I8(n,`HH`)):null,[n,m]),b=(0,U.useMemo)(()=>r?p7(m,I8(r,`HH`)):null,[r,m]),x=(0,U.useMemo)(()=>n?parseInt(I8(n,`mm`),10):null,[n]),S=(0,U.useMemo)(()=>r?parseInt(I8(r,`mm`),10):null,[r]),C=(0,U.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(gpn(i,{minutes:parseInt(h7[t],10),seconds:0,milliseconds:0}))},[m.length,p]),w=(0,U.useCallback)(e=>{u.current?.scrollToIndex(e)},[]),T=(0,U.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,U.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,U.useCallback)(()=>{a(d)},[a,d]),O=(0,U.useCallback)(()=>{f(t),i()},[i,t]);return(0,G.jsx)(u3,{isVisible:e,containerStyle:{backgroundColor:s.bgTransparent},onModalHide:o,children:(0,G.jsxs)(V,{children:[(0,G.jsxs)(V,{style:g7.pickersContainer,children:[(0,G.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,G.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,G.jsxs)(V,{style:g7.buttonContainer,children:[(0,G.jsx)(X5,{onPress:D}),(0,G.jsx)(Y5,{onPress:O})]})]})})}var Upn=U.memo(Hpn),g7=z.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}}),Wpn=({onPress:e})=>(0,G.jsx)(X5,{onPress:e}),Gpn=({onPress:e})=>(0,G.jsx)(Y5,{onPress:e}),Kpn=.5,qpn=e=>{switch(e){case Z.InjectionMethod.PenWhole:return a3(Z.CONSTANTS.INSULIN_DOSE_MIN,Z.CONSTANTS.INSULIN_DOSE_MAX);case Z.InjectionMethod.PenHalf:return z9t(Z.CONSTANTS.INSULIN_DOSE_MIN,Z.CONSTANTS.INSULIN_DOSE_MAX,Kpn);case Z.InjectionMethod.Pump:return o3(Z.CONSTANTS.INSULIN_DOSE_MIN,Z.CONSTANTS.INSULIN_DOSE_MAX);default:throw Error(`[insulin::getInsulinInputSequentialArray] Unsupported injection method!`)}},Jpn=e=>{switch(e){case Z.InjectionMethod.PenWhole:return 0;case Z.InjectionMethod.PenHalf:return 1;case Z.InjectionMethod.Pump:return 1;default:throw Error(`[insulin::getInsulinInputDecimalPlaces] Unsupported injection method!`)}};H(),J0();function Ypn({action:e=u7.Create,insulinEntry:t,onClose:n}){let{t:r}=Sq(),{COLORS:i}=Y(),{bottom:a}=V0(),{colorScheme:o}=g2(),s=C2(o),[c,l]=(0,U.useState)(!1),[u,d]=(0,U.useState)(t?.insulinValue),[f,p]=(0,U.useState)(!1),[m,h]=(0,U.useState)(t?.time),[g,_]=(0,U.useState)(),[v,y]=(0,U.useState)(!1),[b,x]=(0,U.useState)(!1),S=(0,U.useRef)(!1),{initialInsulinValue:C,initialDate:w}=(0,U.useMemo)(()=>({initialInsulinValue:t?.insulinValue,initialDate:t?.time}),[t]),T=(0,U.useCallback)(()=>{l(!0)},[]);(0,U.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,U.useMemo)(()=>qpn(E),[E]),O=(0,U.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?rsn({entry_timestamp:m,insulin_entered_units:parseFloat(u)}):{...G8.getLogbookByUUID(t.uuid),entry_timestamp:m,insulin_entered_units:parseFloat(u)};if(!await G8.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,U.useCallback)(async()=>{try{if(!t)return;await G8.deleteLogbook(t.uuid)?n():y(!0)}catch(e){console.error(`[RegisterActiveInsulin::deleteInsulinEntry] Error deleting insulin entry:`,e),y(!0)}},[t,n]),A=(0,U.useCallback)(()=>{S.current=!0,x(!1)},[]),ee=(0,U.useCallback)(()=>{S.current&&(S.current=!1,k().catch(console.error))},[k]),te=(0,U.useCallback)(()=>{p(!0)},[]),ne=(0,U.useCallback)(e=>{let t=new Date,n=A9t(e,{start:gpn(_pn(t,4),{seconds:0,milliseconds:0}),end:t})?void 0:r(`error_insulin_intake_hint`);h(e),_(n),p(!1)},[r]),re=(0,U.useCallback)(()=>{p(!1)},[]),ie=(0,U.useCallback)(e=>{d(e.toString()),l(!1)},[]),j=(0,U.useMemo)(()=>{if(!u)return 0;let e=Jpn(E);return D.findIndex(t=>t===parseFloat(u).toFixed(e))},[u,D,E]);function M(){return(0,G.jsxs)(V,{style:_7.header,children:[(0,G.jsx)(U5,{onPress:n}),(0,G.jsx)(Q,{style:_7.headerTitle,numberOfLines:1,ellipsizeMode:`middle`,children:r(`register_insulin_title`,{timeFourHour:I8(_pn(new Date,4),`HH:mm`)})}),(0,G.jsx)(W5,{onPress:O,disabled:!m||!u||!!g||w===m&&C===u})]})}function ae(){return(0,G.jsx)(V,{style:[_7.setTimeButton,{backgroundColor:i.bgPill}],children:(0,G.jsx)(Q,{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,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(M,{}),(0,G.jsxs)(ds,{contentContainerStyle:_7.contentContainer,children:[(0,G.jsxs)(V,{style:_7.screen,children:[(0,G.jsx)(Y4,{title:r(`register_insulin_input_title`),testID:`insulin-input`,onPress:T,renderRightSlot:()=>(0,G.jsxs)(V,{style:_7.insulinRightSlot,children:[(0,G.jsx)(Q,{style:[_7.insulinText,{color:i.labelPrimary}],children:u}),(0,G.jsx)(Q,{style:[_7.unitsText,{color:i.labelPrimary}],children:r(u&&parseFloat(u)===1?`unit`:`units`)})]}),style:c?{borderColor:i.borderInputFocus}:void 0}),(0,G.jsx)(B4,{isAnimated:!!g,children:(0,G.jsx)(Y4,{renderLeftSlot:()=>(0,G.jsx)(Q,{children:r(`register_insulin_time_input_title`)}),testID:`time-input`,errorMessage:g,onPress:te,renderRightSlot:ae,style:f?{flexWrap:`wrap`,paddingVertical:8,borderColor:i.borderInputFocus}:_7.rowInsulin})})]}),e===u7.Edit&&(0,G.jsx)(U4,{title:r(`button_delete`),onPress:()=>{x(!0)},type:H4.Error})]}),(0,G.jsx)(Q5,{isVisible:c,items:D,onConfirm:ie,onCancel:()=>{l(!1)},initialScrollIndex:j,testID:`insulin-wheel-picker`}),Eq?(0,G.jsx)(Vpn,{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:Wpn,customCancelButtonIOS:Gpn,pickerContainerStyleIOS:{backgroundColor:i.iosKeyboardPicker},themeVariant:s,isDarkModeEnabled:s===`dark`,pickerStyleIOS:_7.alignCenter,modalStyleIOS:{paddingBottom:a},is24Hour:!0,locale:`en_GB`}):(0,G.jsx)(Upn,{isVisible:f,initialValue:m??new Date,onConfirm:ne,onCancel:re}),(0,G.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,G.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 Xpn=f7(Ypn),_7=z.create({header:{width:`100%`,flexDirection:`row`,justifyContent:`space-between`,alignItems:`center`,paddingHorizontal:16,paddingBottom:12},headerTitle:{...X.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:{...X.Poppins.medium_Base},insulinText:{...X.Poppins.medium_Base,marginRight:4},unitsText:{...X.Poppins.medium_Base},alignCenter:{alignSelf:`center`}});H();function Zpn({entriesCount:e,onInfoPress:t}){let{t:n}=Sq(),{COLORS:r}=Y(),i=e>0;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(V,{style:v7.iconContainer,children:[(0,G.jsx)(Y7t,{}),(0,G.jsx)(Cp,{testID:`info-button`,style:v7.infoIconButton,onPress:t,children:(0,G.jsx)(J7t,{height:32,width:32,color:r.iconBrand})})]}),(0,G.jsx)(Q,{style:v7.title,children:n(i?`Recent_insulin_title`:`Recent_insulin_empty_title`)}),(0,G.jsx)(Q,{style:[v7.subtitle,v7.headerSubtitle,{color:r.labelSecondary}],children:n(i?`recent_insulin_body`:`Recent_insulin_empty_body`)})]})}function Qpn(){return(0,G.jsx)(V,{style:v7.separatorList})}var v7=z.create({iconContainer:{marginBottom:16},title:{...X.Poppins.semiBold_2XL,marginBottom:8},subtitle:{...X.Poppins.regular_SM},headerSubtitle:{marginBottom:48},infoIconButton:{position:`absolute`,right:0},separatorList:{height:8}});H(),J0();function $pn({onNoInsulinPressed:e}){let{t}=Sq(),{COLORS:n}=Y(),{entries:r,animatedEntryId:i,isInfoModalVisible:a,setIsInfoModalVisible:o,registerInsulinAction:s,editingInsulinEntry:c,handleEditInsulinEntry:l,handleEntryAnimationFinished:u,handleRegisterInsulinPressed:d,handleRegisterInsulinClose:f}=ypn(),p=(0,U.useRef)(null),m=(0,U.useCallback)(()=>{u8(l8.RecentInsulinRegisterPress),d(),p.current?.present()},[d]),h=(0,U.useCallback)(e=>{f(e),p.current?.close()},[f]),g=(0,U.useCallback)(e=>{l(e),p.current?.present()},[l]);return(0,G.jsxs)(q0,{edges:[`bottom`],children:[(0,G.jsx)(Uc,{testID:`active_insulin_list`,data:r,keyExtractor:e=>e.uuid,contentContainerStyle:y7.contentContainer,ListHeaderComponent:()=>(0,G.jsx)(Zpn,{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,G.jsx)(O7t,{isAnimated:i===e.uuid,onAnimationFinished:u,children:(0,G.jsx)(Y4,{title:I8(e.time,`HH:mm`),onPress:()=>{g(e.uuid)},testID:`entry-${n}`,renderRightSlot:()=>(0,G.jsxs)(V,{style:y7.rightSlot,children:[(0,G.jsx)(Q,{style:y7.insulinValueText,children:`${e.insulinValue} ${r}`}),(0,G.jsx)(K4,{})]})})})},ItemSeparatorComponent:Qpn,ListFooterComponent:()=>(0,G.jsxs)(V,{style:y7.buttonsWrapper,children:[(0,G.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,G.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,G.jsx)(m$,{ref:p,handleIndicatorStyle:{height:0},backdropComponent:V4,backgroundStyle:{backgroundColor:n.bgSheet,borderRadius:36},stackBehavior:`push`,enablePanDownToClose:!1,children:(0,G.jsx)(g$,{children:(0,G.jsx)(Xpn,{action:s,insulinEntry:c,onClose:h})})}),(0,G.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=z.create({contentContainer:{paddingHorizontal:16,paddingBottom:16},footer:{paddingTop:48},buttonsWrapper:{gap:8},rightSlot:{flexDirection:`row`,alignItems:`center`},insulinValueText:{...X.Poppins.regular_Base,marginRight:16}}),b7=()=>R5(e=>e.selectedReadingId&&e.availableGlucoseReadings.find(t=>t.id===e.selectedReadingId)||null),emn=e=>R5(t=>t.availableGlucoseReadings.find(t=>t.source===e)||null),tmn=()=>({fetchLibreCgmData:()=>Promise.resolve()});H();var nmn={top:16,bottom:16,left:16,right:16};function rmn({activity:e,isChecked:t,index:n=0,onEdit:r,toggleActivitySwitch:i}){let{t:a}=Sq(),{COLORS:o}=Y();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,U.useMemo)(()=>Math.round(c/60),[c]),[m,h]=(0,U.useState)(Kon(l,p)),g=(0,U.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,U.useEffect)(()=>{let e=()=>setInterval(()=>{h(Kon(l,p))},Z.Milliseconds.Minute),n=e=>{e&&clearInterval(e)},r=t?e():null;return()=>{n(r)}},[t,l,p]),g===null?null:(0,G.jsxs)(Cp,{testID:v,style:[x7.card,{backgroundColor:o.bgSecondary}],onPress:()=>{r(d)},children:[(0,G.jsxs)(V,{style:x7.headerContainer,children:[(0,G.jsxs)(V,{style:x7.left,children:[(0,G.jsxs)(V,{style:[x7.headerContent,{opacity:_}],children:[(0,G.jsx)(I7t,{height:24,width:24,color:o.iconButtonSecondary}),(0,G.jsxs)(Q,{style:x7.header,children:[`${Gon(p)} ${a(`activity_card__active_min`)}`,f&&`, `+f]})]}),(0,G.jsxs)(Q,{style:[x7.expiresIn,{color:o.labelSecondary,opacity:_}],children:[a(`activity_card_active_time`),` `,m]})]}),(0,G.jsx)(Cp,{onPress:()=>{i(d)},hitSlop:nmn,children:(0,G.jsx)(Mp,{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,G.jsxs)(V,{style:[x7.reduction,{opacity:_}],children:[(0,G.jsx)(Q,{style:x7.reductionText,children:a(`activity_card_insulinReduction`)}),(0,G.jsx)(Q,{style:x7.reductionValue,children:` ${g}%`})]})]})}var x7=z.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:{...X.Poppins.regular_SM},expiresIn:{...X.Poppins.regular_XS,marginBottom:8},reduction:{flexDirection:`row`,alignItems:`baseline`,justifyContent:`space-between`,gap:8},reductionText:{...X.Poppins.regular_SM,flexShrink:1},reductionValue:{...X.Poppins.bold_2XL}});H();var imn=({selectedActivity:e,onClose:t})=>{let{t:n}=Sq(),{COLORS:r}=Y(),{navigate:i}=A$(),{activityStoreActions:a}=a7(),{modalStoreActions:o,isGoToSettingsPressed:s}=z5(),[c,l]=(0,U.useState)(!1),{activity:u}=k8;if(u===void 0)throw Error(`[CreateActivity::render] activitySettings is undefined`);let d=(0,U.useMemo)(()=>({uuid:i3(),startTimestamp:null,deleted:!1,type:null,activityIntensity:null,durationSeconds:0}),[]),f=(0,U.useMemo)(()=>e??d,[d,e]),p=(0,U.useMemo)(()=>f.startTimestamp===null?null:new Date(f.startTimestamp).getTime()+f.durationSeconds*Z.Milliseconds.Second>Date.now()?0:1,[f]),[m,h]=(0,U.useState)(f),[g,_]=(0,U.useState)(p),v=(0,U.useMemo)(()=>g===null?!1:g===1?m.durationSeconds>0&&!!m.startTimestamp:m.durationSeconds>0&&!!m.activityIntensity&&!!m.startTimestamp,[m,g]),y=(0,U.useMemo)(()=>!s3(m,f),[m,f]),b=(0,U.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*Z.Milliseconds.Second:0);x({durationSeconds:t,startTimestamp:new Date(n).toISOString()})},C=e=>{x({activityIntensity:Z.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*Z.Milliseconds.Second).toISOString()})},E=()=>{x({durationSeconds:0,activityIntensity:null})},D=()=>{E(),o.set({isGoToSettingsPressed:!0})},O=()=>{s&&(t(),o.set({showDiscardCalculationModal:!Tq}),Tq&&(i(F5.SettingsStack,{screen:F5.ActivitySettings}),o.set({isGoToSettingsPressed:!1})))},k=(0,U.useMemo)(()=>Math.round(m.durationSeconds/60),[m.durationSeconds]),A=(0,U.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===Z.ActivityIntensity.hard)return t.fromFortysix!==null;if(k===120&&e===Z.ActivityIntensity.hard)return t.fromSixtyone!==null;if(k===120&&e===Z.ActivityIntensity.moderate)return r.fromSixtyone!==null;if(k===120&&e===Z.ActivityIntensity.light)return n.fromSixtyone!==null}return!0},[m,u,g,v,k]);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(WUt,{testID:`create-activity-scroll-view`,style:[S7.container,{backgroundColor:r.bgSheet}],contentContainerStyle:S7.contentContainer,children:[(0,G.jsxs)(V,{style:S7.header,children:[(0,G.jsx)(U5,{onPress:t}),(0,G.jsx)(W5,{onPress:b,disabled:!v||!y})]}),(0,G.jsxs)(V,{style:S7.cardMandatory,children:[(0,G.jsxs)(V,{children:[(0,G.jsx)(Q,{style:[S7.headerTitle,{color:r.labelSecondary}],children:n(`new_activity_when_title`)}),(0,G.jsxs)(V,{style:[S7.segmentContainer,{backgroundColor:r.bgSegmentContainer,borderColor:r.buttonBorder}],children:[(0,G.jsx)(Cp,{style:[S7.segment,g===0&&{backgroundColor:r.bgSegmentPrimary}],onPress:w,testID:`starting-now-touchable-${g===0}`,children:(0,G.jsx)(Q,{style:[S7.value,{color:g===0?r.textLabelActive:r.textLabelInactive}],children:n(`new_activity_when_option1`)})}),(0,G.jsx)(V,{style:[S7.borderLeft,{backgroundColor:r.divider}]}),(0,G.jsx)(Cp,{style:[S7.segment,g===1&&{backgroundColor:r.bgSegmentPrimary}],onPress:T,testID:`just-finished-now-touchable-${g===1}`,children:(0,G.jsx)(Q,{style:[S7.value,{color:g===1?r.textLabelActive:r.textLabelInactive}],children:n(`new_activity_when_option2`)})})]})]}),(0,G.jsxs)(V,{children:[(0,G.jsx)(Q,{style:[S7.headerTitle,{color:r.labelSecondary}],children:n(`new_activity_duration_title`)}),(0,G.jsxs)(V,{style:[S7.segmentContainer,{backgroundColor:r.bgSegmentContainer,borderColor:r.buttonBorder}],children:[(0,G.jsx)(Cp,{style:[S7.segment,k===29&&{backgroundColor:r.bgSegmentPrimary}],onPress:()=>{S(29)},children:(0,G.jsx)(Q,{style:[S7.value,{color:k===29?r.textLabelActive:r.textLabelInactive}],children:`0-29`})}),(0,G.jsx)(V,{style:[S7.borderLeft,{backgroundColor:r.divider}]}),(0,G.jsx)(Cp,{style:[S7.segment,k===45&&{backgroundColor:r.bgSegmentPrimary}],onPress:()=>{S(45)},children:(0,G.jsx)(Q,{style:[S7.value,{color:k===45?r.textLabelActive:r.textLabelInactive}],children:`30-45`})}),(0,G.jsx)(V,{style:[S7.borderLeft,{backgroundColor:r.divider}]}),(0,G.jsx)(Cp,{style:[S7.segment,k===60&&{backgroundColor:r.bgSegmentPrimary}],onPress:()=>{S(60)},children:(0,G.jsx)(Q,{style:[S7.value,{color:k===60?r.textLabelActive:r.textLabelInactive}],children:`46-60`})}),(0,G.jsx)(V,{style:[S7.borderLeft,{backgroundColor:r.divider}]}),(0,G.jsx)(Cp,{style:[S7.segment,k===120&&{backgroundColor:r.bgSegmentPrimary}],onPress:()=>{S(120)},children:(0,G.jsx)(Q,{style:[S7.value,{color:k===120?r.textLabelActive:r.textLabelInactive}],children:`61-120`})})]})]}),(0,G.jsxs)(V,{style:{opacity:g===1?.5:1},children:[(0,G.jsxs)(V,{style:{flexDirection:`row`,justifyContent:`space-between`},children:[(0,G.jsx)(Q,{style:[S7.headerTitle,{color:r.labelSecondary}],children:n(`new_activity_intensity_title`)}),(0,G.jsx)(Cp,{onPress:()=>{g!==1&&l(!0)},children:(0,G.jsx)(J7t,{width:24,height:24,color:r.iconBrand})})]}),(0,G.jsxs)(V,{style:[S7.segmentContainer,{backgroundColor:r.bgSegmentContainer,borderColor:r.buttonBorder}],children:[(0,G.jsx)(Cp,{style:[S7.segment,m.activityIntensity===Z.ActivityIntensity.light&&{backgroundColor:r.bgSegmentPrimary}],onPress:()=>{g!==1&&C(Z.ActivityIntensity.light)},testID:`activity-light-touchable-${m.activityIntensity===Z.ActivityIntensity.light}`,children:(0,G.jsx)(Q,{style:[S7.value,{color:m.activityIntensity===Z.ActivityIntensity.light?r.textLabelActive:r.textLabelInactive}],maxFontSizeMultiplier:S2.s2,children:n(`activity_intensity_1`)})}),(0,G.jsx)(V,{style:[S7.borderLeft,{backgroundColor:r.divider}]}),(0,G.jsx)(Cp,{style:[S7.segment,m.activityIntensity===Z.ActivityIntensity.moderate&&{backgroundColor:r.bgSegmentPrimary}],onPress:()=>{g!==1&&C(Z.ActivityIntensity.moderate)},testID:`activity-moderate-touchable-${m.activityIntensity===Z.ActivityIntensity.moderate}`,children:(0,G.jsx)(Q,{style:[S7.value,{color:m.activityIntensity===Z.ActivityIntensity.moderate?r.textLabelActive:r.textLabelInactive}],maxFontSizeMultiplier:S2.s2,children:n(`activity_intensity_2`)})}),(0,G.jsx)(V,{style:[S7.borderLeft,{backgroundColor:r.divider}]}),(0,G.jsx)(Cp,{style:[S7.segment,m.activityIntensity===Z.ActivityIntensity.hard&&{backgroundColor:r.bgSegmentPrimary}],onPress:()=>{g!==1&&C(Z.ActivityIntensity.hard)},testID:`activity-hard-touchable-${m.activityIntensity===Z.ActivityIntensity.hard}`,children:(0,G.jsx)(Q,{style:[S7.value,{color:m.activityIntensity===Z.ActivityIntensity.hard?r.textLabelActive:r.textLabelInactive}],maxFontSizeMultiplier:S2.s2,children:n(`activity_intensity_3`)})})]})]})]})]}),(0,G.jsx)(t7,{}),(0,G.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,G.jsxs)(u3,{isVisible:c,title:n(`calcflow_activityInfo_modal_title`),buttons:[{title:n(`button_close`),onPress:()=>{l(!1)}}],children:[(0,G.jsx)(Q,{style:S7.intensityDescriptionTitle,children:n(`calcflow_activityInfo_modal_intensity1_title`)}),(0,G.jsx)(Q,{style:[S7.intensityDescriptionText,{color:r.labelSecondary}],children:n(`calcflow_activityInfo_modal_intensity1_body`)}),(0,G.jsx)(Q,{style:S7.intensityDescriptionTitle,children:n(`calcflow_activityInfo_modal_intensity2_title`)}),(0,G.jsx)(Q,{style:[S7.intensityDescriptionText,{color:r.labelSecondary}],children:n(`calcflow_activityInfo_modal_intensity2_body`)}),(0,G.jsx)(Q,{style:S7.intensityDescriptionTitle,children:n(`calcflow_activityInfo_modal_intensity3_title`)}),(0,G.jsx)(Q,{style:[S7.intensityDescriptionText,{color:r.labelSecondary}],children:n(`calcflow_activityInfo_modal_intensity3_body`)})]})]})},S7=z.create({container:{marginHorizontal:16},contentContainer:{paddingBottom:64},header:{flexDirection:`row`,justifyContent:`space-between`,marginBottom:32},cardMandatory:{gap:24},headerTitle:{...X.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:{...X.Poppins.regular_Base},intensityDescriptionTitle:{...X.Poppins.semiBold_Base,marginTop:16},intensityDescriptionText:{...X.Poppins.regular_Base}}),amn=f7(imn);H();var omn=()=>{let{t:e}=Sq(),{COLORS:t}=Y(),{addListener:n,removeListener:r}=A$(),i=(0,U.useRef)(null),a=(0,U.useRef)(!1),{activity:o}=k8,{selectedEventUUID:s,activityStoreActions:c}=a7(),[l,u]=(0,U.useState)(null),[d,f]=(0,U.useState)([]);(0,U.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,U.useEffect)(()=>{let e=xf.addEventListener(`change`,e=>{e===`active`&&p()});return n(`focus`,p),()=>{r(`focus`,p),e.remove()}},[r,n]);let m=(0,U.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),wf.dismiss(),i.current?.present()},g=e=>{u(S8.getByUUID(e)),h()};return(0,G.jsxs)(G.Fragment,{children:[d.map((e,t)=>(0,G.jsx)(rmn,{index:t,toggleActivitySwitch:m,isChecked:s===e.uuid,onEdit:g,activity:e},e.uuid)),(0,G.jsxs)(Cp,{testID:`add-activity-button`,onPress:h,style:({pressed:e})=>[smn.smallButton,{backgroundColor:t.bgButtonSecondary,opacity:e?.5:1}],children:[(0,G.jsx)(I7t,{color:t.iconButtonSecondary}),(0,G.jsx)(Q,{style:smn.buttonText,children:e(`calcflow_activity_button_add`)})]}),(0,G.jsx)(V,{style:{height:24,borderTopWidth:1,borderTopColor:t.divider}}),(0,G.jsx)(m$,{ref:i,handleIndicatorStyle:{height:0},backdropComponent:V4,backgroundStyle:{backgroundColor:t.bgSheet,borderRadius:36},enablePanDownToClose:!1,children:(0,G.jsx)(amn,{selectedActivity:l,onClose:()=>{u(null),i.current?.close(),p()}})})]})},smn=z.create({smallButton:{flexDirection:`row`,alignSelf:`flex-start`,alignItems:`center`,borderRadius:16,paddingHorizontal:16,paddingVertical:8,marginBottom:24,gap:8},buttonText:{...X.Poppins.medium_SM,alignSelf:`center`}});H();var cmn=()=>{let{COLORS:e}=Y(),{navigate:t}=A$(),{foodIntakeItems:n,removeFoodIntakeItem:r}=L5(),i=(0,U.useCallback)((e,t)=>{e?r(e,`id`):r(t,`title`)},[r]),a=(0,U.useCallback)(e=>{if(e.source===`curated`){t(F5.FoodLibrary,{screen:F5.CuratedFoodItem,params:{foodId:e.id,categoryId:e.categoryId}});return}t(F5.FoodLibrary,{screen:F5.PersonalFoodItem,params:{foodId:e.id}})},[t]),o=(0,U.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,G.jsxs)(V,{style:[C7.pill,{backgroundColor:e.bgPill}],children:[(0,G.jsxs)(Cp,{onPress:()=>{a(t.foodItem)},style:({pressed:e})=>[C7.pillContent,{opacity:e?.5:1}],testID:`carbs-item-${n}`,children:[(0,G.jsx)(Q,{numberOfLines:1,ellipsizeMode:`middle`,style:[C7.title,{color:e.labelPrimary}],testID:`carbs-item-${n}-title`,children:l}),(0,G.jsx)(Q,{style:[C7.value,{color:e.labelPrimary}],testID:`carbs-item-${n}-amount`,children:`${u} g`})]}),(0,G.jsx)(Cp,{onPress:()=>{i(c,l)},testID:`carbs-item-${n}-remove-icon`,hitSlop:16,children:(0,G.jsx)(U7t,{width:16,height:16})})]},r)},[e.bgPill,e.labelPrimary,a,i]);return(0,G.jsx)(V,{style:C7.container,children:n.map((e,t)=>o({item:e,index:t,itemKey:e.foodItem.id||`${t}-${e.foodItem.title}`}))})},C7=z.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:{...X.Poppins.regular_XS,marginRight:2,flexShrink:1},value:{...X.Poppins.regular_XS,marginRight:2}});H();var lmn=(0,U.forwardRef)(({onFocusChange:e},t)=>{let{t:n}=Sq(),{COLORS:r}=Y(),{navigate:i}=A$(),a=(0,U.useRef)(null);(0,U.useImperativeHandle)(t,()=>({blur:()=>a.current?.blur()}));let{foodIntakeItems:o,foodIntakeCarbsAmount:s,manualCarbsInput:c,setManualCarbsInput:l}=L5(),[u,d]=(0,U.useState)(!1),[f,p]=(0,U.useState)(``),m=UWt();(0,U.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,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(V,{style:[w7.carbsSection,{backgroundColor:r.bgListActive,borderColor:u?r.borderInputFocus:r.bgListActive}],children:[(0,G.jsx)(Y4,{testID:`carbs-input`,renderLeftSlot:()=>(0,G.jsxs)(V,{style:w7.inputRow,children:[(0,G.jsx)(L7t,{width:24,height:24,color:r.labelPrimary}),(0,G.jsx)(Q,{testID:`carbs-input-unit`,children:n(`calcflow_carbohydrates_title`)})]}),renderRightSlot:()=>(0,G.jsxs)(V,{style:w7.inputRow,children:[(0,G.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,G.jsx)(Q,{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,G.jsxs)(V,{style:{borderTopWidth:1,borderTopColor:r.divider},children:[(0,G.jsx)(cmn,{}),(0,G.jsx)(P7t,{}),(0,G.jsxs)(V,{style:[w7.totalContainer,{backgroundColor:r.bgListActive}],children:[(0,G.jsx)(Q,{style:w7.totalTitle,children:n(`calcflow_carbohydrates_total`)}),(0,G.jsxs)(V,{style:w7.totalGramsContainer,children:[(0,G.jsx)(Q,{style:w7.totalValue,testID:`total-carbs-value`,children:s+c}),(0,G.jsx)(Q,{style:w7.totalUnits,testID:`total-carbs-unit`,children:n(`my_food_add_unit`)})]})]})]})]}),(0,G.jsxs)(V,{style:w7.buttonsContainer,children:[(0,G.jsxs)(Cp,{testID:`add-food-from-library-button`,onPress:()=>{u8(l8.CalculationFoodLibraryPress),i(F5.FoodLibrary)},style:({pressed:e})=>[w7.smallButton,{backgroundColor:r.bgButtonSecondary,opacity:e?.5:1}],children:[(0,G.jsx)(n9t,{color:r.labelPrimary}),(0,G.jsx)(Q,{style:[w7.title,{color:r.textButtonSecondary}],children:n(`calcflow_button_foodLibrary`)})]}),!Tq&&(0,G.jsx)(Z9t,{onPress:()=>{if(u8(l8.CalculationScanFoodPress),!c7.getState().privacyNoticeAccepted){i(F5.VisualSearchIntro);return}i(F5.VisualSearch)},text:n(`calcflow_button_scan`),style:w7.scanFoodButton})]}),(0,G.jsx)(V,{style:{height:24,borderTopWidth:1,borderTopColor:r.divider}})]})});lmn.displayName=`Carbs`;var w7=z.create({inputRow:{flexDirection:`row`,justifyContent:`flex-start`,alignItems:`center`,marginRight:8,gap:4},carbsSection:{borderWidth:2,borderRadius:16,marginBottom:12},numberInput:{...X.Poppins.regular_Base,lineHeight:B.select({ios:0,default:X.Poppins.regular_Base.lineHeight}),textAlign:`right`,maxWidth:40},totalContainer:{flexDirection:`row`,justifyContent:`space-between`,alignItems:`baseline`,padding:16,paddingTop:8,borderRadius:16},totalTitle:{...X.Poppins.medium_Base},totalGramsContainer:{flexDirection:`row`,alignItems:`baseline`},totalValue:{...X.Poppins.bold_2XL},totalUnits:{...X.Poppins.medium_Base,marginLeft:8},unit:{...X.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:{...X.Poppins.medium_SM,alignSelf:`center`}}),umn=`hda`,dmn=e=>e.device_name.toLowerCase()===umn||e.source_name.toLowerCase()===umn,fmn=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}),pmn=(e,t=Date.now())=>e.map(fmn).filter(e=>!dmn(e)&&e.timestamp.getTime()<=t).sort((e,t)=>t.timestamp.getTime()-e.timestamp.getTime())[0]??null,mmn=(e,t)=>{let{inputMax:n,inputMin:r}=L8(t);return!isNaN(e)&&e>=r&&e<=n};H();var hmn=()=>{let{t:e}=Sq(),{COLORS:t}=Y(),{glucoseStoreActions:n}=R5(),r=emn(`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,U.useState)(!1),[c,l]=(0,U.useState)(!1);R3t(()=>{r&&s(Date.now()-r.timestamp>Z.Milliseconds.Minute*10)},1e3),(0,U.useEffect)(()=>{(async()=>{try{let e=`${_q.HEDIA_SERVER_BASE_URL}/api/v2/samples`,t=await d8(e);await E2(t,Z.StatusCode.OK,e);let r=await t.json();if(r.length===0)return;let i=pmn(r);if(!i)return;let{unit:a,value:o}=i.quantity;if(!mmn(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),iin(i)}catch(e){console.error(`[DevicesSection.web::getSamples]`,e)}})()},[n]);let u=(0,U.useCallback)(()=>{if(_q.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)*Z.Milliseconds.Minute),source_id:`TEST`,quantity:{unit:Z.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,G.jsxs)(V,{style:T7.container,children:[r?.source===`external`?(0,G.jsx)(Cp,{style:[T7.button,{backgroundColor:i?t.bgButtonPrimary:t.bgButtonSecondary}],onPress:()=>{!o&&n.setSelectedReadingId(r.id)},children:(0,G.jsx)(Q,{style:[T7.title,{color:i?t.textButtonPrimary:t.textButtonSecondary}],children:r.deviceName})}):(0,G.jsx)(Cp,{style:[T7.button,{backgroundColor:t.bgButtonSecondary}],onPress:()=>{l(!0)},onLongPress:()=>{u()},children:(0,G.jsx)(Q,{style:[T7.title,{color:t.labelPrimary}],children:e(`import_modal_reading_title`)})}),(0,G.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=z.create({container:{marginTop:12},button:{alignSelf:`flex-start`,paddingVertical:8,paddingHorizontal:16,borderRadius:16},title:{...X.Poppins.medium_SM}});H();var gmn=e=>e.replace(`,`,`.`),_mn=300,vmn=(0,U.forwardRef)(({onFocusChange:e},t)=>{let{t:n}=Sq(),{COLORS:r}=Y(),i=(0,U.useRef)(null);(0,U.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,U.useMemo)(()=>L8(a),[a]),[u,d]=(0,U.useState)(``),[f,p]=(0,U.useState)(!1),m=b7(),{glucoseStoreActions:h,availableGlucoseReadings:g}=R5(),{isNoBGModalVisible:_,modalStoreActions:v}=z5(),[y,b]=(0,U.useState)(!1),[x,S]=(0,U.useState)(!1),[C,w]=(0,U.useState)(`hidden`),[T,E]=(0,U.useState)(`hidden`);R$((0,U.useCallback)(()=>{let e=setInterval(()=>{let e=m?.timestamp;T===`open`||!e||m.source===`cgm`||Date.now()-e>Z.Milliseconds.Minute*10&&(E(`open`),d(``))},1e3);return()=>{clearInterval(e)}},[T,m])),(0,U.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,U.useCallback)(e=>{d(gmn(e))},[]),k=(0,U.useCallback)(()=>{u8(l8.CalculationGlucosePress),p(!0),e?.(!0)},[e]),A=(0,U.useCallback)(()=>{i.current?.focus()},[]),ee=(0,U.useCallback)(()=>{if(Tq){A();return}setTimeout(A,_mn)},[A]),te=(0,U.useCallback)(()=>{d(m&&B8(m.value,m.unit,a)||``)},[a,m]),ne=(0,U.useCallback)(()=>g.find(e=>{let t=B8(e.value,e.unit,a),n=Date.now()-e.timestamp>Z.Milliseconds.Minute*10;return t===u&&e.source!==`manual`&&!n}),[g,a,u]),re=(0,U.useCallback)(e=>!isNaN(e)&&e>=c&&e<=s,[s,c]),ie=(0,U.useCallback)(e=>({id:i3(),source:`manual`,value:e,unit:a,timestamp:Date.now()}),[a]),j=(0,U.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]),M=()=>{(0,d7.flushSync)(()=>{w(`hidden`),h.setSelectedReadingId(null)}),ee()},ae=()=>{w(`closing`)},oe=()=>{w(`hidden`)},N=()=>{u8(l8.ExpiredGlucose),h.setSelectedReadingId(null)},se=()=>{(0,d7.flushSync)(()=>{E(`hidden`)}),ee()},P=()=>{E(`closing`)},F=()=>{E(`hidden`)},ce=()=>{(0,d7.flushSync)(()=>{v.set({isNoBGModalVisible:!1})}),ee()},le=()=>{b(!0),v.set({isNoBGModalVisible:!1})},ue=()=>{b(!1)},de=m===null||m.source===`manual`;return(0,G.jsxs)(G.Fragment,{children:[(0,G.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,G.jsxs)(V,{style:E7.inputRow,children:[(0,G.jsx)(G7t,{height:24,width:24,color:r.labelPrimary}),(0,G.jsx)(Q,{testID:`glucose-input-unit`,ellipsizeMode:`tail`,numberOfLines:1,style:E7.sourceText,children:t})]})},renderRightSlot:()=>(0,G.jsxs)(V,{style:E7.rightSlot,children:[(0,G.jsx)(I4,{testID:`glucose-input-field`,ref:i,value:u,inputMode:a===Z.BloodGlucoseUnit.MMOL_L?`decimal`:`numeric`,maxLength:a===Z.BloodGlucoseUnit.MMOL_L?4:3,editable:de||f,onChangeText:O,onFocus:k,onBlur:j,style:[E7.numberInput,{color:de?r.labelPrimary:r.labelBrand,width:a===Z.BloodGlucoseUnit.MMOL_L?48:36}],selectTextOnFocus:!!u&&!f}),(0,G.jsx)(Q,{style:[E7.unit,{color:de?r.labelPrimary:r.labelBrand}],children:l})]}),onPress:D,style:{...E7.groupedRow,...f&&{borderColor:r.borderInputFocus}}}),(0,G.jsx)(hmn,{glucoseUnit:a,inputRef:i}),(0,G.jsx)(V,{style:[E7.divider,{borderTopColor:r.divider}]}),T!==`hidden`&&(0,G.jsx)(u3,{isVisible:T===`open`,title:n(`calcflow_modal_expired_title`),message:n(`calcflow_modal_expired_body`),icon:()=>(0,G.jsx)(G7t,{width:96,height:96,color:r.labelPrimary}),onModalShow:N,onModalHide:F,buttons:[{title:n(`calcflow_modal_expire_button_add`),onPress:se},{title:n(`button_cancel`),type:H4.Secondary,onPress:P}]}),(0,G.jsx)(u3,{isVisible:x,title:n(`calcflow_modal_glucose_invalid_title`,{min:Qon(c,a),max:Qon(s,a)}),buttons:[{testID:`close-button`,title:n(`button_close`),onPress:()=>{S(!1),te()}}]}),C!==`hidden`&&(0,G.jsx)(u3,{isVisible:C===`open`,title:n(`calcflow_modal_change_synced_value_title`),onModalHide:oe,buttons:[{testID:`change-button`,type:H4.Error,title:n(`calcflow_modal_button_changeValue`),onPress:M},{testID:`keep-button`,type:H4.Secondary,title:n(`calcflow_modal_button_keepValue`),onPress:ae}]}),(_||y)&&(0,G.jsx)(u3,{isVisible:_,title:n(`calcflow_modal_enter_glucose_title`),message:n(`calcflow_modal_enter_glucose_body`),icon:()=>(0,G.jsx)(G7t,{width:96,height:96,color:r.labelPrimary}),onModalHide:ue,buttons:[{title:n(`calcflow_modal_enter_glucose_button_add`),onPress:ce},{title:n(`button_cancel`),type:H4.Secondary,onPress:le}]})]})});vmn.displayName=`Glucose`;var E7=z.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:{...X.Poppins.regular_Base,lineHeight:B.select({ios:0,default:X.Poppins.regular_Base.lineHeight}),textAlign:`right`,textAlignVertical:`center`},unit:{...X.Poppins.regular_Base},divider:{marginTop:24,height:24,borderTopWidth:1}});H();function ymn({description:e,assetId:t,imageUri:n,onPress:r,testID:i}){let{COLORS:a}=Y(),{t:o}=Sq(),s=$5(n?void 0:t),c=n??s,l=e||o(`notes_placeholder`),u=l===o(`notes_placeholder`);return u&&!c?null:(0,G.jsxs)(Cp,{style:({pressed:e})=>[bmn.container,{backgroundColor:a.bgSecondary},e&&r&&{opacity:.9}],onPress:r,disabled:!r,testID:`${i}-button`,children:[(0,G.jsx)(Q,{style:[bmn.text,{color:u?a.labelTertiary:a.labelPrimary}],children:l}),!!c&&(0,G.jsx)(Xu,{source:{uri:c},style:bmn.thumbnail,resizeMode:`cover`,testID:`${i}-thumbnail`})]})}var bmn=z.create({container:{flexDirection:`row`,borderRadius:16,padding:16,gap:12,alignItems:`flex-start`},text:{...X.Poppins.regular_Base,flex:1},thumbnail:{width:64,height:64,borderRadius:8}});H();var xmn=({onClose:e,onConfirm:t})=>{let{COLORS:n}=Y(),{t:r}=Sq(),{noteId:i}=B5(),{noteStoreActions:a}=B5(),[o,s]=(0,U.useState)(!1),[c,l]=(0,U.useState)(!1),{noteBody:u,setNoteBody:d,loadNote:f,saveNote:p,isLoading:m,hasNoteContent:h}=spn();(0,U.useEffect)(()=>{i&&f(i).catch(console.error)},[i,f]);let g=(0,U.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,U.useCallback)(()=>{e()},[e]),v=!h||o;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(V,{style:Smn.header,children:[(0,G.jsx)(U5,{onPress:_}),o?(0,G.jsx)(Nf,{size:`small`,color:n.iconBrand}):(0,G.jsx)(W5,{onPress:g,disabled:v})]}),m?(0,G.jsx)(V,{style:Smn.loader,children:(0,G.jsx)(Nf,{size:`large`,color:n.iconBrand})}):(0,G.jsx)(pfn,{value:u,onChangeText:d,testID:`calculation-notes`,autoFocus:!0,containerStyle:Smn.container}),(0,G.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)}}]})]})},Smn=z.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}});H();var Cmn=()=>{let{t:e}=Sq(),{COLORS:t}=Y(),{noteBody:n,displayImageUri:r}=B5(),i=(0,U.useRef)(null),a=()=>{u8(l8.CalculationNotesPress),wf.dismiss(),i.current?.present()};return(0,G.jsxs)(G.Fragment,{children:[n.trim()||r?(0,G.jsx)(V,{style:wmn.noteContainer,children:(0,G.jsx)(ymn,{description:n,imageUri:r,onPress:a,testID:`note-display`})}):(0,G.jsxs)(Cp,{testID:`add-notes-button`,onPress:a,style:({pressed:e})=>[wmn.smallButton,{backgroundColor:t.bgButtonSecondary,opacity:e?.5:1}],children:[(0,G.jsx)(e9t,{height:20,width:20,color:t.labelPrimary}),(0,G.jsx)(Q,{style:[wmn.title,{color:t.textButtonSecondary}],children:e(`calcflow_notes_button_add`)})]}),(0,G.jsx)(m$,{ref:i,handleIndicatorStyle:{height:0},backdropComponent:V4,backgroundStyle:{backgroundColor:t.bgSheet,borderRadius:36},enablePanDownToClose:!1,enableDynamicSizing:!1,snapPoints:[`85%`],children:(0,G.jsx)(g$,{children:(0,G.jsx)(xmn,{onClose:()=>{wf.dismiss(),i.current?.dismiss()},onConfirm:()=>{wf.dismiss(),i.current?.dismiss()}})})})]})},wmn=z.create({smallButton:{flexDirection:`row`,alignSelf:`flex-start`,alignItems:`center`,borderRadius:16,paddingHorizontal:16,paddingVertical:8,marginBottom:24,gap:8},noteContainer:{marginBottom:24},title:{...X.Poppins.medium_SM,alignSelf:`center`}});H();var Tmn=()=>{let{t:e}=Sq(),{COLORS:t}=Y(),{bottomWithFooterButton:n}=Q4(),r=M5(),i=(0,U.useRef)(null),a=A$(),o=M$(),{modalStoreActions:s}=z5(),{noteId:c}=B5(),{foodIntakeItems:l,manualCarbsInput:u,foodIntakeCarbsAmount:d}=L5(),[f,p]=(0,U.useState)(!1),m=b7(),h=o.params?.errorType??null,g=h===Cq.Sync,_=(0,U.useRef)(!1),v=(0,U.useRef)(!1),y=(0,U.useRef)(null),b=(0,U.useRef)(null),x=(0,U.useCallback)(e=>{_.current=e},[]),S=(0,U.useCallback)(e=>{v.current=e},[]),{fetchLibreCgmData:C}=tmn(),w=(0,U.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]);R$((0,U.useCallback)(()=>{if(Tq)return;let e=Sf.addEventListener(`hardwareBackPress`,w);return()=>{e.remove()}},[w])),(0,U.useEffect)(()=>{C()},[C]),(0,U.useLayoutEffect)(()=>{a.setOptions({headerTransparent:!0,header:()=>(0,G.jsx)(P5,{title:e(`calcflow_navigation`),LeftButton:Tq?void 0:(0,G.jsx)(U5,{onPress:w}),RightButton:Tq?(0,G.jsxs)(V,{style:[D7.buttonsWrapper,{backgroundColor:t.bgButtonSecondary,borderColor:t.border}],children:[(0,G.jsx)(Qdn,{style:D7.noBorder}),(0,G.jsx)(Zdn,{style:D7.noBorder})]}):(0,G.jsx)(Qdn,{}),overlay:!0})})},[t.bgButtonSecondary,t.border,w,a,e]);let[T,E]=(0,U.useState)(Tq);(0,U.useEffect)(()=>{if(!Tq)return a.addListener(`transitionStart`,({data:e})=>{e.closing||!a.isFocused()||E(!0)})},[a]),(0,U.useEffect)(()=>{if(!T)return;let e=setTimeout(()=>{i.current?.present()},100);return()=>{clearTimeout(e)}},[T]);let D=(0,U.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>Qfn().max){p(!0);return}a.navigate(F5.LoadingRecommendation)},[m,a,s,d,u]),O=(0,U.useCallback)(()=>{u8(l8.RecentInsulinContinuePress),i.current?.close()},[]);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(ds,{testID:`calculation-scroll-view`,keyboardShouldPersistTaps:`handled`,contentContainerStyle:[D7.scrollView,{backgroundColor:t.bgPrimary,paddingTop:r+16,paddingBottom:n}],children:[(0,G.jsx)(vmn,{ref:b,onFocusChange:S}),(0,G.jsx)(lmn,{ref:y,onFocusChange:x}),(0,G.jsx)(omn,{}),(0,G.jsx)(Cmn,{})]}),(0,G.jsx)(tpn,{children:(0,G.jsx)(U4,{type:H4.Primary,testID:`calculate-button`,title:e(`calcflow_button_calculate`),onPress:D,inactive:m===null})}),(0,G.jsx)(m$,{ref:i,handleIndicatorStyle:{height:0},backdropComponent:V4,backgroundStyle:{backgroundColor:t.bgSheet,borderRadius:36},enablePanDownToClose:!1,children:(0,G.jsx)(g$,{children:(0,G.jsx)($pn,{onNoInsulinPressed:O})})}),(0,G.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(F5.Calculation)}}]}),(0,G.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,G.jsx)(npn,{}),(0,G.jsx)(ppn,{})]})},D7=z.create({scrollView:{paddingHorizontal:16},buttonsWrapper:{flexDirection:`row`,padding:0,borderRadius:44,borderWidth:1},noBorder:{borderWidth:0}});H();var Emn=1e3;function Dmn(){let e=A$(),t=M$(),[n,r]=(0,U.useState)(!1);return(0,U.useEffect)(()=>{setTimeout(()=>{r(!0)},Emn)},[]),(0,U.useEffect)(()=>{n&&(Tq?(window.location.href=`/redirect?status=success`,vq.clearAll()):e.popTo(F5.MainBottomTabs,{screen:F5.DashboardTab,params:{screen:F5.Dashboard,params:{action:mvt.Saved,logbookEntry:t.params.logbookEntry}}}))},[n,e,t.params.logbookEntry]),(0,G.jsx)(V,{style:Omn.animationContainer,children:(0,G.jsx)(p2,{autoPlay:!0,source:m2.LEAVING_RECOMMENDATION,style:Omn.animation,webStyle:Omn.animation,resizeMode:`cover`,loop:!1})})}var Omn=z.create({animationContainer:{flex:1,justifyContent:`center`,alignItems:`center`},animation:{width:256,height:256}}),kmn=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`}})),Amn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DARK_SEMANTIC_COLORS=void 0;var t=kmn(),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]}})),jmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LIGHT_SEMANTIC_COLORS=void 0;var t=kmn(),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]}})),Mmn=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=(H(),d(em)),n=Amn(),r=jmn(),i=Mmn(),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=Amn(),i=PJ();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)})),Nmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,a(p());var t=i((F4(),d(P4))),n=k7(),r=PJ();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})),Pmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,a(p());var t=i((F4(),d(P4))),n=k7(),r=PJ();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=D2();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=q_t(),r=PJ();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=D2();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))})),Fmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.useDebouncedCallback=m,e.useFontScale=f;var t=p(),n=(H(),d(em)),r=Mmn(),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=(H(),d(em)),r=Fmn(),i=k7(),a=O7(),o=PJ();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})),Imn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=g(p()),n=(H(),d(em)),r=D2(),i=h(Nmn()),a=h(Pmn()),o=A7(),s=k7(),c=j7(),l=O7(),u=M7(),f=h(N7()),m=PJ();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=_})),Lmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,a(p());var t=i((F4(),d(P4))),n=k7(),r=PJ();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})),Rmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,i(p());var t=(F4(),d(P4)),n=k7(),r=PJ();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})]})}})),zmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,i(p());var t=(H(),d(em)),n=k7(),r=PJ();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})),Bmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.CheckmarkCircleFilledHeight=void 0,i(p());var t=r((F4(),d(P4))),n=PJ();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})),Vmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,o(p());var t=(H(),d(em)),n=a(Bmn()),r=k7(),i=PJ();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=(H(),d(em)),r=(J0(),d(R4t)),i=k7(),a=c(zmn()),o=c(Vmn()),s=PJ();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)})),Hmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"HapticFeedbackTypes",{enumerable:!0,get:function(){return n.HapticFeedbackTypes}}),e.triggerHaptic=i;var t=(H(),d(em)),n=r((Cfn(),d(yfn)));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})}})),Umn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=i(p()),n=(H(),d(em)),r=PJ();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`}})})),Wmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=l(p()),n=(H(),d(em)),r=c(R4()),i=Fmn(),a=Hmn(),o=c(Umn()),s=PJ();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`}})})),Gmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=u(p()),n=(H(),d(em)),r=k7(),i=j7(),a=l(P7()),o=l(N7()),s=l(Wmn()),c=PJ();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}})})),Kmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=g(p()),n=(H(),d(em)),r=h(Lmn()),i=h(Rmn()),a=A7(),o=k7(),s=j7(),c=O7(),l=M7(),u=h(N7()),f=h(Gmn()),m=PJ();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`}})})),qmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,i(p());var t=(H(),d(em)),n=k7(),r=PJ();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})),Jmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,a(p());var t=i((F4(),d(P4))),n=k7(),r=PJ();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})),Ymn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,a(p());var t=i((F4(),d(P4))),n=k7(),r=PJ();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})),Xmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,r(p());var t=r((F4(),d(P4))),n=PJ();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})),Zmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.styles=e.default=void 0,o(p());var t=(H(),d(em)),n=k7(),r=O7(),i=o(N7()),a=PJ();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`}})})),Qmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.styles=e.default=void 0;var t=g(p()),n=(H(),d(em)),r=h(Jmn()),i=h(Ymn()),a=h(Xmn()),o=k7(),s=j7(),c=O7(),l=M7(),u=h(N7()),f=h(Zmn()),m=PJ();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`}})})),$mn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,s(p());var t=(H(),d(em)),n=k7(),r=j7(),i=O7(),a=s(N7()),o=PJ();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})),ehn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,c(p());var t=(H(),d(em)),n=c(R4()),r=k7(),i=j7(),a=O7(),o=c(N7()),s=PJ();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})),thn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=_(p()),n=(H(),d(em)),r=Tan(),i=D2(),a=g(Rmn()),o=A7(),s=k7(),c=j7(),l=O7(),u=M7(),f=g(N7()),m=g(Gmn()),h=PJ();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=(H(),d(em)),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`}})})),nhn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,c(p());var t=(H(),d(em)),n=k7(),r=j7(),i=c(N7()),a=c(P7()),o=F7(),s=PJ();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`)})})]})})}})),rhn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,c(p());var t=(H(),d(em)),n=k7(),r=j7(),i=c(N7()),a=c(P7()),o=F7(),s=PJ();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`)})})]})]})})}})),ihn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,c(p());var t=(H(),d(em)),n=k7(),r=j7(),i=c(N7()),a=c(P7()),o=F7(),s=PJ();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`)})})]})})}})),ahn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.getLimitedValue=m;var t=f(p()),n=(H(),d(em)),r=D2(),i=k7(),a=j7(),o=u(N7()),s=u(P7()),c=F7(),l=PJ();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`)})})]})})}})),ohn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,c(p());var t=(H(),d(em)),n=k7(),r=j7(),i=c(N7()),a=c(P7()),o=F7(),s=PJ();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`)})})]})})}})),shn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,c(p());var t=(H(),d(em)),n=k7(),r=j7(),i=c(N7()),a=c(P7()),o=F7(),s=PJ();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`)})})]})]})})}})),chn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,i(p());var t=r((F4(),d(P4))),n=PJ();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})),lhn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=c(p()),n=(H(),d(em)),r=s(R4()),i=s(chn()),a=k7(),o=PJ();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}}})),uhn=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)})),dhn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=uhn(),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}}})),fhn=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(dhn());e.defaultErrorMap=n.default;var r=n.default;function i(e){r=e}function a(){return r}})),phn=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=fhn(),r=t(dhn());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})),mhn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),hhn=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={}))})),ghn=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=Le;var t=uhn(),n=fhn(),r=hhn(),i=phn(),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 De({schema:this,typeName:Re.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 Oe.create(this,this._def)}nullable(){return ke.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return de.create(this)}promise(){return Ee.create(this,this._def)}or(e){return me.create([this,e],this._def)}and(e){return L.create(this,e,this._def)}transform(e){return new De({...c(this._def),schema:this,typeName:Re.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new Ae({...c(this._def),innerType:this,defaultValue:t,typeName:Re.ZodDefault})}brand(){return new Ne({typeName:Re.ZodBranded,type:this,...c(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new je({...c(this._def),innerType:this,catchValue:t,typeName:Re.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Pe.create(this,e)}readonly(){return Fe.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:Re.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:Re.ZodNumber,coerce:e?.coerce||!1,...c(e)});var M=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=M,M.create=e=>new M({checks:[],typeName:Re.ZodBigInt,coerce:e?.coerce??!1,...c(e)});var ae=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=ae,ae.create=e=>new ae({typeName:Re.ZodBoolean,coerce:e?.coerce||!1,...c(e)});var oe=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=oe,oe.create=e=>new oe({checks:[],coerce:e?.coerce||!1,typeName:Re.ZodDate,...c(e)});var N=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=N,N.create=e=>new N({typeName:Re.ZodSymbol,...c(e)});var se=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=se,se.create=e=>new se({typeName:Re.ZodUndefined,...c(e)});var P=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=P,P.create=e=>new P({typeName:Re.ZodNull,...c(e)});var F=class extends l{constructor(){super(...arguments),this._any=!0}_parse(e){return(0,i.OK)(e.data)}};e.ZodAny=F,F.create=e=>new F({typeName:Re.ZodAny,...c(e)});var ce=class extends l{constructor(){super(...arguments),this._unknown=!0}_parse(e){return(0,i.OK)(e.data)}};e.ZodUnknown=ce,ce.create=e=>new ce({typeName:Re.ZodUnknown,...c(e)});var le=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=le,le.create=e=>new le({typeName:Re.ZodNever,...c(e)});var ue=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=ue,ue.create=e=>new ue({typeName:Re.ZodVoid,...c(e)});var de=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=de,de.create=(e,t)=>new de({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Re.ZodArray,...c(t)});function fe(e){if(e instanceof pe){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=Oe.create(fe(r))}return new pe({...e._def,shape:()=>t})}else if(e instanceof de)return new de({...e._def,type:fe(e.element)});else if(e instanceof Oe)return Oe.create(fe(e.unwrap()));else if(e instanceof ke)return ke.create(fe(e.unwrap()));else if(e instanceof _e)return _e.create(e.items.map(e=>fe(e)));else return e}var pe=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 le&&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 le){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:Re.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 fe(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 Oe;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return Ce(a.util.objectKeys(this.shape))}};e.ZodObject=pe,pe.create=(e,t)=>new pe({shape:()=>e,unknownKeys:`strip`,catchall:le.create(),typeName:Re.ZodObject,...c(t)}),pe.strictCreate=(e,t)=>new pe({shape:()=>e,unknownKeys:`strict`,catchall:le.create(),typeName:Re.ZodObject,...c(t)}),pe.lazycreate=(e,t)=>new pe({shape:e,unknownKeys:`strip`,catchall:le.create(),typeName:Re.ZodObject,...c(t)});var me=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=me,me.create=(e,t)=>new me({options:e,typeName:Re.ZodUnion,...c(t)});var he=e=>e instanceof xe?he(e.schema):e instanceof De?he(e.innerType()):e instanceof Se?[e.value]:e instanceof we?e.options:e instanceof Te?a.util.objectValues(e.enum):e instanceof Ae?he(e._def.innerType):e instanceof se?[void 0]:e instanceof P?[null]:e instanceof Oe?[void 0,...he(e.unwrap())]:e instanceof ke?[null,...he(e.unwrap())]:e instanceof Ne||e instanceof Fe?he(e.unwrap()):e instanceof je?he(e._def.innerType):[],I=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=he(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:Re.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...c(r)})}};e.ZodDiscriminatedUnion=I;function ge(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=ge(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=ge(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 L=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=ge(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=L,L.create=(e,t,n)=>new L({left:e,right:t,typeName:Re.ZodIntersection,...c(n)});var _e=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=_e,_e.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new _e({items:e,typeName:Re.ZodTuple,rest:null,...c(t)})};var ve=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:Re.ZodRecord,...c(r)}):new e({keyType:re.create(),valueType:t,typeName:Re.ZodRecord,...c(n)})}};e.ZodRecord=ve;var ye=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=ye,ye.create=(e,t,n)=>new ye({valueType:t,keyType:e,typeName:Re.ZodMap,...c(n)});var be=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=be,be.create=(e,t)=>new be({valueType:e,minSize:null,maxSize:null,typeName:Re.ZodSet,...c(t)});var R=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 Ee){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:_e.create(t).rest(ce.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||_e.create([]).rest(ce.create()),returns:n||ce.create(),typeName:Re.ZodFunction,...c(r)})}};e.ZodFunction=R;var xe=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=xe,xe.create=(e,t)=>new xe({getter:e,typeName:Re.ZodLazy,...c(t)});var Se=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=Se,Se.create=(e,t)=>new Se({value:e,typeName:Re.ZodLiteral,...c(t)});function Ce(e,t){return new we({values:e,typeName:Re.ZodEnum,...c(t)})}var we=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=we,we.create=Ce;var Te=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=Te,Te.create=(e,t)=>new Te({values:e,typeName:Re.ZodNativeEnum,...c(t)});var Ee=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=Ee,Ee.create=(e,t)=>new Ee({type:e,typeName:Re.ZodPromise,...c(t)});var De=class extends l{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Re.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=De,e.ZodTransformer=De,De.create=(e,t,n)=>new De({schema:e,typeName:Re.ZodEffects,effect:t,...c(n)}),De.createWithPreprocess=(e,t,n)=>new De({schema:t,effect:{type:`preprocess`,transform:e},typeName:Re.ZodEffects,...c(n)});var Oe=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=Oe,Oe.create=(e,t)=>new Oe({innerType:e,typeName:Re.ZodOptional,...c(t)});var ke=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=ke,ke.create=(e,t)=>new ke({innerType:e,typeName:Re.ZodNullable,...c(t)});var Ae=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=Ae,Ae.create=(e,t)=>new Ae({innerType:e,typeName:Re.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...c(t)});var je=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=je,je.create=(e,t)=>new je({innerType:e,typeName:Re.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...c(t)});var Me=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=Me,Me.create=e=>new Me({typeName:Re.ZodNaN,...c(e)}),e.BRAND=Symbol(`zod_brand`);var Ne=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=Ne;var Pe=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:Re.ZodPipeline})}};e.ZodPipeline=Pe;var Fe=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=Fe,Fe.create=(e,t)=>new Fe({innerType:e,typeName:Re.ZodReadonly,...c(t)});function Ie(e,t){let n=typeof e==`function`?e(t):typeof e==`string`?{message:e}:e;return typeof n==`string`?{message:n}:n}function Le(e,t={},n){return e?F.create().superRefine((r,i)=>{let a=e(r);if(a instanceof Promise)return a.then(e=>{if(!e){let e=Ie(t,r),a=e.fatal??n??!0;i.addIssue({code:`custom`,...e,fatal:a})}});if(!a){let e=Ie(t,r),a=e.fatal??n??!0;i.addIssue({code:`custom`,...e,fatal:a})}}):F.create()}e.late={object:pe.lazycreate};var Re;(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`})(Re||(e.ZodFirstPartyTypeKind=Re={})),e.instanceof=(e,t={message:`Input not instance of ${e.name}`})=>Le(t=>t instanceof e,t);var ze=re.create;e.string=ze;var Be=j.create;e.number=Be,e.nan=Me.create,e.bigint=M.create;var Ve=ae.create;e.boolean=Ve,e.date=oe.create,e.symbol=N.create,e.undefined=se.create,e.null=P.create,e.any=F.create,e.unknown=ce.create,e.never=le.create,e.void=ue.create,e.array=de.create,e.object=pe.create,e.strictObject=pe.strictCreate,e.union=me.create,e.discriminatedUnion=I.create,e.intersection=L.create,e.tuple=_e.create,e.record=ve.create,e.map=ye.create,e.set=be.create,e.function=R.create,e.lazy=xe.create,e.literal=Se.create,e.enum=we.create,e.nativeEnum=Te.create,e.promise=Ee.create;var He=De.create;e.effect=He,e.transformer=He,e.optional=Oe.create,e.nullable=ke.create,e.preprocess=De.createWithPreprocess,e.pipeline=Pe.create,e.ostring=()=>ze().optional(),e.onumber=()=>Be().optional(),e.oboolean=()=>Ve().optional(),e.coerce={string:(e=>re.create({...e,coerce:!0})),number:(e=>j.create({...e,coerce:!0})),boolean:(e=>ae.create({...e,coerce:!0})),bigint:(e=>M.create({...e,coerce:!0})),date:(e=>oe.create({...e,coerce:!0}))},e.NEVER=i.INVALID})),_hn=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(fhn(),e),n(phn(),e),n(mhn(),e),n(I7(),e),n(ghn(),e),n(uhn(),e)})),vhn=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(_hn());e.z=a,i(_hn(),e),e.default=a})),yhn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.recommendationPropsSchema=e.calculatorParamsSchema=e.activitySchema=e.activityReductionSchema=void 0;var t=vhn(),n=D2(),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)})})),bhn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.SyncStatus=e.RecommendationScreen=void 0;var t=O(p()),n=(H(),d(em)),r=(J0(),d(R4t)),i=Tan(),a=D2(),o=D(Imn()),s=D(Kmn()),c=D(qmn()),l=D(Qmn()),u=D($mn()),f=D(ehn()),m=D(thn()),h=D(nhn()),g=D(rhn()),_=D(ihn()),v=D(ahn()),y=D(ohn()),b=D(shn()),x=D(lhn()),S=A7(),C=k7(),w=j7(),T=yhn(),E=PJ();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:M,injectionMethod:ae,transferEditedRecommendation:oe,closeCalculationFooter:N,closeCalculationTimeoutModal:se,deleteCalculation:P,closeCalculationViewInlogbook:F,trackRecommendationTimeout:ce,trackExpandDetails:le}=e,{glucoseReading:ue,carbohydrates:de,activity:fe}=j,pe=(0,t.useRef)((0,i.calculateRecommendation)(j)).current,[me,he]=(0,t.useState)(null),[I,ge]=(0,t.useState)(null),[L,_e]=(0,t.useState)(null),[ve,ye]=(0,t.useState)(null),[be,R]=(0,t.useState)(0),[xe,Se]=(0,t.useState)(0),[Ce,we]=(0,t.useState)(0),[Te,Ee]=(0,t.useState)(!0),[De,Oe]=(0,t.useState)(!1),[ke,Ae]=(0,t.useState)(!1),[je,Me]=(0,t.useState)(!0),[Ne,Pe]=(0,t.useState)(!1),[Fe,Ie]=(0,t.useState)(!1),[Le,Re]=(0,t.useState)(!1),[ze,Be]=(0,t.useState)(!1),[Ve,He]=(0,t.useState)(!1),[Ue,We]=(0,t.useState)(!1),[Ge,Ke]=(0,t.useState)(!1),[qe,Je]=(0,t.useState)(!1),[Ye,Xe]=(0,t.useState)(!1),[Ze,Qe]=(0,t.useState)(!1);(0,t.useEffect)(()=>{ne===k.Failure&&Xe(!0)},[ne]),(0,t.useEffect)(()=>{ie===k.Failure&&Je(!0)},[ie]),(0,t.useEffect)(()=>{re===k.Success&&(he(I),_e(ve))},[ne,re,ve,I,ie]),(0,t.useEffect)(()=>{T.recommendationPropsSchema.parse(e),p(e.language)},[p,e]),(0,t.useEffect)(()=>{pe.wasLimited&&Ke(!0)},[pe.wasLimited]),(0,t.useEffect)(()=>{let e=pe.recommendationDate.getTime(),t=setInterval(()=>{new Date().getTime()-e>S.TIMEOUT_MODAL_TRIGGER&&!Ue&&!Le&&(Re(!0),We(!0),ce())},a.Milliseconds.Second*1);return()=>clearInterval(t)},[Le,Ue,pe,ce]);let $e=(0,t.useCallback)(e=>{let t=pe.recommendationDate.getTime(),n=new Date().getTime()-t>S.TIMEOUT_MODAL_TRIGGER;e===`active`&&n&&!ze&&(We(!0),ce())},[pe,ce,ze]),et=(0,t.useCallback)(()=>(He(!0),!0),[]);(0,t.useEffect)(()=>{let e=n.AppState.addEventListener(`change`,$e),t=null;return n.Platform.OS===`android`&&(t=n.BackHandler.addEventListener(`hardwareBackPress`,et)),()=>{e.remove(),t?.remove()}},[$e,et]);let tt=(0,t.useMemo)(()=>{if(fe)return{activityDuration:fe.activityDuration,activityIntensity:fe.activityIntensity,activityReduction:pe.activityReduction}},[fe,pe.activityReduction]),nt=(0,t.useCallback)(e=>{n.LayoutAnimation.configureNext(n.LayoutAnimation.Presets.easeInEaseOut);let t=(0,i.roundInsulinValue)(pe.bolus,ae),r=Math.round(pe.carbRecommendation),a=e===t?null:e;e===t?(he(null),ge(null)):ge(e),oe({modified:L,suggested:r},{modified:a,suggested:t},pe.recommendationDate)},[pe,ae,L,oe]),rt=(0,t.useCallback)(e=>{n.LayoutAnimation.configureNext(n.LayoutAnimation.Presets.easeInEaseOut);let t=(0,i.roundInsulinValue)(pe.bolus,ae),r=Math.round(pe.carbRecommendation),a=e===r?null:e;e===r?(_e(null),ye(null)):ye(e),oe({modified:a,suggested:r},{modified:me,suggested:t},pe.recommendationDate)},[pe,ae,me,oe]),it=(0,t.useCallback)(()=>{Ne&&P()},[P,Ne]),at=(0,t.useCallback)(()=>{Be(!0),Fe?F():se()},[Fe,se,F]),ot=(0,t.useCallback)(()=>{Ie(!0),We(!1)},[]),st=(0,t.useCallback)(()=>{Pe(!0),He(!1)},[]),ct=(0,t.useCallback)(()=>{re===k.Failure&&Qe(!0)},[re]),lt=(0,t.useCallback)(()=>{Qe(!1)},[]),ut=(0,t.useCallback)((e,t)=>{we(t)},[]),dt=(0,t.useCallback)(()=>{ee?.current?.scrollToEnd(),Ae(!0),setTimeout(()=>Me(!1),1)},[]),ft=(0,t.useCallback)(e=>{let{layoutMeasurement:{height:t},contentOffset:{y:n}}=e.nativeEvent,r=Math.round(t+n),i=r>=Ce-be,a=r>=Math.round(Ce);Oe(i),Te&&Ee(!1),a&&Ae(!0),a&&setTimeout(()=>Me(!1),1)},[be,Ce,Te]),pt=(0,t.useMemo)(()=>Math.round(xe+be),[xe,be]);return Le?(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:Ue,onPressViewInLogbook:ot,onPressCancel:()=>We(!1),onDismiss:at})})}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(n.ScrollView,{ref:ee,scrollEventThrottle:16,style:[te.scrollView,{backgroundColor:D.bgPrimary}],contentContainerStyle:ke&&te.scrollViewContentContainer,testID:`recommendation-screen`,onScroll:ft,onContentSizeChange:ut,children:[(0,E.jsxs)(n.View,{testID:`recommendation-content`,onLayout:({nativeEvent:e})=>Se(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:me!==null}),(0,E.jsx)(m.default,{initialValue:(0,i.roundInsulinValue)(pe.bolus,ae),editedValue:me,injectionMethod:ae,wasLimited:pe.wasLimited,onDismiss:ct,onConfirm:nt}),(0,E.jsx)(c.default,{}),(0,E.jsx)(l.default,{glucoseReading:ue,bloodGlucoseUnit:M,trackExpandDetails:le,carbIntakeValue:Math.round(de),activeInsulin:Math.round(pe.activeInsulin*10)/10,activity:tt})]}),(0,E.jsxs)(n.View,{style:te.carbsContainer,children:[Math.round(pe.carbRecommendation)>0&&(0,E.jsx)(s.default,{carbsRecommendation:Math.round(pe.carbRecommendation),editedCarbsRecommendation:L,onDismiss:ct,onConfirm:rt}),(0,E.jsx)(o.default,{glucoseReading:ue,hasActivity:fe!==null,bloodGlucoseUnit:M})]})]}),pt>A&&je&&(0,E.jsx)(u.default,{prefixTestID:`scroll`,onSave:dt,onDelete:dt,onLayout:({nativeEvent:e})=>R(e.layout.height)})]}),(0,E.jsx)(x.default,{scrollToEnd:dt,isVisibleArrow:pt>A&&Te,isVisibleBlur:pt>A&&!De&&!ke}),(pt<=A||ke)&&(0,E.jsx)(u.default,{prefixTestID:`fixed`,onSave:N,onDelete:()=>He(!0),onLayout:({nativeEvent:e})=>R(e.layout.height)}),(0,E.jsx)(v.default,{isVisible:Ge,activityReduction:pe.activityReduction,onPress:()=>Ke(!1)}),(0,E.jsx)(g.default,{isVisible:Ve,onPressDelete:st,onDismiss:it,onPressCancel:()=>He(!1)}),(0,E.jsx)(h.default,{isVisible:Ye,onPressClose:()=>Xe(!1)}),(0,E.jsx)(y.default,{isVisible:qe,onPressClose:()=>Je(!1)}),(0,E.jsx)(_.default,{isVisible:Ze,onPressClose:lt})]})};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(bhn()),n=yhn();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 xhn(e,t){return+e3(e)==+e3(t)}function Shn(){return Object.assign({},v8())}function Chn(e,t){let n=whn(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 whn(e){return typeof e==`function`&&e.prototype?.constructor===e}var Thn=10,Ehn=class{subPriority=0;validate(e,t){return!0}},Dhn=class extends Ehn{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)}},Ohn=class extends Ehn{priority=Thn;subPriority=-1;constructor(e,t){super(),this.context=e||(e=>$4(t,e))}set(e,t){return t.timestampIsSet?e:$4(e,Chn(e,this.context))}},z7=class{run(e,t,n,r){let i=this.parse(e,t,n,r);return i?{setter:new Dhn(i.value,this.validate,this.set,this.priority,this.subPriority),rest:i.rest}:null}validate(e,t,n){return!0}},khn=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*E9t+a*T9t+o*D9t),rest:t.slice(n[0].length)}}function Ahn(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 jhn(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 Mhn(e){switch(e){case`morning`:return 4;case`evening`:return 17;case`pm`:case`noon`:case`afternoon`:return 12;default:return 0}}function Nhn(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 Phn(e){return e%400==0||e%4==0&&e%100!=0}var Fhn=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=Nhn(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}},Ihn=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=uon(e,r);if(n.isTwoDigitYear){let t=Nhn(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`]},Lhn=class extends z7{priority=130;parse(e,t){return jhn(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`]},Rhn=class extends z7{priority=130;parse(e,t){return jhn(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`]},zhn=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`]},Bhn=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`]},Vhn=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}},Hhn=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 Uhn(e,t,n){let r=e3(e,n?.in),i=fon(r,n)-t;return r.setDate(r.getDate()-i*7),e3(r,n?.in)}var Whn=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(Uhn(e,n,r),r)}incompatibleTokens=[`y`,`R`,`u`,`q`,`Q`,`M`,`L`,`I`,`d`,`D`,`i`,`t`,`T`]};function Ghn(e,t,n){let r=e3(e,n?.in),i=lon(r,n)-t;return r.setDate(r.getDate()-i*7),r}var Khn=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(Ghn(e,n))}incompatibleTokens=[`y`,`Y`,`u`,`q`,`Q`,`M`,`L`,`w`,`d`,`D`,`e`,`c`,`t`,`T`]},qhn=[31,28,31,30,31,30,31,31,30,31,30,31],Jhn=[31,29,31,30,31,30,31,31,30,31,30,31],Yhn=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=Phn(e.getFullYear()),r=e.getMonth();return n?t>=1&&t<=Jhn[r]:t>=1&&t<=qhn[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`]},Xhn=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 Phn(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 Zhn(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 Qhn=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=Zhn(e,n,r),e.setHours(0,0,0,0),e}incompatibleTokens=[`D`,`i`,`e`,`c`,`t`,`T`]},$hn=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=Zhn(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`]},egn=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=Zhn(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 tgn(e,t){let n=e3(e,t?.in).getDay();return n===0?7:n}function ngn(e,t,n){let r=e3(e,n?.in);return K7(r,t-tgn(r,n),n)}var rgn=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=ngn(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`]},ign=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(Mhn(n),0,0,0),e}incompatibleTokens=[`b`,`B`,`H`,`k`,`t`,`T`]},agn=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(Mhn(n),0,0,0),e}incompatibleTokens=[`a`,`B`,`H`,`k`,`t`,`T`]},ogn=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(Mhn(n),0,0,0),e}incompatibleTokens=[`a`,`b`,`t`,`T`]},sgn=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`]},cgn=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`]},lgn=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`]},ugn=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`]},dgn=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`]},fgn=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`]},pgn=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`]},mgn=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`]},hgn=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`]},ggn=class extends z7{priority=40;parse(e){return Ahn(e)}set(e,t,n){return[$4(e,n*1e3),{timestampIsSet:!0}]}incompatibleTokens=`*`},_gn=class extends z7{priority=20;parse(e){return Ahn(e)}set(e,t,n){return[$4(e,n),{timestampIsSet:!0}]}incompatibleTokens=`*`},vgn={G:new khn,y:new Fhn,Y:new Ihn,R:new Lhn,u:new Rhn,Q:new zhn,q:new Bhn,M:new Vhn,L:new Hhn,w:new Whn,I:new Khn,d:new Yhn,D:new Xhn,E:new Qhn,e:new $hn,c:new egn,i:new rgn,a:new ign,b:new agn,B:new ogn,h:new sgn,H:new cgn,K:new lgn,k:new ugn,m:new dgn,s:new fgn,S:new pgn,X:new mgn,x:new hgn,t:new ggn,T:new _gn},ygn=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,bgn=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,xgn=/^'([^]*?)'?$/,Sgn=/''/g,Cgn=/\S/,wgn=/[a-zA-Z]/;function q7(e,t,n,r){let i=()=>$4(r?.in||n,NaN),a=Shn(),o=r?.locale??a.locale??non,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 Ohn(r?.in,n)],d=t.match(bgn).map(e=>{let t=e[0];if(t in von){let n=von[t];return n(e,o.formatLong)}return e}).join(``).match(ygn),f=[];for(let n of d){!r?.useAdditionalWeekYearTokens&&Con(n)&&won(n,t,e),!r?.useAdditionalDayOfYearTokens&&Son(n)&&won(n,t,e);let a=n[0],s=vgn[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(wgn))throw RangeError("Format string contains an unescaped latin alphabet character `"+a+"`");if(n===`''`?n=`'`:a===`'`&&(n=Tgn(n)),e.indexOf(n)===0)e=e.slice(n.length);else return i()}}if(e.length>0&&Cgn.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 Tgn(e){return e.match(xgn)[1].replace(Sgn,`'`)}function Egn(e){let{glucoseLevelTargets:t}=k8;if(t===void 0)throw Error(`[ParameterTimeIntervalsUtils::getBGLParameters] glucoseLevelTargets is undefined.`);let n=t.use===Z.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 Ogn(e,i)}function Dgn(e){let t=k8.treatmentParameters?.use===Z.Usage.Overall,{treatmentParameters:n}=k8;if(n===void 0)throw Error(`[ParameterTimeIntervalsUtils::getInsulinParameters] treatmentParameters is undefined.`);return t?n.overallParameters:Ogn(e,n.parameterIntervals)}function Ogn(e,t){let n=I8(e,`HH:mm`),r=kgn(t),i=q7(n,`HH:mm`,new Date);for(let e=0;e<r.length;e++)if(Agn(r[e],r[(e+1)%r.length],i))return t[e];throw Error(`[ParameterTimeIntervalsUtils::getDailyParameters] The parameter interval has not been found`)}function kgn(e){let t=[];for(let n of e)t.push(q7(n.startTime,`HH:mm`,new Date));return t}function Agn(e,t,n){let r=R7(e,t),i=xhn(e,n)||R7(e,n),a=jgn(e),o=jgn(t,!r),s=jgn(n,!i);return a<=s&&s<o}function jgn(e,t){return e.getMinutes()+(e.getHours()+(t?24:0))*60}H();var Mgn=1600;function Ngn({setRemeasurementNotification:e}){let{t,language:n}=Sq(),{colorScheme:r}=g2(),i=b7(),{selectedEventUUID:a}=a7(),{manualCarbsInput:o,foodIntakeCarbsAmount:s,saveCarbohydrates:c}=L5(),{noteId:l}=B5(),u=A$(),d=(0,U.useRef)(!1),[f,p]=U.useState(!1),[m,h]=U.useState(null),[g,_]=U.useState(null),{glucoseUnit:v,injectionMethod:y,activity:b}=k8;if(v===void 0)throw Error(`[LoadingRecommendationScreen::render] glucoseUnit is undefined`);if(y===void 0)throw Error(`[LoadingRecommendationScreen::render] injectionMethod is undefined`);if(b===void 0)throw Error(`[LoadingRecommendationScreen::render] activity is undefined`);if(i===null)throw Error(`[LoadingRecommendationScreen::render] selectedGlucoseReading is undefined`);let x=(0,U.useMemo)(()=>G8.getRecentBoluses(),[]),S=(0,U.useMemo)(()=>a?S8.getByUUID(a):null,[a]),C=(0,U.useMemo)(()=>{if(!S?.startTimestamp)return null;let e={activitySettings:b,activityDate:new Date(S.startTimestamp),activityDuration:S.durationSeconds/60,activityIntensity:S.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}},[b,S]),w=(0,U.useMemo)(()=>{let{target:e}=Egn(new Date),{carbohydrateRatio:t,insulinSensitivity:a}=Dgn(new Date);return{bloodGlucoseUnit:v,injectionMethod:y,language:n,colorScheme:r,calculatorParams:{glucoseReading:i,activity:C,carbohydrateRatio:t,insulinSensitivity:a,carbohydrates:o+s,targetBGL:e,recentBoluses:x}}},[v,y,n,r,i,C,o,s,x]),T=(0,U.useCallback)(async()=>{let t=L7.recommendationPropsSchema.safeParse(w);if(!t.success){u8(l8.RecommendationInvalid),console.error(t.error),_(Cq.Validation);return}try{let{activeInsulin:t,carbRecommendation:n,bolus:r,activityReduction:a,recentBolusesIds:u,recommendationDate:d}=(0,b8.calculateRecommendation)(w.calculatorParams),f=o+s,p=z8(w.calculatorParams.glucoseReading.value,w.calculatorParams.glucoseReading.unit,Z.BloodGlucoseUnit.MMOL_L),m=(0,b8.roundInsulinValue)(r,w.injectionMethod),g=Math.round(n),v=i.source===`external`||i.source===`forecast`,y=null,b=null;try{let e=await c(d);y=e?.sampleId??null,b=e?.foodIntakeId??null}catch(e){console.error(`[LoadingRecommendationScreen::saveRecommendation] saveCarbohydrates failed:`,e)}let x=await G8.addLogbook(rsn({blood_glucose_millimolar:p,blood_glucose_millimolar_sample_id:v?i.sampleId:null,glucose_sample_source_id:v?i.sourceId:null,entry_timestamp:d,event_uuid:S?S.uuid:null,is_bolus_calculation:!0,carbohydrates_suggested_grams:g,carbohydrates_entered_grams:f+g,carbohydrates_input_grams:f,carbohydrates_sample_id:y,carbohydrates_manual_grams:o||null,carbohydrates_food_grams:s||null,food_intake_id:b,insulin_entered_units:m,insulin_suggested_units:m,active_insulin:t,activity_reduction:a,active_insulin_source_logbook_ids:u,note_id:l}));if(x===null){_(Cq.Sync);return}if(x.blood_glucose_millimolar!==null&&e!==void 0)try{await e(x.blood_glucose_millimolar)}catch(e){console.error(`[LoadingRecommendationScreen::saveRecommendation] Remeasurement reminder failed:`,e)}h(x),u8(l8.RecommendationSuccess)}catch(e){console.error(`[LoadingRecommendationScreen::saveRecommendation] Unexpected error:`,e),_(Cq.System)}},[w,S,i,o,e,s,c,l]);return d.current||(d.current=!0,T().catch(console.error)),(0,U.useEffect)(()=>{setTimeout(()=>{p(!0)},Mgn)},[]),(0,U.useEffect)(()=>(u.setOptions({gestureEnabled:!1}),u.addListener(`beforeRemove`,({preventDefault:e})=>{f||e()})),[f,u]),(0,U.useEffect)(()=>{f&&m!==null&&g===null&&u.replace(F5.Recommendation,{...w,logbookEntry:tsn(m)}),f&&g!==null&&u.navigate(F5.Calculation,{errorType:g})},[g,f,m,w,u]),(0,G.jsxs)(V,{style:J7.animationContainer,children:[(0,G.jsx)(p2,{autoPlay:!0,source:m2.LOADING_RECOMMENDATION,style:J7.animation,webStyle:J7.animation,resizeMode:`cover`,loop:!0}),(0,G.jsx)(Q,{style:J7.text,children:t(`recommendation_loading_title`)})]})}var J7=z.create({animationContainer:{flex:1,justifyContent:`center`,alignItems:`center`},text:{...X.Poppins.bold_Base,marginTop:32},animation:{width:128,height:128}}),Pgn=f7(Ngn),Fgn=5e3,Ign=async()=>{try{return(await T3(`${_q.HEDIA_SERVER_BASE_URL}/ping`,{headers:Dq},Fgn)).ok}catch{return!1}};H(),J0();function Lgn(){let{COLORS:e}=Y(),t=A$(),n=M$(),{manualCarbsInput:r,foodIntakeCarbsAmount:i}=L5(),{colorScheme:a}=g2(),[o,s]=(0,U.useState)(L7.SyncStatus.Idle),[c,l]=(0,U.useState)(L7.SyncStatus.Idle),[u,d]=(0,U.useState)(L7.SyncStatus.Idle),{bloodGlucoseUnit:f,calculatorParams:p,injectionMethod:m,language:h,logbookEntry:g}=n.params,[_,v]=(0,U.useState)(()=>nsn(g));Svt(),(0,U.useEffect)(()=>{t.setOptions({gestureEnabled:!1})},[t]);let y=(0,U.useCallback)(async(e,t)=>{d(L7.SyncStatus.Loading);let n=r+i,a=rsn({..._,insulin_entered_units:t.modified??t.suggested,carbohydrates_overwritten_suggested_grams:e.modified,carbohydrates_entered_grams:n+(e.modified??e.suggested)}),o=await G8.addLogbook(a,_.uuid);o?(v(o),d(L7.SyncStatus.Success)):d(L7.SyncStatus.Failure)},[r,_,i]),b=(0,U.useCallback)(()=>{if(Tq)throw Error(`Recommendation::handleOnCloseCalculationViewInLogbook] Cannot view-in-logbook on web`);t.popTo(F5.MainBottomTabs,{screen:F5.LogbooksTab,params:{logbookEntry:tsn(_)}}),l7()},[t,_]),x=(0,U.useCallback)(()=>{Tq?(window.location.href=`/redirect?status=success`,vq.clearAll()):t.popTo(F5.MainBottomTabs,{screen:F5.DashboardTab,params:{screen:F5.Dashboard}}),l7()},[t]),S=(0,U.useCallback)(async()=>{s(L7.SyncStatus.Loading);let e=await G8.deleteLogbook(_.uuid);Tq?e?(window.location.href=`/redirect?status=success`,l7(),vq.clearAll()):s(L7.SyncStatus.Failure):(l7(),t.popTo(F5.MainBottomTabs,{screen:F5.DashboardTab,params:{screen:F5.Dashboard,params:{action:mvt.Deleted}}}))},[_.uuid,t]),C=(0,U.useCallback)(async()=>{l(L7.SyncStatus.Loading);let e=()=>{l(L7.SyncStatus.Success),l7(),t.replace(F5.LeavingRecommendation,{logbookEntry:tsn(_)})};Tq?await Ign()?e():l(L7.SyncStatus.Failure):e()},[t,_]);return(0,G.jsx)(q0,{style:[Rgn.container,{backgroundColor:e.bgPrimary}],children:(0,G.jsx)(L7.RecommendationScreenWrapper,{deleteStatus:o,saveStatus:c,editStatus:u,bloodGlucoseUnit:f,injectionMethod:m,language:h,colorScheme:a,calculatorParams:p,closeCalculationViewInlogbook:b,closeCalculationFooter:C,closeCalculationTimeoutModal:x,transferEditedRecommendation:y,deleteCalculation:S,trackExpandDetails:()=>{u8(l8.RecommendationViewDetailsPress)},trackRecommendationTimeout:()=>{u8(l8.RecommendationExpired)}})})}var Rgn=z.create({container:{flex:1}}),zgn=e=>[`foods`,`curated`,e],Bgn=e=>{let{data:t=[],isLoading:n,isError:r,refetch:i}=_0({queryKey:zgn(e),queryFn:()=>jan(e),staleTime:1e3*60*5,networkMode:`offlineFirst`,retry:3});return{curatedFoods:t,isCuratedFoodsLoading:n,isCuratedFoodsError:r,refetchCuratedFoods:i}},Vgn=e=>[`foods`,`categories`,e],Y7=()=>{let{language:e}=bq(),{data:t=[],isLoading:n,isError:r,refetch:i}=_0({queryKey:Vgn(e),queryFn:()=>Ran(e),staleTime:1e3*60*5,networkMode:`offlineFirst`,retry:3});return{foodCategories:t,isFoodCategoriesLoading:n,isFoodCategoriesError:r,refetchFoodCategories:i}},Hgn=()=>{let e=A$().getParent(F5.NewCalculationStack),t=(0,U.useCallback)(()=>{e?.goBack()},[e]);return{isInCalculationFlow:e!==void 0,dismissFoodLibrary:t}},X7=e=>{let t=A$(),{isInCalculationFlow:n,dismissFoodLibrary:r}=Hgn(),{addFoodIntakeItem:i}=L5(),{addExtraFoodItem:a}=c7();return{canAddToCalculation:n||!!e,addToCalculation:(0,U.useCallback)((o,s)=>{if(e){a({foodItem:o,amount:s}),n?r():t.popTo(F5.VisualSearch);return}i({foodItem:o,amount:s}),r()},[e,a,n,t,i,r])}},Ugn={tabBarHeight:0,paddingBottomScreenWithTabBar:0},Z7=pq()(hq(e=>({...Ugn,setTabBarHeight:t=>{e({tabBarHeight:t,paddingBottomScreenWithTabBar:t+24})},clear:()=>{e(Ugn)}}),{name:`DIMENSIONS_STORE`,storage:mq(yq)}));H();function Wgn({icon:e,message:t}){let{COLORS:n}=Y();return(0,G.jsxs)(V,{style:Ggn.container,children:[e,(0,G.jsx)(Q,{style:[Ggn.message,{color:n.labelSecondary}],children:t})]})}var Ggn=z.create({container:{flex:1,alignItems:`center`,justifyContent:`center`},message:{...X.Poppins.regular_SM,marginTop:13,textAlign:`center`}}),Q7=(0,U.memo)(Wgn),Kgn=({item:e,expandable:t,isExpanded:n,onExpand:r,onPress:i,onAddToCalculation:a,testID:o})=>{let{t:s}=Sq(),[c,l]=(0,U.useState)(``),u=$5(e.source===`personal`?e.imageId:null);(0,U.useEffect)(()=>{n||l(``)},[n]);let d=(0,U.useMemo)(()=>C8(Number(c||0),e.measures[0].gramsPerUnit,e.nutritionPer100g.carbohydrates.value),[c,e]),f=(0,U.useCallback)(()=>{a(e,Number(c)||0)},[a,e,c]);return(0,G.jsx)(d9t,{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,G.jsx)(U4,{title:s(`foodAmount_button_addToCalculation`),disabled:!c,onPress:f,style:{marginTop:10}})})};H();var qgn=()=>{let{COLORS:e,isDark:t}=Y(),{t:n}=Sq(),r=A$(),{categoryId:i,subcategoryId:a,cameFromVisualSearch:o}=M$().params,{canAddToCalculation:s,addToCalculation:c}=X7(o),l=M5(s&&Eq),{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}=Bgn(a||i),_=t?p?.color.dark:p?.color.light,v=(t?m?.color.dark:m?.color.light)||_;(0,U.useLayoutEffect)(()=>{r.setOptions({header:()=>(0,G.jsx)(P5,{title:m?.title||p?.title,LeftButton:(0,G.jsx)(H5,{}),color:v,skipTopInset:s&&Eq,overlay:!0})})},[r,m,p,v,s]);let[y,b]=(0,U.useState)(null),x=(0,U.useCallback)(({item:e})=>(0,G.jsx)(Kgn,{item:e,expandable:s,isExpanded:y===e.id,onExpand:()=>b(e.id),onPress:()=>{r.navigate(F5.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,U.useCallback)(e=>(0,G.jsx)(X2t,{...e,bottomOffset:16}),[]);return(0,G.jsxs)(V,{style:[$7.screen,{backgroundColor:e.bgPrimary}],children:[v&&(0,G.jsx)(z4.default,{colors:[v,c3(v,0)],style:$7.gradient,pointerEvents:`none`}),g?(0,G.jsx)(b2,{}):(0,G.jsx)(Uc,{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,G.jsx)(Q7,{icon:(0,G.jsx)(q7t,{}),message:n(`food_empty_state_no_food`)})})]})},$7=z.create({screen:{flex:1},gradient:{position:`absolute`,top:0,left:0,right:0,height:`50%`},contentContainer:{gap:8,paddingHorizontal:16},list:{flex:1}}),Jgn=[F5.CuratedFoodItem,F5.PersonalFoodItem],Ygn=(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},Xgn=(e,t)=>{let n=e.routes.filter(e=>!Jgn.includes(e.name)).map(e=>({name:e.name,params:e.params})),r=t[t.length-1],i=n.findIndex(e=>Ygn(e,r));if(i>=0)return n.slice(0,i+1);let a=t.filter(e=>!n.some(t=>Ygn(t,e)));return[...n,...a]},Zgn=()=>{let e=A$();return(0,U.useCallback)(t=>{e.dispatch(e=>{let n=Xgn(e,t);return v$({...e,routes:n,index:n.length-1})})},[e])};H(),F4();var Qgn={ringSize:120,strokeWidth:10,gap:14},$gn={ringSize:36,strokeWidth:4.5,gap:6},e_n=({totalAmount:e=100,carbsValue:t,carbsUnit:n,size:r=`large`})=>{let{COLORS:i}=Y(),{ringSize:a,strokeWidth:o,gap:s}=r===`large`?Qgn:$gn,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,G.jsxs)(V,{style:[e9.ringContainer,{width:a,height:a}],children:[(0,G.jsxs)(E4,{width:a,height:a,style:e9.ringSvg,children:[(0,G.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,G.jsx)(x4,{cx:u,cy:u,r:c,stroke:i.bgFoodCarbsRing,strokeWidth:o,fill:`none`,strokeDasharray:[m,l-m],strokeLinecap:`round`})]}),r===`large`&&(0,G.jsx)(V,{style:e9.ringCenter,children:(0,G.jsxs)(Q,{style:[e9.carbsNumber,{color:i.labelPrimary}],maxFontSizeMultiplier:S2.s0,children:[f,(0,G.jsx)(Q,{style:[e9.carbsUnit,{color:i.labelPrimary}],children:n})]})})]})},e9=z.create({ringContainer:{alignItems:`center`,justifyContent:`center`},ringSvg:{transform:[{rotate:`-90deg`}],position:`absolute`},ringCenter:{alignItems:`center`,justifyContent:`center`},carbsNumber:{...X.Poppins.semiBold_4XL},carbsUnit:{...X.Poppins.medium_Base}});H();var t_n=({title:e,color:t,iconUri:n,onPress:r})=>{let{COLORS:i}=Y();return(0,G.jsxs)(Jf,{style:[n_n.pill,{borderColor:i.border,backgroundColor:t}],onPress:r,testID:`food-category-pill`,children:[!!n&&(0,G.jsx)(Xu,{source:{uri:n},style:n_n.icon}),(0,G.jsx)(Q,{style:[n_n.label,{color:i.textFoodCategoryPill}],children:e})]})},n_n=z.create({pill:{flexDirection:`row`,alignItems:`center`,paddingVertical:6,paddingHorizontal:12,borderRadius:32,borderWidth:1},icon:{width:20,height:20,marginRight:4},label:{...X.Poppins.regular_XS}});H();var r_n=`444`,i_n=({amount:e,onChangeAmount:t,unit:n,carbs:r,autoFocus:i=!1,testID:a})=>{let{t:o}=Sq(),{COLORS:s}=Y(),[c,l]=(0,U.useState)(!1),u=(0,U.useRef)(null),d=(0,U.useCallback)(()=>{c||u.current?.focus()},[c]);return(0,G.jsxs)(V,{style:t9.inputContainer,children:[(0,G.jsx)(Q,{style:[t9.amountLabel,{color:s.labelPrimary}],children:o(`foodAmountInputField_weight`)}),(0,G.jsxs)(Cp,{accessible:!1,onPress:d,style:[t9.inputBox,{backgroundColor:s.bgVsInput,borderColor:c?s.borderInputFocus:s.border}],children:[n===`g`?(0,G.jsx)(l9t,{}):(0,G.jsx)(u9t,{}),(0,G.jsxs)(V,{style:t9.inputValue,children:[(0,G.jsxs)(V,{children:[(0,G.jsx)(Q,{"aria-hidden":!0,style:t9.inputSizer,children:r_n}),(0,G.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,G.jsx)(Q,{style:[t9.inputUnit,{color:s.labelSecondary}],children:n})]})]}),(0,G.jsx)(Q,{style:[t9.carbsResult,{color:s.labelSecondary}],children:`= ${e?r:`-`} ${o(`my_food_add_unit`)}`})]})},t9=z.create({inputContainer:{alignItems:`center`,gap:8},amountLabel:{...X.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:{...X.Poppins.medium_2XL,opacity:0},input:{position:`absolute`,top:0,bottom:0,left:0,right:0,...X.Poppins.medium_2XL,lineHeight:B.select({ios:0,default:X.Poppins.medium_2XL.lineHeight}),includeFontPadding:!1,textAlign:`right`,padding:0},inputUnit:{...X.Poppins.regular_Base},carbsResult:{...X.Poppins.regular_Base,textAlign:`center`}});H();var a_n=({amount:e,onChangeAmount:t,unit:n,carbs:r,onAdd:i,testID:a})=>{let{t:o}=Sq(),{COLORS:s}=Y();return(0,G.jsxs)(V,{style:[o_n.container,{borderColor:s.border,backgroundColor:s.bgInputLayer}],children:[(0,G.jsx)(i_n,{amount:e,onChangeAmount:t,unit:n,carbs:r,autoFocus:!0,testID:a}),(0,G.jsx)(U4,{title:o(`foodAmount_button_addToCalculation`),onPress:i,disabled:!e,style:o_n.addButton})]})},o_n=z.create({container:{alignSelf:`stretch`,padding:16,gap:16,borderWidth:1,borderRadius:24},addButton:{alignSelf:`center`}});H();var s_n=56,c_n=20,l_n=100,n9=(e,t)=>{if(!e)return`-`;let n=e.value*t/100;return`${Math.round(n*10)/10} ${e.unit}`},u_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}}},d_n=()=>{let{t:e}=Sq(),{params:t}=M$(),{COLORS:n,isDark:r}=Y(),{bottomWithScroll:i,topInsideModal:a}=Q4(),o=A$(),{canAddToCalculation:s,addToCalculation:c}=X7(t.cameFromVisualSearch),l=Zgn(),u=[r9.headerRow,{paddingTop:a}],d={paddingTop:a+s_n+c_n,paddingBottom:i},{food:f,isFoodLoading:p,isFoodError:m}=sfn(t.foodId),{foodCategories:h}=Y7(),{foodIntakeItems:g}=L5(),[_,v]=(0,U.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,U.useEffect)(()=>{y||p||m||o.goBack()},[y,p,m,o]);let b=(0,U.useMemo)(()=>y?C8(Number(_||0),y.measures[0].gramsPerUnit,y.nutritionPer100g.carbohydrates.value):0,[y,_]),x=u_n(h,t.categoryId??y?.categoryId),S=r?x?.color.dark:x?.color.light,C=(0,U.useMemo)(()=>{if(!x)return;let e={name:F5.FoodSubcategories,params:{categoryId:x.browseCategoryId}};return x.id===x.browseCategoryId?[e]:[e,{name:F5.CuratedFood,params:{categoryId:x.browseCategoryId,subcategoryId:x.id}}]},[x]),w=(0,U.useCallback)(()=>{C&&l(C)},[C,l]),T=(0,U.useCallback)(()=>{y&&c(y,Number(_)||0)},[y,_,c]),E=s&&Number(_)>0?Number(_):l_n,D=(0,U.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,G.jsxs)(V,{style:r9.screen,children:[!!S&&(0,G.jsx)(z4.default,{colors:[S,c3(S,0)],style:z.absoluteFill,pointerEvents:`none`}),(0,G.jsxs)(ds,{style:r9.scrollableContent,contentContainerStyle:d,keyboardDismissMode:`on-drag`,keyboardShouldPersistTaps:`handled`,children:[(0,G.jsxs)(V,{style:r9.topSection,children:[(0,G.jsx)(Q,{style:[r9.title,{color:n.labelPrimary}],numberOfLines:2,children:y.title}),s?(0,G.jsx)(a_n,{amount:_||``,onChangeAmount:v,unit:y.measures[0].unit,carbs:b,onAdd:T,testID:`curated-food-item-input`}):(0,G.jsxs)(V,{style:r9.carbsContainer,children:[(0,G.jsx)(e_n,{totalAmount:100,carbsValue:y.nutritionPer100g.carbohydrates.value,carbsUnit:y.nutritionPer100g.carbohydrates.unit}),(0,G.jsx)(Q,{style:[r9.carbsLabel,{color:n.labelPrimary}],children:`${Math.round(y.nutritionPer100g.carbohydrates.value*10)/10} carbs / 100${y.nutritionPer100g.carbohydrates.unit}`})]})]}),(0,G.jsxs)(V,{style:r9.section,children:[!!x&&(0,G.jsxs)(V,{style:r9.categorySection,children:[(0,G.jsx)(Q,{style:[r9.categorySectionTitle,{color:n.labelSecondary}],children:e(`food_library_info_category`)}),(0,G.jsx)(t_n,{title:x.title,color:S,iconUri:x.icon,onPress:w})]}),(0,G.jsx)(Q,{style:[r9.contentsTitle,{color:n.labelPrimary}],children:e(`food_library_carb_body`,{amount:E.toString(),unit:y.measures[0].unit})}),D.map(e=>(0,G.jsxs)(V,{style:[r9.contentsRow,{borderBottomColor:n.border}],children:[(0,G.jsx)(Q,{style:[r9.contentsText,{color:n.labelSecondary}],children:e.title}),(0,G.jsx)(Q,{style:[r9.contentsText,{color:n.labelSecondary}],children:e.value})]},e.id)),(0,G.jsx)(V,{style:[r9.contentsRow,{borderBottomColor:n.bgTransparent}],children:(0,G.jsx)(Q,{style:[r9.contentsText,{color:n.labelSecondary}],children:`${e(`food_library_source`)} ${y.provider.name}`})})]})]}),(0,G.jsx)(V,{style:u,children:(0,G.jsx)(U5,{})})]}):(0,G.jsxs)(V,{style:r9.screen,children:[!!S&&(0,G.jsx)(z4.default,{colors:[S,c3(S,0)],style:z.absoluteFill,pointerEvents:`none`}),(0,G.jsx)(V,{style:r9.topSection,children:(0,G.jsx)(V,{style:u,children:(0,G.jsx)(U5,{})})}),m?(0,G.jsx)(Q7,{icon:(0,G.jsx)($7t,{}),message:e(`food_offline_state_default`)}):(0,G.jsx)(b2,{})]})},r9=z.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:{...X.Poppins.medium_2XL,textAlign:`center`,marginBottom:32,paddingHorizontal:16},carbsContainer:{alignItems:`center`},carbsLabel:{...X.Poppins.regular_Base,marginTop:12},scrollableContent:{flex:1},section:{paddingHorizontal:16},categorySection:{flexDirection:`row`,alignItems:`center`,marginBottom:45},categorySectionTitle:{...X.Poppins.regular_SM,marginRight:7},contentsTitle:{...X.Poppins.medium_Base,marginBottom:6},contentsRow:{flexDirection:`row`,justifyContent:`space-between`,paddingVertical:10,borderBottomWidth:1},contentsText:{...X.Poppins.regular_Base}}),f_n=[`foods`,`recent`],p_n=e=>{let{data:t=[],isLoading:n,isError:r,refetch:i}=_0({queryKey:f_n,queryFn:Man,enabled:e,networkMode:`offlineFirst`,retry:3});return{recentFoods:t,isRecentFoodsLoading:n,isRecentFoodsError:r,refetchRecentFoods:i}};H();var m_n=({onPress:e,title:t,description:n,imageUrl:r,color:i})=>{let{COLORS:a}=Y();return(0,G.jsxs)(Jf,{style:[i9.row,{backgroundColor:a.bgSecondary,borderColor:a.buttonBorder}],onPress:e,children:[(0,G.jsx)(V,{style:[i9.imageContainer,{backgroundColor:i}],children:(0,G.jsx)(Xu,{source:{uri:r},style:i9.categoryImage,resizeMode:`contain`})}),(0,G.jsxs)(V,{style:i9.textContainer,children:[(0,G.jsx)(Q,{style:[i9.title,{color:a.labelPrimary}],numberOfLines:1,ellipsizeMode:`tail`,children:t}),!!n&&(0,G.jsx)(Q,{style:[i9.description,{color:a.labelSecondary}],numberOfLines:2,ellipsizeMode:`tail`,children:n})]}),(0,G.jsx)(K4,{width:18,height:18,color:a.labelTertiary})]})},i9=z.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:{...X.Poppins.medium_Base},description:{...X.Poppins.regular_SM,marginTop:2}});H();var h_n=Tq?{outlineStyle:`none`}:{},g_n=({isSearchActive:e,onSearch:t,onClear:n,onFocus:r,onBlur:i})=>{let{t:a}=Sq(),{COLORS:o}=Y(),s=(0,U.useRef)(null),[c,l]=(0,U.useState)(``),u=z3t(t,300),d=(0,U.useCallback)(()=>{u.cancel(),l(``),s.current?.blur(),n()},[u,n]),f=(0,U.useCallback)(()=>{c.length>2&&(u.cancel(),t(c))},[u,t,c]),p=(0,U.useCallback)(e=>{if(l(e),e.length>2){u(e);return}u.cancel(),t(e)},[u,t]),m=(0,U.useCallback)(()=>{s.current?.focus()},[]);return(0,G.jsxs)(Cp,{style:[__n.container,{backgroundColor:o.bgInputActive,borderColor:o.buttonBorder}],onPress:m,accessible:!1,children:[(0,G.jsx)(n9t,{height:24,width:24}),(0,G.jsx)(Ip,{ref:s,testID:`food-searchbar-input`,autoCapitalize:`none`,placeholder:a(`food_search_title`),placeholderTextColor:o.labelSecondary,cursorColor:o.textSearchText,maxFontSizeMultiplier:S2.s3,style:[__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,G.jsx)(Cp,{testID:`food-searchbar-clear`,onPress:d,hitSlop:10,children:(0,G.jsx)(U7t,{color:o.labelSecondary,width:16,height:16})})]})},__n=z.create({container:{flex:1,flexDirection:`row`,alignItems:`center`,height:48,borderRadius:16,borderWidth:1,paddingLeft:16,paddingRight:12,gap:4},searchInput:{...X.Poppins.regular_Base,lineHeight:B.select({ios:0,default:X.Poppins.regular_Base.lineHeight}),flex:1,includeFontPadding:!1,...h_n}});H();function v_n({showScanButton:e,isSearchActive:t,onSearch:n,onClearSearch:r,onSearchFocus:i,onSearchBlur:a,onScanFoodPress:o}){return(0,G.jsxs)(V,{style:y_n.row,children:[(0,G.jsx)(g_n,{isSearchActive:t,onSearch:n,onClear:r,onFocus:i,onBlur:a}),e&&!Tq&&(0,G.jsx)(Z9t,{onPress:o,style:{width:48,height:48}})]})}var y_n=z.create({row:{flexDirection:`row`,alignItems:`center`,gap:10,paddingVertical:12}}),b_n=(0,U.memo)(v_n),x_n=`/assets/webp/heart.webp`;H();var S_n=({onPress:e})=>{let{COLORS:t}=Y(),{t:n}=Sq();return(0,G.jsxs)(Jf,{style:[a9.container,{backgroundColor:t.bgSecondary,borderColor:t.buttonBorder}],onPress:e,children:[(0,G.jsx)(V,{style:[a9.imageContainer,{backgroundColor:t.bgMyFoodCategory}],children:(0,G.jsx)(Xu,{source:x_n,style:a9.heartImage})}),(0,G.jsx)(Q,{style:[a9.title,{color:t.labelPrimary}],numberOfLines:1,children:n(`food_segment_button_my_food`)}),(0,G.jsx)(K4,{width:18,height:18,color:t.labelTertiary})]})},a9=z.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:{...X.Poppins.medium_Base,flex:1}});H();var C_n=e=>`measures`in e,w_n=()=>wf.dismiss(),T_n=()=>{let{t:e}=Sq(),{COLORS:t,isDark:n}=Y(),{paddingBottomScreenWithTabBar:r}=Z7(),{bottomWithScroll:i}=Q4(),a=A$(),o=M$(),{isInCalculationFlow:s}=Hgn(),{canAddToCalculation:c,addToCalculation:l}=X7(o.params?.cameFromVisualSearch),u=M5(c&&Eq),[d,f]=(0,U.useState)(``),[p,m]=(0,U.useState)(!1),[h,g]=(0,U.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}=p_n(y===`recentFoods`),{foodSearchResults:T,isFoodSearchLoading:E,isFoodSearchError:D}=lfn(d);(0,U.useLayoutEffect)(()=>{a.setOptions({headerTransparent:!0,header:()=>(0,G.jsx)(P5,{title:e(`food_library_sheet_navigation`),LeftButton:c?(0,G.jsx)(U5,{}):void 0,color:t.bgPrimary,skipTopInset:c&&Eq,overlay:!0})})},[a,e,c,t]);let O=(0,U.useCallback)(()=>{m(!0)},[]),k=(0,U.useCallback)(()=>{f(``),g(null),m(!1)},[]),A=(0,U.useCallback)(()=>{if(u8(l8.FoodLibraryScanFoodPress),!c7.getState().privacyNoticeAccepted){a.navigate(F5.VisualSearchIntro);return}a.navigate(F5.VisualSearch)},[a]),ee=(0,U.useCallback)(()=>{a.navigate(F5.PersonalFood,{cameFromVisualSearch:o.params?.cameFromVisualSearch})},[a,o.params]),te=(0,U.useCallback)(({item:e})=>{if(C_n(e))return(0,G.jsx)(Kgn,{item:e,expandable:c,isExpanded:h===e.id,onExpand:()=>g(e.id),onPress:()=>{e.source===`curated`?a.navigate(F5.CuratedFoodItem,{foodId:e.id,categoryId:e.categoryId,cameFromVisualSearch:o.params?.cameFromVisualSearch}):a.navigate(F5.PersonalFoodItem,{foodId:e.id,cameFromVisualSearch:o.params?.cameFromVisualSearch})},onAddToCalculation:l,testID:`food-search-item-${e.id}`});let t=()=>{a.navigate(F5.FoodSubcategories,{categoryId:e.id,cameFromVisualSearch:o.params?.cameFromVisualSearch})},r=e.color.light;return n&&(r=e.color.dark),(0,G.jsx)(m_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,U.useMemo)(()=>{let t=(0,G.jsx)(Q7,{icon:(0,G.jsx)($7t,{}),message:e(`food_offline_state_default`)});return y===`categories`?x?t:null:y===`recentFoods`?w?t:C?(0,G.jsx)(b2,{}):null:D?t:E?(0,G.jsx)(b2,{}):(0,G.jsx)(Q7,{icon:(0,G.jsx)(q7t,{}),message:e(`food_empty_state_no_food`)})},[y,x,w,C,D,E,e]),ie=(0,U.useCallback)(e=>(0,G.jsx)(X2t,{...e,bottomOffset:16}),[]),j=(0,U.useMemo)(()=>[o9.contentContainer,{paddingTop:u,paddingBottom:c?i:r}],[u,c,i,r]),M=(0,G.jsxs)(V,{style:o9.listHeader,children:[(0,G.jsx)(b_n,{showScanButton:_,isSearchActive:p,onSearch:f,onClearSearch:k,onSearchFocus:O,onScanFoodPress:A}),y===`categories`&&(0,G.jsx)(S_n,{onPress:ee}),y===`recentFoods`&&S.length>0&&(0,G.jsxs)(V,{style:o9.recentTitleRow,children:[(0,G.jsx)(t9t,{width:16,height:16}),(0,G.jsx)(Q,{style:[o9.recentTitle,{color:t.labelPrimary}],children:e(`food_library_frequent_title`)})]})]});return(0,G.jsxs)(V,{style:[o9.screen,{backgroundColor:t.bgPrimary}],children:[(0,G.jsx)(z4.default,{colors:[t.bgPrimary,c3(t.bgPrimary,0)],style:o9.gradient,pointerEvents:`none`}),(0,G.jsx)(Uc,{style:o9.list,data:ne,keyExtractor:e=>e.id,renderItem:te,ListHeaderComponent:M,ListEmptyComponent:re,contentContainerStyle:j,keyboardDismissMode:Tq?`none`:`on-drag`,keyboardShouldPersistTaps:`handled`,onScroll:Tq?w_n:void 0,renderScrollComponent:ie,scrollEventThrottle:16})]})},o9=z.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:{...X.Poppins.medium_SM},list:{flex:1}});H();var E_n=()=>{let e=M$(),t=A$(),{categoryId:n,cameFromVisualSearch:r}=e.params,{canAddToCalculation:i}=X7(r),{COLORS:a,isDark:o}=Y(),{bottomWithScroll:s}=Q4(),{paddingBottomScreenWithTabBar:c}=Z7(),l=M5(i&&Eq),{foodCategories:u}=Y7(),d=u.find(e=>e.id===n),f=o?d?.color.dark:d?.color.light;(0,U.useLayoutEffect)(()=>{t.setOptions({header:()=>(0,G.jsx)(P5,{title:d?.title,LeftButton:(0,G.jsx)(H5,{}),color:f,skipTopInset:i&&Eq,overlay:!0})})},[t,d,f,i]);let p=(0,U.useCallback)((e,n)=>{t.navigate(F5.CuratedFood,{categoryId:n,subcategoryId:e,cameFromVisualSearch:r})},[t,r]),m=(0,U.useCallback)(({item:e})=>(0,G.jsx)(m_n,{onPress:()=>p(e.id,d?.id),title:e.title,imageUrl:e.icon,color:f??a.bgPrimary}),[a,d,f,p]);return(0,G.jsxs)(V,{style:[s9.screen,{backgroundColor:a.bgPrimary}],children:[f&&(0,G.jsx)(z4.default,{colors:[f,c3(f,0)],style:s9.gradient,pointerEvents:`none`}),(0,G.jsx)(Uc,{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=z.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}});H();var D_n=()=>{let{COLORS:e}=Y(),{t}=Sq(),n=A$(),{params:r}=M$(),{canAddToCalculation:i,addToCalculation:a}=X7(r?.cameFromVisualSearch),o=M5(i&&Eq),{bottomWithScroll:s}=Q4(),{paddingBottomScreenWithTabBar:c}=Z7(),{personalFoods:l,isPersonalFoodsLoading:u}=ifn(),d=l.length===0;(0,U.useLayoutEffect)(()=>{n.setOptions({header:()=>(0,G.jsx)(P5,{title:t(`food_myFood_title`),LeftButton:(0,G.jsx)(H5,{}),color:e.bgMyFoodCategory,skipTopInset:i&&Eq,overlay:!0})})},[n,e,i,t]);let f=(0,U.useCallback)(()=>{n.navigate(F5.CreateFood)},[n]),[p,m]=(0,U.useState)(null),h=(0,U.useCallback)(({item:e})=>(0,G.jsx)(Kgn,{item:e,expandable:i,isExpanded:p===e.id,onExpand:()=>m(e.id),onPress:()=>{n.navigate(F5.PersonalFoodItem,{foodId:e.id,cameFromVisualSearch:r?.cameFromVisualSearch})},onAddToCalculation:a,testID:`personal-food-item-${e.id}`}),[i,n,r?.cameFromVisualSearch,a,p]),g=(0,U.useCallback)(e=>(0,G.jsx)(X2t,{...e,bottomOffset:16}),[]);return(0,G.jsxs)(V,{style:[c9.screen,{backgroundColor:e.bgPrimary}],children:[(0,G.jsx)(z4.default,{colors:[e.bgMyFoodCategory,c3(e.bgMyFoodCategory,0)],style:c9.gradient,pointerEvents:`none`}),u?(0,G.jsx)(b2,{}):(0,G.jsx)(Uc,{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,G.jsx)(V,{children:(0,G.jsx)(Q7,{icon:(0,G.jsx)(q7t,{}),message:t(`food_myFood_empty_state_default`)})}),ListFooterComponent:(0,G.jsx)(U4,{title:t(`food_button_createFood`),onPress:f,type:H4.Secondary})})]})},c9=z.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}});H();var O_n=()=>{let{t:e}=Sq(),t=A$(),{params:n}=M$(),{COLORS:r}=Y(),{topInsideModal:i}=Q4(),{canAddToCalculation:a,addToCalculation:o}=X7(n.cameFromVisualSearch),s=Zgn(),c=(0,U.useCallback)(()=>{s([{name:F5.PersonalFood}])},[s]),l=[l9.headerRow,{paddingTop:i}],{foodIntakeItems:u}=L5(),{food:d,isFoodLoading:f,isFoodError:p}=sfn(n.foodId),[m,h]=(0,U.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,U.useEffect)(()=>{g||f||p||t.goBack()},[g,f,p,t]);let v=(0,U.useCallback)(()=>{g&&t.navigate(F5.CreateFood,{personalFoodId:g.id})},[t,g]),y=(0,U.useMemo)(()=>g?C8(Number(m||0),g.measures[0].gramsPerUnit,g.nutritionPer100g.carbohydrates.value):0,[g,m]),b=(0,U.useCallback)(()=>{g&&o(g,Number(m)||0)},[g,m,o]);if(!g)return(0,G.jsxs)(V,{style:l9.screen,children:[(0,G.jsxs)(V,{style:l9.gradient,children:[(0,G.jsx)(z4.default,{colors:[r.bgMyFoodCategory,c3(r.bgMyFoodCategory,0)],style:z.absoluteFill,pointerEvents:`none`}),(0,G.jsx)(V,{style:l,children:(0,G.jsx)(U5,{})})]}),p?(0,G.jsx)(Q7,{icon:(0,G.jsx)($7t,{}),message:e(`food_offline_state_default`)}):(0,G.jsx)(b2,{})]});let x=`${Math.round(g.nutritionPer100g.carbohydrates.value*10)/10} carbs / 100${g.nutritionPer100g.carbohydrates.unit}`;return(0,G.jsxs)(V,{style:l9.screen,children:[(0,G.jsxs)(V,{style:l9.gradient,children:[(0,G.jsx)(z4.default,{colors:[r.bgMyFoodCategory,c3(r.bgMyFoodCategory,0)],style:z.absoluteFill,pointerEvents:`none`}),(0,G.jsxs)(V,{style:l,children:[(0,G.jsx)(U5,{}),(0,G.jsx)($dn,{onPress:v})]}),(0,G.jsx)(Q,{style:[l9.title,a&&l9.titleInCalculation,{color:r.labelPrimary}],numberOfLines:2,children:g.title}),a?(0,G.jsx)(V,{style:l9.inputCardSection,children:(0,G.jsx)(a_n,{amount:m||``,onChangeAmount:h,unit:g.measures[0].unit,carbs:y,onAdd:b,testID:`personal-food-item-input`})}):(0,G.jsxs)(V,{style:l9.carbsContainer,children:[(0,G.jsx)(e_n,{totalAmount:100,carbsValue:g.nutritionPer100g.carbohydrates.value,carbsUnit:g.nutritionPer100g.carbohydrates.unit}),(0,G.jsx)(Q,{style:[l9.carbsLabel,{color:r.labelPrimary}],children:x})]})]}),(0,G.jsxs)(V,{style:l9.section,children:[(0,G.jsxs)(V,{style:l9.categoryRow,children:[(0,G.jsx)(Q,{style:[l9.categorySectionTitle,{color:r.labelSecondary}],children:e(`food_library_info_category`)}),(0,G.jsx)(t_n,{title:e(`food_segment_button_my_food`),color:r.bgMyFoodCategory,onPress:c})]}),(0,G.jsx)(V,{style:[l9.divider,{backgroundColor:r.border}]}),a&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(V,{style:l9.carbsInfoRow,children:[(0,G.jsx)(Q,{style:[l9.carbsInfoLabel,{color:r.labelPrimary}],children:x}),(0,G.jsx)(e_n,{size:`small`,totalAmount:100,carbsValue:g.nutritionPer100g.carbohydrates.value,carbsUnit:g.nutritionPer100g.carbohydrates.unit})]}),(0,G.jsx)(V,{style:[l9.divider,{backgroundColor:r.border}]})]}),(!!g.description||!!_)&&(0,G.jsxs)(V,{style:l9.notesRow,children:[!!g.description&&(0,G.jsx)(Q,{style:[l9.description,{color:r.labelSecondary}],children:g.description}),!!_&&(0,G.jsx)(Xu,{source:{uri:_},style:l9.foodImage,resizeMode:`cover`})]})]})]})},l9=z.create({screen:{flex:1},gradient:{alignItems:`center`},headerRow:{flexDirection:`row`,justifyContent:`space-between`,alignSelf:`stretch`,paddingHorizontal:16,paddingBottom:10,marginBottom:20},title:{...X.Poppins.medium_2XL,textAlign:`center`,marginBottom:32,paddingHorizontal:16},titleInCalculation:{marginBottom:22},inputCardSection:{alignSelf:`stretch`,paddingHorizontal:16},carbsContainer:{alignItems:`center`},carbsLabel:{...X.Poppins.regular_Base,marginTop:12},notesRow:{flexDirection:`row`,alignItems:`center`,paddingHorizontal:16,gap:8},description:{...X.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:{...X.Poppins.regular_SM,marginRight:7},divider:{height:1},carbsInfoRow:{flexDirection:`row`,alignItems:`center`,justifyContent:`space-between`,paddingHorizontal:16},carbsInfoLabel:{...X.Poppins.regular_Base,flex:1}}),{Group:k_n,Navigator:A_n,Screen:u9}=A5();function j_n(){return(0,G.jsxs)(A_n,{screenOptions:{...K5,header:()=>null,...Q8},children:[(0,G.jsx)(u9,{name:F5.FoodAndDrink,component:T_n}),(0,G.jsx)(u9,{name:F5.FoodSubcategories,component:E_n,options:{headerTransparent:!0}}),(0,G.jsx)(u9,{name:F5.PersonalFood,component:D_n,options:{headerTransparent:!0}}),(0,G.jsx)(u9,{name:F5.CuratedFood,component:qgn,options:{headerTransparent:!0}}),(0,G.jsxs)(k_n,{screenOptions:{...Bsn,headerShown:!1,gestureEnabled:!1},children:[(0,G.jsx)(u9,{name:F5.PersonalFoodItem,component:O_n}),(0,G.jsx)(u9,{name:F5.CuratedFoodItem,component:d_n})]})]})}var{Navigator:M_n,Screen:d9}=A5();function N_n(){let{COLORS:e}=Y();return(0,G.jsxs)(M_n,{id:`NewCalculationStack`,screenOptions:{headerShown:!1,...Q8},children:[(0,G.jsx)(d9,{name:F5.Calculation,component:Tmn,options:{headerShown:!0,cardStyle:{flex:1}}}),(0,G.jsx)(d9,{name:F5.LoadingRecommendation,component:Pgn}),(0,G.jsx)(d9,{name:F5.Recommendation,component:Lgn,options:{...K5,headerStyle:{backgroundColor:e.bgSheet},headerShown:!1}}),(0,G.jsx)(d9,{name:F5.LeavingRecommendation,component:Dmn}),(0,G.jsx)(d9,{name:F5.FoodLibrary,component:j_n,options:{...tfn,...Jsn,headerShown:!1,gestureEnabled:!1}})]})}var P_n=Z.Milliseconds.Minute*20,F_n=()=>{let{pinCode:e,settingsUnlockedTimestamp:t,setSettingsUnlockedTimestamp:n}=E3(),r=(0,U.useMemo)(()=>t===null||Date.now()-t>P_n,[t]);R$((0,U.useCallback)(()=>{if(t===null)return;let e=P_n-(Date.now()-t);if(e<=0)return;let r=setTimeout(()=>n(null),e);return()=>clearTimeout(r)},[t,n]));let i=(0,U.useCallback)(()=>{n(Date.now())},[n]),a=(0,U.useCallback)(()=>{n(null)},[n]);return{areSettingsLocked:r,isPINSet:!!e,unlockSettings:i,lockSettings:a}};H();var I_n=()=>{let{t:e}=Sq(),{COLORS:t}=Y();return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Q,{style:[f9.header,f9.firstHeaderSpacing],testID:`activity-info-title`,children:e(`physical_activity_modal_activity_insulin_title`)}),(0,G.jsx)(Q,{style:[{color:t.labelSecondary},f9.spacing],children:e(`physical_activity_modal_activity_insulin_body`)}),(0,G.jsx)(Q,{style:f9.header,children:e(`physical_activity_modal_adjust_insulin_title`)}),(0,G.jsx)(Q,{style:[{color:t.labelSecondary},f9.spacing],children:e(`physical_activity_modal_adjust_insulin_body`)})]})},f9=z.create({header:{...X.Poppins.semiBold_2XL,marginBottom:8},firstHeaderSpacing:{marginTop:32},spacing:{marginBottom:32}});H();var p9=({text:e,learnMoreText:t,learnMoreOnPress:n})=>{let{t:r}=Sq(),{COLORS:i}=Y();return(0,G.jsxs)(V,{style:[m9.card,{backgroundColor:i.bgSecondary}],children:[(0,G.jsx)(c9t,{}),(0,G.jsxs)(V,{style:m9.rightContainer,children:[(0,G.jsx)(Q,{style:[m9.contactText,{color:i.labelPrimary}],children:e??r(`warning_HCP`)}),t!==void 0&&n!==void 0&&(0,G.jsx)(Jf,{onPress:n,style:m9.learnMoreContainer,children:(0,G.jsx)(Q,{style:[m9.learnMoreText,{color:i.textLink}],children:t})})]})]})},m9=z.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,...X.Poppins.medium_SM},learnMoreText:{flexShrink:1,...X.Poppins.semiBold_SM}});H();var h9=4,L_n=({onFinish:e,ref:t})=>{let{COLORS:n}=Y(),{colorScheme:r}=g2(),i=(0,U.useRef)(Array.from({length:h9},()=>U.createRef())),[a,o]=(0,U.useState)(()=>Array.from({length:h9},()=>``)),[s,c]=(0,U.useState)(0),[l,u]=(0,U.useState)(null);(0,U.useImperativeHandle)(t,()=>({resetDigits(){o(Array.from({length:h9},()=>``)),c(0),u(null),i.current[0].current?.focus()},displayError(e){u(e)}}),[i]);let d=(0,U.useCallback)((e,t)=>{let n=e.replace(/[^0-9]/g,``),r=[...a];r[t]=n,o(r),u(null),n&&t<i.current.length-1&&i.current[t+1].current?.focus(),!e&&t!==0&&i.current[t-1].current?.focus()},[a,i]),f=(0,U.useCallback)(e=>{a[e]===``&&e!==0&&i.current[e-1].current?.focus()},[a,i]);return(0,U.useEffect)(()=>{let t=a.join(``);t.length===h9&&e(t)},[a,e]),(0,G.jsxs)(V,{children:[(0,G.jsx)(V,{style:R_n.inputContainer,children:i.current.map((e,t)=>(0,G.jsx)(Ip,{ref:e,testID:`pin-digit-${t}`,value:a[t],autoFocus:t===0&&Eq,keyboardType:`number-pad`,maxLength:1,onChangeText:e=>d(e,t),onKeyPress:e=>{e.nativeEvent.key===`Backspace`&&f(t)},onFocus:()=>c(t),onBlur:()=>c(null),style:[R_n.input,{borderColor:l===null?s===t?n.borderActivationCodeFocus:r===h2.Light?n.border:n.bgTertiary:n.borderActivationCodeDanger,backgroundColor:n.bgTertiary,color:n.labelPrimary}]},t))}),l!==null&&(0,G.jsx)(Q,{style:[R_n.error,{color:n.textDanger}],children:l})]})},R_n=z.create({inputContainer:{flexDirection:`row`,gap:8,justifyContent:`center`},input:{...X.Poppins.medium_2XL,lineHeight:B.select({ios:0,default:X.Poppins.regular_Base.lineHeight}),width:49,height:55,borderRadius:8,padding:0,textAlign:`center`,textAlignVertical:`center`,borderWidth:2},error:{...X.Poppins.regular_SM,textAlign:`center`,marginTop:8}});H();var z_n=()=>(0,G.jsx)(V,{style:B_n.animationContainer,children:(0,G.jsx)(p2,{autoPlay:!0,source:m2.LEAVING_RECOMMENDATION,style:B_n.animation,loop:!0})}),B_n=z.create({animationContainer:{justifyContent:`center`,alignItems:`center`},animation:{width:75,height:75}});H(),KQ();var V_n=1600,H_n=({isVisible:e,onClose:t,onForgotPIN:n,onModalHide:r,onModalHideWithSuccess:i})=>{let{COLORS:a}=Y(),{t:o}=(0,$_t.useTranslation)(),{pinCode:s}=E3(),[c,l]=(0,U.useState)(`enter_pin`),[u,d]=U.useState(!1),f=(0,U.useRef)(null),p=(0,U.useRef)(null),{height:m}=M2t(),h=lQ(!1),g=lQ(0),_=dQ(()=>({paddingBottom:h.value?g.value:-m.value}));(0,U.useEffect)(()=>{e&&(h.value=!1)},[e,h]),(0,U.useEffect)(()=>(p.current&&=(clearTimeout(p.current),null),c===`success`&&(p.current=setTimeout(()=>{d(!0)},V_n)),()=>{p.current&&=(clearTimeout(p.current),null)}),[c]);let v=(0,U.useCallback)(()=>{g.value=-m.value,h.value=!0,wf.dismiss(),t()},[t,h,g,m]),y=(0,U.useCallback)(()=>{l(`enter_pin`),d(!1),c===`success`?i():r?.()},[i,r,c]);(0,U.useEffect)(()=>{c===`success`&&u&&v()},[u,c,v]);let b=(0,U.useCallback)(e=>{c===`enter_pin`&&(e===s?l(`success`):f.current?.displayError(o(`pin_modal_error_invalid`)))},[c,s,o]),x=(0,U.useCallback)(()=>{g.value=-m.value,h.value=!0,wf.dismiss(),n()},[n,h,g,m]);return(0,G.jsxs)(u3,{testID:`validate_pin_code_modal`,isVisible:e,onModalHide:y,onModalShow:()=>f.current?.resetDigits(),containerStyle:{backgroundColor:a.bgSheet},children:[(0,G.jsx)(V,{style:U_n.header,children:(0,G.jsx)(U5,{onPress:v})}),(0,G.jsx)(Q,{style:U_n.title,children:o(`pin_modal_header_enter`)}),(0,G.jsxs)(GQ.View,{style:[U_n.content,_],children:[c===`success`?(0,G.jsx)(z_n,{}):(0,G.jsx)(L_n,{onFinish:b,ref:f}),(0,G.jsx)(U4,{title:o(`pin_modal_button_forgot`),onPress:x,type:H4.Plain})]})]})},U_n=z.create({title:{...X.Poppins.bold_2XL,marginBottom:6,textAlign:`center`},header:{alignItems:`flex-start`,paddingTop:16,marginBottom:10},content:{paddingTop:10}});H(),KQ();var W_n=1600,G_n=({isVisible:e,onClose:t,onModalHideWithSuccess:n})=>{let{COLORS:r}=Y(),{t:i}=Sq(),[a,o]=(0,U.useState)(`enter_pin`),[s,c]=(0,U.useState)(``),[l,u]=U.useState(!1),d=(0,U.useRef)(null),f=(0,U.useRef)(null),{height:p}=M2t(),m=lQ(!1),h=lQ(0),g=dQ(()=>({paddingBottom:m.value?h.value:-p.value}));(0,U.useEffect)(()=>{e&&(m.value=!1)},[e,m]),(0,U.useEffect)(()=>(f.current&&=(clearTimeout(f.current),null),a===`success`&&(f.current=setTimeout(()=>{u(!0)},W_n)),()=>{f.current&&=(clearTimeout(f.current),null)}),[a]);let _=(0,U.useCallback)(()=>{h.value=-p.value,m.value=!0,wf.dismiss(),t()},[t,m,h,p]),v=(0,U.useCallback)(()=>{o(`enter_pin`),u(!1),a===`success`&&n(s)},[n,s,a]);(0,U.useEffect)(()=>{a===`success`&&l&&_()},[l,a,_]);let y=(0,U.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,G.jsxs)(u3,{testID:`pin_code_modal`,isVisible:e,onModalHide:v,onModalShow:()=>d.current?.resetDigits(),containerStyle:{backgroundColor:r.bgSheet},children:[(0,G.jsx)(V,{style:g9.header,children:(0,G.jsx)(U5,{onPress:_})}),(0,G.jsx)(Q,{style:g9.title,children:i(a===`enter_pin`?`pin_modal_header_enter`:`pin_modal_header_repeat`)}),(0,G.jsxs)(GQ.View,{style:[g9.content,g],children:[a===`success`&&(0,G.jsx)(V,{style:g9.animationContainer,children:(0,G.jsx)(p2,{autoPlay:!0,source:m2.LEAVING_RECOMMENDATION,style:g9.animation,loop:!0})}),a!==`success`&&(0,G.jsx)(L_n,{onFinish:y,ref:d})]})]})},g9=z.create({title:{...X.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}}),K_n=()=>{let{setPINCode:e,isElevatedAuthConfirmed:t,setIsElevatedAuthConfirmed:n}=E3(),[r,i]=(0,U.useState)(!1);return R$((0,U.useCallback)(()=>{t&&(n(!1),i(!0))},[t,n])),(0,G.jsx)(G_n,{isVisible:r,onClose:()=>i(!1),onModalHideWithSuccess:(0,U.useCallback)(t=>{e(t)},[e])})},q_n=({isVisible:e,onModalHide:t,onEnterPIN:n,onCancel:r})=>{let{t:i}=Sq();return(0,G.jsx)(u3,{isVisible:e,title:i(`settings_locked_modal_header`),onModalHide:t,icon:()=>(0,G.jsx)(X7t,{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}]})};H();function _9({columnDisposition:e,disabled:t=!1,testID:n,children:r,style:i}){let{COLORS:a}=Y();return(0,G.jsx)(V,{testID:n,style:[J_n.row,t&&J_n.disabledRow,{backgroundColor:a.bgTableOdd},i],children:U.Children.map(r,(n,r)=>U.isValidElement(n)?U.cloneElement(n,{disabled:t,cellRatio:e?e[r]:void 0}):null)})}var J_n=z.create({row:{flexDirection:`row`,justifyContent:`space-between`},disabledRow:{opacity:.5}});H();function v9({index:e,columnDisposition:t,disabled:n=!1,testID:r,children:i,style:a}){let{COLORS:o}=Y(),s=(0,U.useCallback)(e=>e===void 0?o.bgTableEven:e%2?o.bgTableOdd:o.bgTableEven,[o]);return(0,G.jsx)(V,{testID:r,style:[Y_n.row,{backgroundColor:s(e)},a],children:U.Children.map(i,(e,r)=>U.isValidElement(e)?U.cloneElement(e,{disabled:n,cellRatio:t?t[r]:void 0}):null)})}var Y_n=z.create({row:{flexDirection:`row`,justifyContent:`space-between`}});H();function y9({columnDisposition:e,disabled:t=!1,testID:n,children:r,style:i}){let{COLORS:a}=Y();return(0,G.jsx)(V,{testID:n,style:[X_n.table,{backgroundColor:a.bgSecondary,borderWidth:1,borderColor:a.divider},t&&{backgroundColor:a.bgButtonSecondaryDangerDisabled},i],children:(()=>{let n=0;return U.Children.map(r,r=>{if(U.isValidElement(r)){if(r.type===_9){let n=r;return U.cloneElement(n,{disabled:n.props.disabled??t,columnDisposition:e})}if(r.type===v9){let i=r,a=U.cloneElement(i,{disabled:i.props.disabled??t,index:n,columnDisposition:e});return n+=1,a}return U.cloneElement(r)}return null})})()})}var X_n=z.create({table:{borderRadius:16,overflow:`hidden`}});H();function b9({disabled:e=!1,onPress:t,testID:n,accessibilityLabel:r,accessibilityValue:i,cellRatio:a,children:o,style:s}){let{COLORS:c}=Y();return(0,G.jsx)(Jf,{disabled:!t||e,onPress:t,style:[Z_n.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:U.Children.map(o,t=>{if(U.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 U.cloneElement(n,{...n.props,style:t})}else return U.cloneElement(n)}return null})})}var Z_n=z.create({cell:{justifyContent:`center`,alignItems:`center`,borderTopWidth:1,borderLeftWidth:1,paddingVertical:8}});H();function x9({testID:e,cellRatio:t,children:n,style:r,accessibilityLabel:i,accessibilityValue:a,disabled:o=!1}){let{COLORS:s}=Y();return(0,G.jsx)(V,{style:[Q_n.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 Q_n=z.create({cell:{justifyContent:`space-between`,alignItems:`center`,borderTopWidth:1,borderLeftWidth:1,paddingVertical:8}});H();var $_n=[Z.ActivityIntensity.light,Z.ActivityIntensity.moderate,Z.ActivityIntensity.hard],evn=[Z.ActivityReductionIntervals.fromZero,Z.ActivityReductionIntervals.fromThirty,Z.ActivityReductionIntervals.fromFortysix,Z.ActivityReductionIntervals.fromSixtyone],tvn={[Z.ActivityReductionIntervals.fromZero]:`0-29`,[Z.ActivityReductionIntervals.fromThirty]:`30-45`,[Z.ActivityReductionIntervals.fromFortysix]:`46-60`,[Z.ActivityReductionIntervals.fromSixtyone]:`61-120`},nvn=e=>Math.round((1-e)*100),rvn=e=>e==null?`-`:`${nvn(e).toString()} %`,ivn=e=>Math.round((1-e/100)*100)/100;function avn(){let{t:e}=Sq(),t=A$(),{COLORS:n}=Y(),{modalStoreActions:r}=z5(),{bottomWithScroll:i}=Q4(),a=M5(),[o,s]=(0,U.useState)(!1),[c,l]=(0,U.useState)(!1),[u,d]=(0,U.useState)(!1),[f,p]=(0,U.useState)(null),[m,h]=(0,U.useState)(null),[g,_]=(0,U.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,U.useMemo)(()=>B8(x,Z.BloodGlucoseUnit.MMOL_L,v),[v,x]),{text:D}=(0,U.useMemo)(()=>L8(v),[v]),O=(0,U.useMemo)(()=>({light:w,moderate:T,hard:C}),[w,T,C]),k=(0,U.useMemo)(()=>({post:S}),[S]),A=(0,U.useMemo)(()=>[{title:e(`table_activity_duration`),maxFontSizeMultiplier:S2.s1},{title:R8.light(),maxFontSizeMultiplier:S2.s1},{title:R8.moderate(),maxFontSizeMultiplier:S2.s1},{title:R8.hard(),maxFontSizeMultiplier:S2.s1}],[e]),[ee,te]=(0,U.useState)(!1),[ne,re]=(0,U.useState)(!1),{areSettingsLocked:ie,isPINSet:j,lockSettings:M,unlockSettings:ae}=F_n(),[oe,N]=(0,U.useState)(!1),[se,P]=(0,U.useState)(!1),F=(0,U.useCallback)(()=>{ie?te(!0):M()},[ie,M]);(0,U.useEffect)(()=>{t.setOptions({header:()=>(0,G.jsx)(P5,{title:e(`physical_activity_navigation`),LeftButton:(0,G.jsx)(H5,{}),RightButton:j?(0,G.jsx)(efn,{onPress:F,isLocked:ie}):void 0,overlay:!0})})},[t,ie,j,F,e]);let ce=(0,U.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]),le=(0,U.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]),ue=(0,U.useCallback)((e,t)=>{p({interval:t,intensity:e}),s(!0)},[s,p]),de=(0,U.useCallback)(()=>{p(null),s(!0)},[]),fe=(0,U.useCallback)(async e=>{if(f===null)throw Error(`[ActivitySettings::updateActivity] pressedTableCell is null`);if(ivn(e)!==y[f.intensity][f.interval]){let t=JSON.parse(JSON.stringify(y));t[f.intensity][f.interval]=ivn(e),t.updatedAt=new Date().toISOString(),_(await k8.postUserSettings({activity:t}))}},[y,f]),pe=(0,U.useCallback)(async e=>{let t=z8(e,v,Z.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]),me=(0,U.useCallback)(async e=>{f?await fe(e):await pe(e),s(!1)},[f,fe,pe]),he=(0,U.useMemo)(()=>f===null?v===Z.BloodGlucoseUnit.MMOL_L?Van:Han:a3(0,75),[f,v]),I=(0,U.useMemo)(()=>{if(f===null){let e=B8(x,Z.BloodGlucoseUnit.MMOL_L,v);return he.findIndex(t=>t===e)}let e=y[f.intensity][f.interval];return e===0?0:e?nvn(e):75},[f,y,x,v,he]),ge=async()=>{m===`after`?await le():await ce(),l(!1)},L=()=>{h(`during`),l(!0)},_e=()=>{h(`after`),l(!0)},ve=(0,U.useCallback)(()=>{g===!1&&r.set({showSyncErrorModal:!0}),_(void 0)},[g,r]),ye=(0,U.useCallback)(()=>{oe&&(re(!0),N(!1))},[oe,re,N]),be=(0,U.useCallback)(()=>{N(!0),te(!1)},[N,te]),R=(0,U.useCallback)(()=>{ae()},[ae]),xe=(0,U.useCallback)(e=>j&&ie?(...e)=>te(!0):(...t)=>e(...t),[ie,j]),Se=(0,U.useCallback)(()=>{se&&(P(!1),setTimeout(()=>{t.navigate(F5.ChangePINCode)},500))},[se,t]),Ce=y.updatedAt??b;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(ds,{testID:`settings-activity-scroll`,style:S9.scrollView,contentContainerStyle:[S9.scrollViewContent,{paddingBottom:i,paddingTop:a+16}],children:[(0,G.jsx)(Q,{style:[S9.updatedAtText,{color:n.labelSecondary}],children:e(`settings_lastEdited`,{date:Ce?I8(Ce,`d MMM yyyy`):``})}),(0,G.jsx)(p9,{text:e(`physical_activity_hcp_card_body`),learnMoreText:e(`physical_activity_hcp_card_button`),learnMoreOnPress:()=>{d(!0)}}),(0,G.jsxs)(y9,{children:[(0,G.jsxs)(V,{style:[S9.tableDescripContainer,{borderBottomColor:n.divider}],children:[(0,G.jsx)(Q,{style:[S9.title,{color:n.labelPrimary}],accessibilityRole:`header`,children:e(`physical_activity_target_title`)}),(0,G.jsx)(Q,{style:[S9.subtitle,{color:n.labelSecondary}],children:e(`physical_activity_target_body`)})]}),(0,G.jsx)(Y4,{title:e(`target_activity_input`),value:`${E} ${D}`,style:{backgroundColor:n.bgSecondary},testID:`activity-target`,onPress:xe(de),valueStyle:{color:n.labelBrand}})]}),(0,G.jsxs)(y9,{columnDisposition:[1,1,1,1],children:[(0,G.jsxs)(V,{style:[S9.tableDescripContainer,{borderBottomColor:n.divider}],children:[(0,G.jsx)(Q,{style:[S9.title,{color:n.labelPrimary}],accessibilityRole:`header`,children:e(`target_activity_reduction_title`)}),(0,G.jsx)(Q,{style:[S9.subtitle,{color:n.labelSecondary}],children:e(`target_activity_reduction_body`)})]}),(0,G.jsx)(_9,{children:A.map((e,t)=>(0,G.jsx)(x9,{style:[t===0&&S9.tableFirstCell,S9.noTopBorder],children:(0,G.jsx)(Q,{style:[S9.tableHeaderTitle,{color:n.labelPrimary}],maxFontSizeMultiplier:e.maxFontSizeMultiplier,children:e.title})},e.title))}),evn.map(t=>(0,G.jsxs)(v9,{children:[(0,G.jsxs)(b9,{style:S9.tableFirstCell,children:[(0,G.jsx)(Q,{style:[S9.tableInterval,{color:n.labelPrimary}],children:tvn[t]}),(0,G.jsx)(Q,{style:[S9.minutes,{color:n.textTableSecondary}],children:e(`activity_settings_table_min`)})]}),$_n.map(e=>(0,G.jsx)(b9,{testID:`settings-activity-${e}-${t}`,onPress:xe(()=>{ue(e,t)}),children:(0,G.jsx)(Q,{style:[S9.tablePercentage,{color:n.textTableHighlight}],children:rvn(O[e][t])})},`${t}-${e}`))]},t)),(0,G.jsx)(Jf,{style:[S9.resetContainer,{backgroundColor:n.bgButtonSecondaryDanger,borderColor:n.divider}],onPress:xe(L),testID:`restore-default-activity-settings-during`,children:(0,G.jsx)(Q,{style:[S9.resetText,{color:n.textButtonSecondaryDanger}],children:e(`button_reset_default`)})})]}),(0,G.jsxs)(y9,{children:[(0,G.jsxs)(V,{style:[S9.tableDescripContainer,{borderBottomWidth:0}],children:[(0,G.jsx)(Q,{style:[S9.title,{color:n.labelPrimary}],accessibilityRole:`header`,children:e(`target_activity_reduction_after_title`)}),(0,G.jsx)(Q,{style:[S9.subtitle,{color:n.labelSecondary}],children:e(`target_activity_reduction_after_body`)})]}),evn.map(t=>(0,G.jsxs)(v9,{children:[(0,G.jsxs)(b9,{style:[S9.tableFirstCell,S9.noLeftBorder],children:[(0,G.jsx)(Q,{style:S9.tableInterval,children:tvn[t]}),(0,G.jsx)(Q,{style:[S9.minutes,{color:n.textTableSecondary}],children:e(`activity_settings_table_min`)})]}),(0,G.jsx)(b9,{testID:`settings-activity-post-${t}`,onPress:xe(()=>{ue(`post`,t)}),children:(0,G.jsx)(Q,{style:[S9.tablePercentage,{color:n.textTableHighlight}],children:rvn(k.post[t])})})]},`post-${t}`)),(0,G.jsx)(Jf,{style:[S9.resetContainer,{backgroundColor:n.bgButtonSecondaryDanger,borderColor:n.divider}],onPress:xe(_e),testID:`restore-default-activity-settings-after`,children:(0,G.jsx)(Q,{style:[S9.resetText,{color:n.textButtonSecondaryDanger}],children:e(`button_reset_default`)})})]})]}),(0,G.jsx)(Q5,{initialScrollIndex:I,isVisible:o,onCancel:()=>{s(!1)},onConfirm:me,items:he,onModalHide:ve,testID:`activity-wheel-picker`}),(0,G.jsx)(u3,{title:e(`physical_activity_modal_reset_title `),isVisible:c,onModalHide:ve,buttons:[{title:e(`button_reset`),type:H4.Error,onPress:ge},{title:e(`button_cancel`),type:H4.Secondary,onPress:()=>{l(!1)}}]}),(0,G.jsx)(u3,{isVisible:u,enableScroll:!0,buttons:[{title:e(`button_close`),onPress:()=>{d(!1)},style:S9.activityInfoModalButton}],children:(0,G.jsx)(I_n,{})}),(0,G.jsx)(t7,{onModalHide:()=>{_(void 0)}}),(0,G.jsx)(q_n,{isVisible:ee,onModalHide:ye,onEnterPIN:be,onCancel:()=>te(!1)}),(0,G.jsx)(H_n,{isVisible:ne,onClose:()=>re(!1),onModalHide:Se,onForgotPIN:()=>{P(!0),re(!1)},onModalHideWithSuccess:R}),(0,G.jsx)(K_n,{})]})}var ovn=f7(avn),S9=z.create({scrollView:{paddingHorizontal:16},scrollViewContent:{flexGrow:1,gap:32,paddingTop:32},updatedAtText:{...X.Poppins.regular_SM,textAlign:`center`},tableDescripContainer:{padding:16,borderBottomWidth:1},title:{...X.Poppins.semiBold_Base,marginBottom:8},subtitle:{...X.Poppins.regular_SM},tableFirstCell:{paddingLeft:16,paddingVertical:12,borderLeftWidth:0},resetText:{...X.Poppins.semiBold_Base,textAlign:`center`},resetContainer:{alignItems:`center`,padding:16,borderTopWidth:1},tableHeaderTitle:{...X.Poppins.medium_SM},minutes:{...X.Poppins.regular_XS},tableInterval:{...X.Poppins.medium_Base},tablePercentage:{...X.Poppins.medium_Base},activityInfoModalButton:{marginTop:32},noTopBorder:{borderTopWidth:0,paddingVertical:16},noLeftBorder:{borderLeftWidth:0}});function C9(e,t){return+e3(e)>+e3(t)}function svn(e,t,n){return K7(e,-t,n)}function cvn(e,t){let n=e3(e,t?.in);return n.setMinutes(0,0,0),n}function lvn(e,t,n){let[r,i]=_8(n?.in,e,t);return+cvn(r)==+cvn(i)}H();var w9=Array.from({length:60},(e,t)=>t.toString().padStart(2,`0`));function uvn({isVisible:e,initialValue:t,min:n,max:r,onCancel:i,onConfirm:a,onModalHide:o}){let{COLORS:s}=Y(),{width:c}=$p(),l=(0,U.useRef)(null),u=(0,U.useRef)(null),d=(0,U.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)||lvn(i,t);)e.push(i),i=Von(i,1);return e},[r,n]),f=(0,U.useMemo)(()=>d.map(e=>e.getHours().toString().padStart(2,`0`),[]),[d]),[p,m]=(0,U.useState)(t),h=B3t(e);(0,U.useEffect)(()=>{!h&&e&&m(t)},[h,e,t]);let g=(0,U.useMemo)(()=>d.findIndex(e=>e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()&&e.getHours()===t.getHours()),[d,t]),_=(0,U.useMemo)(()=>{let[,e]=I8(t,`HH:mm`).split(`:`);return w9.indexOf(e)},[t]),v=(0,U.useMemo)(()=>d.findIndex(e=>e.getFullYear()===p.getFullYear()&&e.getMonth()===p.getMonth()&&e.getDate()===p.getDate()&&e.getHours()===p.getHours()),[d,p]),y=(0,U.useMemo)(()=>{let[,e]=I8(p,`HH:mm`).split(`:`);return w9.indexOf(e)},[p]),b=(0,U.useMemo)(()=>n?0:null,[n]),x=(0,U.useMemo)(()=>r?d.length-1:null,[r,d]),S=(0,U.useMemo)(()=>{if(!n)return null;let[,e]=I8(n,`HH:mm`).split(`:`);return w9.indexOf(e)},[n]),C=(0,U.useMemo)(()=>{if(!r)return null;let[,e]=I8(r,`HH:mm`).split(`:`);return w9.indexOf(e)},[r]),w=(0,U.useCallback)(()=>{a(p)},[a,p]),T=(0,U.useCallback)(()=>{m(t),i()},[i,t]),E=(0,U.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,U.useCallback)(e=>{u.current?.scrollToIndex(e)},[]),O=(0,U.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,U.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,G.jsx)(u3,{isVisible:e,containerStyle:{backgroundColor:s.bgTransparent},onModalHide:o,children:(0,G.jsxs)(V,{children:[(0,G.jsxs)(V,{style:T9.pickersContainer,children:[(0,G.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,G.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,G.jsxs)(V,{style:T9.buttonContainer,children:[(0,G.jsx)(X5,{onPress:w}),(0,G.jsx)(Y5,{onPress:T})]})]})})}var dvn=U.memo(uvn),T9=z.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}});H();var fvn=(e,t)=>({startTime:e.startTime,target:B8(e.target,Z.BloodGlucoseUnit.MMOL_L,t)}),pvn=(e,t)=>e.map(e=>fvn(e,t)),mvn=(e,t)=>{let n=e.startTime,r=parseFloat(e.target);return r=z8(r,t,Z.BloodGlucoseUnit.MMOL_L),{startTime:n,target:r}},hvn=(e,t)=>e.map(e=>mvn(e,t));function gvn(){let{t:e}=Sq(),{COLORS:t}=Y(),{modalStoreActions:n}=z5(),{bottomWithScroll:r}=Q4(),i=A$(),a=M5(),[o,s]=(0,U.useState)(),[c,l]=(0,U.useState)(void 0),[u,d]=(0,U.useState)(!1),[f,p]=(0,U.useState)(!1),[m,h]=(0,U.useState)(!1),[g,_]=(0,U.useState)(),[v,y]=(0,U.useState)(!1),[b,x]=(0,U.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===Z.Usage.Overall,O=pvn(T,S),k=fvn(E,S),{areSettingsLocked:A,isPINSet:ee,lockSettings:te,unlockSettings:ne}=F_n(),[re,ie]=(0,U.useState)(!1),[j,M]=(0,U.useState)(!1),ae=(0,U.useCallback)(()=>{A?y(!0):te()},[A,te]);(0,U.useEffect)(()=>{i.setOptions({header:()=>(0,G.jsx)(P5,{title:e(`glucose_navigation`),LeftButton:(0,G.jsx)(H5,{}),RightButton:ee?(0,G.jsx)(efn,{onPress:ae,isLocked:A}):void 0,overlay:!0})})},[i,A,ee,ae,e]);let oe=(0,U.useCallback)(e=>{p(!0),_(e)},[]),N=(0,U.useCallback)(async()=>{let e=Jan(),t=Yan(),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]),se=(0,U.useCallback)(async e=>{if(e!==parseFloat(k.target)){let t={...k};t.target=e.toString();let n=mvn(t,S),r={glucoseLevelTargets:{...C,updatedAt:new Date().toISOString(),overallTargetBGL:n}};l(await k8.postUserSettings(r))}},[S,k,C]),P=(0,U.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=hvn(t,S),i={glucoseLevelTargets:{...C,updatedAt:new Date().toISOString(),targetBGLIntervals:r}};l(await k8.postUserSettings(i))}},[g,O,S,C]),F=(0,U.useCallback)(async e=>{D?await se(e):await P(e),p(!1)},[D,se,P]),ce=(0,U.useCallback)(async()=>{let e=!D,t={glucoseLevelTargets:{...C,use:e?Z.Usage.Overall:Z.Usage.Intervals,updatedAt:new Date().toISOString()}},r=await k8.postUserSettings(t);n.set({showSyncErrorModal:!r})},[D,C,n]),le=(0,U.useMemo)(()=>L8(S).text,[S]),ue=(0,U.useMemo)(()=>{let{min:e,max:t}=S===Z.BloodGlucoseUnit.MMOL_L?Zan():Qan();return S===Z.BloodGlucoseUnit.MG_DL?a3(e,t):o3(e,t)},[S]),de=(0,U.useMemo)(()=>g===void 0?0:D?ue.indexOf(k.target):ue.indexOf(O[g].target),[g,D,ue,O,k.target]),fe=(0,U.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(svn(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]),pe=(0,U.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=hvn(e,S),i={glucoseLevelTargets:{...C,targetBGLIntervals:r,updatedAt:new Date().toISOString()}};l(await k8.postUserSettings(i))}d(!1)},[g,O,S,C]),me=(0,U.useCallback)(()=>{d(!1)},[]),he=(0,U.useCallback)(()=>{p(!1)},[]),I=(0,U.useCallback)(()=>{c===!1&&n.set({showSyncErrorModal:!0}),l(void 0)},[n,c]),ge=(0,U.useCallback)(()=>{re&&(x(!0),ie(!1))},[re,x,ie]),L=(0,U.useCallback)(()=>{ie(!0),y(!1)},[ie,y]),_e=(0,U.useCallback)(()=>{i.navigate(F5.GlucoseUnit)},[i]),ve=(0,U.useCallback)(()=>{ne()},[ne]),ye=(0,U.useCallback)(e=>ee&&A?(...e)=>y(!0):(...t)=>e(...t),[A,ee]),be=(0,U.useCallback)(()=>{j&&(M(!1),setTimeout(()=>{i.navigate(F5.ChangePINCode)},500))},[j,i]),R=C.updatedAt??w;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(ds,{testID:`settings-glucose-scrollview`,style:E9.scrollView,contentContainerStyle:[E9.scrollViewContent,{paddingBottom:r,paddingTop:a+16}],children:[(0,G.jsx)(Q,{style:[E9.updatedAtText,{color:t.labelSecondary}],children:e(`settings_lastEdited`,{date:R?I8(R,`d MMM yyyy`):``})}),(0,G.jsx)(p9,{}),(0,G.jsx)(Y4,{title:e(`glucose_input`),value:le,testID:`glucose-change`,onPress:ye(_e),renderRightSlot:()=>(0,G.jsx)(K4,{})}),(0,G.jsxs)(y9,{columnDisposition:[1,2],children:[(0,G.jsx)(f3,{title:e(`fixed_input_title`),message:e(`fixed_input_body`),value:D,testID:`settings-glucose-overall-switch`,onValueChange:ye(ce),style:E9.switchContainer}),(0,G.jsxs)(_9,{disabled:!D,testID:`settings-glucose-overall-header`,children:[(0,G.jsx)(x9,{style:E9.tableFirstCell,testID:`settings-glucose-overall-header-time`,children:(0,G.jsx)(Q,{style:[E9.headerTitle,{color:t.textTableActive}],maxFontSizeMultiplier:S2.s2,children:e(`table_fixed_time`)})}),(0,G.jsxs)(x9,{testID:`settings-glucose-overall-header-target`,children:[(0,G.jsx)(Q,{style:[E9.headerTitle,{color:t.textTableActive}],maxFontSizeMultiplier:S2.s2,children:e(`table_fixed_target`)}),(0,G.jsx)(Q,{style:[E9.headerSubtitle,{color:t.textTableSecondary}],children:le})]})]}),(0,G.jsxs)(v9,{disabled:!D,children:[(0,G.jsx)(b9,{style:E9.tableFirstCell,children:(0,G.jsx)(Q,{style:[E9.subtitle,{color:t.textTableActive}],children:e(`table_fixed_all_day `)})}),(0,G.jsx)(b9,{onPress:ye(()=>oe(0)),children:(0,G.jsx)(Q,{style:[E9.fixedValueTitle,{color:t.textTableHighlight}],testID:`settings-glucose-overall-all-day-target`,children:k.target})})]}),(0,G.jsx)(Jf,{style:[E9.resetContainer,{borderColor:t.divider}],disabled:!D,onPress:ye(()=>h(!0)),children:(0,G.jsx)(Q,{style:[E9.resetText,D?{color:t.textButtonSecondaryDanger}:{color:t.textButtonSecondaryDangerDisabled}],children:e(`button_reset_default`)})})]}),(0,G.jsxs)(y9,{columnDisposition:[1,2],children:[(0,G.jsx)(f3,{title:e(`table_variable_title`),message:e(`table_variable_body`),value:!D,testID:`daily-interval-switch`,onValueChange:ye(ce),style:E9.switchContainer}),(0,G.jsxs)(_9,{disabled:D,testID:`settings-glucose-variable-header`,children:[(0,G.jsxs)(x9,{style:E9.tableFirstCell,testID:`settings-glucose-variable-header-time`,children:[(0,G.jsx)(Q,{style:[E9.headerTitle,{color:t.textTableActive}],maxFontSizeMultiplier:S2.s2,children:e(`table_variable_time`)}),(0,G.jsx)(Q,{style:[E9.headerSubtitle,{color:t.textTableSecondary}],children:e(`table_variable_time_unit`)})]}),(0,G.jsxs)(x9,{testID:`settings-glucose-variable-header-target`,children:[(0,G.jsx)(Q,{style:[E9.headerTitle,{color:t.textTableActive}],maxFontSizeMultiplier:S2.s2,children:e(`table_fixed_target`)}),(0,G.jsx)(Q,{style:[E9.headerSubtitle,{color:t.textTableSecondary}],children:le})]})]}),O.map((e,n)=>(0,G.jsxs)(v9,{disabled:D,children:[(0,G.jsxs)(b9,{style:E9.tableFirstCell,onPress:ye(()=>{fe(n)}),children:[(0,G.jsx)(Q,{style:[E9.title,{color:t.textTableHighlight}],children:e.startTime}),(0,G.jsx)(Q,{style:[E9.subtitle,{color:t.textTableSecondary}],children:gvt[Object.keys(wq)[n]]()})]}),(0,G.jsx)(b9,{onPress:ye(()=>{oe(n)}),children:(0,G.jsx)(Q,{style:[E9.title,{color:t.textTableHighlight}],testID:`settings-glucose-variable-target-${Object.keys(wq)[n].toLowerCase()}`,children:e.target})})]},e.startTime)),(0,G.jsx)(Jf,{style:[E9.resetContainer,{borderColor:t.divider}],disabled:D,onPress:ye(()=>{h(!0)}),children:(0,G.jsx)(Q,{style:[E9.resetText,D?{color:t.textButtonSecondaryDangerDisabled}:{color:t.textButtonSecondaryDanger}],children:e(`button_reset_default`)})})]})]}),(0,G.jsx)(Q5,{isVisible:f,items:ue,onConfirm:F,onCancel:he,initialScrollIndex:de,onModalHide:I,testID:`settings-glucose-target-wheel-picker`}),(0,G.jsx)(dvn,{isVisible:u,initialValue:o?.current??new Date,min:o?.min,max:o?.max,onConfirm:pe,onCancel:me,onModalHide:I}),(0,G.jsx)(u3,{isVisible:m,title:e(`physical_activity_modal_reset_title `),onModalHide:I,buttons:[{title:e(`button_reset`),type:H4.Error,onPress:N},{title:e(`button_cancel`),type:H4.Secondary,onPress:()=>{h(!1)}}]}),(0,G.jsx)(t7,{onModalHide:()=>{l(void 0)}}),(0,G.jsx)(q_n,{isVisible:v,onModalHide:ge,onEnterPIN:L,onCancel:()=>y(!1)}),(0,G.jsx)(H_n,{isVisible:b,onClose:()=>x(!1),onModalHide:be,onForgotPIN:()=>{M(!0),x(!1)},onModalHideWithSuccess:ve}),(0,G.jsx)(K_n,{})]})}var _vn=f7(gvn),E9=z.create({scrollView:{paddingHorizontal:16},scrollViewContent:{flexGrow:1,gap:32},updatedAtText:{...X.Poppins.regular_SM,textAlign:`center`},tableFirstCell:{alignItems:`flex-start`,paddingLeft:16,borderLeftWidth:0},resetContainer:{alignItems:`center`,padding:16,borderTopWidth:1},resetText:{...X.Poppins.semiBold_Base,textAlign:`center`},headerTitle:{...X.Poppins.medium_SM},headerSubtitle:{...X.Poppins.medium_XS},title:{...X.Poppins.medium_Base},fixedValueTitle:{...X.Poppins.medium_Base,paddingVertical:8},subtitle:{...X.Poppins.regular_XS},switchContainer:{borderBottomLeftRadius:0,borderBottomRightRadius:0}});H();var vvn=e=>{let{t}=Sq(),{COLORS:n}=Y(),{glucoseUnit:r,isError:i,onPressMGDL:a,onPressMMOLL:o}=e,s=r===Z.BloodGlucoseUnit.MMOL_L,c=r===Z.BloodGlucoseUnit.MG_DL;return(0,G.jsxs)(V,{style:D9.unitsContainer,children:[(0,G.jsxs)(Cp,{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,G.jsx)(Q,{style:[D9.unitText,{color:s?n.textLabelActive:n.textLabelInactive}],children:t(`glucose_unit_mmol/l`)}),(0,G.jsx)(Q,{style:[D9.exampleText,{color:s?n.textLabelActive:n.textLabelInactive}],children:t(`example`)}),(0,G.jsx)(Q,{style:[D9.unitExampleText,{color:s?n.textLabelActive:n.textLabelInactive}],maxFontSizeMultiplier:S2.s2,children:t(`glucose_unit_example_mmol/L`)})]}),(0,G.jsxs)(Cp,{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,G.jsx)(Q,{style:[D9.unitText,{color:c?n.textLabelActive:n.textLabelInactive}],children:t(`glucose_unit_mg/dl`)}),(0,G.jsx)(Q,{style:[D9.exampleText,{color:c?n.textLabelActive:n.textLabelInactive}],children:t(`example`)}),(0,G.jsx)(Q,{style:[D9.unitExampleText,{color:c?n.textLabelActive:n.textLabelInactive}],maxFontSizeMultiplier:S2.s2,children:t(`glucose_unit_example_mg/dl`)})]})]})},D9=z.create({unitsContainer:{flexDirection:`row`,justifyContent:`space-between`,gap:12},unitButton:{flex:1,paddingHorizontal:14,paddingVertical:10,borderRadius:16,borderWidth:2},unitText:{...X.Poppins.medium_Base,marginBottom:8},exampleText:{...X.Poppins.medium_XS,marginBottom:4},unitExampleText:{...X.Poppins.regular_XS}});H();var yvn=()=>{let{modalStoreActions:e}=z5(),t=M5(),n=(0,U.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,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(V,{style:[bvn.container,{paddingTop:t+16}],children:(0,G.jsx)(vvn,{onPressMMOLL:()=>n(Z.BloodGlucoseUnit.MMOL_L),onPressMGDL:()=>n(Z.BloodGlucoseUnit.MG_DL),glucoseUnit:k8.glucoseUnit})}),(0,G.jsx)(t7,{})]})},bvn=z.create({container:{paddingHorizontal:16}}),xvn=f7(yvn);H();var Svn=()=>{let{t:e}=Sq(),{COLORS:t}=Y(),n=A$(),{bottomWithScroll:r}=Q4(),i=M5();return(0,G.jsxs)(ds,{contentContainerStyle:[O9.scrollView,{paddingBottom:r,paddingTop:i+16}],testID:`legal-page-scrollview`,children:[(0,G.jsx)(Q,{style:O9.title,children:e(`legal_title`)}),(0,G.jsxs)(V,{style:O9.section,children:[(0,G.jsx)(Q7t,{testID:`manufacturer-symbol`,color:t.bgPrimary}),(0,G.jsx)(Q,{style:[O9.textContainer,{color:t.labelSecondary}],children:ein})]}),(0,G.jsxs)(V,{style:O9.section,children:[(0,G.jsx)(Z7t,{testID:`manual-icon`}),(0,G.jsx)(Q,{testID:`manual-button`,style:[O9.manualText,{color:t.textLink}],onPress:()=>{u8(l8.SettingsIFU),n.navigate(F5.IFU)},children:e(`legal_IFU`)})]}),(0,G.jsxs)(V,{style:O9.section,children:[(0,G.jsx)(r9t,{testID:`SN-symbol`}),(0,G.jsx)(Q,{style:[O9.textContainer,{color:t.labelSecondary}],children:c8})]}),(0,G.jsxs)(V,{style:O9.section,children:[(0,G.jsx)(z7t,{testID:`ce-logo`}),(0,G.jsx)(Q,{style:[O9.alignTop,{color:t.labelSecondary}],children:e(`legal_ce_mark_text`)})]}),(0,G.jsxs)(V,{style:O9.section,children:[(0,G.jsx)(Q7t,{color:t.labelPrimary}),(0,G.jsxs)(V,{style:O9.textContainer,children:[(0,G.jsx)(Q,{style:[O9.sectionTitle,{color:t.labelSecondary}],children:e(`legal_company_name`)}),(0,G.jsx)(Q,{style:{color:t.labelSecondary},children:e(`legal_company_adress`)}),(0,G.jsx)(Q,{style:{color:t.labelSecondary},children:e(`legal_company_country`)}),(0,G.jsx)(Q,{style:{color:t.labelSecondary},children:e(`legal_company_email`)}),(0,G.jsx)(Q,{style:{color:t.labelSecondary},children:e(`legal_company_cvr_vat`)})]})]}),(0,G.jsxs)(V,{style:[O9.section,O9.udiSection],children:[(0,G.jsx)(i9t,{testID:`udi-logo`,style:O9.udiLogo}),(0,G.jsxs)(Q,{style:[O9.textContainer,O9.udiText,{color:t.labelSecondary}],children:[(0,G.jsx)(Q,{style:{color:t.labelSecondary},children:`(01)${nin}(10)`}),(0,G.jsx)(Q,{style:{color:t.labelSecondary},children:`${c8}(8012)${c8}`})]})]}),(0,G.jsxs)(V,{style:O9.sectionColumn,children:[(0,G.jsx)(a9t,{testID:`uk-rep-logo`,style:O9.repIcon}),(0,G.jsx)(Q,{style:{color:t.labelSecondary},children:e(`legal_ukrep`)})]}),Tq?null:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Q,{style:[O9.sectionTitle,{color:t.labelSecondary}],children:e(`more_legal_novo_nordisk_disclaimer_title`)}),(0,G.jsx)(Q,{style:{color:t.labelSecondary},children:e(`more_legal_novo_nordisk_disclaimer_text`)})]})]})},O9=z.create({scrollView:{paddingTop:32,paddingHorizontal:16},title:{...X.Poppins.regular_SM,textAlign:`center`,marginBottom:32},section:{flexDirection:`row`,marginBottom:32},sectionTitle:{...X.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:{...X.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`}});H();var Cvn=()=>{let e=new Date().getFullYear();return[...Array(12).keys()].map(t=>I8(new Date(e,t),`MMM`))},wvn=()=>{let e=1900,t=new Date().getFullYear()-e+1;return Array.from({length:t},(t,n)=>(n+e).toString())},Tvn=(e,t)=>mpn(new Date(e,t)),Evn=Cvn(),Dvn=Array.from({length:31},(e,t)=>(t+1).toString().padStart(2,`0`)),Ovn=wvn();function kvn({isVisible:e,initialValue:t,onCancel:n,onConfirm:r,onModalHide:i}){let{COLORS:a}=Y(),{width:o}=$p(),s=(0,U.useRef)(null),c=(0,U.useRef)(null),l=(0,U.useRef)(null),[u,d]=(0,U.useState)(t);(0,U.useEffect)(()=>{e&&d(e=>e.getTime()===t.getTime()?e:new Date(t))},[t,e]);let f=(0,U.useMemo)(()=>t.getDate()-1,[t]),p=(0,U.useMemo)(()=>t.getMonth(),[t]),m=(0,U.useMemo)(()=>{let e=t.getFullYear();return Ovn.indexOf(e.toString())},[t]),h=(0,U.useMemo)(()=>u.getDate()-1,[u]),g=(0,U.useMemo)(()=>u.getMonth(),[u]),_=(0,U.useMemo)(()=>u.getFullYear(),[u]),v=(0,U.useCallback)(()=>{r(u)},[r,u]),y=(0,U.useCallback)(()=>{d(t),n()},[n,t]),b=(0,U.useCallback)(e=>{let t=Tvn(_,e)-1;d(new Date(_,e,Math.min(h,t)+1)),h>t&&s.current?.scrollToIndex(t)},[h,_]),x=(0,U.useCallback)(e=>{let t=Tvn(_,g)-1;d(new Date(_,g,Math.min(e,t)+1)),e>t&&s.current?.scrollToIndex(t)},[g,_]),S=(0,U.useCallback)(e=>{let t=parseInt(Ovn[e],10),n=Tvn(t,g)-1;d(new Date(t,g,Math.min(h,n)+1)),h>n&&s.current?.scrollToIndex(n)},[h,g]);return(0,G.jsx)(u3,{isVisible:e,containerStyle:{backgroundColor:a.bgTransparent},onModalHide:i,children:(0,G.jsxs)(V,{children:[(0,G.jsxs)(V,{style:k9.pickersContainer,children:[(0,G.jsx)(Z5,{ref:c,initialScrollIndex:p,options:Evn,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,G.jsx)(Z5,{ref:s,initialScrollIndex:f,options:Dvn,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,G.jsx)(Z5,{ref:l,initialScrollIndex:m,options:Ovn,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,G.jsxs)(V,{style:k9.buttonContainer,children:[(0,G.jsx)(X5,{onPress:v}),(0,G.jsx)(Y5,{onPress:y})]})]})})}var Avn=U.memo(kvn),k9=z.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}}),jvn=a3(0,220),Mvn=a3(0,300),Nvn=f7(({isVisible:e,onCancel:t,onModalHide:n})=>{let{t:r}=Sq(),{isOnboardingFinished:i}=E3(),{biologicalSex:a}=s7(),{setSetupCalculatorStoreValues:o}=o7(),{modalStoreActions:s}=z5(),c=i?k8.biologicalSex:a,[l,u]=(0,U.useState)(void 0),d=!k8.biologicalSex,f=+!!d,p=(0,U.useMemo)(()=>{switch(c){case Z.BiologicalSex.Male:return 0;case Z.BiologicalSex.Female:return 1;case Z.BiologicalSex.Unspecified:return 2;default:return 0}},[c]),m=(0,U.useCallback)(async(e,n)=>{if(d&&n===0){o({biologicalSex:void 0}),t();return}let r=n-f,a=Z.BiologicalSex.Male;if(r===1&&(a=Z.BiologicalSex.Female),r===2&&(a=Z.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,U.useCallback)(()=>{l===!1?s.set({showSyncErrorModal:!0}):n&&n(),u(void 0)},[s,l,n]);return(0,G.jsxs)(G.Fragment,{children:[(0,G.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,G.jsx)(t7,{})]})}),Pvn=f7(({isVisible:e,onCancel:t,onModalHide:n})=>{let{t:r}=Sq(),{modalStoreActions:i}=z5(),a=k8.diabetesType,[o,s]=(0,U.useState)(!1),[c,l]=(0,U.useState)(void 0),u=(0,U.useMemo)(()=>a===Z.DiabetesType.Type1?0:1,[a]),d=(0,U.useCallback)(async(e,n)=>{let r=n===0?Z.DiabetesType.Type1:Z.DiabetesType.Type2;if(a===r){t();return}l(await k8.postUserSettings({diabetesType:r})),t()},[a,t]),f=(0,U.useCallback)(()=>{s(!1)},[]),p=(0,U.useCallback)(()=>{c===!1?i.set({showSyncErrorModal:!0}):c&&a===Z.DiabetesType.Type2?s(!0):n&&n(),l(void 0)},[i,c,a,n]);return(0,G.jsxs)(G.Fragment,{children:[(0,G.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,G.jsx)(u3,{title:r(`modal_diabetes2_title`),isVisible:o,message:r(`modal_diabetes2_body`),onModalHide:n,buttons:[{title:r(`button_close`),onPress:f}]}),(0,G.jsx)(t7,{})]})});H(),J0();function Fvn(){let{t:e}=Sq(),{COLORS:t}=Y(),{bottom:n}=V0(),{modalStoreActions:r}=z5(),{colorScheme:i}=g2(),a=C2(i),[o,s]=(0,U.useState)(!1),[c,l]=(0,U.useState)(!1),[u,d]=(0,U.useState)(!1),[f,p]=(0,U.useState)(!1),[m,h]=(0,U.useState)(!1),[g,_]=(0,U.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,U.useMemo)(()=>v?new Date(v):void 0,[v]),w=(0,U.useMemo)(()=>y===Z.DiabetesType.Type1?`type_of_diabetes_type1`:`type_of_diabetes_type2`,[y]),T=(0,U.useCallback)(async e=>{e!==S&&_(await k8.postUserSettings({height:e})),d(!1)},[S]),E=(0,U.useCallback)(async e=>{e!==x&&_(await k8.postUserSettings({weight:e})),p(!1)},[x]),D=(0,U.useMemo)(()=>{if(S===void 0)return 0;let e=Math.round(S*10)/10;return jvn.indexOf(e.toString())},[S]),O=(0,U.useMemo)(()=>{if(x===void 0)return 0;let e=Math.round(x*10)/10;return Mvn.indexOf(e.toString())},[x]),k=async e=>{e.toISOString()!==v&&_(await k8.postUserSettings({birthday:e.toISOString()})),h(!1)},A=(0,U.useCallback)(()=>{g===!1&&r.set({showSyncErrorModal:!0}),_(void 0)},[r,g]),ee=(0,U.useCallback)(()=>{A()},[A]);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(V,{children:(0,G.jsxs)(Y4.Container,{children:[(0,G.jsx)(Y4,{title:e(`my_profile_birth`),value:C?C.toLocaleDateString():`-`,testID:`date-of-birth`,onPress:()=>{h(!0)}}),(0,G.jsx)(Y4,{title:e(`my_profile_diabetes_type`),value:e(w),testID:`diabetes-type`,onPress:()=>{s(!0)}}),(0,G.jsx)(Y4,{title:e(`my_profile_sex`),testID:`biologicalSex`,value:b?_vt[b]():`-`,onPress:()=>{l(!0)}}),(0,G.jsx)(Y4,{title:e(`my_profile_height`),value:`${S??`-`} cm`,testID:`height`,onPress:()=>{d(!0)}}),(0,G.jsx)(Y4,{title:e(`my_profile_weight`),value:`${x??`-`} kg`,testID:`weight`,onPress:()=>{p(!0)}})]})}),Eq?(0,G.jsx)(Vpn,{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:Wpn,customCancelButtonIOS:Gpn,pickerContainerStyleIOS:{backgroundColor:t.iosKeyboardPicker},modalStyleIOS:{paddingBottom:n},themeVariant:a,isDarkModeEnabled:a===`dark`,onHide:ee,pickerStyleIOS:{alignSelf:`center`}}):(0,G.jsx)(Avn,{isVisible:m,initialValue:C??new Date,onConfirm:k,onCancel:()=>{h(!1)},onModalHide:ee}),(0,G.jsx)(Pvn,{isVisible:o,onCancel:()=>{s(!1)},onModalHide:A}),(0,G.jsx)(Nvn,{isVisible:c,onCancel:()=>{l(!1)},onModalHide:A}),(0,G.jsx)(Q5,{isVisible:u,items:jvn,onConfirm:T,onCancel:()=>{d(!1)},initialScrollIndex:D,onModalHide:A,testID:`height_wheel_picker`}),(0,G.jsx)(Q5,{isVisible:f,items:Mvn,onConfirm:E,onCancel:()=>{p(!1)},initialScrollIndex:O,onModalHide:A,testID:`weight_wheel_picker`}),(0,G.jsx)(t7,{onModalHide:()=>{_(void 0)}})]})}var Ivn=f7(Fvn);H();function Lvn(){let{t:e}=Sq();return(0,G.jsxs)(ds,{testID:`profile-screen-scroll`,style:Rvn.scrollView,contentContainerStyle:Rvn.contentContainer,children:[(0,G.jsx)(Y4,{title:e(`my_profile_account`),testID:`first-name`,renderRightSlot:()=>(0,G.jsx)(K4,{}),onPress:()=>{window.location.href=`/account`}}),(0,G.jsx)(Ivn,{})]})}var Rvn=z.create({scrollView:{paddingHorizontal:16},contentContainer:{paddingVertical:32,flexGrow:1,gap:24}});H(),new Df(vi.RNDeviceInfo);var zvn=c({getBaseOs:()=>oyn,getBatteryLevel:()=>nyn,getBatteryLevelSync:()=>ryn,getFreeDiskStorage:()=>lyn,getFreeDiskStorageSync:()=>uyn,getInstallReferrer:()=>Xvn,getInstallReferrerSync:()=>Hvn,getMaxMemory:()=>dyn,getMaxMemorySync:()=>Vvn,getPowerState:()=>myn,getPowerStateSync:()=>hyn,getTotalDiskCapacity:()=>syn,getTotalDiskCapacitySync:()=>cyn,getTotalMemory:()=>pyn,getTotalMemorySync:()=>Kvn,getUsedMemory:()=>fyn,getUsedMemorySync:()=>qvn,getUserAgent:()=>Zvn,getUserAgentSync:()=>Wvn,isAirplaneMode:()=>ayn,isAirplaneModeSync:()=>Uvn,isBatteryCharging:()=>Qvn,isBatteryChargingSync:()=>$vn,isCameraPresent:()=>eyn,isCameraPresentSync:()=>tyn,isLocationEnabled:()=>iyn,isLocationEnabledSync:()=>Gvn}),A9,j9,Bvn,M9,N9,Vvn,Hvn,Uvn,Wvn,Gvn,Kvn,qvn,Jvn,Yvn,Xvn,Zvn,Qvn,$vn,eyn,tyn,nyn,ryn,iyn,ayn,oyn,syn,cyn,lyn,uyn,dyn,fyn,pyn,myn,hyn,gyn=o((()=>{H(),A9=new Df(vi.RNDeviceInfo),j9=!1,Bvn=-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}},Vvn=()=>window.performance&&window.performance.memory?window.performance.memory.jsHeapSizeLimit:-1,Hvn=()=>document.referrer,Uvn=()=>!!navigator.onLine,Wvn=()=>window.navigator.userAgent,Gvn=()=>!!navigator.geolocation,Kvn=()=>navigator.deviceMemory?navigator.deviceMemory*1e9:-1,qvn=()=>window.performance&&window.performance.memory?window.performance.memory.usedJSHeapSize:-1,Jvn=()=>{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;Bvn=t,M9=N9(e),A9.emit(`RNDeviceInfo_batteryLevelDidChange`,t),t<.2&&A9.emit(`RNDeviceInfo_batteryLevelIsLow`,t)})})},Yvn=()=>{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},Jvn(),Xvn=async()=>Hvn(),Zvn=async()=>Wvn(),Qvn=async()=>navigator.getBattery?navigator.getBattery().then(e=>e.charging):!1,$vn=()=>j9,eyn=async()=>navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices?navigator.mediaDevices.enumerateDevices().then(e=>!!e.find(e=>e.kind===`videoinput`)):!1,tyn=()=>(console.log(`[react-native-device-info] isCameraPresentSync not supported - please use isCameraPresent`),!1),nyn=async()=>navigator.getBattery?navigator.getBattery().then(e=>e.level):-1,ryn=()=>Bvn,iyn=async()=>Gvn(),ayn=async()=>Uvn(),oyn=async()=>Yvn(),syn=async()=>navigator.storage&&navigator.storage.estimate?navigator.storage.estimate().then(({quota:e})=>e):-1,cyn=()=>(console.log(`[react-native-device-info] getTotalDiskCapacitySync not supported - please use getTotalDiskCapacity`),-1),lyn=async()=>navigator.storage&&navigator.storage.estimate?navigator.storage.estimate().then(({quota:e,usage:t})=>e-t):-1,uyn=()=>(console.log(`[react-native-device-info] getFreeDiskStorageSync not supported - please use getFreeDiskStorage`),-1),dyn=async()=>Vvn(),fyn=async()=>qvn(),pyn=async()=>Kvn(),myn=async()=>navigator.getBattery?navigator.getBattery().then(e=>N9(e)):{},hyn=()=>M9}));H();var _yn=vi.RNDeviceInfo;if((B.OS===`web`||B.OS===`dom`)&&(_yn=(gyn(),d(zvn))),!_yn&&(B.OS===`android`||B.OS===`ios`||B.OS===`web`||B.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 $=_yn;H();var P9={};function vyn(e,t,n){let r={};return e.filter(e=>B.OS==e).forEach(e=>r[e]=t),B.select({...r,default:n})}function yyn({getter:e,supportedPlatforms:t,defaultValue:n,memoKey:r}){if(r&&P9[r]!=null)return P9[r];{let i=vyn(t,e,()=>n)();return r&&(P9[r]=i),i}}async function byn({getter:e,supportedPlatforms:t,defaultValue:n,memoKey:r}){if(r&&P9[r]!=null)return P9[r];{let i=await vyn(t,e,()=>Promise.resolve(n))();return r&&(P9[r]=i),i}}function F9({syncGetter:e,...t}){return[(...e)=>byn({...t,getter:()=>t.getter(...e)}),(...n)=>yyn({...t,getter:()=>e(...n)})]}H();var[xyn,Syn]=F9({memoKey:`uniqueId`,supportedPlatforms:[`android`,`ios`,`windows`],getter:()=>$.getUniqueId(),syncGetter:()=>$.getUniqueIdSync(),defaultValue:`unknown`}),[Cyn,wyn]=F9({memoKey:`instanceId`,supportedPlatforms:[`android`],getter:()=>$.getInstanceId(),syncGetter:()=>$.getInstanceIdSync(),defaultValue:`unknown`}),[Tyn,Eyn]=F9({memoKey:`serialNumber`,supportedPlatforms:[`android`,`windows`],getter:()=>$.getSerialNumber(),syncGetter:()=>$.getSerialNumberSync(),defaultValue:`unknown`}),[Dyn,Oyn]=F9({memoKey:`androidId`,supportedPlatforms:[`android`],getter:()=>$.getAndroidId(),syncGetter:()=>$.getAndroidIdSync(),defaultValue:`unknown`}),[kyn,Ayn]=F9({supportedPlatforms:[`android`,`ios`,`windows`],getter:()=>$.getIpAddress(),syncGetter:()=>$.getIpAddressSync(),defaultValue:`unknown`}),[jyn,Myn]=F9({supportedPlatforms:[`android`,`windows`,`web`],getter:()=>$.isCameraPresent(),syncGetter:()=>$.isCameraPresentSync(),defaultValue:!1}),[Nyn,Pyn]=F9({memoKey:`manufacturer`,supportedPlatforms:[`android`,`ios`,`windows`],getter:()=>B.OS==`ios`?Promise.resolve(`Apple`):$.getSystemManufacturer(),syncGetter:()=>B.OS==`ios`?`Apple`:$.getSystemManufacturerSync(),defaultValue:`unknown`}),Fyn=()=>yyn({defaultValue:`unknown`,supportedPlatforms:[`ios`,`android`,`windows`],memoKey:`systemName`,getter:()=>B.select({ios:$.systemName,android:`Android`,windows:`Windows`,default:`unknown`})}),Iyn=()=>yyn({defaultValue:`unknown`,getter:()=>$.systemVersion,supportedPlatforms:[`android`,`ios`,`windows`],memoKey:`systemVersion`}),[Lyn,Ryn]=F9({memoKey:`buildId`,supportedPlatforms:[`android`,`ios`,`windows`],getter:()=>$.getBuildId(),syncGetter:()=>$.getBuildIdSync(),defaultValue:`unknown`}),[zyn,Byn]=F9({memoKey:`apiLevel`,supportedPlatforms:[`android`],getter:()=>$.getApiLevel(),syncGetter:()=>$.getApiLevelSync(),defaultValue:-1}),[Vyn,Hyn]=F9({memoKey:`installerPackageName`,supportedPlatforms:[`android`,`windows`,`ios`],getter:()=>$.getInstallerPackageName(),syncGetter:()=>$.getInstallerPackageNameSync(),defaultValue:`unknown`}),[Uyn,Wyn]=F9({supportedPlatforms:[`android`,`ios`,`windows`],getter:()=>$.getDeviceName(),syncGetter:()=>$.getDeviceNameSync(),defaultValue:`unknown`}),[Gyn,Kyn]=F9({supportedPlatforms:[`android`,`ios`,`windows`,`web`],getter:()=>$.getUsedMemory(),syncGetter:()=>$.getUsedMemorySync(),defaultValue:-1}),[qyn,Jyn]=F9({supportedPlatforms:[`android`,`ios`,`windows`],getter:()=>$.getFontScale(),syncGetter:()=>$.getFontScaleSync(),defaultValue:-1}),[Yyn,Xyn]=F9({memoKey:`bootloader`,supportedPlatforms:[`android`],getter:()=>$.getBootloader(),syncGetter:()=>$.getBootloaderSync(),defaultValue:`unknown`}),[Zyn,Qyn]=F9({getter:()=>$.getDevice(),syncGetter:()=>$.getDeviceSync(),defaultValue:`unknown`,memoKey:`device`,supportedPlatforms:[`android`]}),[$yn,ebn]=F9({memoKey:`display`,supportedPlatforms:[`android`],getter:()=>$.getDisplay(),syncGetter:()=>$.getDisplaySync(),defaultValue:`unknown`}),[tbn,nbn]=F9({memoKey:`fingerprint`,supportedPlatforms:[`android`],getter:()=>$.getFingerprint(),syncGetter:()=>$.getFingerprintSync(),defaultValue:`unknown`}),[rbn,ibn]=F9({memoKey:`hardware`,supportedPlatforms:[`android`],getter:()=>$.getHardware(),syncGetter:()=>$.getHardwareSync(),defaultValue:`unknown`}),[abn,obn]=F9({memoKey:`host`,supportedPlatforms:[`android`,`windows`],getter:()=>$.getHost(),syncGetter:()=>$.getHostSync(),defaultValue:`unknown`}),[sbn,cbn]=F9({memoKey:`hostNames`,supportedPlatforms:[`windows`],getter:()=>$.getHostNames(),syncGetter:()=>$.getHostNamesSync(),defaultValue:[]}),[lbn,ubn]=F9({memoKey:`product`,supportedPlatforms:[`android`],getter:()=>$.getProduct(),syncGetter:()=>$.getProductSync(),defaultValue:`unknown`}),[dbn,fbn]=F9({memoKey:`tags`,supportedPlatforms:[`android`],getter:()=>$.getTags(),syncGetter:()=>$.getTagsSync(),defaultValue:`unknown`}),[pbn,mbn]=F9({memoKey:`type`,supportedPlatforms:[`android`],getter:()=>$.getType(),syncGetter:()=>$.getTypeSync(),defaultValue:`unknown`}),[hbn,gbn]=F9({memoKey:`baseOs`,supportedPlatforms:[`android`,`web`,`windows`],getter:()=>$.getBaseOs(),syncGetter:()=>$.getBaseOsSync(),defaultValue:`unknown`}),[_bn,vbn]=F9({memoKey:`previewSdkInt`,supportedPlatforms:[`android`],getter:()=>$.getPreviewSdkInt(),syncGetter:()=>$.getPreviewSdkIntSync(),defaultValue:-1}),[ybn,bbn]=F9({memoKey:`securityPatch`,supportedPlatforms:[`android`],getter:()=>$.getSecurityPatch(),syncGetter:()=>$.getSecurityPatchSync(),defaultValue:`unknown`}),[xbn,Sbn]=F9({memoKey:`codeName`,supportedPlatforms:[`android`],getter:()=>$.getCodename(),syncGetter:()=>$.getCodenameSync(),defaultValue:`unknown`}),[Cbn,wbn]=F9({memoKey:`incremental`,supportedPlatforms:[`android`],getter:()=>$.getIncremental(),syncGetter:()=>$.getIncrementalSync(),defaultValue:`unknown`}),[Tbn,Ebn]=F9({memoKey:`emulator`,supportedPlatforms:[`android`,`ios`,`windows`],getter:()=>$.isEmulator(),syncGetter:()=>$.isEmulatorSync(),defaultValue:!1}),[Dbn,Obn]=F9({supportedPlatforms:[`android`,`ios`,`windows`],getter:()=>$.isPinOrFingerprintSet(),syncGetter:()=>$.isPinOrFingerprintSetSync(),defaultValue:!1}),[kbn,Abn]=F9({supportedPlatforms:[`android`],getter:()=>$.hasGms(),syncGetter:()=>$.hasGmsSync(),defaultValue:!1}),[jbn,Mbn]=F9({supportedPlatforms:[`android`],getter:()=>$.hasHms(),syncGetter:()=>$.hasHmsSync(),defaultValue:!1}),[Nbn,Pbn]=F9({memoKey:`firstInstallTime`,supportedPlatforms:[`android`,`ios`,`windows`],getter:()=>$.getFirstInstallTime(),syncGetter:()=>$.getFirstInstallTimeSync(),defaultValue:-1}),[Fbn,Ibn]=F9({memoKey:`installReferrer`,supportedPlatforms:[`android`,`windows`,`web`],getter:()=>$.getInstallReferrer(),syncGetter:()=>$.getInstallReferrerSync(),defaultValue:`unknown`}),[Lbn,Rbn]=F9({memoKey:`lastUpdateTime`,supportedPlatforms:[`android`],getter:()=>$.getLastUpdateTime(),syncGetter:()=>$.getLastUpdateTimeSync(),defaultValue:-1}),[zbn,Bbn]=F9({memoKey:`startupTime`,supportedPlatforms:[`android`,`ios`],getter:()=>$.getStartupTime(),syncGetter:()=>$.getStartupTimeSync(),defaultValue:-1}),[Vbn,Hbn]=F9({supportedPlatforms:[`android`,`ios`],getter:()=>$.getCarrier(),syncGetter:()=>$.getCarrierSync(),defaultValue:`unknown`}),[Ubn,Wbn]=F9({memoKey:`totalMemory`,supportedPlatforms:[`android`,`ios`,`windows`,`web`],getter:()=>$.getTotalMemory(),syncGetter:()=>$.getTotalMemorySync(),defaultValue:-1}),[Gbn,Kbn]=F9({memoKey:`maxMemory`,supportedPlatforms:[`android`,`windows`,`web`],getter:()=>$.getMaxMemory(),syncGetter:()=>$.getMaxMemorySync(),defaultValue:-1}),[qbn,Jbn]=F9({supportedPlatforms:[`android`,`ios`,`windows`,`web`],getter:()=>$.getTotalDiskCapacity(),syncGetter:()=>$.getTotalDiskCapacitySync(),defaultValue:-1}),[Ybn,Xbn]=F9({supportedPlatforms:[`android`,`ios`,`windows`,`web`],getter:(e=`total`)=>B.OS===`ios`?$.getFreeDiskStorage(e):$.getFreeDiskStorage(),syncGetter:(e=`total`)=>B.OS===`ios`?$.getFreeDiskStorageSync(e):$.getFreeDiskStorageSync(),defaultValue:-1}),[Zbn,Qbn]=F9({supportedPlatforms:[`android`,`ios`,`windows`,`web`],getter:()=>$.getBatteryLevel(),syncGetter:()=>$.getBatteryLevelSync(),defaultValue:-1}),[$bn,exn]=F9({supportedPlatforms:[`ios`,`android`,`windows`,`web`],getter:()=>$.getPowerState(),syncGetter:()=>$.getPowerStateSync(),defaultValue:{}}),[txn,nxn]=F9({supportedPlatforms:[`android`,`ios`,`windows`,`web`],getter:()=>$.isBatteryCharging(),syncGetter:()=>$.isBatteryChargingSync(),defaultValue:!1}),[rxn,ixn]=F9({supportedPlatforms:[`android`,`web`],getter:()=>$.isAirplaneMode(),syncGetter:()=>$.isAirplaneModeSync(),defaultValue:!1}),[axn,oxn]=F9({memoKey:`_supportedAbis`,supportedPlatforms:[`android`,`ios`,`windows`],getter:()=>$.getSupportedAbis(),syncGetter:()=>$.getSupportedAbisSync(),defaultValue:[]}),[sxn,cxn]=F9({memoKey:`_supported32BitAbis`,supportedPlatforms:[`android`],getter:()=>$.getSupported32BitAbis(),syncGetter:()=>$.getSupported32BitAbisSync(),defaultValue:[]}),[lxn,uxn]=F9({memoKey:`_supported64BitAbis`,supportedPlatforms:[`android`],getter:()=>$.getSupported64BitAbis(),syncGetter:()=>$.getSupported64BitAbisSync(),defaultValue:[]}),[dxn,fxn]=F9({supportedPlatforms:[`android`],getter:()=>$.getSystemAvailableFeatures(),syncGetter:()=>$.getSystemAvailableFeaturesSync(),defaultValue:[]}),[pxn,mxn]=F9({supportedPlatforms:[`android`,`ios`,`web`],getter:()=>$.isLocationEnabled(),syncGetter:()=>$.isLocationEnabledSync(),defaultValue:!1}),[hxn,gxn]=F9({supportedPlatforms:[`android`,`ios`],getter:()=>$.isHeadphonesConnected(),syncGetter:()=>$.isHeadphonesConnectedSync(),defaultValue:!1}),[_xn,vxn]=F9({supportedPlatforms:[`android`,`ios`],getter:()=>$.isWiredHeadphonesConnected(),syncGetter:()=>$.isWiredHeadphonesConnectedSync(),defaultValue:!1}),[yxn,bxn]=F9({supportedPlatforms:[`android`,`ios`],getter:()=>$.isBluetoothHeadphonesConnected(),syncGetter:()=>$.isBluetoothHeadphonesConnectedSync(),defaultValue:!1}),[xxn,Sxn]=F9({supportedPlatforms:[`windows`],getter:()=>$.isMouseConnected(),syncGetter:()=>$.isMouseConnectedSync(),defaultValue:!1}),[Cxn,wxn]=F9({supportedPlatforms:[`windows`],getter:()=>$.isKeyboardConnected(),syncGetter:()=>$.isKeyboardConnectedSync(),defaultValue:!1}),[Txn,Exn]=F9({supportedPlatforms:[`android`],getter:()=>$.getSupportedMediaTypeList(),syncGetter:()=>$.getSupportedMediaTypeListSync(),defaultValue:[]}),[Dxn,Oxn]=F9({supportedPlatforms:[`android`,`ios`],getter:()=>$.getAvailableLocationProviders(),syncGetter:()=>$.getAvailableLocationProvidersSync(),defaultValue:{}}),[kxn,Axn]=F9({supportedPlatforms:[`ios`],getter:()=>$.getBrightness(),syncGetter:()=>$.getBrightnessSync(),defaultValue:-1});new Df(vi.RNDeviceInfo),H();var jxn=()=>{let{t:e}=Sq(),{COLORS:t}=Y(),{navigate:n}=A$(),r=(0,U.useCallback)(async()=>{if(Tq)n(F5.SupportContact);else{let e=`App version: ${c8}\n${Fyn()} version: ${Iyn()}`;await Lre.openURL(`mailto:support@hedia.com?subject=Hedia support&body=${e}`)}},[n]);return(0,G.jsxs)(ds,{contentContainerStyle:Mxn.wrapper,children:[(0,G.jsx)(Q,{style:[Mxn.title,{color:t.labelPrimary}],children:e(`support_title`)}),(0,G.jsxs)(V,{style:Mxn.buttons,children:[(0,G.jsx)(U4,{title:e(`button_email`),onPress:r,testID:`send_email_button`}),(0,G.jsx)(U4,{title:e(`button_support_page`),onPress:()=>{n(F5.SupportWebView)},testID:`open_support_page_button`,type:H4.Secondary}),(0,G.jsx)(U4,{title:e(`button_instructions`),onPress:()=>{u8(l8.SettingsIFU),n(F5.IFU)},testID:`open_ifu_page_button`,type:H4.Secondary})]})]})},Mxn=z.create({wrapper:{flex:1,justifyContent:`center`,paddingHorizontal:16},title:{...X.Poppins.bold_2XL,marginBottom:48,textAlign:`center`},buttons:{gap:16}});H();var Nxn=()=>{let{t:e}=Sq(),{COLORS:t}=Y(),{colorScheme:n,setColorScheme:r}=g2(),i=M5(),{bottomWithScroll:a}=Q4(),o=(0,U.useCallback)(e=>{let t=`colorScheme-${e.toLowerCase()}`;return h2[e]===n?`${t}-selected`:t},[n]),s=(0,U.useCallback)(e=>{h2[e]!==n&&r(h2[e])},[n,r]);return(0,G.jsxs)(ds,{contentContainerStyle:[I9.scrollView,{paddingTop:i+16,paddingBottom:a}],children:[(0,G.jsxs)(Y4.Container,{children:[(0,G.jsx)(Y4,{title:e(`theme_system`),renderRightSlot:()=>(0,G.jsx)(V,{style:I9.checkmarkContainer,children:h2.System===n?(0,G.jsx)(G4,{width:24,height:24}):null}),onPress:()=>{s(`System`)},testID:o(`System`),displayType:J4.ListItem}),(0,G.jsx)(Y4,{title:e(`theme_dark`),renderRightSlot:()=>(0,G.jsx)(V,{style:I9.checkmarkContainer,children:h2.Dark===n?(0,G.jsx)(G4,{width:24,height:24}):null}),onPress:()=>{s(`Dark`)},testID:o(`Dark`),displayType:J4.ListItem}),(0,G.jsx)(Y4,{title:e(`theme_light`),renderRightSlot:()=>(0,G.jsx)(V,{style:I9.checkmarkContainer,children:h2.Light===n?(0,G.jsx)(G4,{width:24,height:24}):null}),onPress:()=>{s(`Light`)},testID:o(`Light`),displayType:J4.ListItem})]}),(0,G.jsx)(Q,{style:[I9.description,{color:t.labelSecondary}],testID:`settings-colorScheme-hint`,children:e(`theme_subtitle`)})]})},I9=z.create({scrollView:{paddingHorizontal:16,flexGrow:1},checkmarkContainer:{width:24,height:24},description:{...X.Poppins.regular_SM,margin:16}});H();var Pxn=()=>{let{COLORS:e}=Y(),{fontScale:t}=$p(),n=t.toFixed(3);return(0,G.jsxs)(V,{style:{backgroundColor:e.textWarning,borderRadius:16,padding:8},children:[(0,G.jsx)(Q,{style:[Fxn.text,{color:e.bgPrimary}],children:`Font scale: ${n}`}),(0,G.jsx)(Q,{style:[Fxn.textBold,{color:e.bgPrimary}],children:_q.HEDIA_SERVER_BASE_URL})]})},Fxn=z.create({text:{...X.Poppins.regular_Base,textAlign:`center`},textBold:{...X.Poppins.semiBold_Base,textAlign:`center`}});H();function Ixn(){let{t:e}=Sq(),{COLORS:t}=Y(),n=A$(),[r,i]=(0,U.useState)(!0),a=(0,U.useCallback)(()=>{u8(l8.SettingsProfile),n.navigate(F5.Profile)},[n]),o=(0,U.useCallback)(()=>{u8(l8.SettingsGlucose),n.navigate(F5.GlucoseSettings)},[n]),s=(0,U.useCallback)(()=>{u8(l8.SettingsInsulin),n.navigate(F5.InsulinSettingsStack,{screen:F5.InsulinSettings})},[n]),c=(0,U.useCallback)(()=>{u8(l8.SettingsActivity),n.navigate(F5.ActivitySettings)},[n]),l=(0,U.useCallback)(()=>{u8(l8.SettingsSupport),n.navigate(F5.Support)},[n]),u=(0,U.useCallback)(()=>{u8(l8.SettingsLegal),n.navigate(F5.Legal)},[n]);return(0,G.jsxs)(ds,{testID:`scroll-settings`,style:L9.scrollView,contentContainerStyle:L9.scrollViewContentContainer,contentInsetAdjustmentBehavior:`automatic`,children:[(0,G.jsx)(Y4,{title:e(`settings_card_my_profile`),testID:`edit-profile-button`,renderRightSlot:()=>(0,G.jsx)(K4,{}),onPress:a}),(0,G.jsxs)(Y4.Container,{children:[(0,G.jsx)(Y4,{title:e(`settings_card_glucose`),testID:`settings-glucose`,onPress:o,renderRightSlot:()=>(0,G.jsx)(K4,{})}),(0,G.jsx)(Y4,{title:e(`settings_card_insulin_settings`),testID:`settings-insulin`,onPress:s,renderRightSlot:()=>(0,G.jsx)(K4,{})}),(0,G.jsx)(Y4,{title:e(`settings_card_physical_activity`),testID:`settings-activity`,onPress:c,renderRightSlot:()=>(0,G.jsx)(K4,{})})]}),(0,G.jsxs)(Y4.Container,{children:[(0,G.jsx)(Y4,{title:e(`settings_support`),testID:`settings-support`,onPress:l,renderRightSlot:()=>(0,G.jsx)(K4,{})}),(0,G.jsx)(Y4,{title:e(`settings_card_legal`),testID:`settings-legal`,onPress:u,renderRightSlot:()=>(0,G.jsx)(K4,{})})]}),(0,G.jsx)(Jf,{onPress:()=>{i(!r)},style:L9.versionContainer,children:(0,G.jsx)(Q,{style:[L9.versionText,{color:t.labelSecondary}],children:r?c8:`(${tin})`})}),_q.IS_PRODUCTION!==`true`&&(0,G.jsx)(V,{children:(0,G.jsx)(Pxn,{})})]})}var L9=z.create({scrollView:{flex:1,paddingHorizontal:16},scrollViewContentContainer:{paddingVertical:32,flexGrow:1,gap:24},versionContainer:{alignItems:`center`,marginTop:`auto`},versionText:{...X.Poppins.regular_Base}});H();function Lxn(){let{COLORS:e}=Y();return(0,G.jsx)(V,{style:[Rxn.separator,{backgroundColor:e.divider}]})}var Rxn=z.create({separator:{height:1}}),R9=o3(Z.CONSTANTS.INSULIN_TO_CARBS_RATIO_MIN,Z.CONSTANTS.INSULIN_TO_CARBS_RATIO_MAX),z9=function(e){return e.DividendNumber=`109`,e.ExampleInsulinSensitivity=`2.2`,e}({}),zxn=function(e){return e.DividendNumber=`1960`,e.ExampleInsulinSensitivity=`39.2`,e}({}),Bxn=o3(Z.CONSTANTS.INSULIN_SENSITIVITY_MIN,Z.CONSTANTS.INSULIN_SENSITIVITY_MAX),Vxn=a3(5,393);H();var Hxn=({onPress:e,isVisible:t})=>{let{t:n}=Sq(),{COLORS:r}=Y();return(0,G.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,G.jsx)(Q,{testID:`insulin_settings_modal_carb_ratio_body`,style:[Uxn.bodyText,{color:r.labelSecondary}],children:n(`insulin_settings_modal_carb_ratio_body`)}),(0,G.jsx)(Q,{testID:`insulin_settings_modal_carb_ratio_example`,style:{color:r.labelSecondary},children:n(`insulin_settings_modal_carb_example_body`)})]})},Uxn=z.create({bodyText:{marginTop:12,marginBottom:16}});H();var Wxn=({glucoseUnit:e,onPress:t,isVisible:n})=>{let{t:r}=Sq(),{COLORS:i}=Y(),{text:a}=L8(e),o=e===Z.BloodGlucoseUnit.MMOL_L?z9.DividendNumber:zxn.DividendNumber,s=e===Z.BloodGlucoseUnit.MMOL_L?z9.ExampleInsulinSensitivity:zxn.ExampleInsulinSensitivity;return(0,G.jsxs)(u3,{title:r(`modal_insulin_seneitivity_title`),isVisible:n,enableScroll:!0,buttons:[{title:r(`button_close`),onPress:t,testID:`close-button`}],children:[(0,G.jsx)(Q,{testID:`insulin_sensitivity_modal_body`,style:[Gxn.bodyText,{color:i.labelSecondary}],children:r(`insulin_sensitivity_modal_body`,{dividerNumber:o})}),(0,G.jsx)(Q,{testID:`insulin_sensitivity_modal_example`,style:{color:i.labelSecondary},children:r(`insulin_sensitivity_modal_example`,{dividerNumber:o,displayResult:s,displayUnit:a})})]})},Gxn=z.create({bodyText:{marginTop:12,marginBottom:16}});H();var Kxn=()=>{let{t:e}=Sq(),{bloodGlucoseUnits:t}=s7(),n=k8.glucoseUnit??t;if(n===void 0)throw Error(`[HelpCalculatingSection::render] glucoseUnit must be defined.`);let[r,i]=(0,U.useState)(!1),[a,o]=(0,U.useState)(!1),s=n===Z.BloodGlucoseUnit.MMOL_L?z9.DividendNumber:zxn.DividendNumber;return(0,G.jsxs)(V,{children:[(0,G.jsx)(d3,{title:e(`insulin_settings_learn_more_title`)}),(0,G.jsxs)(Y4.Container,{children:[(0,G.jsx)(Y4,{testID:`info-insulin-carbs-ratio`,title:e(`insulin_settings_learn_more_carb_ratio`),onPress:()=>{o(!0)},displayType:J4.ListItem}),(0,G.jsx)(Y4,{testID:`info-insulin-sensitivity-${s}`,title:e(`insulin_settings_learn_more_sensitivity`),onPress:()=>{i(!0)},displayType:J4.ListItem})]}),(0,G.jsx)(Wxn,{onPress:()=>{i(!1)},glucoseUnit:n,isVisible:r}),(0,G.jsx)(Hxn,{onPress:()=>{o(!1)},isVisible:a})]})};H();var qxn=({withLockedSettings:e})=>{let{t}=Sq(),{COLORS:n}=Y(),{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,U.useState)(!1),[l,u]=(0,U.useState)(!1),[d,f]=(0,U.useState)(void 0),[p,m]=(0,U.useState)(0),[h,g]=(0,U.useState)(!1),[_,v]=(0,U.useState)(),y=(0,U.useCallback)(async e=>{let t=z8(e,i,Z.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,U.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,U.useMemo)(()=>[{title:t(`table_variable_insulin_time`),subtitle:t(`table_variable_time_unit`),scale:S2.s2},{title:t(`table_variable_insulin_sensitivity`),subtitle:t(`table_variable_insulin_sensitivity_unit`,{displayUnit:x}),scale:S2.s2},{title:t(`table_variable_insulin_carb`),subtitle:t(`table_variable_insulin_carb_unit`),scale:S2.s2}],[x,t]),C=(0,U.useMemo)(()=>i===Z.BloodGlucoseUnit.MG_DL?Vxn:Bxn,[i]),w=(0,U.useMemo)(()=>{let e=a.parameterIntervals[p].insulinSensitivity,t=B8(e,Z.BloodGlucoseUnit.MMOL_L,i);return C.findIndex(e=>e===t)},[C,i,a.parameterIntervals,p]),T=(0,U.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`,svn(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,U.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,U.useCallback)(()=>{g(!1)},[]),ee=(0,U.useCallback)(async e=>{let t={...a,use:e?Z.Usage.Intervals:Z.Usage.Overall,updatedAt:new Date().toISOString()},n=await k8.postUserSettings({parameters:t});r.set({showSyncErrorModal:!n})},[a,r]),te=(0,U.useCallback)(()=>{d===!1&&r.set({showSyncErrorModal:!0}),f(void 0)},[r,d]);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(y9,{columnDisposition:[2,3,3],children:[(0,G.jsx)(f3,{testID:`daily-interval-switch`,title:t(`variable_insulin_settings_title`),message:t(`variable_insulin_settings_body`),value:o===Z.Usage.Intervals,onValueChange:e(ee),style:B9.switchContainer}),(0,G.jsx)(_9,{disabled:o!==Z.Usage.Intervals,children:S.map((e,t)=>(0,G.jsxs)(x9,{style:t===0&&B9.firstTableCell,children:[(0,G.jsx)(Q,{maxFontSizeMultiplier:e.scale,style:[B9.tableHeaderTitle,{color:n.labelPrimary},t!==0&&B9.tableHeaderTitleWithMargin],children:e.title}),(0,G.jsx)(Q,{style:[B9.tableSubtitle,{color:n.textTableSecondary}],children:e.subtitle})]},e.title))}),Object.keys(wq).map((t,r)=>(0,G.jsxs)(v9,{disabled:o!==Z.Usage.Intervals,children:[(0,G.jsxs)(b9,{onPress:e(()=>{E(r)}),style:B9.firstTableCell,children:[(0,G.jsx)(Q,{maxFontSizeMultiplier:S2.s2,style:[B9.tableTitle,{color:n.textTableHighlight}],children:a.parameterIntervals[r].startTime}),(0,G.jsx)(Q,{style:[B9.tableSubtitle,{color:n.textTableSecondary}],children:gvt[t]()})]}),(0,G.jsx)(b9,{testID:`${t.toLowerCase()}-insulin`,onPress:e(()=>{D(r)}),children:(0,G.jsx)(Q,{maxFontSizeMultiplier:S2.s2,style:[B9.tableText,{color:n.textTableHighlight}],children:B8(a.parameterIntervals[r].insulinSensitivity,Z.BloodGlucoseUnit.MMOL_L,i)})}),(0,G.jsx)(b9,{testID:`${t.toLowerCase()}-carbs`,onPress:e(()=>{O(r)}),children:(0,G.jsx)(Q,{maxFontSizeMultiplier:S2.s2,style:[B9.tableText,{color:n.textTableHighlight}],children:a.parameterIntervals[r].carbohydrateRatio.toFixed(1)})})]},t))]}),(0,G.jsx)(dvn,{isVisible:h,initialValue:_?.current??new Date,min:_?.min,max:_?.max,onConfirm:k,onCancel:A,onModalHide:te}),(0,G.jsx)(Q5,{isVisible:s,items:C,initialScrollIndex:w,onConfirm:y,onCancel:()=>{c(!1)},onModalHide:te,testID:`insulin_sensitivity_picker`}),(0,G.jsx)(Q5,{isVisible:l,items:R9,initialScrollIndex:T,onConfirm:b,onCancel:()=>{u(!1)},onModalHide:te,testID:`insulin_to_carb_ratio_picker`})]})},B9=z.create({switchContainer:{borderBottomLeftRadius:0,borderBottomRightRadius:0},firstTableCell:{paddingLeft:16,alignItems:`flex-start`,justifyContent:`space-between`,borderLeftWidth:0},tableHeaderTitle:{...X.Poppins.medium_SM,textAlign:`center`},tableHeaderTitleWithMargin:{marginHorizontal:8},tableTitle:{...X.Poppins.medium_Base},tableSubtitle:{...X.Poppins.regular_XS},tableText:{...X.Poppins.medium_Base}}),Jxn=f7(qxn);H();var Yxn={Lantus:()=>xq(`long-acting_insulin_option1`),Basaglar:()=>xq(`long-acting_insulin_option2`),Tuojeo:()=>xq(`long-acting_insulin_option3`),Levemir:()=>xq(`long-acting_insulin_option4`),Tresiba:()=>xq(`long-acting_insulin_option5`),Other:()=>xq(`long-acting_insulin_option6`),None:()=>xq(`long-acting_insulin_option7`)},Xxn=()=>{let{modalStoreActions:e}=z5(),t=M5(),{longActingInsulin:n,treatmentParameters:r}=k8,i=(0,U.useCallback)(async t=>{t!==n&&(await k8.postUserSettings({longActingInsulin:Z.LongActingInsulin[t],parameters:r?{...r,updatedAt:new Date().toISOString()}:void 0})||e.set({showSyncErrorModal:!0}))},[n,r,e]);return(0,G.jsxs)(ds,{testID:`scroll`,contentContainerStyle:[Zxn.scrollView,{paddingTop:t+16}],children:[(0,G.jsx)(Y4.Container,{children:Object.keys(Z.LongActingInsulin).map(e=>(0,G.jsx)(Y4,{title:Yxn[e](),renderRightSlot:()=>(0,G.jsx)(V,{style:Zxn.checkmarkContainer,children:Z.LongActingInsulin[e]===n?(0,G.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,G.jsx)(t7,{})]})},Zxn=z.create({scrollView:{paddingVertical:32,paddingHorizontal:16,flexGrow:1},checkmarkContainer:{width:24,height:24}}),Qxn=f7(Xxn);H();var $xn={Novorapid:()=>xq(`rapid-acting_insulin_option1`),Fiasp:()=>xq(`rapid-acting_insulin_option2`),Humalog:()=>xq(`rapid-acting_insulin_option3`),Apidra:()=>xq(`rapid-acting_insulin_option4`),Other:()=>xq(`rapid-acting_insulin_option5`),None:()=>xq(`rapid-acting_insulin_option6`)},eSn=()=>{let{modalStoreActions:e}=z5(),t=M5(),{fastActingInsulin:n,treatmentParameters:r}=k8,i=(0,U.useCallback)(async t=>{t!==n&&(await k8.postUserSettings({fastActingInsulin:Z.FastActingInsulin[t],parameters:r?{...r,updatedAt:new Date().toISOString()}:void 0})||e.set({showSyncErrorModal:!0}))},[n,r,e]);return(0,G.jsxs)(ds,{testID:`scroll`,contentContainerStyle:[tSn.scrollView,{paddingTop:t+16}],children:[(0,G.jsx)(Y4.Container,{children:Object.keys(Z.FastActingInsulin).map(e=>(0,G.jsx)(Y4,{title:$xn[e](),renderRightSlot:()=>(0,G.jsx)(V,{style:tSn.checkmarkContainer,children:Z.FastActingInsulin[e]===n?(0,G.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,G.jsx)(t7,{})]})},tSn=z.create({scrollView:{paddingVertical:32,paddingHorizontal:16,flexGrow:1},checkmarkContainer:{width:24,height:24}}),nSn=f7(eSn);H();var V9={PenHalf:()=>xq(`treatment_type_option1`),PenWhole:()=>xq(`treatment_type_option2`),Pump:()=>xq(`treatment_type_option3`)},rSn=()=>{let{modalStoreActions:e}=z5(),t=M5(),{injectionMethod:n,treatmentParameters:r}=k8,i=(0,U.useCallback)(async t=>{t!==n&&(await k8.postUserSettings({treatmentType:Z.InjectionMethod[t],parameters:r?{...r,updatedAt:new Date().toISOString()}:void 0})||e.set({showSyncErrorModal:!0}))},[n,r,e]);return(0,G.jsxs)(ds,{testID:`scroll`,contentContainerStyle:[{...iSn.scrollView,paddingTop:t+16}],children:[(0,G.jsx)(Y4.Container,{children:Object.keys(Z.InjectionMethod).map(e=>(0,G.jsx)(Y4,{title:V9[e](),renderRightSlot:()=>(0,G.jsx)(V,{style:iSn.checkmarkContainer,children:Z.InjectionMethod[e]===n?(0,G.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,G.jsx)(t7,{})]})},iSn=z.create({scrollView:{paddingVertical:32,paddingHorizontal:16,flexGrow:1},checkmarkContainer:{width:24,height:24}}),aSn=f7(rSn);H();function oSn({withLockedSettings:e}){let{t}=Sq(),n=A$(),{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,U.useMemo)(()=>V9[R9t(Z.InjectionMethod,r)](),[r]),s=(0,U.useMemo)(()=>i?$xn[i]():`-`,[i]),c=(0,U.useMemo)(()=>a?Yxn[a]():`-`,[a]);return(0,G.jsxs)(V,{children:[(0,G.jsx)(Y4,{title:t(`my_profile_treatment_type`),value:o,testID:`treatment-type`,onPress:e(()=>{n.navigate(F5.TreatmentType)}),renderRightSlot:()=>(0,G.jsx)(K4,{}),style:{marginBottom:24}}),(0,G.jsxs)(Y4.Container,{children:[(0,G.jsx)(Y4,{title:t(`my_profile_rapid-acting_insulin`),value:s,testID:`fast-acting-insulin`,onPress:e(()=>{n.navigate(F5.RapidActingInsulin)}),renderRightSlot:()=>(0,G.jsx)(K4,{})}),(0,G.jsx)(Y4,{title:t(`my_profile_long-acting_insulin`),value:c,testID:`long-acting-insulin`,onPress:e(()=>{n.navigate(F5.LongActingInsulin)}),renderRightSlot:()=>(0,G.jsx)(K4,{})})]})]})}var sSn=f7(oSn);H();var{MMOL_L:H9}=Z.BloodGlucoseUnit,cSn=()=>{let e=A$(),{t}=Sq(),{COLORS:n}=Y(),{modalStoreActions:r}=z5(),{bottomWithScroll:i}=Q4(),a=M5(),{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===Z.Usage.Overall,{text:u}=L8(o),{carbohydrateRatio:d,insulinSensitivity:f}=s.overallParameters,[p,m]=(0,U.useState)(!1),[h,g]=(0,U.useState)(!1),[_,v]=(0,U.useState)(void 0),[y,b]=(0,U.useState)(!1),[x,S]=(0,U.useState)(!1),{areSettingsLocked:C,isPINSet:w,lockSettings:T,unlockSettings:E}=F_n(),[D,O]=(0,U.useState)(!1),[k,A]=(0,U.useState)(!1),ee=(0,U.useCallback)(()=>{C?b(!0):T()},[C,T]);(0,U.useEffect)(()=>{e.setOptions({header:()=>(0,G.jsx)(P5,{title:t(`insulin_settings_navigation`),LeftButton:(0,G.jsx)(H5,{}),RightButton:w?(0,G.jsx)(efn,{onPress:ee,isLocked:C}):void 0,overlay:!0})})},[e,C,w,ee,t]);let te=(0,U.useMemo)(()=>o===H9?Bxn:Vxn,[o]),ne=()=>{m(!0)},re=()=>{g(!0)},ie=(0,U.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,U.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]),M=(0,U.useMemo)(()=>{let e=B8(f,H9,o);return te.findIndex(t=>t===e)},[te,o,f]),ae=(0,U.useMemo)(()=>R9.findIndex(e=>e===d.toFixed(1)),[d]),oe=(0,U.useCallback)(()=>{_===!1&&r.set({showSyncErrorModal:!0}),v(void 0)},[r,_]),N=(0,U.useCallback)(async e=>{let t={...s,use:e?Z.Usage.Overall:Z.Usage.Intervals,updatedAt:new Date().toISOString()},n=await k8.postUserSettings({parameters:t});r.set({showSyncErrorModal:!n})},[s,r]),se=(0,U.useCallback)(()=>{D&&(S(!0),O(!1))},[D,S,O]),P=(0,U.useCallback)(()=>{O(!0),b(!1)},[O,b]),F=(0,U.useCallback)(()=>{E()},[E]),ce=(0,U.useCallback)(e=>w&&C?(...e)=>b(!0):(...t)=>e(...t),[C,w]),le=(0,U.useCallback)(()=>{k&&(A(!1),setTimeout(()=>{e.navigate(F5.ChangePINCode)},500))},[k,e]),ue=s.updatedAt??c;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(ds,{testID:`scroll`,contentContainerStyle:[U9.scrollView,{paddingBottom:i,paddingTop:a+16}],children:[(0,G.jsx)(Q,{style:[U9.updatedAtText,{color:n.labelSecondary}],children:t(`settings_lastEdited`,{date:ue?I8(ue,`d MMM yyyy`):``})}),(0,G.jsx)(sSn,{withLockedSettings:ce}),(0,G.jsx)(V,{style:U9.spacing}),(0,G.jsx)(p9,{}),(0,G.jsx)(V,{style:U9.spacing}),(0,G.jsxs)(Y4.Container,{containerStyle:{backgroundColor:n.bgSecondary,borderColor:n.divider,borderWidth:1},children:[(0,G.jsx)(f3,{testID:`insulin-settings-overall-switch`,title:t(`fixed_insulin_settings_title`),message:t(`fixed_insulin_settings_body`),value:l,onValueChange:ce(N),style:U9.switchContainer}),(0,G.jsx)(Lxn,{}),(0,G.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:ce(()=>l?re():void 0),containerStyle:l?U9.active:U9.inactive,valueStyle:l?{color:n.textTableHighlight}:{color:n.labelSecondary}}),(0,G.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:ce(()=>l?ne():void 0),containerStyle:l?U9.active:U9.inactive,valueStyle:l?{color:n.textTableHighlight}:{color:n.labelSecondary}})]}),(0,G.jsx)(V,{style:U9.spacing}),(0,G.jsx)(Jxn,{withLockedSettings:ce}),(0,G.jsx)(V,{style:U9.spacing}),(0,G.jsx)(Kxn,{})]}),(0,G.jsx)(Q5,{isVisible:p,items:te,initialScrollIndex:M,onConfirm:ie,onCancel:()=>{m(!1)},onModalHide:oe,testID:`insulin_sensitivity_picker`}),(0,G.jsx)(Q5,{isVisible:h,items:R9,initialScrollIndex:ae,onConfirm:j,onCancel:()=>{g(!1)},onModalHide:oe,testID:`insulin_to_carb_ratio_picker`}),(0,G.jsx)(t7,{onModalHide:()=>{v(void 0)}}),(0,G.jsx)(q_n,{isVisible:y,onModalHide:se,onEnterPIN:P,onCancel:()=>b(!1)}),(0,G.jsx)(H_n,{isVisible:x,onClose:()=>S(!1),onModalHide:le,onForgotPIN:()=>{A(!0),S(!1)},onModalHideWithSuccess:F}),(0,G.jsx)(K_n,{})]})},U9=z.create({scrollView:{paddingTop:32,paddingHorizontal:16,flexGrow:1},spacing:{height:32},updatedAtText:{...X.Poppins.regular_SM,textAlign:`center`,marginBottom:24},active:{opacity:1},inactive:{opacity:.5},switchContainer:{borderBottomLeftRadius:0,borderBottomRightRadius:0}}),lSn=f7(cSn),{Navigator:uSn,Screen:W9}=A5(),dSn=()=>{let{t:e}=Sq();return(0,G.jsxs)(uSn,{screenOptions:{...K5,...Q8},children:[(0,G.jsx)(W9,{name:F5.InsulinSettings,component:lSn,options:{header:()=>(0,G.jsx)(P5,{LeftButton:(0,G.jsx)(H5,{}),title:e(`insulin_settings_navigation`),overlay:!0})}}),(0,G.jsx)(W9,{name:F5.TreatmentType,component:aSn,options:{header:()=>(0,G.jsx)(P5,{LeftButton:(0,G.jsx)(H5,{}),title:e(`treatment_type_navigation`),overlay:!0})}}),(0,G.jsx)(W9,{name:F5.RapidActingInsulin,component:nSn,options:{header:()=>(0,G.jsx)(P5,{LeftButton:(0,G.jsx)(H5,{}),title:e(`rapid-acting_insulin_navigation`),overlay:!0})}}),(0,G.jsx)(W9,{name:F5.LongActingInsulin,component:Qxn,options:{header:()=>(0,G.jsx)(P5,{LeftButton:(0,G.jsx)(H5,{}),title:e(`long-acting_insulin_navigation`),overlay:!0})}})]})},{Navigator:fSn,Screen:G9}=A5(),pSn=()=>{let{t:e}=Sq(),{COLORS:t}=Y();return(0,G.jsxs)(fSn,{screenOptions:{...K5,...Q8,headerStyle:{backgroundColor:t.bgNavigationBar}},children:[(0,G.jsx)(G9,{name:F5.Settings,component:Ixn,options:{header:()=>(0,G.jsx)(P5,{LeftButton:(0,G.jsx)(U5,{}),title:e(`settings_navigation`)})}}),(0,G.jsx)(G9,{name:F5.Profile,component:Lvn,options:{header:()=>(0,G.jsx)(P5,{LeftButton:(0,G.jsx)(H5,{}),title:e(`my_profile_navigation`)})}}),(0,G.jsx)(G9,{name:F5.GlucoseSettings,component:_vn,options:{header:()=>(0,G.jsx)(P5,{LeftButton:(0,G.jsx)(H5,{}),title:e(`glucose_navigation`),overlay:!0})}}),(0,G.jsx)(G9,{name:F5.GlucoseUnit,component:xvn,options:{header:()=>(0,G.jsx)(P5,{LeftButton:(0,G.jsx)(H5,{}),title:e(`glucose_unit_navigation`),overlay:!0})}}),(0,G.jsx)(G9,{name:F5.ActivitySettings,component:ovn,options:{header:()=>(0,G.jsx)(P5,{LeftButton:(0,G.jsx)(H5,{}),title:e(`physical_activity_navigation`),overlay:!0})}}),(0,G.jsx)(G9,{name:F5.InsulinSettingsStack,component:dSn,options:{headerShown:!1}}),(0,G.jsx)(G9,{name:F5.Theme,component:Nxn,options:{header:()=>(0,G.jsx)(P5,{LeftButton:(0,G.jsx)(H5,{}),title:e(`navigation_title_theme`),overlay:!0})}}),(0,G.jsx)(G9,{name:F5.Support,component:jxn,options:{header:()=>(0,G.jsx)(P5,{LeftButton:(0,G.jsx)(H5,{}),title:e(`support_navigation`)})}}),(0,G.jsx)(G9,{name:F5.Legal,component:Svn,options:{header:()=>(0,G.jsx)(P5,{LeftButton:(0,G.jsx)(H5,{}),title:e(`legal_navigation`),overlay:!0})}})]})},mSn=e=>!(!e||e.authenticationContextClassReference!==`urn:hedia:acr:elevated`||(Date.now()-Date.parse(e.authenticationTime))/6e4>60),hSn=()=>{let e=A$();return(0,U.useEffect)(()=>{(async()=>{try{mSn(await Den())?e.replace(F5.SettingsStack,{screen:F5.Settings}):window.location.href=`/reauthenticate`}catch{e.goBack()}})()},[e]),(0,G.jsx)(b2,{})};H();function gSn(){return(0,G.jsx)(Hfn,{style:_Sn.iframe,uri:`https://www.hedia.com/contact#contactsupport`})}var _Sn=z.create({iframe:{flex:1}}),{Navigator:vSn,Screen:K9,Group:ySn}=A5(),bSn=()=>{let{t:e}=Sq();return(0,G.jsxs)(vSn,{children:[(0,G.jsxs)(ySn,{screenOptions:{headerShown:!1},children:[(0,G.jsx)(K9,{name:F5.NewCalculationStack,component:N_n}),(0,G.jsx)(K9,{name:F5.SettingsStack,component:pSn})]}),(0,G.jsxs)(ySn,{screenOptions:{...tfn},children:[(0,G.jsx)(K9,{name:F5.CreateFood,component:Vfn}),(0,G.jsx)(K9,{name:F5.IFU,component:Wfn,options:{header:()=>(0,G.jsx)(P5,{LeftButton:(0,G.jsx)(U5,{}),title:e(`IFU_navigation`)})}}),(0,G.jsx)(K9,{name:F5.SupportWebView,component:Xfn,options:{header:()=>(0,G.jsx)(P5,{LeftButton:(0,G.jsx)(U5,{}),title:e(`support_navigation`)})}}),(0,G.jsx)(K9,{name:F5.SupportContact,component:gSn,options:{header:()=>(0,G.jsx)(P5,{LeftButton:(0,G.jsx)(U5,{}),title:e(`support_navigation`)})}}),(0,G.jsx)(K9,{name:F5.ConfirmPINCode,component:hSn,options:{headerShown:!1}})]})]})};H();var xSn=({title:e,subtitle:t,stepChecked:n,onAnimationFinished:r})=>{let{t:i}=Sq(),{COLORS:a}=Y();return(0,U.useEffect)(()=>{r?.()},[r]),(0,G.jsxs)(ds,{contentContainerStyle:q9.container,style:{backgroundColor:a.bgPrimary},children:[(0,G.jsx)(Q,{style:q9.title,children:e}),(0,G.jsx)(Q,{style:[q9.subtitle,{color:a.labelSecondary}],children:t}),(0,G.jsxs)(V,{style:q9.stepsWrapper,children:[(0,G.jsxs)(V,{style:q9.stepContainer,children:[(0,G.jsx)(Q,{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,G.jsx)(G4,{width:24,height:24,color:a.labelPrimary})]}),(0,G.jsxs)(V,{style:q9.stepContainer,children:[(0,G.jsx)(Q,{style:[q9.text,n===2||n===3?{color:a.labelPrimary}:{color:a.labelSecondary}],children:`2. `+i(`overview2`)}),(n===2||n===3)&&(0,G.jsx)(G4,{width:24,height:24,color:a.labelPrimary})]}),(0,G.jsxs)(V,{style:q9.stepContainer,children:[(0,G.jsx)(Q,{style:[q9.text,n===3?{color:a.labelPrimary}:{color:a.labelSecondary}],children:`3. `+i(`overview3`)}),n===3&&(0,G.jsx)(G4,{width:24,height:24,color:a.labelPrimary})]})]})]})},q9=z.create({container:{flex:1,justifyContent:`center`,paddingHorizontal:16},title:{...X.Poppins.bold_4XL,paddingHorizontal:16,marginBottom:2},subtitle:{...X.Poppins.regular_Base,paddingHorizontal:16,marginBottom:32},stepsWrapper:{padding:16,gap:8},stepContainer:{flexDirection:`row`,alignItems:`center`,gap:8},text:{marginBottom:8}}),SSn=()=>{let{t:e}=Sq(),{setIsOnboardingFinished:t}=E3(),n=(0,U.useCallback)(()=>{setTimeout(()=>{t(!0)},1e3)},[t]);return(0,G.jsx)(xSn,{title:e(`guide_end_title`),subtitle:e(`guide_end_body`),stepChecked:3,onAnimationFinished:n})};H();var J9=({currentStep:e,text:t,onPress:n,inactive:r,isBackVisible:i=!0,onBackPress:a})=>{let{t:o}=Sq(),{COLORS:s}=Y(),{goBack:c}=A$();return(0,G.jsx)(tpn,{children:(0,G.jsxs)(V,{style:[CSn.buttonsWrapper,{borderColor:s.bgTransparent}],children:[i&&(0,G.jsx)(U4,{title:o(`button_back`),onPress:a||c,testID:`back${e}`,style:CSn.button,type:H4.Secondary}),(0,G.jsx)(U4,{title:t??o(`button_next`),onPress:n,inactive:r,testID:`next${e}`,style:CSn.button})]})})},CSn=z.create({buttonsWrapper:{flexDirection:`row`,paddingTop:16,gap:8,borderWidth:1},button:{flex:1}});H();var wSn=()=>{let{t:e}=Sq(),{COLORS:t}=Y(),{top:n}=Q4(),{navigate:r}=A$(),i=(0,U.useCallback)(()=>{r(I5.QuickGuideStack,{screen:I5.QuickGuide}),u8(l8.QuickGuideStartPress)},[r]);return(0,G.jsxs)(V,{style:{flex:1,backgroundColor:t.bgSecondary,paddingTop:n},children:[(0,G.jsx)(xSn,{title:e(`guide_quick_guide_title`),subtitle:e(`guide_quick_guide_body`),stepChecked:2}),(0,G.jsx)(J9,{currentStep:1,isBackVisible:!1,onPress:i,text:e(`button_start`)})]})},TSn=`/assets/webp/1_EN.webp`,ESn=`/assets/webp/2_EN.webp`,DSn=`/assets/webp/3_EN.webp`,OSn=`/assets/webp/4_EN2.webp`,kSn=`/assets/webp/1_EN2.webp`,ASn=`/assets/webp/2_EN2.webp`,jSn=`/assets/webp/3_EN2.webp`,MSn=`/assets/webp/4_EN.webp`;H();var NSn=()=>{let{t:e}=Sq(),t=A$(),{COLORS:n}=Y(),r=(0,U.useRef)(null),[i,a]=(0,U.useState)(2),[o,s]=(0,U.useState)(0),{colorScheme:c}=g2(),l=C2(c),{width:u}=$p(),d=(0,U.useMemo)(()=>[{title:e(`guide_recent_insulin_title`),body:e(`guide_recent_insulin_body`),image:l===`dark`?TSn:kSn},{title:e(`web_guide_no_import_title`),body:e(`web_guide_no_import_body`),image:l===`dark`?ESn:ASn},{title:e(`guide_glucose_title`),body:e(`guide_glucose_body`),image:l===`dark`?DSn:jSn},{title:e(`guide_recommendation_title`),body:e(`guide_recommendation_body`),image:l===`dark`?OSn:MSn}],[l,e]),f=(0,U.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`)}},[]),p=(0,U.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`)}},[]),m=(0,U.useCallback)(()=>{if(o===d.length-1)u8(l8.QuickGuideFinishPress),t.navigate(I5.QuickGuideAllSet);else{let e=o+1;r.current?.scrollToIndex({index:e,animated:!0}),a(i+1),s(e),u8(p(i))}},[o,i,p,t,d.length]),h=(0,U.useCallback)(()=>{if(o===0)t.navigate(I5.QuickGuideStart);else{let e=o-1;r.current?.scrollToIndex({index:e,animated:!0}),a(i-1),s(e)}u8(f(i))},[o,i,f,t]);return(0,G.jsxs)(V,{style:{flex:1,backgroundColor:n.bgSecondary},children:[(0,G.jsx)(Uc,{ref:r,data:d,initialNumToRender:1,scrollEnabled:!1,horizontal:!0,showsHorizontalScrollIndicator:!1,renderItem:({item:e,index:t})=>(0,G.jsxs)(V,{style:[Y9.container,{width:u,backgroundColor:n.bgPrimary}],children:[(0,G.jsx)(Xu,{source:e.image,style:[Y9.image,{bottom:t===0?64:0,width:t===1?`55%`:`100%`,height:t===1?`55%`:`60%`}],resizeMode:`contain`}),(0,G.jsxs)(V,{style:Y9.contentContainer,children:[(0,G.jsx)(Q,{style:Y9.title,maxFontSizeMultiplier:S2.s2,children:e.title}),(0,G.jsx)(Q,{style:[Y9.body,{color:n.labelSecondary}],maxFontSizeMultiplier:S2.s2,children:e.body})]})]})}),(0,G.jsx)(J9,{currentStep:i,onPress:m,onBackPress:h,text:o===d.length-1?e(`button_complete`):e(`button_next`)})]})},Y9=z.create({container:{alignItems:`center`,justifyContent:`flex-end`},image:{width:`100%`,height:`60%`,marginTop:64},contentContainer:{minHeight:`25%`,paddingTop:12,marginBottom:84},title:{...X.Poppins.semiBold_2XL,marginBottom:2,paddingHorizontal:16,textAlign:`center`},body:{...X.Poppins.regular_Base,paddingHorizontal:Lu.getFontScale()>S2.s0?16:32,textAlign:`center`}}),{Navigator:PSn,Screen:FSn}=A5(),ISn=()=>(0,G.jsxs)(PSn,{screenOptions:{...K5,headerShown:!1},children:[(0,G.jsx)(FSn,{name:I5.QuickGuideStart,component:wSn}),(0,G.jsx)(FSn,{name:I5.QuickGuide,component:NSn}),(0,G.jsx)(FSn,{name:I5.QuickGuideAllSet,component:SSn})]});H();function LSn({onOptionSelect:e,setNextEnabled:t,ref:n}){let{t:r}=Sq(),{COLORS:i}=Y(),{width:a}=$p(),o=M5(),[s,c]=(0,U.useState)(null),l=(0,U.useCallback)(n=>{c(n),e(n),t(!0)},[e,t]);return(0,U.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,G.jsxs)(ds,{contentContainerStyle:[X9.container,{width:a,paddingTop:o+16}],style:{backgroundColor:i.bgPrimary},children:[(0,G.jsx)(Q,{style:[X9.header,{color:i.labelPrimary}],children:r(`insulin_settings_title`)}),(0,G.jsxs)(V,{style:X9.buttonsContainer,children:[(0,G.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,G.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=z.create({container:{flex:1,paddingHorizontal:16,paddingTop:32},header:{...X.Poppins.bold_2XL,paddingHorizontal:16,marginBottom:24},buttonsContainer:{flexDirection:`row`,marginBottom:24,gap:12},button:{flex:1}});function RSn(e,t){let n=e3(e)-+e3(t);return n<0?-1:n>0?1:n}function zSn(e,t,n){let[r,i]=_8(n?.in,e,t);return r.getFullYear()-i.getFullYear()}function BSn(e,t,n){let[r,i]=_8(n?.in,e,t),a=RSn(r,i),o=Math.abs(zSn(r,i));r.setFullYear(1584),i.setFullYear(1584);let s=a*(o-+(RSn(r,i)===-a));return s===0?0:s}H(),J0();function VSn({setNextEnabled:e,ref:t}){let{t:n}=Sq(),{COLORS:r}=Y(),{width:i}=$p(),{bottom:a}=V0(),{bottomWithFooterButton:o}=Q4(),s=M5(),{birthday:c,biologicalSex:l,diabetesType:u,bloodGlucoseUnits:d}=s7(),{setSetupCalculatorStoreValues:f}=o7(),{colorScheme:p}=g2(),m=C2(p),[h,g]=(0,U.useState)(!1),[_,v]=(0,U.useState)(!1),[y,b]=(0,U.useState)(!1),[x,S]=(0,U.useState)(``),[C,w]=(0,U.useState)(``),[T,E]=(0,U.useState)(!1),D=(0,U.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=BSn(r,t)>=18;f({birthday:t.toISOString()}),S(``),w(i?``:n(`setup_birthday_hint_under18`))},[f,n]),O=(0,U.useCallback)(e=>{D(e),g(!1)},[D]),k=(0,U.useCallback)(()=>{f({diabetesType:Z.DiabetesType.Type2}),v(!0)},[f]),A=(0,U.useCallback)(()=>!!(c&&l&&u&&d),[c,d,u,l]);return(0,U.useEffect)(()=>{e(A())},[e,A]),(0,U.useImperativeHandle)(t,()=>({onBackPress(){u8(l8.SetupGeneralBackPress)},onNextPressed:()=>(E(!0),!c&&S(n(`birthday_error`)),A()?(e(!0),u8(l8.SetupGeneralNextPress),{transitionAllowed:!0}):(e(!1),{transitionAllowed:!1})),validateData(){return{isValid:A()}}}),[c,n,A,e]),(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(ds,{testID:`step_2`,contentContainerStyle:[Z9.container,{width:i,paddingTop:s+16,paddingBottom:o}],style:{backgroundColor:r.bgPrimary},children:[(0,G.jsx)(Y4,{testID:`birthday`,title:n(`general_input_birthday`),renderRightSlot:()=>(0,G.jsx)(V,{style:[Z9.pillButton,{backgroundColor:r.bgPill}],children:(0,G.jsx)(Q,{style:[Z9.pillText,{color:h?r.textLink:r.labelPrimary}],children:c?I8(new Date(c),`dd-MM-yyyy`):`DD-MM-YYYY`})}),errorMessage:x,warningMessage:C,containerStyle:Z9.wrapper,style:Z9.customRow,onPress:()=>{g(!0)}}),(0,G.jsx)(V,{style:Z9.wrapper,children:(0,G.jsx)(B4,{isAnimated:T&&!l,children:(0,G.jsx)(Y4,{title:n(`my_profile_sex`),testID:`biological-sex`,value:l?_vt[l]():`-`,onPress:()=>{b(!0)},errorMessage:T&&!l?n(`diabetes_error`):void 0})})}),(0,G.jsxs)(V,{style:Z9.wrapper,children:[(0,G.jsx)(d3,{title:n(`type_of_diabetes_title`)}),(0,G.jsx)(B4,{isAnimated:T&&!u,message:n(`diabetes_error`),children:(0,G.jsxs)(V,{style:[Z9.row,{backgroundColor:r.bgSegmentContainer,borderColor:r.buttonBorder}],children:[(0,G.jsx)(m9t,{title:n(`type_of_diabetes_type1`),isActive:u===Z.DiabetesType.Type1,testID:`type-1`,onPress:()=>{f({diabetesType:Z.DiabetesType.Type1})},isError:T&&!u}),!u&&(0,G.jsx)(V,{style:[Z9.separator,{backgroundColor:r.divider}]}),(0,G.jsx)(m9t,{title:n(`type_of_diabetes_type2`),isActive:u===Z.DiabetesType.Type2,testID:`type-2`,onPress:k,isError:T&&!u})]})})]}),(0,G.jsxs)(V,{style:Z9.wrapper,children:[(0,G.jsx)(d3,{title:n(`glucose_unit_title`)}),(0,G.jsx)(B4,{isAnimated:T&&!d,message:n(`glucose_unit_error`),children:(0,G.jsx)(vvn,{glucoseUnit:d,onPressMMOLL:()=>{f({bloodGlucoseUnits:Z.BloodGlucoseUnit.MMOL_L})},onPressMGDL:()=>{f({bloodGlucoseUnits:Z.BloodGlucoseUnit.MG_DL})},isError:T&&!d})})]})]}),Eq?(0,G.jsx)(Vpn,{testID:`birthday-date-picker`,display:`spinner`,date:c?new Date(c):new Date,isVisible:h,onConfirm:O,onCancel:()=>{g(!1)},customConfirmButtonIOS:Wpn,customCancelButtonIOS:Gpn,pickerContainerStyleIOS:{backgroundColor:r.iosKeyboardPicker},modalStyleIOS:{paddingBottom:a},themeVariant:m,isDarkModeEnabled:m===`dark`,pickerStyleIOS:Z9.alignCenter,minimumDate:new Date(1900,0,1),maximumDate:new Date(2100,0,1)}):(0,G.jsx)(Avn,{isVisible:h,initialValue:c?new Date(c):new Date,onConfirm:O,onCancel:()=>{g(!1)}}),(0,G.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,G.jsx)(Nvn,{isVisible:y,onCancel:()=>{b(!1)}})]})}var Z9=z.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:{...X.Poppins.regular_SM,paddingHorizontal:8,paddingVertical:6}});H();function HSn({setNextEnabled:e,ref:t}){let{COLORS:n}=Y(),{t:r}=Sq(),{width:i}=$p(),a=M5(),{parameters:o,treatmentType:s}=s7(),{setSetupCalculatorStoreValues:c}=o7(),[l,u]=(0,U.useState)(!1);(0,U.useEffect)(()=>{o||c({parameters:O8(0,0,Z.Usage.Overall)})},[o,c]),(0,U.useEffect)(()=>{e(!!s)},[e,s]);let d=(0,U.useCallback)(e=>{c({treatmentType:Z.InjectionMethod[e]})},[c]);return(0,U.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,G.jsxs)(V,{testID:`step_3`,style:[USn.container,{width:i,backgroundColor:n.bgPrimary,paddingTop:a+16}],children:[(0,G.jsx)(d3,{title:r(`treatment_units_title`)}),(0,G.jsx)(B4,{isAnimated:l&&!s,message:r(`treatment_type_input_error`),children:(0,G.jsx)(Y4.Container,{children:Object.keys(Z.InjectionMethod).map(e=>(0,G.jsx)(Y4,{title:V9[e](),renderRightSlot:()=>(0,G.jsx)(V,{style:USn.checkmarkContainer,children:Z.InjectionMethod[e]===s?(0,G.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 USn=z.create({container:{paddingHorizontal:16,paddingVertical:32},checkmarkContainer:{width:24,height:24}}),WSn=a3(5,350);H();function GSn({setNextEnabled:e,ref:t}){let{t:n}=Sq(),{COLORS:r}=Y(),{width:i}=$p(),a=M5(),{bottomWithFooterButton:o}=Q4(),{bloodGlucoseUnits:s,parameters:c}=s7();if(!s||!c)throw Error(`[Step4::render] are not defined`);let l=dpn(),{setSetupCalculatorStoreValues:u,setTotalDailyDosage:d}=o7(),[f,p]=(0,U.useState)(!1),[m,h]=(0,U.useState)(void 0),g=(0,U.useMemo)(()=>l?{carbohydrateRatio:parseFloat((500/l).toFixed(1)),insulinSensitivityMMOLL:Number(z9.DividendNumber)/l}:{carbohydrateRatio:0,insulinSensitivityMMOLL:0},[l]);(0,U.useEffect)(()=>{let{carbohydrateRatio:e,insulinSensitivityMMOLL:t}=g;u({parameters:O8(t,e,Z.Usage.Overall)})},[s,g,u]);let _=(0,U.useMemo)(()=>l?WSn.findIndex(e=>e===l.toString()):WSn.findIndex(e=>e===`50`),[l]);(0,U.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,U.useCallback)(t=>{d(t),p(!1),h(void 0),e(!0)},[e,d]),{text:y}=(0,U.useMemo)(()=>L8(s),[s]),b=(0,U.useMemo)(()=>`${B8(c.overallParameters.insulinSensitivity,Z.BloodGlucoseUnit.MMOL_L,s)} ${n(`fixed_insulin_settings_sensitivity_unit`,{displayUnit:y})}`,[c,y,n,s]),x=(0,U.useMemo)(()=>c.overallParameters.carbohydrateRatio+` `+n(`insulin_helper_carb_ratio_unit`),[c,n]);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(ds,{contentContainerStyle:[Q9.container,{width:i,paddingTop:a+16,paddingBottom:o}],style:{backgroundColor:r.bgPrimary},children:[(0,G.jsxs)(V,{children:[(0,G.jsx)(d3,{title:n(`daily_insulin_dosage_title`)}),(0,G.jsx)(Q,{style:[Q9.subheader,{color:r.labelSecondary}],children:n(`daily_insulin_dosage_body`)}),(0,G.jsx)(B4,{isAnimated:!!m,children:(0,G.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,G.jsxs)(V,{style:[Q9.explanation,{backgroundColor:r.bgSecondary}],children:[(0,G.jsx)(Q,{style:[Q9.description,{color:r.labelPrimary,borderBottomColor:r.divider}],children:n(`insulin_helper_body`)}),(0,G.jsxs)(V,{style:Q9.row,children:[(0,G.jsx)(Q,{style:[Q9.textSemiBold,{color:r.labelPrimary}],children:n(`insulin_helper_carb_ratio_input`)}),(0,G.jsx)(Q,{style:[Q9.textSemiBold,{color:r.labelSecondary}],children:x})]}),(0,G.jsx)(Lxn,{}),(0,G.jsxs)(V,{style:Q9.row,children:[(0,G.jsx)(Q,{style:[Q9.textSemiBold,{color:r.labelPrimary}],children:n(`insulin_helper_insulin_sensitivity_input`)}),(0,G.jsx)(Q,{style:[Q9.textSemiBold,{color:r.labelSecondary}],children:b})]})]}),(0,G.jsx)(p9,{}),(0,G.jsx)(V,{children:(0,G.jsx)(Kxn,{})})]}),(0,G.jsx)(Q5,{testID:`daily_insulin_dosage_picker`,onCancel:()=>{p(!1)},onConfirm:v,initialScrollIndex:_,isVisible:f,items:WSn})]})}var Q9=z.create({container:{paddingVertical:32,paddingHorizontal:16,gap:24},subheader:{...X.Poppins.regular_SM,marginBottom:8},explanation:{borderRadius:8,paddingBottom:0},row:{flexDirection:`row`,justifyContent:`space-between`},description:{...X.Poppins.regular_SM,padding:16,borderBottomWidth:1},textSemiBold:{...X.Poppins.medium_SM,padding:16}});H();function KSn({setNextEnabled:e,ref:t}){let{t:n}=Sq(),{COLORS:r}=Y(),{width:i}=$p(),a=M5(),{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,U.useState)(void 0),[p,m]=(0,U.useState)(void 0),[h,g]=(0,U.useState)(!1),[_,v]=(0,U.useState)(!1),{text:y}=(0,U.useMemo)(()=>L8(s),[s]),{carbohydrateRatio:b,insulinSensitivity:x}=(0,U.useMemo)(()=>c.overallParameters,[c]),S=(0,U.useCallback)(e=>n(`insulin_settings_input_error`,{inputTypeTranslated:n(e===`IS`?`insulin_sensitivity_input`:`insulin-to-carb_ratio_input`)}),[n]);(0,U.useEffect)(()=>{e(!!(x&&b))},[b,x,e]),(0,U.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,U.useCallback)(e=>{let t=z8(e,s,Z.BloodGlucoseUnit.MMOL_L);l({parameters:{...c,overallParameters:{...c.overallParameters,insulinSensitivity:t}}}),u(null),f(void 0),g(!1)},[s,c,l,u]),w=(0,U.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,U.useMemo)(()=>s===Z.BloodGlucoseUnit.MMOL_L?Bxn:Vxn,[s]),E=(0,U.useMemo)(()=>{let e=s===Z.BloodGlucoseUnit.MMOL_L?2 .toFixed(1):`36`;if(x===0)return T.findIndex(t=>t===e);let t=B8(x,Z.BloodGlucoseUnit.MMOL_L,s);return T.findIndex(e=>e===t)},[T,s,x]),D=(0,U.useMemo)(()=>b===0?R9.findIndex(e=>e===10 .toFixed(1)):R9.findIndex(e=>e===b.toFixed(1)),[b]),O=(0,U.useMemo)(()=>{let e=B8(x,Z.BloodGlucoseUnit.MMOL_L,s);return`${x?e:`-`} ${n(`fixed_insulin_settings_sensitivity_unit`,{displayUnit:y})}`},[x,s,y,n]);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(ds,{contentContainerStyle:[qSn.contentContainer,{width:i,paddingTop:a+16,paddingBottom:o}],style:{backgroundColor:r.bgPrimary},children:[(0,G.jsxs)(V,{children:[(0,G.jsx)(d3,{title:n(`insulin-to-carb_ratio_title`)}),(0,G.jsx)(B4,{isAnimated:!!p,children:(0,G.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,G.jsxs)(V,{children:[(0,G.jsx)(d3,{title:n(`insulin_sensitivity_title`)}),(0,G.jsx)(B4,{isAnimated:!!d,children:(0,G.jsx)(Y4,{title:n(`insulin_sensitivity_input`),value:O,valueStyle:{color:r.labelBrand},testID:`insulin_sensitivity`,onPress:()=>{g(!0)},errorMessage:d})})]}),(0,G.jsx)(p9,{}),(0,G.jsx)(Kxn,{})]}),(0,G.jsx)(Q5,{testID:`insulin_sensitivity_picker`,isVisible:h,items:T,initialScrollIndex:E,onConfirm:C,onCancel:()=>{g(!1)}}),(0,G.jsx)(Q5,{testID:`insulin_to_carb_ratio_picker`,isVisible:_,items:R9,initialScrollIndex:D,onConfirm:w,onCancel:()=>{v(!1)}})]})}var qSn=z.create({contentContainer:{paddingTop:32,paddingHorizontal:16,gap:24}});H();function JSn({setNextEnabled:e,ref:t}){let{t:n}=Sq(),{COLORS:r}=Y(),{width:i}=$p(),a=M5(),{bottomWithFooterButton:o}=Q4(),{bloodGlucoseUnits:s,parameters:c,treatmentType:l,diabetesType:u,birthday:d,biologicalSex:f}=s7(),p=dpn(),{modalStoreActions:m}=z5(),h=(0,U.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,Z.Usage.Overall);return k8.postUserSettings({parameters:n,activity:w8(),notifications:ton(),glucoseLevelTargets:Xan(),bloodGlucoseUnits:s,treatmentType:l,diabetesType:u,birthday:d,biologicalSex:f})},[d,s,u,f,c,l]);(0,U.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,U.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=R9t(Z.InjectionMethod,l),r=u===Z.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,U.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,Z.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,G.jsxs)(ds,{testID:`scroll`,contentContainerStyle:[YSn.scrollContent,{width:i,paddingTop:a+16,paddingBottom:o}],style:{backgroundColor:r.bgPrimary},children:[(0,G.jsx)(p9,{}),(0,G.jsx)(V,{style:YSn.spacer}),(0,G.jsx)(d3,{title:n(`summary_setup_general_title`)}),(0,G.jsx)(Y4.Container,{children:g.map(({testID:e,label:t,value:n,unit:i})=>(0,G.jsx)(Y4,{testID:e,title:t,displayStyle:f9t.List,displayType:J4.ListItem,titleStyle:{color:r.labelPrimary},valueStyle:{color:r.labelSecondary},value:`${n} ${i??``}`},e))}),(0,G.jsx)(V,{style:YSn.spacer}),(0,G.jsx)(d3,{title:n(`summary_setup_insuling_settings_title`)}),(0,G.jsx)(Y4.Container,{children:_.map(({testID:e,label:t,value:n,unit:i})=>(0,G.jsx)(Y4,{testID:e,title:t,displayStyle:f9t.List,displayType:J4.ListItem,titleStyle:{color:r.labelPrimary},valueStyle:{color:r.labelSecondary},value:`${n} ${i??``}`},e))}),(0,G.jsx)(t7,{})]})}var YSn=z.create({scrollContent:{paddingHorizontal:16},spacer:{height:24}});H();var XSn=()=>{let{t:e}=Sq(),{COLORS:t}=Y(),{width:n}=$p(),{clear:r}=o7(),{setHasCompletedSetupFlow:i,setIsPinSetupShouldBeShown:a}=E3(),o=A$(),[s,c]=(0,U.useState)(2),[l,u]=(0,U.useState)(0),[d,f]=(0,U.useState)(0),[p,m]=(0,U.useState)(!1),[h,g]=(0,U.useState)(!1),_=(0,U.useRef)(null),v=(0,U.useRef)(null);(0,U.useEffect)(()=>{r()},[r]);let y=(0,U.useCallback)(e=>{m(e)},[]),b=(0,U.useCallback)(e=>{g(e===`yes`)},[]),x=(0,U.useMemo)(()=>[{title:e(`general_navigation`),stepNumber:2,renderComponent:e=>(0,G.jsx)(VSn,{ref:e,setNextEnabled:y})},{title:e(`treatment_navigation`),stepNumber:3,renderComponent:e=>(0,G.jsx)(HSn,{ref:e,setNextEnabled:y})},{title:e(`insulin_settings_navigation`),stepNumber:4,renderComponent:e=>(0,G.jsx)(LSn,{ref:e,onOptionSelect:b,setNextEnabled:y})},{title:e(`insulin_settings_navigation`),stepNumber:4,renderComponent:e=>h?(0,G.jsx)(KSn,{ref:e,setNextEnabled:y}):(0,G.jsx)(GSn,{ref:e,setNextEnabled:y})},{title:e(`summary_setup_navigation`),stepNumber:5,renderComponent:e=>(0,G.jsx)(JSn,{ref:e,setNextEnabled:y})}],[b,y,h,e]);(0,U.useEffect)(()=>{o.setOptions({headerTransparent:!0,header:()=>(0,G.jsx)(P5,{title:x[l].title,overlay:!0})})},[l,o,x]),(0,U.useEffect)(()=>{if(!v.current)return;let{isValid:e}=v.current.validateData();m(e)},[l,x]);let S=(0,U.useCallback)(async()=>{if(!v.current)return;let{transitionAllowed:e}=await v.current.onNextPressed();if(e)if(l===x.length-1){Tq||a(!0),i(!0);let e=Tq?{name:I5.QuickGuideStack}:{name:I5.PINCodeSetup,params:{comingFrom:I5.Setup}};o.dispatch(v$({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,U.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 R$((0,U.useCallback)(()=>{let e=Sf.addEventListener(`hardwareBackPress`,()=>(C(),!0));return()=>{e.remove()}},[C])),(0,G.jsxs)(V,{style:[ZSn.container,{backgroundColor:t.bgSecondary}],children:[(0,G.jsx)(Uc,{ref:_,data:x,renderItem:({item:e,index:t})=>t<=d?e.renderComponent(t===l?v:null):(0,G.jsx)(V,{style:{width:n}}),scrollEnabled:!1,horizontal:!0,initialNumToRender:1,showsHorizontalScrollIndicator:!1}),(0,G.jsx)(J9,{currentStep:s,onPress:S,onBackPress:C,inactive:!p,text:l===x.length-1?e(`button_complete`):e(`button_next`)})]})},ZSn=z.create({container:{flex:1}});H();var QSn=({isVisible:e,onCancelPress:t,onContinuePress:n,onModalHide:r})=>{let{t:i}=Sq(),{COLORS:a}=Y(),[o,s]=(0,U.useState)([!1,!1]),[c,l]=(0,U.useState)(!1),u=(0,U.useMemo)(()=>o.every(Boolean),[o]);(0,U.useEffect)(()=>{e&&(s([!1,!1]),l(!1))},[e]);let d=(0,U.useCallback)(e=>{s(t=>t.map((t,n)=>n===e?!t:t))},[]),f=(0,U.useCallback)(()=>{c&&u&&r()},[u,c,r]),p=(0,U.useCallback)(()=>{l(!0),n()},[n]);return(0,G.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,G.jsx)(Q,{style:$9.title,children:i(`welcome_modal_title`)}),(0,G.jsx)(Q,{style:[$9.subtitle,{color:a.labelSecondary}],children:i(`welcome_modal_body`)}),(0,G.jsxs)(Cp,{testID:`restrictions_checkmark_1`,onPress:()=>{d(0)},style:({pressed:e})=>[{opacity:e?.5:1},$9.checkmarkContainer],children:[o[0]?(0,G.jsx)(V7t,{}):(0,G.jsx)(B7t,{}),(0,G.jsxs)(V,{style:$9.checkmarkTextContainer,children:[(0,G.jsx)(Q,{style:$9.checkmarkTitle,children:i(`welcome_modal_pregnancy_title`)}),(0,G.jsx)(Q,{style:[$9.checkmarkSubtitle,{color:a.labelSecondary}],children:i(`welcome_modal_pregnancy_body`)})]})]}),(0,G.jsx)(V,{style:[$9.separatorLine,{backgroundColor:a.divider}]}),(0,G.jsxs)(Cp,{testID:`restrictions_checkmark_2`,onPress:()=>{d(1)},style:({pressed:e})=>[{opacity:e?.5:1},$9.checkmarkContainer],children:[o[1]?(0,G.jsx)(V7t,{}):(0,G.jsx)(B7t,{}),(0,G.jsxs)(V,{style:$9.checkmarkTextContainer,children:[(0,G.jsx)(Q,{style:$9.checkmarkTitle,children:i(`welcome_modal_gestational_title`)}),(0,G.jsx)(Q,{style:[$9.checkmarkSubtitle,{color:a.labelSecondary}],children:i(`welcome_modal_gestational_body`)})]})]})]})},$9=z.create({title:{...X.Poppins.bold_2XL,marginTop:32,marginBottom:8},subtitle:{...X.Poppins.regular_Base,marginBottom:16},checkmarkContainer:{paddingVertical:16,flexDirection:`row`,justifyContent:`space-between`},checkmarkTextContainer:{flex:1,marginLeft:8},checkmarkTitle:{...X.Poppins.semiBold_Base,marginBottom:2},checkmarkSubtitle:{...X.Poppins.regular_SM},separatorLine:{width:`100%`,height:1}});H();var $Sn=()=>{let{t:e}=Sq(),{navigate:t}=A$(),{clear:n}=o7(),{COLORS:r}=Y(),[i,a]=(0,U.useState)(!1);(0,U.useEffect)(()=>{n()},[n]);let o=(0,U.useCallback)(()=>{a(!0),u8(l8.SetupIntroStartPress)},[]);return(0,G.jsxs)(V,{style:[eCn.container,{backgroundColor:r.bgSecondary}],children:[(0,G.jsx)(xSn,{title:e(`setup_account_title`),subtitle:e(`setup_account_body`),stepChecked:1}),(0,G.jsx)(J9,{currentStep:1,isBackVisible:!1,onPress:o,text:e(`button_start`)}),(0,G.jsx)(QSn,{isVisible:i,onCancelPress:()=>{a(!1)},onContinuePress:()=>{a(!1)},onModalHide:()=>{t(I5.Setup)}})]})},eCn=z.create({container:{flex:1}}),{Navigator:tCn,Screen:nCn}=A5(),rCn=()=>{let{t:e}=Sq();return(0,G.jsxs)(tCn,{screenOptions:{...K5},children:[(0,G.jsx)(nCn,{name:I5.SetupStart,component:$Sn,options:{header:()=>(0,G.jsx)(P5,{title:e(`setup_account_navigation`),overlay:!0})}}),(0,G.jsx)(nCn,{name:I5.Setup,component:XSn,options:{header:()=>(0,G.jsx)(P5,{title:e(`general_navigation`),overlay:!0})}})]})},{Navigator:iCn,Screen:aCn}=A5(),oCn=()=>{let{hasCompletedSetupFlow:e}=E3(),t=U.useMemo(()=>e?I5.QuickGuideStack:I5.SetupBolusCalculator,[e]);return(0,G.jsxs)(iCn,{initialRouteName:t,screenOptions:{...K5,headerShown:!1},children:[(0,G.jsx)(aCn,{name:I5.SetupBolusCalculator,component:rCn}),(0,G.jsx)(aCn,{name:I5.QuickGuideStack,component:ISn})]},t)},sCn=()=>{let{isOnboardingFinished:e,setIsOnboardingFinished:t}=E3(),[n,r]=U.useState(!1),i=(0,U.useCallback)(async()=>{if(await K8.syncAll(),!k8.uuid){if(_q.IS_PRODUCTION===`true`)throw window.location.href=`/redirect?status=error`,Error(`[App::syncData] User settings not found`);k8.updateMockUserSettings()}t(Z6t(Z.BloodGlucoseUnit).safeParse(k8.glucoseUnit).success)},[t]);return(0,U.useEffect)(()=>{i().catch(console.error).finally(()=>{r(!0)})},[i]),!n||e===void 0?(0,G.jsx)(b2,{}):e?(0,G.jsx)(bSn,{}):(0,G.jsx)(oCn,{})},cCn={prefixes:[],config:{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`}}}}};J0();var lCn=vWt();_q.SENTRY_ENABLED===`true`&&U1t({dsn:_q.SENTRY_DSN,environment:_q.SENTRY_ENVIRONMENT,beforeSend:(e,t)=>{let n=e.exception?.values?.[0],r=[n?.type,n?.value].filter(Boolean).join(`: `);if(r.includes(hvt.NetworkErrorFailure)||r.includes(hvt.NetworkErrorTimeout)||_q.IS_PRODUCTION===`false`&&r.includes(hvt.TranslationError))return null;if(t.originalException instanceof T2){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 uCn=()=>{let{colorScheme:e}=g2(),{COLORS:t}=Y(),n=e===`light`?PKt:SKt;return(0,G.jsx)(H3t,{children:(0,G.jsx)(oSt,{children:(0,G.jsx)(x4t,{children:(0,G.jsx)(S2t,{children:(0,G.jsx)(R0t,{client:z4t,children:(0,G.jsx)(NKt,{theme:{...n,colors:{...n.colors,background:t.bgPrimary,border:t.divider,text:t.labelPrimary},fonts:{...n.fonts,regular:{...n.fonts.regular,fontFamily:x2.PoppinsRegular},medium:{...n.fonts.medium,fontFamily:x2.PoppinsMedium},bold:{...n.fonts.bold,fontFamily:x2.PoppinsSemiBold},heavy:{...n.fonts.heavy,fontFamily:x2.PoppinsBold}}},ref:lCn,linking:cCn,children:(0,G.jsx)(IUt,{children:(0,G.jsx)(sCn,{})})})})})})})})},dCn=u(y());xvt(),dCn.createRoot(document.getElementById(`root`)).render((0,G.jsx)(uCn,{}));
|
|
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,G.jsx)(V,{...r,pointerEvents:`box-none`,style:[e&&i?idn.page:idn.card,n]})}var idn=z.create({page:{minHeight:`100%`},card:{flex:1,overflow:`hidden`}});H();var adn=.3,odn=1,T5=0,sdn=B.OS!==`web`,cdn=e=>{if(e){let t=z.flatten(e);return`opacity`in t&&t.opacity!=null}return!1},ldn=({closing:e,layout:t,gestureDirection:n,direction:r,preloaded:i})=>!e&&!i?0:f5(t,n,r===`rtl`),udn=({style:e})=>e?(0,G.jsx)(cf.View,{pointerEvents:`none`,style:[E5.overlay,e]}):null;function ddn({shadowEnabled:e=!1,gestureEnabled:t=!0,gestureVelocityImpact:n=adn,overlay:r=udn,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=U.useRef(!1),ee=U.useRef(void 0),te=U.useRef(void 0),ne=U.useRef(void 0),re=U.useRef(void 0),ie=U.useRef(void 0),[j]=U.useState(()=>new cf.Value(T5)),[M]=U.useState(()=>new cf.Value(d5(h,p===`rtl`))),[ae]=U.useState(()=>({width:new cf.Value(d.width),height:new cf.Value(d.height)})),[oe]=U.useState(()=>new cf.Value(T5)),N=S$(()=>{te.current===void 0&&(te.current=ws.createInteractionHandle())}),se=S$(()=>{te.current!==void 0&&(ws.clearInteractionHandle(te.current),te.current=void 0)}),P=S$(({closing:e,velocity:t})=>{let n=ldn({closing:e,layout:d,gestureDirection:h,direction:p,preloaded:E});ee.current=n,j.setValue(e?odn:T5);let r=e?T.close:T.open,a=r.animation===`spring`?cf.spring:cf.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(()=>{ue()})};i?(N(),a(u,{...r.config,velocity:t,toValue:n,useNativeDriver:sdn,isInteraction:!1}).start(({finished:e})=>{se(),clearTimeout(re.current),e&&o()})):o()}),F=S$(({nativeEvent:e})=>{switch(e.state){case u5.ACTIVE:clearTimeout(re.current),clearTimeout(ie.current),oe.setValue(odn),N(),y?.();break;case u5.CANCELLED:case u5.FAILED:oe.setValue(T5),se(),P({closing:s,velocity:h===`vertical`||h===`vertical-inverted`?e.velocityY:e.velocityX}),b?.();break;case u5.END:{oe.setValue(T5);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)*d5(h,p===`rtl`)>t/2?i!==0||r!==0:s;P({closing:a,velocity:i}),a&&(re.current=setTimeout(()=>{_(),ie.current=setTimeout(()=>{ue()},32)},16)),x?.();break}}});U.useLayoutEffect(()=>{ae.width.setValue(d.width),ae.height.setValue(d.height),M.setValue(d5(h,p===`rtl`))},[h,p,M,ae.width,ae.height,d.width,d.height]);let ce=U.useRef(null);U.useEffect(()=>()=>{se(),ne.current&&cancelAnimationFrame(ne.current),clearTimeout(re.current),clearTimeout(ie.current)},[]);let le=U.useRef(void 0),ue=S$(()=>{if(clearTimeout(re.current),clearTimeout(ie.current),!A.current)clearTimeout(le.current),le.current=setTimeout(()=>{A.current=!0,P({closing:s})},0);else{let e=ce.current?.opening,t=ce.current?ldn(ce.current):null,n=ldn({closing:s,layout:d,gestureDirection:h,direction:p,preloaded:E});t!==n||ee.current!==n?P({closing:s}):typeof e==`boolean`&&o&&!e&&(u.setValue(f5(d,h,p===`rtl`)),P({closing:s}))}});U.useEffect(()=>{E||(ue(),ce.current={opening:o,closing:s,layout:d,gestureDirection:h,direction:p,preloaded:E})},[P,s,p,u,h,d,o,E,ue]);let de=U.useMemo(()=>({index:a,current:{progress:l},next:c&&{progress:c},closing:j,swiping:oe,inverted:M,layouts:{screen:d},insets:{top:f.top,right:f.right,bottom:f.bottom,left:f.left}}),[a,l,c,j,oe,M,d,f.top,f.right,f.bottom,f.left]),{containerStyle:fe,cardStyle:pe,overlayStyle:me,shadowStyle:he}=U.useMemo(()=>D(de),[D,de]),I=U.useMemo(()=>t?cf.event([{nativeEvent:h===`vertical`||h===`vertical-inverted`?{translationY:u}:{translationX:u}}],{useNativeDriver:sdn}):void 0,[u,h,t]),{backgroundColor:ge}=z.flatten(k||{}),L=typeof ge==`string`?(0,a5.default)(ge).alpha()===0:!1;return(0,G.jsxs)(Qun.Provider,{value:de,children:[B.OS===`web`?null:(0,G.jsx)(cf.View,{style:{opacity:l},collapsable:!1}),C?(0,G.jsx)(V,{pointerEvents:`box-none`,style:z.absoluteFill,children:r({style:me})}):null,(0,G.jsx)(cf.View,{pointerEvents:`box-none`,style:[E5.container,fe,O],children:(0,G.jsx)(nln,{enabled:d.width!==0&&t,onGestureEvent:I,onHandlerStateChange:F,...tdn({layout:d,direction:p,gestureDirection:h,gestureResponseDistance:w}),children:(0,G.jsxs)(cf.View,{pointerEvents:`box-none`,needsOffscreenAlphaCompositing:cdn(pe),style:[E5.container,pe],children:[e&&he&&!L?(0,G.jsx)(cf.View,{pointerEvents:`none`,style:[E5.shadow,h===`horizontal`?[E5.shadowHorizontal,E5.shadowStart]:h===`horizontal-inverted`?[E5.shadowHorizontal,E5.shadowEnd]:h===`vertical`?[E5.shadowVertical,E5.shadowTop]:[E5.shadowVertical,E5.shadowBottom],{backgroundColor:ge},he]}):null,(0,G.jsx)(rdn,{enabled:m,layout:d,style:k,children:S})]})})})]})}var E5=z.create({container:{flex:1},overlay:{flex:1,backgroundColor:`#000`},shadow:{position:`absolute`},shadowHorizontal:{top:0,bottom:0,width:3,...ndn({offset:{width:-1,height:1},radius:5,opacity:.3})},shadowStart:{start:0},shadowEnd:{end:0},shadowVertical:{start:0,end:0,height:3,...ndn({offset:{width:1,height:-1},radius:5,opacity:.3})},shadowTop:{top:0},shadowBottom:{bottom:0}});H();var fdn=U.forwardRef(({focused:e,active:t,animated:n,isNextScreenTransparent:r,detachCurrentScreen:i,children:a},o)=>{let[s,c]=U.useState(!1);U.useImperativeHandle(o,()=>({setInert:c}),[]);let l=!n&&r===!1&&i!==!1&&!e;return(0,G.jsx)(V,{"aria-hidden":!e,pointerEvents:(n?s:!e)?`none`:`box-none`,style:[z.absoluteFill,{overflow:t?void 0:`hidden`,display:B.OS!==`web`&&l?`none`:`flex`,visibility:l?`hidden`:`visible`}],collapsable:!1,children:a})});fdn.displayName=`CardA11yWrapper`,H();var pdn=.1;function mdn({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=U.useRef(null),{direction:te}=U$(),ne=U.useContext(Jcn),{options:re}=A.descriptor,{onPageChangeStart:ie,onPageChangeCancel:j,onPageChangeConfirm:M}=Zun({enabled:o&&re.keyboardHandlingEnabled!==!1,focused:o}),ae=()=>{let{route:e}=A.descriptor;S({route:e},!1),v({route:e})},oe=()=>{let{route:e}=A.descriptor;S({route:e},!0),_({route:e})},N=()=>{let{route:e}=A.descriptor;ie(),x({route:e})},se=()=>{let{route:e}=A.descriptor;j(),y({route:e})},P=()=>{let{route:e}=A.descriptor;b({route:e})},F=({closing:e,gesture:t})=>{ee.current?.setInert(e);let{route:r}=A.descriptor;M?.({gesture:t,active:n,closing:e}),C?.({route:r},e)},ce={top:k,right:O,bottom:E,left:D},{colors:le}=L$();U.useEffect(()=>{let e=A.progress.next?.addListener?.(({value:e})=>{ee.current?.setInert(e>pdn)});return()=>{e&&A.progress.next?.removeListener?.(e)}},[A.progress.next]);let{presentation:ue,animation:de,cardOverlay:fe,cardOverlayEnabled:pe,cardShadowEnabled:me,cardStyle:he,cardStyleInterpolator:I,gestureDirection:ge,gestureEnabled:L,gestureResponseDistance:_e,gestureVelocityImpact:ve,headerMode:ye,headerShown:be,headerTransparent:R,transitionSpec:xe}=A.descriptor.options,{buildHref:Se}=LKt(),Ce=c({route:A.descriptor.route}),we,Te;if(Ce){let{options:e,route:t}=Ce.descriptor;we=vcn(e,t.name),Te=Se(t.name,t.params)}let Ee=Ce!=null,De=U.useMemo(()=>{if(Ee)return{href:Te,title:we}},[Ee,we,Te]),Oe=de!==`none`;return(0,G.jsx)(fdn,{ref:ee,focused:o,active:n,animated:Oe,isNextScreenTransparent:m,detachCurrentScreen:h,children:(0,G.jsx)(ddn,{animated:Oe,interpolationIndex:e,gestureDirection:ge,layout:g,insets:ce,direction:te,gesture:a,current:A.progress.current,next:A.progress.next,opening:r,closing:i,onOpen:ae,onClose:oe,overlay:fe,overlayEnabled:pe,shadowEnabled:me,onTransition:F,onGestureBegin:N,onGestureCanceled:se,onGestureEnd:P,gestureEnabled:t===0?!1:L,gestureResponseDistance:_e,gestureVelocityImpact:ve,transitionSpec:xe,styleInterpolator:I,pageOverflowEnabled:ye!==`float`&&ue!==`modal`,preloaded:w,containerStyle:u&&ye!==`screen`?{marginTop:d}:null,contentStyle:[{backgroundColor:ue===`transparentModal`?`transparent`:le.background},he],children:(0,G.jsx)(V,{style:gdn.container,children:(0,G.jsxs)(tln.Provider,{value:s,children:[ye===`float`?null:T({mode:`screen`,layout:g,scenes:[Ce,A],getPreviousScene:c,getFocusedRoute:l,onContentHeightChange:f,style:[gdn.header,R?{minHeight:d}:null]}),(0,G.jsx)(V,{style:gdn.scene,children:(0,G.jsx)(qcn.Provider,{value:De,children:(0,G.jsx)(c5.Provider,{value:p||be!==!1,children:(0,G.jsx)(Jcn.Provider,{value:be===!1?ne??0:d,children:A.descriptor.render()})})})})]})})})})}var hdn=U.memo(mdn),gdn=z.create({container:{flex:1},header:{zIndex:1},scene:{flex:1}});H();var _dn={default:$8,fade:qsn,fade_from_bottom:Hsn,fade_from_right:Gsn,none:$8,reveal_from_bottom:Usn,scale_from_center:Wsn,slide_from_left:Ysn,slide_from_right:Q8,slide_from_bottom:B.select({ios:Bsn,default:Ksn})},vdn=1e-5,D5=0,ydn=1,bdn=2,xdn=Object.freeze({options:{}}),Sdn=(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},O5=e=>e===vsn||e.name===`forModalPresentationIOS`,Cdn=(e,t,n)=>{if(n)return!0;let{cardStyleInterpolator:r}=e.descriptor.options;return O5(r)&&t!==0},wdn=(e,t,n,r,i,a)=>e.reduce((o,s,c)=>{let{headerStatusBarHeight:l=n?0:t.top,headerStyle:u}=s.descriptor.options,d=z.flatten(u||{}),f=`height`in d&&typeof d.height==`number`?d.height:a[s.route.key],p=Cdn(s,Sdn(e,c),r);return o[s.route.key]=typeof f==`number`?f:_cn(i,p,l),o},{}),Tdn=(e,t,n)=>{if(t?.gestureDirection)return f5(e,t.gestureDirection,n);let r=t?.presentation===`modal`?Jsn.gestureDirection:$8.gestureDirection;return f5(e,t?.animation?_dn[t?.animation]?.gestureDirection:r,n)},Edn=(e,t,n,r)=>{let i=Tdn({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 Ddn(e){let t=B.OS!==`web`&&B.OS!==`windows`&&B.OS!==`macos`;return e??(t?`default`:`none`)}function Odn(e){return Ddn(e)!==`none`}var kdn=class extends U.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 cf.Value(e.openingRouteKeys.includes(r.key)&&Odn(a)||e.state.preloadedRoutes.includes(r)?Tdn(t.layout,i?.options,e.direction===`rtl`):0),n},{}),r=uln([...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:xdn),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=Ddn(_.animation),b=Odn(y),x=y==="default"?_.presentation===`transparentModal`?qsn:_.presentation===`modal`||v?Jsn:$8:_dn[y],{gestureEnabled:S=B.OS===`ios`&&b,gestureDirection:C=x.gestureDirection,transitionSpec:w=x.transitionSpec,cardStyleInterpolator:T=b?x.cardStyleInterpolator:Tsn,headerStyleInterpolator:E=x.headerStyleInterpolator,cardOverlayEnabled:D=B.OS!==`ios`&&_.presentation!==`transparentModal`||O5(T)}=_,O=m.options.headerMode??(!(_.presentation===`modal`||_.presentation===`transparentModal`||h?.presentation===`modal`||h?.presentation===`transparentModal`||O5(T))&&B.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:Edn(d,t.layout,m.options,k),next:p&&h?.presentation!==`transparentModal`?Edn(p,t.layout,h,k):void 0,previous:f?Edn(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:O5(r.cardStyleInterpolator)?t!==lln(i,e=>{let{cardStyleInterpolator:t}=e.descriptor.options;return t===vsn||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===D5&&!c)o=D5;else{let e=i[a.length-1],t=r===a.length-1?bdn:c?ydn:D5;o=e?e.progress.current.interpolate({inputRange:[0,1-vdn,1],outputRange:[1,1,t],extrapolate:`clamp`}):ydn}return o})}return{routes:e.routes,scenes:i,gestures:n,descriptors:e.descriptors,activeStates:a,headerHeights:wdn(i,e.insets,e.isParentHeaderShown,e.isParentModal,t.layout,t.headerHeights)}}constructor(e){super(e),this.state={routes:[],scenes:[],gestures:{},layout:$cn.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:wdn(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=B.OS===`web`||B.OS===`android`||B.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,G.jsxs)(V,{style:k5.container,children:[s({mode:`float`,layout:_,scenes:g,getPreviousScene:this.getPreviousScene,getFocusedRoute:this.getFocusedRoute,onContentHeightChange:this.handleHeaderLayout,style:[k5.floating,C&&[{height:S},k5.absolute]]}),(0,G.jsx)(Yun,{enabled:h,style:k5.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,M=k===!1?0:b[S.key],ae=Sdn(g,w),oe=Cdn(D,ae,l),N=g[w+1]?.descriptor.options.presentation===`transparentModal`,se=g[w+1]?.descriptor.options.detachPreviousScreen!==!1,P=O?D5:y[w];return(0,G.jsx)(Xun,{style:[z.absoluteFill],enabled:h,active:P,freezeOnBlur:ee,shouldFreeze:P===D5&&!O,homeIndicatorHidden:te,pointerEvents:`box-none`,children:(0,G.jsx)(hdn,{index:w,interpolationIndex:ae,modal:oe,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:M,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:N,detachCurrentScreen:se,preloaded:O})},S.key)})})]})}},k5=z.create({container:{flex:1},absolute:{position:`absolute`,top:0,start:0,end:0},floating:{zIndex:1}});H(),J0();var Adn=rln??V,jdn=(e,t)=>e.length===t.length&&e.every((e,n)=>Object.is(e,t[n])),Mdn=class extends U.Component{static getDerivedStateFromProps(e,t){let n=[...e.state.routes,...e.state.preloadedRoutes],r=t.previousState?[...t.previousState.routes,...t.previousState.preloadedRoutes]:[];if(jdn(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),!jdn(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=>Odn((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,G.jsx)(sln,{...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 v$({...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({...x$.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,G.jsx)(Adn,{style:Ndn.container,children:(0,G.jsx)($cn,{children:(0,G.jsx)(U0.Consumer,{children:t=>(0,G.jsx)(tln.Consumer,{children:c=>(0,G.jsx)(c5.Consumer,{children:l=>(0,G.jsx)(kdn,{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})})})})})})}},Ndn=z.create({container:{flex:1}});function Pdn({id:e,initialRouteName:t,UNSTABLE_routeNamesChangeBehavior:n,children:r,layout:i,screenListeners:a,screenOptions:o,screenLayout:s,UNSTABLE_router:c,...l}){let{direction:u}=U$(),{state:d,describe:f,descriptors:p,navigation:m,NavigationContent:h}=vKt(hWt,{id:e,initialRouteName:t,UNSTABLE_routeNamesChangeBehavior:n,children:r,layout:i,screenListeners:a,screenOptions:o,screenLayout:s,UNSTABLE_router:c});return U.useEffect(()=>m.addListener?.(`tabPress`,e=>{let t=m.isFocused();requestAnimationFrame(()=>{d.index>0&&t&&!e.defaultPrevented&&m.dispatch({...x$.popToTop(),target:d.key})})}),[m,d.index,d.key]),(0,G.jsx)(h,{children:(0,G.jsx)(Mdn,{...l,direction:u,state:d,describe:f,descriptors:p,navigation:m})})}function A5(e){return YWt(Pdn)(e)}H();var Fdn={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%)`},Idn=`blur(5px)`,Ldn=({direction:e,style:t})=>{let n=Fdn[e];return(0,G.jsx)(V,{style:[t,{backdropFilter:Idn,WebkitBackdropFilter:Idn,maskImage:n,WebkitMaskImage:n}],pointerEvents:`none`})};H();var Rdn=50,j5=44,zdn=44,Bdn=10,Vdn=54,Hdn=6;function M5(e=!1){let{top:t}=Q4();return(e?16:t)+Vdn}var Udn=(0,U.memo)(function({title:e,LeftButton:t,RightButton:n,BottomContent:r,hasHeaderRow:i,style:a}){let[o,s]=(0,U.useState)(j5),[c,l]=(0,U.useState)(j5),{COLORS:u}=Y(),d=(0,U.useMemo)(()=>Math.max(o,c,j5),[o,c]),f=(0,U.useCallback)(e=>{let t=Math.round(e.nativeEvent.layout.width);t&&t!==o&&s(t)},[o]),p=(0,U.useCallback)(e=>{let t=Math.round(e.nativeEvent.layout.width);t&&t!==c&&l(t)},[c]);return(0,G.jsxs)(V,{style:a,children:[i&&(0,G.jsxs)(V,{style:N5.headerRow,children:[(0,G.jsx)(V,{style:[N5.sideContainer,{minWidth:d}],onLayout:f,children:t??(0,G.jsx)(V,{style:{minWidth:d}})}),e?(0,G.jsx)(Q,{style:[N5.headerTitle,{color:u.textNavigationBar}],numberOfLines:1,allowFontScaling:!1,children:e}):(0,G.jsx)(V,{style:N5.placeHolderTitle}),(0,G.jsx)(V,{style:[N5.sideContainer,{minWidth:d}],onLayout:p,children:n??(0,G.jsx)(V,{style:{minWidth:d}})})]}),r]})});function Wdn({title:e,LeftButton:t,RightButton:n,BottomContent:r,extraBlurSize:i=0,skipTopInset:a=!1,color:o,overlay:s=!1}){let{COLORS:c}=Y(),{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?Rdn+i:0+i,h=(0,U.useMemo)(()=>({backdrop:{height:u+Vdn+Hdn+m},container:{marginTop:u}}),[u,m]),g=Tq&&s?N5.overlay:void 0;return Eq||Tq?(0,G.jsxs)(V,{style:g,children:[(0,G.jsxs)(V,{style:{pointerEvents:`none`},children:[(0,G.jsx)(z4.default,{colors:[d,f],style:[N5.gradient,h.backdrop]}),(0,G.jsx)(Ldn,{direction:`blurredTopClearBottom`,style:[N5.blur,h.backdrop],fallbackColor:d})]}),(0,G.jsx)(Udn,{title:e,LeftButton:t,RightButton:n,BottomContent:r,style:h.container,hasHeaderRow:p})]}):(0,G.jsxs)(V,{children:[(0,G.jsx)(z4.default,{colors:[d,f],style:[N5.gradient,h.backdrop,{pointerEvents:`none`}]}),(0,G.jsx)(Udn,{title:e,LeftButton:t,RightButton:n,BottomContent:r,style:h.container,hasHeaderRow:p})]})}var N5=z.create({headerRow:{flexDirection:`row`,alignItems:`center`,paddingHorizontal:16,justifyContent:`space-between`,paddingBottom:Bdn},sideContainer:{minWidth:j5,minHeight:zdn,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:{...X.Poppins.medium_Base,flex:1,textAlign:`center`,paddingHorizontal:16},placeHolderTitle:{flex:1}}),P5=(0,U.memo)(Wdn),F5=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.ConfirmPINCode=`ConfirmPINCode`,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.LicensingStatus=`LicensingStatus`,e.LicensingWebView=`LicensingWebView`,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}({}),Gdn=async e=>{let t=`${_q.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 E2(n,Z.StatusCode.CREATED,t,Z.HTTPRequestMethod.POST),await n.json()},Kdn=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)},qdn={foodIntakeItems:[],visualSearchIds:[],foodIntakeCarbsAmount:0,manualCarbsInput:0},L5=pq()((e,t)=>({...qdn,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=Kdn(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:Kdn(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 zan({startDate:o,endDate:o,visualSearchIds:a,items:[...s,...c]});try{return{sampleId:(await Gdn({type:`carbohydrates`,startDate:o,endDate:o,quantity:{unit:`g`,value:r+i},metadata:{foodIntakeId:l.id}})).id,foodIntakeId:l.id}}catch(e){throw await Ban(l.id).catch(console.error),e}},clear:()=>{e(qdn)}})),Jdn={availableGlucoseReadings:[],selectedReadingId:null},R5=pq()((e,t)=>({...Jdn,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(Jdn)}}})),Ydn={isGoToSettingsPressed:!1,isNoBGModalVisible:!1,showCalculationInfoModal:!1,showDiscardCalculationModal:!1,showDiscardSmartPenSetupModal:!1,showSyncErrorModal:!1},z5=pq()(e=>({...Ydn,modalStoreActions:{set:t=>{e(e=>({...e,...t}))},clear:()=>{e(Ydn)}}})),Xdn={noteId:null,noteBody:``,displayImageUri:null},B5=pq()(e=>({...Xdn,noteStoreActions:{set:t=>{e(e=>({...e,...t}))},clear:()=>{e(Xdn)}}}));H();var V5={top:10,bottom:10,left:20,right:20},H5=()=>{let{goBack:e}=A$(),{COLORS:t}=Y();return(0,G.jsx)(Cp,{onPress:e,testID:`header-back-button`,style:({pressed:e})=>[G5.button,{opacity:e?.5:1,backgroundColor:t.bgBtnSecondary,borderColor:t.border}],hitSlop:V5,children:(0,G.jsx)(H7t,{height:28,width:28})})},U5=({onPress:e})=>{let{pop:t}=A$(),{COLORS:n}=Y();return(0,G.jsx)(Cp,{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,G.jsx)(W7t,{height:28,width:28})})},Zdn=({style:e})=>{let{navigate:t}=A$(),{COLORS:n}=Y(),r=(0,U.useRef)(0);return(0,G.jsx)(Cp,{onPress:(0,U.useCallback)(()=>{let e=Date.now();e-r.current<500||(r.current=e,u8(l8.SettingsTabPress),Tq?(L5.getState().clear(),R5.getState().glucoseStoreActions.clear(),B5.getState().noteStoreActions.clear(),t(F5.ConfirmPINCode)):t(F5.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,G.jsx)(s9t,{})})},Qdn=({onPress:e,testID:t=`header-info-button`,style:n})=>{let{COLORS:r}=Y(),{modalStoreActions:i}=z5();return(0,G.jsx)(Cp,{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,G.jsx)(J7t,{height:28,width:28})})},W5=({onPress:e,disabled:t=!1})=>{let{COLORS:n}=Y();return(0,G.jsx)(Cp,{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,G.jsx)(G4,{height:28,width:28,color:n.iconButtonPrimary})})},$dn=({onPress:e})=>{let{COLORS:t}=Y();return(0,G.jsx)(Cp,{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,G.jsx)(K7t,{height:28,width:28})})},efn=({onPress:e,isLocked:t})=>{let{COLORS:n}=Y();return(0,G.jsx)(Cp,{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,G.jsx)(X7t,{height:28,width:28}):(0,G.jsx)(o9t,{height:28,width:28})})},G5=z.create({button:{padding:8,borderRadius:22,borderWidth:1}});({...X.Poppins.medium_Base});var K5={cardStyle:{flex:1},headerShown:!0,headerLeft:H5,headerTitleStyle:{...X.Poppins.medium_Base},headerTitleAlign:`center`,headerTitleAllowFontScaling:!1,title:``},tfn={...K5,animation:`slide_from_bottom`,presentation:`modal`,headerLeft:U5,headerLeftContainerStyle:{flex:1},headerTitleContainerStyle:{flex:3,alignItems:`center`},headerRightContainerStyle:{flex:1}},nfn=async e=>{let t=`${_q.ASSET_BASE_URL}/api/v1/assets/${e}`,n=await d8(t,{method:`GET`,headers:{Accept:`application/json`}});return await E2(n,Z.StatusCode.OK,t),n.json()},rfn=async e=>{let t=`${_q.ASSET_BASE_URL}/api/v1/assets/${e}`;await E2(await d8(t,{method:`DELETE`}),Z.StatusCode.NO_CONTENT,t,Z.HTTPRequestMethod.DELETE)},q5=[`foods`,`personal`],ifn=()=>{let{data:e=[],isLoading:t,isError:n,refetch:r}=_0({queryKey:q5,queryFn:Aan,staleTime:1e3*60*5,networkMode:`offlineFirst`,retry:3});return{personalFoods:e,isPersonalFoodsLoading:t,isPersonalFoodsError:n,refetchPersonalFoods:r}},afn=()=>{let e=g0(),{mutateAsync:t,isPending:n,isError:r,error:i}=Q0t({mutationFn:Lan,onSuccess:()=>{e.invalidateQueries({queryKey:q5})}});return{createPersonalFood:t,isCreatingPersonalFood:n,createPersonalFoodError:r?i:null}},ofn=e=>[`foods`,`item`,e],sfn=e=>{let{data:t=null,isLoading:n,isError:r,refetch:i}=_0({queryKey:ofn(e),queryFn:()=>Pan(e),staleTime:1e3*60*5,networkMode:`offlineFirst`,retry:3});return{food:t,isFoodLoading:n,isFoodError:r,refetchFood:i}},J5=[`foods`,`search`],cfn=e=>[...J5,e],lfn=e=>{let{data:t=[],isLoading:n,isError:r,refetch:i}=_0({queryKey:cfn(e),queryFn:()=>Nan(e),enabled:e.length>2,staleTime:1e3*60*5,networkMode:`offlineFirst`,retry:3});return{foodSearchResults:t,isFoodSearchLoading:n,isFoodSearchError:r,refetchFoodSearch:i}},ufn=()=>{let e=g0(),{mutateAsync:t,isPending:n}=Q0t({mutationFn:e=>Ian(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(ofn(n),null),e.invalidateQueries({queryKey:q5}),e.invalidateQueries({queryKey:J5})}});return{deletePersonalFood:t,isDeletingPersonalFood:n}},dfn=()=>{let e=g0(),{mutateAsync:t,isPending:n}=Q0t({mutationFn:({foodId:e,request:t})=>Fan(e,t),onSuccess:t=>{e.setQueryData(ofn(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}};H();var ffn={outlineStyle:`none`};function pfn({value:e,onChangeText:t,imageUri:n,containerStyle:r,testID:i,autoFocus:a,maxLength:o=1024}){let{COLORS:s}=Y(),{t:c}=Sq(),l=(0,U.useRef)(null);return(0,U.useEffect)(()=>{if(!a)return;let e=setTimeout(()=>{l.current?.focus()},300);return()=>{clearTimeout(e)}},[a]),(0,G.jsxs)(V,{style:[mfn.container,{backgroundColor:s.bgInputActive},r],testID:i,children:[(0,G.jsx)(Ip,{ref:l,value:e,onChangeText:t,placeholder:c(`notes_placeholder`),placeholderTextColor:s.labelTertiary,multiline:!0,maxLength:o,style:[mfn.input,{color:s.labelPrimary},ffn],cursorColor:s.iconBrand,testID:`${i}-input`}),!!n&&(0,G.jsx)(Xu,{source:{uri:n},style:mfn.image,resizeMode:`cover`,testID:`${i}-image`})]})}var mfn=z.create({container:{borderRadius:16,padding:16,minHeight:160},input:{...X.Poppins.regular_Base,flex:1,marginBottom:16,textAlignVertical:`top`,maxHeight:300},image:{width:`100%`,height:234,borderRadius:12,marginTop:12}});H();function hfn({onPress:e}){let{t}=Sq(),{COLORS:n}=Y();return(0,G.jsx)(Cp,{accessibilityRole:`button`,style:[gfn.button,{backgroundColor:n.iosKeyboardPicker}],onPress:e,testID:`wheel-picker-modal-cancel`,children:(0,G.jsx)(gd,{maxFontSizeMultiplier:S2.s3,style:[gfn.buttonText,{color:n.textKeyboardButtons}],children:t(`button_cancel`)})})}var gfn=z.create({button:{borderRadius:13},buttonText:{fontSize:17,fontWeight:`600`,paddingHorizontal:16,paddingVertical:15,textAlign:`center`}}),Y5=U.memo(hfn);H();function _fn({onPress:e}){let{t}=Sq(),{COLORS:n}=Y();return(0,G.jsx)(Cp,{accessibilityRole:`button`,style:[vfn.button,{backgroundColor:n.iosKeyboardPicker}],onPress:e,testID:`wheel-picker-modal-confirm`,children:(0,G.jsx)(gd,{maxFontSizeMultiplier:S2.s3,style:[vfn.buttonText,{color:n.textKeyboardButtons}],children:t(`button_confirm`)})})}var vfn=z.create({button:{borderBottomLeftRadius:13,borderBottomRightRadius:13},buttonText:{fontSize:17,fontWeight:`400`,paddingHorizontal:16,paddingVertical:15,textAlign:`center`}}),X5=U.memo(_fn),yfn=c({HapticFeedbackTypes:()=>xfn,default:()=>Sfn,triggerHaptic:()=>bfn});function bfn(e=`selection`,t){}var xfn,Sfn,Cfn=o((()=>{xfn=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}({}),Sfn={trigger:(e,t)=>{}}}));Cfn(),H();var wfn=22,Tfn=26;function Efn({textStyle:e,style:t,height:n,fontScale:r,option:i,onItemPress:a}){let{COLORS:o}=Y();return(0,G.jsx)(V,{style:[Dfn.item,t,{height:n}],children:(0,G.jsx)(Cp,{style:Dfn.itemPressable,onPress:a,children:(0,G.jsx)(gd,{allowFontScaling:!1,style:[e,Dfn.itemText,{fontSize:wfn*r,lineHeight:Tfn*r,color:o.labelPrimary}],children:i})})})}var Dfn=z.create({item:{alignItems:`center`,justifyContent:`center`,zIndex:100},itemPressable:{width:`100%`},itemText:{textAlign:`center`,fontWeight:`400`}}),Ofn=U.memo(Efn);H();function kfn({itemHeight:e,visibleRest:t}){let{COLORS:n}=Y(),r=e*t;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(z4.default,{colors:[n.iosKeyboardPicker+`FF`,n.iosKeyboardPicker+`4D`],style:[Afn.mask,{top:0,height:r}]}),(0,G.jsx)(z4.default,{colors:[n.iosKeyboardPicker+`4D`,n.iosKeyboardPicker+`FF`],style:[Afn.mask,{bottom:0,height:r}]})]})}var Afn=z.create({mask:{position:`absolute`,left:0,right:0,pointerEvents:`none`}}),jfn=(0,U.memo)(kfn);H();function Mfn({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}=Sq(),{COLORS:g}=Y(),{width:_,fontScale:v}=$p(),y=Math.min(v,S2.s3),b=Math.round(c*y),x=(1+l*2)*b,S=(0,U.useRef)(null),C=(0,U.useRef)(null);(0,U.useImperativeHandle)(m,()=>({scrollToIndex(e){S.current?.scrollToIndex({index:e,animated:!0})}}),[]);let[w]=(0,U.useState)(new cf.Value(0)),T=(0,U.useMemo)(()=>{let e=[...n];for(let t=0;t<l;t++)e.unshift(null),e.push(null);return e},[n,l]),E=(0,U.useMemo)(()=>[...Array(T.length)].map((e,t)=>t*b),[T,b]),D=(0,U.useCallback)(e=>{Tq||C.current!==e&&(C.current=e)},[]),O=(0,U.useCallback)(e=>{let t=e.nativeEvent.contentOffset.y,i=Math.min(n.length-1,Math.max(0,Math.round(t/b)));D(i),Tq&&(r(i),S.current?.scrollToIndex({index:i,animated:!0}))},[D,b,r,n.length]),k=z3t((...e)=>{let t=e[0];O(t)},100),A=(0,U.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,G.jsxs)(V,{accessible:!0,accessibilityHint:h(`wheelpicker_accessibility_label`),accessibilityLabel:p,accessibilityRole:`adjustable`,style:[Nfn.container,{backgroundColor:g.iosKeyboardPicker,height:x,width:_},a],...d,children:[(0,G.jsx)(V,{style:[Nfn.selectedIndicator,{backgroundColor:g.iosSelectorKeyboard},{transform:[{translateY:-b/2}],height:b,width:_-32-20},i]}),(0,G.jsx)(cf.FlatList,{...f,testID:e,ref:S,showsVerticalScrollIndicator:!1,removeClippedSubviews:vvt,onScroll:cf.event([{nativeEvent:{contentOffset:{y:w}}}],{useNativeDriver:!Tq,listener:Tq?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,G.jsx)(Ofn,{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,G.jsx)(jfn,{itemHeight:b,visibleRest:l})]})}var Nfn=z.create({container:{borderTopLeftRadius:13,borderTopRightRadius:13,alignSelf:`center`},selectedIndicator:{position:`absolute`,borderRadius:7,top:`50%`,alignSelf:`center`}}),Z5=U.memo(Mfn);H();function Pfn({items:e,isVisible:t,onCancel:n,onConfirm:r,onModalHide:i,initialScrollIndex:a,accessibilityLabel:o,testID:s}){let{COLORS:c}=Y(),[l,u]=(0,U.useState)(a),{width:d}=$p();(0,U.useEffect)(()=>{u(a)},[a]);let f=(0,U.useCallback)(e=>{u(e)},[]),p=(0,U.useCallback)(()=>{r(parseFloat(e[l]),l)},[e,r,l]),m=(0,U.useCallback)(()=>{u(a),n()},[a,n]);return(0,G.jsx)(u3,{isVisible:t,containerStyle:{backgroundColor:c.bgTransparent},onModalHide:i,children:(0,G.jsxs)(V,{children:[(0,G.jsx)(V,{style:Ffn.pickersContainer,children:(0,G.jsx)(Z5,{testID:s,initialScrollIndex:a,options:e,onChange:f,accessibilityLabel:o,containerStyle:{width:d-32}})}),(0,G.jsxs)(V,{style:Ffn.buttonContainer,children:[(0,G.jsx)(X5,{onPress:p}),(0,G.jsx)(Y5,{onPress:m})]})]})})}var Q5=U.memo(Pfn),Ffn=z.create({pickersContainer:{flexDirection:`row`,borderTopLeftRadius:13,borderTopRightRadius:13,overflow:`hidden`},buttonContainer:{gap:8}});function $5(e){let t=g0(),[n,r]=(0,U.useState)(null);return(0,U.useEffect)(()=>{if(!e){r(null);return}(async()=>{r((await t.fetchQuery({queryKey:[`asset`,e],queryFn:()=>nfn(e),staleTime:Z.Milliseconds.Minute*5})).downloadUrl)})().catch(console.error)},[e,t]),n}H();var Ifn=({isLiquid:e,setSelected:t})=>{let{COLORS:n}=Y();return(0,G.jsxs)(V,{style:[e7.container,{backgroundColor:n.bgSegmentContainer,borderColor:n.buttonBorder}],children:[(0,G.jsx)(Cp,{style:[e7.segment,!e&&{backgroundColor:n.bgSegmentPrimary}],onPress:()=>{t(!1)},testID:`food-type-food-${e}`,children:(0,G.jsx)(Q,{style:[e7.value,{color:e?n.textLabelInactive:n.textLabelActive}],maxFontSizeMultiplier:S2.s0,children:`g`})}),(0,G.jsx)(Cp,{style:[e7.segment,e&&{backgroundColor:n.bgSegmentPrimary}],onPress:()=>{t(!0)},testID:`food-type-drink-${e}`,children:(0,G.jsx)(Q,{style:[e7.value,{color:e?n.textLabelActive:n.textLabelInactive}],maxFontSizeMultiplier:S2.s0,children:`ml`})})]})},e7=z.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:{...X.Poppins.medium_Base}}),t7=({onModalHide:e})=>{let{t}=Sq(),n=UWt(),{showSyncErrorModal:r,modalStoreActions:i}=z5();return(0,G.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})}}]})};H();var Lfn={title:``,carbohydrates:null,measure:`g`,description:``},Rfn=e=>e?{title:e.title,carbohydrates:e.nutritionPer100g.carbohydrates.value,measure:e.measures[0]?.unit,description:e.description??``}:Lfn,zfn=a3(0,100),Bfn=`create-food`,Vfn=()=>{let{t:e}=Sq(),{COLORS:t}=Y(),{createPersonalFood:n,isCreatingPersonalFood:r}=afn(),{updatePersonalFood:i,isUpdatingPersonalFood:a}=dfn(),{deletePersonalFood:o,isDeletingPersonalFood:s}=ufn(),{removeFoodIntakeItem:c}=L5(),l=M$(),u=l.params?.personalFoodId,{personalFoods:d}=ifn(),f=u?d.find(e=>e.id===u):void 0,{modalStoreActions:p}=z5(),m=A$(),h=M5(),{bottomWithScroll:g}=Q4(),[_,v]=(0,U.useState)(()=>Rfn(f)),y=(0,U.useRef)(_),b=(0,U.useRef)(!!f);(0,U.useEffect)(()=>{if(b.current||!f||(b.current=!0,_!==y.current))return;let e=Rfn(f);y.current=e,v(e)},[f,_]);let[x,S]=(0,U.useState)(!1),[C,w]=(0,U.useState)(0),[T,E]=(0,U.useState)(!1),[D,O]=(0,U.useState)(!1),k=(0,U.useRef)(!1),[A,ee]=(0,U.useState)(!1),te=(0,U.useRef)(!1),ne=$5(f?.imageId??null),re=_.title.trim().length>0&&_.carbohydrates!==null,ie=T||r||a||s,j=y.current,M=_.title!==j.title||_.carbohydrates!==j.carbohydrates||_.measure!==j.measure||_.description!==j.description,ae=(0,U.useCallback)(()=>{if(!M){m.pop();return}ee(!0)},[M,m]);(0,U.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,G.jsx)(P5,{title:_.title||e(`add_food_segment_food`),LeftButton:(0,G.jsx)(U5,{onPress:ae}),RightButton:ie?(0,G.jsx)(Nf,{size:`small`,color:t.iconBrand,style:n7.activityIndicator}):(0,G.jsx)(W5,{onPress:r,disabled:!M||!re}),overlay:!0})})},[re,M,m,_,p,ie,t.iconBrand,n,i,o,c,j.carbohydrates,j.measure,f?.imageId,u,l.key,ae,e]);let oe=(0,U.useCallback)(()=>{wf.dismiss(),w(Math.max(0,_.carbohydrates??0)),S(!0)},[_.carbohydrates]),N=(0,U.useCallback)(e=>{v(t=>({...t,carbohydrates:e})),S(!1)},[]),se=(0,U.useCallback)(e=>{v(t=>({...t,description:e}))},[]),P=(0,U.useCallback)(()=>{te.current=!0,ee(!1)},[]),F=(0,U.useCallback)(()=>{te.current&&(te.current=!1,m.pop())},[m]),ce=(0,U.useCallback)(()=>{k.current=!0,O(!1)},[]),le=(0,U.useCallback)(async()=>{if(!(!k.current||!f)){k.current=!1;try{f.imageId&&await rfn(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,G.jsxs)(ds,{testID:`${Bfn}-scroll`,keyboardDismissMode:`on-drag`,keyboardShouldPersistTaps:`always`,contentContainerStyle:{paddingTop:h+8,paddingBottom:g},style:{backgroundColor:t.bgSheet},children:[(0,G.jsxs)(V,{style:n7.container,children:[(0,G.jsxs)(V,{style:n7.mandatorySection,children:[(0,G.jsx)(_9t,{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:`${Bfn}-name`,autoFocus:!u}),(0,G.jsx)(Y4,{title:e(`food_add_library_item_carbs`),onPress:oe,renderRightSlot:()=>(0,G.jsxs)(Q,{style:[n7.rightSlot,{color:t.labelPrimary}],testID:`${Bfn}-carbohydrates`,children:[_.carbohydrates??`-`,` / 100g`]})})]}),(0,G.jsxs)(V,{style:n7.measurementSection,children:[(0,G.jsx)(Q,{style:[n7.measurementQuestion,{color:t.labelPrimary}],children:e(`food_unitToggle_title`)}),(0,G.jsx)(Ifn,{isLiquid:_.measure===`mL`,setSelected:e=>{v(t=>({...t,measure:e?`mL`:`g`}))}})]}),(0,G.jsx)(pfn,{value:_.description,onChangeText:se,maxLength:255,imageUri:ne,testID:`create-food-notes`}),!!f&&(0,G.jsx)(U4,{type:H4.ErrorSecondary,title:e(`button_delete_food`),testID:`delete_food_button`,disabled:ie,onPress:()=>O(!0),style:n7.deleteButton})]}),(0,G.jsx)(Q5,{isVisible:x,items:zfn,initialScrollIndex:C,onCancel:()=>S(!1),onConfirm:N,testID:`create-food-wheel-picker`}),(0,G.jsx)(u3,{isVisible:A,title:e(`logbook_personal_modal_discard_title`),onModalHide:F,buttons:[{title:e(`button_discard_changes`),type:H4.Error,testID:`discard-button`,onPress:P},{title:e(`button_keep_editing`),type:H4.Secondary,testID:`keep-button`,onPress:()=>ee(!1)}]}),(0,G.jsx)(u3,{isVisible:D,title:e(`food_modal_delete_food_title`),onModalHide:le,buttons:[{title:e(`button_delete_food`),type:H4.Error,testID:`delete_modal_delete_button`,onPress:ce},{title:e(`button_cancel`),type:H4.Secondary,testID:`delete_modal_cancel_button`,onPress:()=>O(!1)}]}),(0,G.jsx)(t7,{})]})},n7=z.create({container:{flex:1,paddingHorizontal:16,gap:16},mandatorySection:{gap:8},measurementSection:{gap:10},measurementQuestion:{...X.Poppins.regular_SM},rightSlot:{...X.Poppins.regular_Base,marginRight:8},deleteButton:{marginTop:8},activityIndicator:{width:44,height:44}});function Hfn({uri:e,style:t,onLoadEnd:n}){let r=(0,U.useRef)(null);return(0,U.useEffect)(()=>{let e=r.current;if(!(!n||!e))return e.addEventListener(`load`,n),()=>{e.removeEventListener(`load`,n)}},[r,n]),(0,G.jsx)(`iframe`,{ref:r,src:e,style:t})}function Ufn(){let{language:e}=bq.getState();return`https://pdf.hedia.io/IFU/${e}/Hedia-IFU-${c8}`}H();var Wfn=()=>(0,G.jsx)(Hfn,{style:Gfn.iframe,uri:Ufn()}),Gfn=z.create({iframe:{flex:1}}),Kfn=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})),qfn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.default=(H(),d(em)).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`}})})),Jfn=u(s((e=>{var t=Kfn();Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.WebView=void 0,t(p());var n=(H(),d(em)),r=t(qfn()),i=PJ();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.`})})}}))());H(),KQ(),J0();function Yfn({url:e,testID:t,incognito:n=!0,onNavigationStateChange:r,spinnerSize:i=15,style:a}){let{t:o}=Sq(),{COLORS:s}=Y(),{colorScheme:c}=g2(),l=C2(c),{bottom:u}=V0(),[d,f]=(0,U.useState)(!1),[p,m]=(0,U.useState)(null),[h,g]=(0,U.useState)(null),_=(0,U.useMemo)(()=>`document.cookie = "theme=${l}; path=/; SameSite=Lax";`,[l]);return e?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Jfn.default,{source:{uri:e},testID:t,incognito:n,startInLoadingState:!0,renderLoading:()=>(0,G.jsx)(V,{style:r7.centerContainer,children:(0,G.jsx)(p2,{source:m2.LOADING_SPINNER,autoPlay:!0,style:{height:`${i}%`}})}),setSupportMultipleWindows:!1,onHttpError:()=>{f(!0),m(o(`global_modal_swr_title`)),g(o(`global_modal_swr_body`)),console.error(`WebViewLoader onHttpError: `,e)},onError:t=>{let n=t.nativeEvent.description;f(!0),n.includes(`ERR_INTERNET_DISCONNECTED`)?(m(o(`settings_modal_no_internet_title`)),g(o(`settings_modal_no_internet_body`))):(m(o(`global_modal_swr_title`)),g(o(`global_modal_swr_body`))),console.error(`WebViewLoader onError: `,e,n)},injectedJavaScriptBeforeContentLoaded:_,onNavigationStateChange:r,style:{backgroundColor:s.bgPrimary},containerStyle:[r7.container,{backgroundColor:s.bgPrimary,paddingBottom:u},a]}),d&&(0,G.jsxs)(GQ.View,{entering:LQ.duration(300).delay(2e3),style:r7.centerContainer,children:[(0,G.jsx)(Q,{style:[r7.errorTitle,{color:s.labelPrimary}],children:p}),(0,G.jsx)(Q,{style:[r7.errorSubtitle,{color:s.labelSecondary}],children:h})]})]}):null}var r7=z.create({container:{height:`100%`},centerContainer:{height:`100%`,justifyContent:`center`,marginHorizontal:16},errorTitle:{...X.Poppins.semiBold_2XL,textAlign:`center`},errorSubtitle:{...X.Poppins.regular_Base,textAlign:`center`}});H();function Xfn(){let e=Ycn();return Tq?(0,G.jsx)(Hfn,{style:Zfn.iframe,uri:`https://www.hedia.com/support/partner`}):(0,G.jsx)(Yfn,{url:`https://www.hedia.com/support/native`,testID:`support-webview`,style:{paddingTop:e}})}var Zfn=z.create({iframe:{flex:1}}),Qfn=()=>({min:Z.CONSTANTS.CARBOHYDRATES_INPUT_MIN,max:Z.CONSTANTS.CARBOHYDRATES_INPUT_MAX});a3(Z.CONSTANTS.CARBOHYDRATES_INPUT_MIN,Z.CONSTANTS.CARBOHYDRATES_INPUT_MAX),H();function $fn({children:e,offset:t=47}){let{COLORS:n}=Y(),{bottom:r}=Q4();return(0,G.jsxs)(V,{children:[(0,G.jsx)(z4.default,{colors:[c3(n.bgPrimary,0),n.bgPrimary],style:[epn.gradient,{height:r+t+16}],pointerEvents:`none`}),(0,G.jsx)(V,{style:[{paddingBottom:r},epn.contentContainer],children:e})]})}var epn=z.create({gradient:{position:`absolute`,bottom:0,left:0,right:0},contentContainer:{position:`absolute`,bottom:0,left:0,right:0,marginHorizontal:16}}),tpn=(0,U.memo)($fn);H();var npn=()=>{let{t:e}=Sq(),{COLORS:t}=Y(),{showCalculationInfoModal:n,modalStoreActions:r}=z5(),i=(0,U.useMemo)(()=>[{testID:`close-button`,title:e(`button_close`),onPress:()=>{r.set({showCalculationInfoModal:!1})}}],[r,e]);return(0,G.jsxs)(u3,{testID:`calculation_info_modal`,isVisible:n,title:e(`calcflow_modal_info_title`),buttons:i,enableScroll:!0,containerStyle:i7.modal,children:[(0,G.jsx)(Q,{style:[i7.header,{color:t.labelPrimary}],children:e(`calcflow_modal_info_insulin_title`)}),(0,G.jsx)(Q,{style:[i7.text,{color:t.labelSecondary}],children:e(`calcflow_modal_info_insulin_body`)}),(0,G.jsx)(Q,{style:[i7.header,{color:t.labelPrimary}],children:e(`calcflow_modal_info_glucose_title`)}),(0,G.jsx)(Q,{style:[i7.text,{color:t.labelSecondary}],children:e(`calcflow_modal_info_glucose_body`)}),(0,G.jsx)(Q,{style:[i7.header,{color:t.labelPrimary}],children:e(`calcflow_modal_info_carbohydrates_title`)}),(0,G.jsx)(Q,{style:[i7.text,{color:t.labelSecondary}],children:e(`calcflow_modal_info_carbohydrates_body`)}),(0,G.jsx)(Q,{style:[i7.header,{color:t.labelPrimary}],children:e(`calcflow_modal_info_activity_title`)}),(0,G.jsx)(Q,{style:[i7.text,{color:t.labelSecondary}],children:e(`calcflow_modal_info_activity_body`)}),(0,G.jsx)(Q,{style:[i7.header,{color:t.labelPrimary}],children:e(`calcflow_modal_info_notes_title`)}),(0,G.jsx)(Q,{style:[i7.text,{color:t.labelSecondary}],children:e(`calcflow_modal_info_notes_body`)}),(0,G.jsx)(Q,{style:[i7.header,{color:t.labelPrimary}],children:e(`calcflow_modal_info_calculate_title`)}),(0,G.jsx)(Q,{style:[i7.text,{color:t.labelSecondary}],children:e(`calcflow_modal_info_calculate_body`)})]},`calculation_info_modal`)},i7=z.create({modal:{maxHeight:`92%`},header:{...X.Poppins.semiBold_Base,marginTop:16},text:{...X.Poppins.regular_Base}}),rpn=async e=>{let t=`${_q.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 E2(n,Z.StatusCode.CREATED,t,Z.HTTPRequestMethod.POST),n.json()},ipn=async e=>{let t=`${_q.NOTE_BASE_URL}/api/v1/notes/${e}`,n=await d8(t,{method:`GET`,headers:{Accept:`application/json`}});return await E2(n,Z.StatusCode.OK,t),n.json()},apn=async(e,t)=>{let n=`${_q.NOTE_BASE_URL}/api/v1/notes/${e}`,r=await d8(n,{method:Z.HTTPRequestMethod.PATCH,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:JSON.stringify(t)});return await E2(r,Z.StatusCode.OK,n,Z.HTTPRequestMethod.PATCH),r.json()},opn=async e=>{let t=`${_q.NOTE_BASE_URL}/api/v1/notes/${e}`;await E2(await d8(t,{method:`DELETE`}),Z.StatusCode.NO_CONTENT,t,Z.HTTPRequestMethod.DELETE)};function spn(){let e=g0(),[t,n]=(0,U.useState)(``),[r,i]=(0,U.useState)(!1),[a,o]=(0,U.useState)(!1),s=(0,U.useRef)(null),c=(0,U.useRef)(``),l=(0,U.useRef)(null),u=(0,U.useRef)(t);u.current=t;let d=(0,U.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:()=>ipn(t),staleTime:Z.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,U.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,U.useCallback)(async()=>{let t=u.current;if(!t.trim())return s.current&&=(await opn(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 apn(s.current,{body:t});return e.setQueryData([`note`,n.id],n),s.current}let n=await rpn({body:t});return s.current=n.id,e.setQueryData([`note`,n.id],n),n.id},[e]),deleteNoteAndAssets:(0,U.useCallback)(async t=>{try{let n=await e.fetchQuery({queryKey:[`note`,t],queryFn:()=>ipn(t),staleTime:Z.Milliseconds.Minute*5});for(let t of n.assetIds)await rfn(t).catch(console.error),e.removeQueries({queryKey:[`asset`,t]});await opn(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,U.useMemo)(()=>!a&&t.trim().length>0,[t,a]),isNoteModified:(0,U.useMemo)(()=>t!==c.current,[t])}}var cpn={selectedEventUUID:null,activityDurationSeconds:0},a7=pq()(e=>({...cpn,activityStoreActions:{set:t=>{e(e=>({...e,...t}))},clear:()=>{e(cpn)}}})),lpn={setupCalculatorSettings:{},totalDailyDosage:null},upn=pq()(e=>({...lpn,setupCalculatorActions:{setSetupCalculatorStoreValues:t=>{e(e=>({setupCalculatorSettings:{...e.setupCalculatorSettings,...t}}))},setTotalDailyDosage:t=>{e({totalDailyDosage:t})},clear:()=>{e(lpn)}}})),o7=()=>upn(e=>e.setupCalculatorActions),s7=()=>upn(e=>e.setupCalculatorSettings),dpn=()=>upn(e=>e.totalDailyDosage),fpn={privacyNoticeAccepted:!1,extraFoodItems:[],visualSearchId:null},c7=pq()(hq(e=>({...fpn,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(fpn)}}),{name:`VISUAL_SEARCH_STORE`,storage:mq(yq)})),l7=()=>{L5.getState().clear(),R5.getState().glucoseStoreActions.clear(),a7.getState().activityStoreActions.clear(),B5.getState().noteStoreActions.clear()},ppn=()=>{let{t:e}=Sq(),{showDiscardCalculationModal:t,modalStoreActions:n,isGoToSettingsPressed:r}=z5(),{deleteNoteAndAssets:i}=spn(),a=A$(),o=(0,U.useRef)(!1),s=(0,U.useCallback)(()=>{let e=B5.getState().noteId;e&&i(e).catch(console.error),l7(),o.current=!0,n.set({showDiscardCalculationModal:!1})},[i,n]),c=(0,U.useCallback)(()=>{o.current&&(o.current=!1,a.pop()),r&&((vvt||Eq)&&a.reset({index:1,routes:[{name:F5.MainBottomTabs},{name:F5.SettingsStack,state:{routes:[{name:F5.Settings},{name:F5.ActivitySettings}],index:1}}]}),n.set({isGoToSettingsPressed:!1}))},[r,n,a]),l=(0,U.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,G.jsx)(u3,{testID:`discard_calculation_modal`,isVisible:t,title:e(`calcflow_modal_discard_cal_title`),onModalHide:c,buttons:l},`discard_calculation_modal`)};function mpn(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 hpn(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=mpn(o);return r.setMonth(t,Math.min(a,s)),r}function gpn(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=hpn(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 _pn(e,t,n){return Von(e,-t,n)}var u7=function(e){return e.Create=`Create`,e.Edit=`Edit`,e.Delete=`Delete`,e}({});function vpn(){let e=gpn(_pn(new Date,4),{seconds:0,milliseconds:0});return G8.getLogbooks(e).map(e=>({uuid:e.uuid,time:e.entry_timestamp,insulinValue:e.insulin_entered_units?.toString()??``}))}function ypn(){let[e,t]=(0,U.useState)(vpn),[n,r]=(0,U.useState)(null),[i,a]=(0,U.useState)(!1),[o,s]=(0,U.useState)(`Create`),[c,l]=(0,U.useState)(void 0),u=(0,U.useCallback)(()=>{t(vpn())},[]);return(0,U.useEffect)(()=>{n&&u()},[n,u]),R$((0,U.useCallback)(()=>{u()},[u])),(0,U.useEffect)(()=>{K8.syncAll().catch(console.error).finally(()=>{u()})},[u]),{entries:e,animatedEntryId:n,isInfoModalVisible:i,setIsInfoModalVisible:a,registerInsulinAction:o,editingInsulinEntry:c,refresh:u,handleEditInsulinEntry:(0,U.useCallback)(t=>{let n=e.find(e=>e.uuid===t);n&&(s(`Edit`),l(n))},[e]),handleEntryAnimationFinished:(0,U.useCallback)(()=>{r(null)},[]),handleRegisterInsulinPressed:(0,U.useCallback)(()=>{s(`Create`),l(void 0)},[]),handleRegisterInsulinClose:(0,U.useCallback)(e=>{r(e||`deleted-${Date.now()}`)},[])}}if(!U.useState)throw Error(`mobx-react-lite requires React with Hooks support`);if(!drn)throw Error(`mobx-react-lite@3 requires mobx at least version 6 to be available`);var d7=_();function bpn(e){e()}function xpn(e){e||=bpn,Znn({reactionScheduler:e})}function Spn(e){return $nn(e)}var Cpn=!1;function wpn(){return Cpn}var Tpn=1e4,Epn=1e4,Dpn=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=Tpn),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,Epn))}}),e}(),Opn=new(typeof FinalizationRegistry<`u`?FinalizationRegistry:Dpn)(function(e){var t;(t=e.reaction)==null||t.dispose(),e.reaction=null}),kpn=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})),Apn=s(((e,t)=>{t.exports=kpn()}))();function jpn(e){e.reaction=new E6(`observer${e.name}`,function(){var t;e.stateVersion=Symbol(),(t=e.onStoreChange)==null||t.call(e)})}function Mpn(e,t){if(t===void 0&&(t=`observed`),wpn())return e();var n=U.useRef(null);if(!n.current){var r={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:t,subscribe:function(e){return Opn.unregister(r),r.onStoreChange=e,r.reaction||(jpn(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||(jpn(i),Opn.register(n,i,i)),U.useDebugValue(i.reaction,Spn),(0,Apn.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 Npn=typeof Symbol==`function`&&Symbol.for,Ppn=Object.getOwnPropertyDescriptor(function(){},`name`)?.configurable??!1,Fpn=Npn?Symbol.for(`react.forward_ref`):typeof U.forwardRef==`function`&&(0,U.forwardRef)(function(e){return null}).$$typeof,Ipn=Npn?Symbol.for(`react.memo`):typeof U.memo==`function`&&(0,U.memo)(function(e){return null}).$$typeof;function f7(e,t){if(Ipn&&e.$$typeof===Ipn)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(wpn())return e;var n=t?.forwardRef??!1,r=e,i=e.displayName||e.name;if(Fpn&&e.$$typeof===Fpn&&(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 Mpn(function(){return r(e,t)},i)};return a.displayName=e.displayName,Ppn&&Object.defineProperty(a,"name",{value:e.name,writable:!0,configurable:!0}),e.contextTypes&&(a.contextTypes=e.contextTypes),n&&(a=(0,U.forwardRef)(a)),a=(0,U.memo)(a),Rpn(e,a),a}var Lpn={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function Rpn(e,t){Object.keys(e).forEach(function(n){Lpn[n]||Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}function zpn(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`?Mpn(r):null}zpn.displayName=`Observer`,xpn(d7.unstable_batchedUpdates),Opn.finalizeAllImmediately,H();function Bpn(){return U.useEffect(()=>{console.warn(`DateTimePicker is not supported on: ${B.OS}`)},[]),null}var Vpn=Bpn;H();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 Hpn({isVisible:e,initialValue:t,min:n,max:r,onCancel:i,onConfirm:a,onModalHide:o}){let{COLORS:s}=Y(),{width:c}=$p(),l=(0,U.useRef)(null),u=(0,U.useRef)(null),[d,f]=(0,U.useState)(t),p=(0,U.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(B9t(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,U.useMemo)(()=>p.map(e=>I8(e.date,`HH`)),[p]),h=(0,U.useMemo)(()=>{let[e]=I8(t,`HH:mm`).split(`:`);return p7(m,e)},[t,m]),g=(0,U.useMemo)(()=>{let[,e]=I8(t,`HH:mm`).split(`:`);return p7(h7,e)},[t]),_=(0,U.useMemo)(()=>{let[e]=I8(d,`HH:mm`).split(`:`);return p7(m,e)},[d,m]),v=(0,U.useMemo)(()=>{let[,e]=I8(d,`HH:mm`).split(`:`);return p7(h7,e)},[d]),y=(0,U.useMemo)(()=>n?p7(m,I8(n,`HH`)):null,[n,m]),b=(0,U.useMemo)(()=>r?p7(m,I8(r,`HH`)):null,[r,m]),x=(0,U.useMemo)(()=>n?parseInt(I8(n,`mm`),10):null,[n]),S=(0,U.useMemo)(()=>r?parseInt(I8(r,`mm`),10):null,[r]),C=(0,U.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(gpn(i,{minutes:parseInt(h7[t],10),seconds:0,milliseconds:0}))},[m.length,p]),w=(0,U.useCallback)(e=>{u.current?.scrollToIndex(e)},[]),T=(0,U.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,U.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,U.useCallback)(()=>{a(d)},[a,d]),O=(0,U.useCallback)(()=>{f(t),i()},[i,t]);return(0,G.jsx)(u3,{isVisible:e,containerStyle:{backgroundColor:s.bgTransparent},onModalHide:o,children:(0,G.jsxs)(V,{children:[(0,G.jsxs)(V,{style:g7.pickersContainer,children:[(0,G.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,G.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,G.jsxs)(V,{style:g7.buttonContainer,children:[(0,G.jsx)(X5,{onPress:D}),(0,G.jsx)(Y5,{onPress:O})]})]})})}var Upn=U.memo(Hpn),g7=z.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}}),Wpn=({onPress:e})=>(0,G.jsx)(X5,{onPress:e}),Gpn=({onPress:e})=>(0,G.jsx)(Y5,{onPress:e}),Kpn=.5,qpn=e=>{switch(e){case Z.InjectionMethod.PenWhole:return a3(Z.CONSTANTS.INSULIN_DOSE_MIN,Z.CONSTANTS.INSULIN_DOSE_MAX);case Z.InjectionMethod.PenHalf:return z9t(Z.CONSTANTS.INSULIN_DOSE_MIN,Z.CONSTANTS.INSULIN_DOSE_MAX,Kpn);case Z.InjectionMethod.Pump:return o3(Z.CONSTANTS.INSULIN_DOSE_MIN,Z.CONSTANTS.INSULIN_DOSE_MAX);default:throw Error(`[insulin::getInsulinInputSequentialArray] Unsupported injection method!`)}},Jpn=e=>{switch(e){case Z.InjectionMethod.PenWhole:return 0;case Z.InjectionMethod.PenHalf:return 1;case Z.InjectionMethod.Pump:return 1;default:throw Error(`[insulin::getInsulinInputDecimalPlaces] Unsupported injection method!`)}};H(),J0();function Ypn({action:e=u7.Create,insulinEntry:t,onClose:n}){let{t:r}=Sq(),{COLORS:i}=Y(),{bottom:a}=V0(),{colorScheme:o}=g2(),s=C2(o),[c,l]=(0,U.useState)(!1),[u,d]=(0,U.useState)(t?.insulinValue),[f,p]=(0,U.useState)(!1),[m,h]=(0,U.useState)(t?.time),[g,_]=(0,U.useState)(),[v,y]=(0,U.useState)(!1),[b,x]=(0,U.useState)(!1),S=(0,U.useRef)(!1),{initialInsulinValue:C,initialDate:w}=(0,U.useMemo)(()=>({initialInsulinValue:t?.insulinValue,initialDate:t?.time}),[t]),T=(0,U.useCallback)(()=>{l(!0)},[]);(0,U.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,U.useMemo)(()=>qpn(E),[E]),O=(0,U.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?rsn({entry_timestamp:m,insulin_entered_units:parseFloat(u)}):{...G8.getLogbookByUUID(t.uuid),entry_timestamp:m,insulin_entered_units:parseFloat(u)};if(!await G8.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,U.useCallback)(async()=>{try{if(!t)return;await G8.deleteLogbook(t.uuid)?n():y(!0)}catch(e){console.error(`[RegisterActiveInsulin::deleteInsulinEntry] Error deleting insulin entry:`,e),y(!0)}},[t,n]),A=(0,U.useCallback)(()=>{S.current=!0,x(!1)},[]),ee=(0,U.useCallback)(()=>{S.current&&(S.current=!1,k().catch(console.error))},[k]),te=(0,U.useCallback)(()=>{p(!0)},[]),ne=(0,U.useCallback)(e=>{let t=new Date,n=A9t(e,{start:gpn(_pn(t,4),{seconds:0,milliseconds:0}),end:t})?void 0:r(`error_insulin_intake_hint`);h(e),_(n),p(!1)},[r]),re=(0,U.useCallback)(()=>{p(!1)},[]),ie=(0,U.useCallback)(e=>{d(e.toString()),l(!1)},[]),j=(0,U.useMemo)(()=>{if(!u)return 0;let e=Jpn(E);return D.findIndex(t=>t===parseFloat(u).toFixed(e))},[u,D,E]);function M(){return(0,G.jsxs)(V,{style:_7.header,children:[(0,G.jsx)(U5,{onPress:n}),(0,G.jsx)(Q,{style:_7.headerTitle,numberOfLines:1,ellipsizeMode:`middle`,children:r(`register_insulin_title`,{timeFourHour:I8(_pn(new Date,4),`HH:mm`)})}),(0,G.jsx)(W5,{onPress:O,disabled:!m||!u||!!g||w===m&&C===u})]})}function ae(){return(0,G.jsx)(V,{style:[_7.setTimeButton,{backgroundColor:i.bgPill}],children:(0,G.jsx)(Q,{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,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(M,{}),(0,G.jsxs)(ds,{contentContainerStyle:_7.contentContainer,children:[(0,G.jsxs)(V,{style:_7.screen,children:[(0,G.jsx)(Y4,{title:r(`register_insulin_input_title`),testID:`insulin-input`,onPress:T,renderRightSlot:()=>(0,G.jsxs)(V,{style:_7.insulinRightSlot,children:[(0,G.jsx)(Q,{style:[_7.insulinText,{color:i.labelPrimary}],children:u}),(0,G.jsx)(Q,{style:[_7.unitsText,{color:i.labelPrimary}],children:r(u&&parseFloat(u)===1?`unit`:`units`)})]}),style:c?{borderColor:i.borderInputFocus}:void 0}),(0,G.jsx)(B4,{isAnimated:!!g,children:(0,G.jsx)(Y4,{renderLeftSlot:()=>(0,G.jsx)(Q,{children:r(`register_insulin_time_input_title`)}),testID:`time-input`,errorMessage:g,onPress:te,renderRightSlot:ae,style:f?{flexWrap:`wrap`,paddingVertical:8,borderColor:i.borderInputFocus}:_7.rowInsulin})})]}),e===u7.Edit&&(0,G.jsx)(U4,{title:r(`button_delete`),onPress:()=>{x(!0)},type:H4.Error})]}),(0,G.jsx)(Q5,{isVisible:c,items:D,onConfirm:ie,onCancel:()=>{l(!1)},initialScrollIndex:j,testID:`insulin-wheel-picker`}),Eq?(0,G.jsx)(Vpn,{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:Wpn,customCancelButtonIOS:Gpn,pickerContainerStyleIOS:{backgroundColor:i.iosKeyboardPicker},themeVariant:s,isDarkModeEnabled:s===`dark`,pickerStyleIOS:_7.alignCenter,modalStyleIOS:{paddingBottom:a},is24Hour:!0,locale:`en_GB`}):(0,G.jsx)(Upn,{isVisible:f,initialValue:m??new Date,onConfirm:ne,onCancel:re}),(0,G.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,G.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 Xpn=f7(Ypn),_7=z.create({header:{width:`100%`,flexDirection:`row`,justifyContent:`space-between`,alignItems:`center`,paddingHorizontal:16,paddingBottom:12},headerTitle:{...X.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:{...X.Poppins.medium_Base},insulinText:{...X.Poppins.medium_Base,marginRight:4},unitsText:{...X.Poppins.medium_Base},alignCenter:{alignSelf:`center`}});H();function Zpn({entriesCount:e,onInfoPress:t}){let{t:n}=Sq(),{COLORS:r}=Y(),i=e>0;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(V,{style:v7.iconContainer,children:[(0,G.jsx)(Y7t,{}),(0,G.jsx)(Cp,{testID:`info-button`,style:v7.infoIconButton,onPress:t,children:(0,G.jsx)(J7t,{height:32,width:32,color:r.iconBrand})})]}),(0,G.jsx)(Q,{style:v7.title,children:n(i?`Recent_insulin_title`:`Recent_insulin_empty_title`)}),(0,G.jsx)(Q,{style:[v7.subtitle,v7.headerSubtitle,{color:r.labelSecondary}],children:n(i?`recent_insulin_body`:`Recent_insulin_empty_body`)})]})}function Qpn(){return(0,G.jsx)(V,{style:v7.separatorList})}var v7=z.create({iconContainer:{marginBottom:16},title:{...X.Poppins.semiBold_2XL,marginBottom:8},subtitle:{...X.Poppins.regular_SM},headerSubtitle:{marginBottom:48},infoIconButton:{position:`absolute`,right:0},separatorList:{height:8}});H(),J0();function $pn({onNoInsulinPressed:e}){let{t}=Sq(),{COLORS:n}=Y(),{entries:r,animatedEntryId:i,isInfoModalVisible:a,setIsInfoModalVisible:o,registerInsulinAction:s,editingInsulinEntry:c,handleEditInsulinEntry:l,handleEntryAnimationFinished:u,handleRegisterInsulinPressed:d,handleRegisterInsulinClose:f}=ypn(),p=(0,U.useRef)(null),m=(0,U.useCallback)(()=>{u8(l8.RecentInsulinRegisterPress),d(),p.current?.present()},[d]),h=(0,U.useCallback)(e=>{f(e),p.current?.close()},[f]),g=(0,U.useCallback)(e=>{l(e),p.current?.present()},[l]);return(0,G.jsxs)(q0,{edges:[`bottom`],children:[(0,G.jsx)(Uc,{testID:`active_insulin_list`,data:r,keyExtractor:e=>e.uuid,contentContainerStyle:y7.contentContainer,ListHeaderComponent:()=>(0,G.jsx)(Zpn,{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,G.jsx)(O7t,{isAnimated:i===e.uuid,onAnimationFinished:u,children:(0,G.jsx)(Y4,{title:I8(e.time,`HH:mm`),onPress:()=>{g(e.uuid)},testID:`entry-${n}`,renderRightSlot:()=>(0,G.jsxs)(V,{style:y7.rightSlot,children:[(0,G.jsx)(Q,{style:y7.insulinValueText,children:`${e.insulinValue} ${r}`}),(0,G.jsx)(K4,{})]})})})},ItemSeparatorComponent:Qpn,ListFooterComponent:()=>(0,G.jsxs)(V,{style:y7.buttonsWrapper,children:[(0,G.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,G.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,G.jsx)(m$,{ref:p,handleIndicatorStyle:{height:0},backdropComponent:V4,backgroundStyle:{backgroundColor:n.bgSheet,borderRadius:36},stackBehavior:`push`,enablePanDownToClose:!1,children:(0,G.jsx)(g$,{children:(0,G.jsx)(Xpn,{action:s,insulinEntry:c,onClose:h})})}),(0,G.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=z.create({contentContainer:{paddingHorizontal:16,paddingBottom:16},footer:{paddingTop:48},buttonsWrapper:{gap:8},rightSlot:{flexDirection:`row`,alignItems:`center`},insulinValueText:{...X.Poppins.regular_Base,marginRight:16}}),b7=()=>R5(e=>e.selectedReadingId&&e.availableGlucoseReadings.find(t=>t.id===e.selectedReadingId)||null),emn=e=>R5(t=>t.availableGlucoseReadings.find(t=>t.source===e)||null),tmn=()=>({fetchLibreCgmData:()=>Promise.resolve()});H();var nmn={top:16,bottom:16,left:16,right:16};function rmn({activity:e,isChecked:t,index:n=0,onEdit:r,toggleActivitySwitch:i}){let{t:a}=Sq(),{COLORS:o}=Y();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,U.useMemo)(()=>Math.round(c/60),[c]),[m,h]=(0,U.useState)(Kon(l,p)),g=(0,U.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,U.useEffect)(()=>{let e=()=>setInterval(()=>{h(Kon(l,p))},Z.Milliseconds.Minute),n=e=>{e&&clearInterval(e)},r=t?e():null;return()=>{n(r)}},[t,l,p]),g===null?null:(0,G.jsxs)(Cp,{testID:v,style:[x7.card,{backgroundColor:o.bgSecondary}],onPress:()=>{r(d)},children:[(0,G.jsxs)(V,{style:x7.headerContainer,children:[(0,G.jsxs)(V,{style:x7.left,children:[(0,G.jsxs)(V,{style:[x7.headerContent,{opacity:_}],children:[(0,G.jsx)(I7t,{height:24,width:24,color:o.iconButtonSecondary}),(0,G.jsxs)(Q,{style:x7.header,children:[`${Gon(p)} ${a(`activity_card__active_min`)}`,f&&`, `+f]})]}),(0,G.jsxs)(Q,{style:[x7.expiresIn,{color:o.labelSecondary,opacity:_}],children:[a(`activity_card_active_time`),` `,m]})]}),(0,G.jsx)(Cp,{onPress:()=>{i(d)},hitSlop:nmn,children:(0,G.jsx)(Mp,{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,G.jsxs)(V,{style:[x7.reduction,{opacity:_}],children:[(0,G.jsx)(Q,{style:x7.reductionText,children:a(`activity_card_insulinReduction`)}),(0,G.jsx)(Q,{style:x7.reductionValue,children:` ${g}%`})]})]})}var x7=z.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:{...X.Poppins.regular_SM},expiresIn:{...X.Poppins.regular_XS,marginBottom:8},reduction:{flexDirection:`row`,alignItems:`baseline`,justifyContent:`space-between`,gap:8},reductionText:{...X.Poppins.regular_SM,flexShrink:1},reductionValue:{...X.Poppins.bold_2XL}});H();var imn=({selectedActivity:e,onClose:t})=>{let{t:n}=Sq(),{COLORS:r}=Y(),{navigate:i}=A$(),{activityStoreActions:a}=a7(),{modalStoreActions:o,isGoToSettingsPressed:s}=z5(),[c,l]=(0,U.useState)(!1),{activity:u}=k8;if(u===void 0)throw Error(`[CreateActivity::render] activitySettings is undefined`);let d=(0,U.useMemo)(()=>({uuid:i3(),startTimestamp:null,deleted:!1,type:null,activityIntensity:null,durationSeconds:0}),[]),f=(0,U.useMemo)(()=>e??d,[d,e]),p=(0,U.useMemo)(()=>f.startTimestamp===null?null:new Date(f.startTimestamp).getTime()+f.durationSeconds*Z.Milliseconds.Second>Date.now()?0:1,[f]),[m,h]=(0,U.useState)(f),[g,_]=(0,U.useState)(p),v=(0,U.useMemo)(()=>g===null?!1:g===1?m.durationSeconds>0&&!!m.startTimestamp:m.durationSeconds>0&&!!m.activityIntensity&&!!m.startTimestamp,[m,g]),y=(0,U.useMemo)(()=>!s3(m,f),[m,f]),b=(0,U.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*Z.Milliseconds.Second:0);x({durationSeconds:t,startTimestamp:new Date(n).toISOString()})},C=e=>{x({activityIntensity:Z.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*Z.Milliseconds.Second).toISOString()})},E=()=>{x({durationSeconds:0,activityIntensity:null})},D=()=>{E(),o.set({isGoToSettingsPressed:!0})},O=()=>{s&&(t(),o.set({showDiscardCalculationModal:!Tq}),Tq&&(i(F5.SettingsStack,{screen:F5.ActivitySettings}),o.set({isGoToSettingsPressed:!1})))},k=(0,U.useMemo)(()=>Math.round(m.durationSeconds/60),[m.durationSeconds]),A=(0,U.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===Z.ActivityIntensity.hard)return t.fromFortysix!==null;if(k===120&&e===Z.ActivityIntensity.hard)return t.fromSixtyone!==null;if(k===120&&e===Z.ActivityIntensity.moderate)return r.fromSixtyone!==null;if(k===120&&e===Z.ActivityIntensity.light)return n.fromSixtyone!==null}return!0},[m,u,g,v,k]);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(WUt,{testID:`create-activity-scroll-view`,style:[S7.container,{backgroundColor:r.bgSheet}],contentContainerStyle:S7.contentContainer,children:[(0,G.jsxs)(V,{style:S7.header,children:[(0,G.jsx)(U5,{onPress:t}),(0,G.jsx)(W5,{onPress:b,disabled:!v||!y})]}),(0,G.jsxs)(V,{style:S7.cardMandatory,children:[(0,G.jsxs)(V,{children:[(0,G.jsx)(Q,{style:[S7.headerTitle,{color:r.labelSecondary}],children:n(`new_activity_when_title`)}),(0,G.jsxs)(V,{style:[S7.segmentContainer,{backgroundColor:r.bgSegmentContainer,borderColor:r.buttonBorder}],children:[(0,G.jsx)(Cp,{style:[S7.segment,g===0&&{backgroundColor:r.bgSegmentPrimary}],onPress:w,testID:`starting-now-touchable-${g===0}`,children:(0,G.jsx)(Q,{style:[S7.value,{color:g===0?r.textLabelActive:r.textLabelInactive}],children:n(`new_activity_when_option1`)})}),(0,G.jsx)(V,{style:[S7.borderLeft,{backgroundColor:r.divider}]}),(0,G.jsx)(Cp,{style:[S7.segment,g===1&&{backgroundColor:r.bgSegmentPrimary}],onPress:T,testID:`just-finished-now-touchable-${g===1}`,children:(0,G.jsx)(Q,{style:[S7.value,{color:g===1?r.textLabelActive:r.textLabelInactive}],children:n(`new_activity_when_option2`)})})]})]}),(0,G.jsxs)(V,{children:[(0,G.jsx)(Q,{style:[S7.headerTitle,{color:r.labelSecondary}],children:n(`new_activity_duration_title`)}),(0,G.jsxs)(V,{style:[S7.segmentContainer,{backgroundColor:r.bgSegmentContainer,borderColor:r.buttonBorder}],children:[(0,G.jsx)(Cp,{style:[S7.segment,k===29&&{backgroundColor:r.bgSegmentPrimary}],onPress:()=>{S(29)},children:(0,G.jsx)(Q,{style:[S7.value,{color:k===29?r.textLabelActive:r.textLabelInactive}],children:`0-29`})}),(0,G.jsx)(V,{style:[S7.borderLeft,{backgroundColor:r.divider}]}),(0,G.jsx)(Cp,{style:[S7.segment,k===45&&{backgroundColor:r.bgSegmentPrimary}],onPress:()=>{S(45)},children:(0,G.jsx)(Q,{style:[S7.value,{color:k===45?r.textLabelActive:r.textLabelInactive}],children:`30-45`})}),(0,G.jsx)(V,{style:[S7.borderLeft,{backgroundColor:r.divider}]}),(0,G.jsx)(Cp,{style:[S7.segment,k===60&&{backgroundColor:r.bgSegmentPrimary}],onPress:()=>{S(60)},children:(0,G.jsx)(Q,{style:[S7.value,{color:k===60?r.textLabelActive:r.textLabelInactive}],children:`46-60`})}),(0,G.jsx)(V,{style:[S7.borderLeft,{backgroundColor:r.divider}]}),(0,G.jsx)(Cp,{style:[S7.segment,k===120&&{backgroundColor:r.bgSegmentPrimary}],onPress:()=>{S(120)},children:(0,G.jsx)(Q,{style:[S7.value,{color:k===120?r.textLabelActive:r.textLabelInactive}],children:`61-120`})})]})]}),(0,G.jsxs)(V,{style:{opacity:g===1?.5:1},children:[(0,G.jsxs)(V,{style:{flexDirection:`row`,justifyContent:`space-between`},children:[(0,G.jsx)(Q,{style:[S7.headerTitle,{color:r.labelSecondary}],children:n(`new_activity_intensity_title`)}),(0,G.jsx)(Cp,{onPress:()=>{g!==1&&l(!0)},children:(0,G.jsx)(J7t,{width:24,height:24,color:r.iconBrand})})]}),(0,G.jsxs)(V,{style:[S7.segmentContainer,{backgroundColor:r.bgSegmentContainer,borderColor:r.buttonBorder}],children:[(0,G.jsx)(Cp,{style:[S7.segment,m.activityIntensity===Z.ActivityIntensity.light&&{backgroundColor:r.bgSegmentPrimary}],onPress:()=>{g!==1&&C(Z.ActivityIntensity.light)},testID:`activity-light-touchable-${m.activityIntensity===Z.ActivityIntensity.light}`,children:(0,G.jsx)(Q,{style:[S7.value,{color:m.activityIntensity===Z.ActivityIntensity.light?r.textLabelActive:r.textLabelInactive}],maxFontSizeMultiplier:S2.s2,children:n(`activity_intensity_1`)})}),(0,G.jsx)(V,{style:[S7.borderLeft,{backgroundColor:r.divider}]}),(0,G.jsx)(Cp,{style:[S7.segment,m.activityIntensity===Z.ActivityIntensity.moderate&&{backgroundColor:r.bgSegmentPrimary}],onPress:()=>{g!==1&&C(Z.ActivityIntensity.moderate)},testID:`activity-moderate-touchable-${m.activityIntensity===Z.ActivityIntensity.moderate}`,children:(0,G.jsx)(Q,{style:[S7.value,{color:m.activityIntensity===Z.ActivityIntensity.moderate?r.textLabelActive:r.textLabelInactive}],maxFontSizeMultiplier:S2.s2,children:n(`activity_intensity_2`)})}),(0,G.jsx)(V,{style:[S7.borderLeft,{backgroundColor:r.divider}]}),(0,G.jsx)(Cp,{style:[S7.segment,m.activityIntensity===Z.ActivityIntensity.hard&&{backgroundColor:r.bgSegmentPrimary}],onPress:()=>{g!==1&&C(Z.ActivityIntensity.hard)},testID:`activity-hard-touchable-${m.activityIntensity===Z.ActivityIntensity.hard}`,children:(0,G.jsx)(Q,{style:[S7.value,{color:m.activityIntensity===Z.ActivityIntensity.hard?r.textLabelActive:r.textLabelInactive}],maxFontSizeMultiplier:S2.s2,children:n(`activity_intensity_3`)})})]})]})]})]}),(0,G.jsx)(t7,{}),(0,G.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,G.jsxs)(u3,{isVisible:c,title:n(`calcflow_activityInfo_modal_title`),buttons:[{title:n(`button_close`),onPress:()=>{l(!1)}}],children:[(0,G.jsx)(Q,{style:S7.intensityDescriptionTitle,children:n(`calcflow_activityInfo_modal_intensity1_title`)}),(0,G.jsx)(Q,{style:[S7.intensityDescriptionText,{color:r.labelSecondary}],children:n(`calcflow_activityInfo_modal_intensity1_body`)}),(0,G.jsx)(Q,{style:S7.intensityDescriptionTitle,children:n(`calcflow_activityInfo_modal_intensity2_title`)}),(0,G.jsx)(Q,{style:[S7.intensityDescriptionText,{color:r.labelSecondary}],children:n(`calcflow_activityInfo_modal_intensity2_body`)}),(0,G.jsx)(Q,{style:S7.intensityDescriptionTitle,children:n(`calcflow_activityInfo_modal_intensity3_title`)}),(0,G.jsx)(Q,{style:[S7.intensityDescriptionText,{color:r.labelSecondary}],children:n(`calcflow_activityInfo_modal_intensity3_body`)})]})]})},S7=z.create({container:{marginHorizontal:16},contentContainer:{paddingBottom:64},header:{flexDirection:`row`,justifyContent:`space-between`,marginBottom:32},cardMandatory:{gap:24},headerTitle:{...X.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:{...X.Poppins.regular_Base},intensityDescriptionTitle:{...X.Poppins.semiBold_Base,marginTop:16},intensityDescriptionText:{...X.Poppins.regular_Base}}),amn=f7(imn);H();var omn=()=>{let{t:e}=Sq(),{COLORS:t}=Y(),{addListener:n,removeListener:r}=A$(),i=(0,U.useRef)(null),a=(0,U.useRef)(!1),{activity:o}=k8,{selectedEventUUID:s,activityStoreActions:c}=a7(),[l,u]=(0,U.useState)(null),[d,f]=(0,U.useState)([]);(0,U.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,U.useEffect)(()=>{let e=xf.addEventListener(`change`,e=>{e===`active`&&p()});return n(`focus`,p),()=>{r(`focus`,p),e.remove()}},[r,n]);let m=(0,U.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),wf.dismiss(),i.current?.present()},g=e=>{u(S8.getByUUID(e)),h()};return(0,G.jsxs)(G.Fragment,{children:[d.map((e,t)=>(0,G.jsx)(rmn,{index:t,toggleActivitySwitch:m,isChecked:s===e.uuid,onEdit:g,activity:e},e.uuid)),(0,G.jsxs)(Cp,{testID:`add-activity-button`,onPress:h,style:({pressed:e})=>[smn.smallButton,{backgroundColor:t.bgButtonSecondary,opacity:e?.5:1}],children:[(0,G.jsx)(I7t,{color:t.iconButtonSecondary}),(0,G.jsx)(Q,{style:smn.buttonText,children:e(`calcflow_activity_button_add`)})]}),(0,G.jsx)(V,{style:{height:24,borderTopWidth:1,borderTopColor:t.divider}}),(0,G.jsx)(m$,{ref:i,handleIndicatorStyle:{height:0},backdropComponent:V4,backgroundStyle:{backgroundColor:t.bgSheet,borderRadius:36},enablePanDownToClose:!1,children:(0,G.jsx)(amn,{selectedActivity:l,onClose:()=>{u(null),i.current?.close(),p()}})})]})},smn=z.create({smallButton:{flexDirection:`row`,alignSelf:`flex-start`,alignItems:`center`,borderRadius:16,paddingHorizontal:16,paddingVertical:8,marginBottom:24,gap:8},buttonText:{...X.Poppins.medium_SM,alignSelf:`center`}});H();var cmn=()=>{let{COLORS:e}=Y(),{navigate:t}=A$(),{foodIntakeItems:n,removeFoodIntakeItem:r}=L5(),i=(0,U.useCallback)((e,t)=>{e?r(e,`id`):r(t,`title`)},[r]),a=(0,U.useCallback)(e=>{if(e.source===`curated`){t(F5.FoodLibrary,{screen:F5.CuratedFoodItem,params:{foodId:e.id,categoryId:e.categoryId}});return}t(F5.FoodLibrary,{screen:F5.PersonalFoodItem,params:{foodId:e.id}})},[t]),o=(0,U.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,G.jsxs)(V,{style:[C7.pill,{backgroundColor:e.bgPill}],children:[(0,G.jsxs)(Cp,{onPress:()=>{a(t.foodItem)},style:({pressed:e})=>[C7.pillContent,{opacity:e?.5:1}],testID:`carbs-item-${n}`,children:[(0,G.jsx)(Q,{numberOfLines:1,ellipsizeMode:`middle`,style:[C7.title,{color:e.labelPrimary}],testID:`carbs-item-${n}-title`,children:l}),(0,G.jsx)(Q,{style:[C7.value,{color:e.labelPrimary}],testID:`carbs-item-${n}-amount`,children:`${u} g`})]}),(0,G.jsx)(Cp,{onPress:()=>{i(c,l)},testID:`carbs-item-${n}-remove-icon`,hitSlop:16,children:(0,G.jsx)(U7t,{width:16,height:16})})]},r)},[e.bgPill,e.labelPrimary,a,i]);return(0,G.jsx)(V,{style:C7.container,children:n.map((e,t)=>o({item:e,index:t,itemKey:e.foodItem.id||`${t}-${e.foodItem.title}`}))})},C7=z.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:{...X.Poppins.regular_XS,marginRight:2,flexShrink:1},value:{...X.Poppins.regular_XS,marginRight:2}});H();var lmn=(0,U.forwardRef)(({onFocusChange:e},t)=>{let{t:n}=Sq(),{COLORS:r}=Y(),{navigate:i}=A$(),a=(0,U.useRef)(null);(0,U.useImperativeHandle)(t,()=>({blur:()=>a.current?.blur()}));let{foodIntakeItems:o,foodIntakeCarbsAmount:s,manualCarbsInput:c,setManualCarbsInput:l}=L5(),[u,d]=(0,U.useState)(!1),[f,p]=(0,U.useState)(``),m=UWt();(0,U.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,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(V,{style:[w7.carbsSection,{backgroundColor:r.bgListActive,borderColor:u?r.borderInputFocus:r.bgListActive}],children:[(0,G.jsx)(Y4,{testID:`carbs-input`,renderLeftSlot:()=>(0,G.jsxs)(V,{style:w7.inputRow,children:[(0,G.jsx)(L7t,{width:24,height:24,color:r.labelPrimary}),(0,G.jsx)(Q,{testID:`carbs-input-unit`,children:n(`calcflow_carbohydrates_title`)})]}),renderRightSlot:()=>(0,G.jsxs)(V,{style:w7.inputRow,children:[(0,G.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,G.jsx)(Q,{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,G.jsxs)(V,{style:{borderTopWidth:1,borderTopColor:r.divider},children:[(0,G.jsx)(cmn,{}),(0,G.jsx)(P7t,{}),(0,G.jsxs)(V,{style:[w7.totalContainer,{backgroundColor:r.bgListActive}],children:[(0,G.jsx)(Q,{style:w7.totalTitle,children:n(`calcflow_carbohydrates_total`)}),(0,G.jsxs)(V,{style:w7.totalGramsContainer,children:[(0,G.jsx)(Q,{style:w7.totalValue,testID:`total-carbs-value`,children:s+c}),(0,G.jsx)(Q,{style:w7.totalUnits,testID:`total-carbs-unit`,children:n(`my_food_add_unit`)})]})]})]})]}),(0,G.jsxs)(V,{style:w7.buttonsContainer,children:[(0,G.jsxs)(Cp,{testID:`add-food-from-library-button`,onPress:()=>{u8(l8.CalculationFoodLibraryPress),i(F5.FoodLibrary)},style:({pressed:e})=>[w7.smallButton,{backgroundColor:r.bgButtonSecondary,opacity:e?.5:1}],children:[(0,G.jsx)(n9t,{color:r.labelPrimary}),(0,G.jsx)(Q,{style:[w7.title,{color:r.textButtonSecondary}],children:n(`calcflow_button_foodLibrary`)})]}),!Tq&&(0,G.jsx)(Z9t,{onPress:()=>{if(u8(l8.CalculationScanFoodPress),!c7.getState().privacyNoticeAccepted){i(F5.VisualSearchIntro);return}i(F5.VisualSearch)},text:n(`calcflow_button_scan`),style:w7.scanFoodButton})]}),(0,G.jsx)(V,{style:{height:24,borderTopWidth:1,borderTopColor:r.divider}})]})});lmn.displayName=`Carbs`;var w7=z.create({inputRow:{flexDirection:`row`,justifyContent:`flex-start`,alignItems:`center`,marginRight:8,gap:4},carbsSection:{borderWidth:2,borderRadius:16,marginBottom:12},numberInput:{...X.Poppins.regular_Base,lineHeight:B.select({ios:0,default:X.Poppins.regular_Base.lineHeight}),textAlign:`right`,maxWidth:40},totalContainer:{flexDirection:`row`,justifyContent:`space-between`,alignItems:`baseline`,padding:16,paddingTop:8,borderRadius:16},totalTitle:{...X.Poppins.medium_Base},totalGramsContainer:{flexDirection:`row`,alignItems:`baseline`},totalValue:{...X.Poppins.bold_2XL},totalUnits:{...X.Poppins.medium_Base,marginLeft:8},unit:{...X.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:{...X.Poppins.medium_SM,alignSelf:`center`}}),umn=`hda`,dmn=e=>e.device_name.toLowerCase()===umn||e.source_name.toLowerCase()===umn,fmn=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}),pmn=(e,t=Date.now())=>e.map(fmn).filter(e=>!dmn(e)&&e.timestamp.getTime()<=t).sort((e,t)=>t.timestamp.getTime()-e.timestamp.getTime())[0]??null,mmn=(e,t)=>{let{inputMax:n,inputMin:r}=L8(t);return!isNaN(e)&&e>=r&&e<=n};H();var hmn=()=>{let{t:e}=Sq(),{COLORS:t}=Y(),{glucoseStoreActions:n}=R5(),r=emn(`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,U.useState)(!1),[c,l]=(0,U.useState)(!1);R3t(()=>{r&&s(Date.now()-r.timestamp>Z.Milliseconds.Minute*10)},1e3),(0,U.useEffect)(()=>{(async()=>{try{let e=`${_q.HEDIA_SERVER_BASE_URL}/api/v2/samples`,t=await d8(e);await E2(t,Z.StatusCode.OK,e);let r=await t.json();if(r.length===0)return;let i=pmn(r);if(!i)return;let{unit:a,value:o}=i.quantity;if(!mmn(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),iin(i)}catch(e){console.error(`[DevicesSection.web::getSamples]`,e)}})()},[n]);let u=(0,U.useCallback)(()=>{if(_q.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)*Z.Milliseconds.Minute),source_id:`TEST`,quantity:{unit:Z.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,G.jsxs)(V,{style:T7.container,children:[r?.source===`external`?(0,G.jsx)(Cp,{style:[T7.button,{backgroundColor:i?t.bgButtonPrimary:t.bgButtonSecondary}],onPress:()=>{!o&&n.setSelectedReadingId(r.id)},children:(0,G.jsx)(Q,{style:[T7.title,{color:i?t.textButtonPrimary:t.textButtonSecondary}],children:r.deviceName})}):(0,G.jsx)(Cp,{style:[T7.button,{backgroundColor:t.bgButtonSecondary}],onPress:()=>{l(!0)},onLongPress:()=>{u()},children:(0,G.jsx)(Q,{style:[T7.title,{color:t.labelPrimary}],children:e(`import_modal_reading_title`)})}),(0,G.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=z.create({container:{marginTop:12},button:{alignSelf:`flex-start`,paddingVertical:8,paddingHorizontal:16,borderRadius:16},title:{...X.Poppins.medium_SM}});H();var gmn=e=>e.replace(`,`,`.`),_mn=300,vmn=(0,U.forwardRef)(({onFocusChange:e},t)=>{let{t:n}=Sq(),{COLORS:r}=Y(),i=(0,U.useRef)(null);(0,U.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,U.useMemo)(()=>L8(a),[a]),[u,d]=(0,U.useState)(``),[f,p]=(0,U.useState)(!1),m=b7(),{glucoseStoreActions:h,availableGlucoseReadings:g}=R5(),{isNoBGModalVisible:_,modalStoreActions:v}=z5(),[y,b]=(0,U.useState)(!1),[x,S]=(0,U.useState)(!1),[C,w]=(0,U.useState)(`hidden`),[T,E]=(0,U.useState)(`hidden`);R$((0,U.useCallback)(()=>{let e=setInterval(()=>{let e=m?.timestamp;T===`open`||!e||m.source===`cgm`||Date.now()-e>Z.Milliseconds.Minute*10&&(E(`open`),d(``))},1e3);return()=>{clearInterval(e)}},[T,m])),(0,U.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,U.useCallback)(e=>{d(gmn(e))},[]),k=(0,U.useCallback)(()=>{u8(l8.CalculationGlucosePress),p(!0),e?.(!0)},[e]),A=(0,U.useCallback)(()=>{i.current?.focus()},[]),ee=(0,U.useCallback)(()=>{if(Tq){A();return}setTimeout(A,_mn)},[A]),te=(0,U.useCallback)(()=>{d(m&&B8(m.value,m.unit,a)||``)},[a,m]),ne=(0,U.useCallback)(()=>g.find(e=>{let t=B8(e.value,e.unit,a),n=Date.now()-e.timestamp>Z.Milliseconds.Minute*10;return t===u&&e.source!==`manual`&&!n}),[g,a,u]),re=(0,U.useCallback)(e=>!isNaN(e)&&e>=c&&e<=s,[s,c]),ie=(0,U.useCallback)(e=>({id:i3(),source:`manual`,value:e,unit:a,timestamp:Date.now()}),[a]),j=(0,U.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]),M=()=>{(0,d7.flushSync)(()=>{w(`hidden`),h.setSelectedReadingId(null)}),ee()},ae=()=>{w(`closing`)},oe=()=>{w(`hidden`)},N=()=>{u8(l8.ExpiredGlucose),h.setSelectedReadingId(null)},se=()=>{(0,d7.flushSync)(()=>{E(`hidden`)}),ee()},P=()=>{E(`closing`)},F=()=>{E(`hidden`)},ce=()=>{(0,d7.flushSync)(()=>{v.set({isNoBGModalVisible:!1})}),ee()},le=()=>{b(!0),v.set({isNoBGModalVisible:!1})},ue=()=>{b(!1)},de=m===null||m.source===`manual`;return(0,G.jsxs)(G.Fragment,{children:[(0,G.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,G.jsxs)(V,{style:E7.inputRow,children:[(0,G.jsx)(G7t,{height:24,width:24,color:r.labelPrimary}),(0,G.jsx)(Q,{testID:`glucose-input-unit`,ellipsizeMode:`tail`,numberOfLines:1,style:E7.sourceText,children:t})]})},renderRightSlot:()=>(0,G.jsxs)(V,{style:E7.rightSlot,children:[(0,G.jsx)(I4,{testID:`glucose-input-field`,ref:i,value:u,inputMode:a===Z.BloodGlucoseUnit.MMOL_L?`decimal`:`numeric`,maxLength:a===Z.BloodGlucoseUnit.MMOL_L?4:3,editable:de||f,onChangeText:O,onFocus:k,onBlur:j,style:[E7.numberInput,{color:de?r.labelPrimary:r.labelBrand,width:a===Z.BloodGlucoseUnit.MMOL_L?48:36}],selectTextOnFocus:!!u&&!f}),(0,G.jsx)(Q,{style:[E7.unit,{color:de?r.labelPrimary:r.labelBrand}],children:l})]}),onPress:D,style:{...E7.groupedRow,...f&&{borderColor:r.borderInputFocus}}}),(0,G.jsx)(hmn,{glucoseUnit:a,inputRef:i}),(0,G.jsx)(V,{style:[E7.divider,{borderTopColor:r.divider}]}),T!==`hidden`&&(0,G.jsx)(u3,{isVisible:T===`open`,title:n(`calcflow_modal_expired_title`),message:n(`calcflow_modal_expired_body`),icon:()=>(0,G.jsx)(G7t,{width:96,height:96,color:r.labelPrimary}),onModalShow:N,onModalHide:F,buttons:[{title:n(`calcflow_modal_expire_button_add`),onPress:se},{title:n(`button_cancel`),type:H4.Secondary,onPress:P}]}),(0,G.jsx)(u3,{isVisible:x,title:n(`calcflow_modal_glucose_invalid_title`,{min:Qon(c,a),max:Qon(s,a)}),buttons:[{testID:`close-button`,title:n(`button_close`),onPress:()=>{S(!1),te()}}]}),C!==`hidden`&&(0,G.jsx)(u3,{isVisible:C===`open`,title:n(`calcflow_modal_change_synced_value_title`),onModalHide:oe,buttons:[{testID:`change-button`,type:H4.Error,title:n(`calcflow_modal_button_changeValue`),onPress:M},{testID:`keep-button`,type:H4.Secondary,title:n(`calcflow_modal_button_keepValue`),onPress:ae}]}),(_||y)&&(0,G.jsx)(u3,{isVisible:_,title:n(`calcflow_modal_enter_glucose_title`),message:n(`calcflow_modal_enter_glucose_body`),icon:()=>(0,G.jsx)(G7t,{width:96,height:96,color:r.labelPrimary}),onModalHide:ue,buttons:[{title:n(`calcflow_modal_enter_glucose_button_add`),onPress:ce},{title:n(`button_cancel`),type:H4.Secondary,onPress:le}]})]})});vmn.displayName=`Glucose`;var E7=z.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:{...X.Poppins.regular_Base,lineHeight:B.select({ios:0,default:X.Poppins.regular_Base.lineHeight}),textAlign:`right`,textAlignVertical:`center`},unit:{...X.Poppins.regular_Base},divider:{marginTop:24,height:24,borderTopWidth:1}});H();function ymn({description:e,assetId:t,imageUri:n,onPress:r,testID:i}){let{COLORS:a}=Y(),{t:o}=Sq(),s=$5(n?void 0:t),c=n??s,l=e||o(`notes_placeholder`),u=l===o(`notes_placeholder`);return u&&!c?null:(0,G.jsxs)(Cp,{style:({pressed:e})=>[bmn.container,{backgroundColor:a.bgSecondary},e&&r&&{opacity:.9}],onPress:r,disabled:!r,testID:`${i}-button`,children:[(0,G.jsx)(Q,{style:[bmn.text,{color:u?a.labelTertiary:a.labelPrimary}],children:l}),!!c&&(0,G.jsx)(Xu,{source:{uri:c},style:bmn.thumbnail,resizeMode:`cover`,testID:`${i}-thumbnail`})]})}var bmn=z.create({container:{flexDirection:`row`,borderRadius:16,padding:16,gap:12,alignItems:`flex-start`},text:{...X.Poppins.regular_Base,flex:1},thumbnail:{width:64,height:64,borderRadius:8}});H();var xmn=({onClose:e,onConfirm:t})=>{let{COLORS:n}=Y(),{t:r}=Sq(),{noteId:i}=B5(),{noteStoreActions:a}=B5(),[o,s]=(0,U.useState)(!1),[c,l]=(0,U.useState)(!1),{noteBody:u,setNoteBody:d,loadNote:f,saveNote:p,isLoading:m,hasNoteContent:h}=spn();(0,U.useEffect)(()=>{i&&f(i).catch(console.error)},[i,f]);let g=(0,U.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,U.useCallback)(()=>{e()},[e]),v=!h||o;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(V,{style:Smn.header,children:[(0,G.jsx)(U5,{onPress:_}),o?(0,G.jsx)(Nf,{size:`small`,color:n.iconBrand}):(0,G.jsx)(W5,{onPress:g,disabled:v})]}),m?(0,G.jsx)(V,{style:Smn.loader,children:(0,G.jsx)(Nf,{size:`large`,color:n.iconBrand})}):(0,G.jsx)(pfn,{value:u,onChangeText:d,testID:`calculation-notes`,autoFocus:!0,containerStyle:Smn.container}),(0,G.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)}}]})]})},Smn=z.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}});H();var Cmn=()=>{let{t:e}=Sq(),{COLORS:t}=Y(),{noteBody:n,displayImageUri:r}=B5(),i=(0,U.useRef)(null),a=()=>{u8(l8.CalculationNotesPress),wf.dismiss(),i.current?.present()};return(0,G.jsxs)(G.Fragment,{children:[n.trim()||r?(0,G.jsx)(V,{style:wmn.noteContainer,children:(0,G.jsx)(ymn,{description:n,imageUri:r,onPress:a,testID:`note-display`})}):(0,G.jsxs)(Cp,{testID:`add-notes-button`,onPress:a,style:({pressed:e})=>[wmn.smallButton,{backgroundColor:t.bgButtonSecondary,opacity:e?.5:1}],children:[(0,G.jsx)(e9t,{height:20,width:20,color:t.labelPrimary}),(0,G.jsx)(Q,{style:[wmn.title,{color:t.textButtonSecondary}],children:e(`calcflow_notes_button_add`)})]}),(0,G.jsx)(m$,{ref:i,handleIndicatorStyle:{height:0},backdropComponent:V4,backgroundStyle:{backgroundColor:t.bgSheet,borderRadius:36},enablePanDownToClose:!1,enableDynamicSizing:!1,snapPoints:[`85%`],children:(0,G.jsx)(g$,{children:(0,G.jsx)(xmn,{onClose:()=>{wf.dismiss(),i.current?.dismiss()},onConfirm:()=>{wf.dismiss(),i.current?.dismiss()}})})})]})},wmn=z.create({smallButton:{flexDirection:`row`,alignSelf:`flex-start`,alignItems:`center`,borderRadius:16,paddingHorizontal:16,paddingVertical:8,marginBottom:24,gap:8},noteContainer:{marginBottom:24},title:{...X.Poppins.medium_SM,alignSelf:`center`}});H();var Tmn=()=>{let{t:e}=Sq(),{COLORS:t}=Y(),{bottomWithFooterButton:n}=Q4(),r=M5(),i=(0,U.useRef)(null),a=A$(),o=M$(),{modalStoreActions:s}=z5(),{noteId:c}=B5(),{foodIntakeItems:l,manualCarbsInput:u,foodIntakeCarbsAmount:d}=L5(),[f,p]=(0,U.useState)(!1),m=b7(),h=o.params?.errorType??null,g=h===Cq.Sync,_=(0,U.useRef)(!1),v=(0,U.useRef)(!1),y=(0,U.useRef)(null),b=(0,U.useRef)(null),x=(0,U.useCallback)(e=>{_.current=e},[]),S=(0,U.useCallback)(e=>{v.current=e},[]),{fetchLibreCgmData:C}=tmn(),w=(0,U.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]);R$((0,U.useCallback)(()=>{if(Tq)return;let e=Sf.addEventListener(`hardwareBackPress`,w);return()=>{e.remove()}},[w])),(0,U.useEffect)(()=>{C()},[C]),(0,U.useLayoutEffect)(()=>{a.setOptions({headerTransparent:!0,header:()=>(0,G.jsx)(P5,{title:e(`calcflow_navigation`),LeftButton:Tq?void 0:(0,G.jsx)(U5,{onPress:w}),RightButton:Tq?(0,G.jsxs)(V,{style:[D7.buttonsWrapper,{backgroundColor:t.bgButtonSecondary,borderColor:t.border}],children:[(0,G.jsx)(Qdn,{style:D7.noBorder}),(0,G.jsx)(Zdn,{style:D7.noBorder})]}):(0,G.jsx)(Qdn,{}),overlay:!0})})},[t.bgButtonSecondary,t.border,w,a,e]);let[T,E]=(0,U.useState)(Tq);(0,U.useEffect)(()=>{if(!Tq)return a.addListener(`transitionStart`,({data:e})=>{e.closing||!a.isFocused()||E(!0)})},[a]),(0,U.useEffect)(()=>{if(!T)return;let e=setTimeout(()=>{i.current?.present()},100);return()=>{clearTimeout(e)}},[T]);let D=(0,U.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>Qfn().max){p(!0);return}a.navigate(F5.LoadingRecommendation)},[m,a,s,d,u]),O=(0,U.useCallback)(()=>{u8(l8.RecentInsulinContinuePress),i.current?.close()},[]);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(ds,{testID:`calculation-scroll-view`,keyboardShouldPersistTaps:`handled`,contentContainerStyle:[D7.scrollView,{backgroundColor:t.bgPrimary,paddingTop:r+16,paddingBottom:n}],children:[(0,G.jsx)(vmn,{ref:b,onFocusChange:S}),(0,G.jsx)(lmn,{ref:y,onFocusChange:x}),(0,G.jsx)(omn,{}),(0,G.jsx)(Cmn,{})]}),(0,G.jsx)(tpn,{children:(0,G.jsx)(U4,{type:H4.Primary,testID:`calculate-button`,title:e(`calcflow_button_calculate`),onPress:D,inactive:m===null})}),(0,G.jsx)(m$,{ref:i,handleIndicatorStyle:{height:0},backdropComponent:V4,backgroundStyle:{backgroundColor:t.bgSheet,borderRadius:36},enablePanDownToClose:!1,children:(0,G.jsx)(g$,{children:(0,G.jsx)($pn,{onNoInsulinPressed:O})})}),(0,G.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(F5.Calculation)}}]}),(0,G.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,G.jsx)(npn,{}),(0,G.jsx)(ppn,{})]})},D7=z.create({scrollView:{paddingHorizontal:16},buttonsWrapper:{flexDirection:`row`,padding:0,borderRadius:44,borderWidth:1},noBorder:{borderWidth:0}});H();var Emn=1e3;function Dmn(){let e=A$(),t=M$(),[n,r]=(0,U.useState)(!1);return(0,U.useEffect)(()=>{setTimeout(()=>{r(!0)},Emn)},[]),(0,U.useEffect)(()=>{n&&(Tq?(window.location.href=`/redirect?status=success`,vq.clearAll()):e.popTo(F5.MainBottomTabs,{screen:F5.DashboardTab,params:{screen:F5.Dashboard,params:{action:mvt.Saved,logbookEntry:t.params.logbookEntry}}}))},[n,e,t.params.logbookEntry]),(0,G.jsx)(V,{style:Omn.animationContainer,children:(0,G.jsx)(p2,{autoPlay:!0,source:m2.LEAVING_RECOMMENDATION,style:Omn.animation,webStyle:Omn.animation,resizeMode:`cover`,loop:!1})})}var Omn=z.create({animationContainer:{flex:1,justifyContent:`center`,alignItems:`center`},animation:{width:256,height:256}}),kmn=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`}})),Amn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DARK_SEMANTIC_COLORS=void 0;var t=kmn(),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]}})),jmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LIGHT_SEMANTIC_COLORS=void 0;var t=kmn(),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]}})),Mmn=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=(H(),d(em)),n=Amn(),r=jmn(),i=Mmn(),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=Amn(),i=PJ();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)})),Nmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,a(p());var t=i((F4(),d(P4))),n=k7(),r=PJ();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})),Pmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,a(p());var t=i((F4(),d(P4))),n=k7(),r=PJ();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=D2();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=q_t(),r=PJ();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=D2();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))})),Fmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.useDebouncedCallback=m,e.useFontScale=f;var t=p(),n=(H(),d(em)),r=Mmn(),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=(H(),d(em)),r=Fmn(),i=k7(),a=O7(),o=PJ();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})),Imn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=g(p()),n=(H(),d(em)),r=D2(),i=h(Nmn()),a=h(Pmn()),o=A7(),s=k7(),c=j7(),l=O7(),u=M7(),f=h(N7()),m=PJ();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=_})),Lmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,a(p());var t=i((F4(),d(P4))),n=k7(),r=PJ();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})),Rmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,i(p());var t=(F4(),d(P4)),n=k7(),r=PJ();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})]})}})),zmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,i(p());var t=(H(),d(em)),n=k7(),r=PJ();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})),Bmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.CheckmarkCircleFilledHeight=void 0,i(p());var t=r((F4(),d(P4))),n=PJ();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})),Vmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,o(p());var t=(H(),d(em)),n=a(Bmn()),r=k7(),i=PJ();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=(H(),d(em)),r=(J0(),d(R4t)),i=k7(),a=c(zmn()),o=c(Vmn()),s=PJ();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)})),Hmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"HapticFeedbackTypes",{enumerable:!0,get:function(){return n.HapticFeedbackTypes}}),e.triggerHaptic=i;var t=(H(),d(em)),n=r((Cfn(),d(yfn)));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})}})),Umn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=i(p()),n=(H(),d(em)),r=PJ();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`}})})),Wmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=l(p()),n=(H(),d(em)),r=c(R4()),i=Fmn(),a=Hmn(),o=c(Umn()),s=PJ();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`}})})),Gmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=u(p()),n=(H(),d(em)),r=k7(),i=j7(),a=l(P7()),o=l(N7()),s=l(Wmn()),c=PJ();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}})})),Kmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=g(p()),n=(H(),d(em)),r=h(Lmn()),i=h(Rmn()),a=A7(),o=k7(),s=j7(),c=O7(),l=M7(),u=h(N7()),f=h(Gmn()),m=PJ();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`}})})),qmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,i(p());var t=(H(),d(em)),n=k7(),r=PJ();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})),Jmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,a(p());var t=i((F4(),d(P4))),n=k7(),r=PJ();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})),Ymn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,a(p());var t=i((F4(),d(P4))),n=k7(),r=PJ();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})),Xmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,r(p());var t=r((F4(),d(P4))),n=PJ();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})),Zmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.styles=e.default=void 0,o(p());var t=(H(),d(em)),n=k7(),r=O7(),i=o(N7()),a=PJ();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`}})})),Qmn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.styles=e.default=void 0;var t=g(p()),n=(H(),d(em)),r=h(Jmn()),i=h(Ymn()),a=h(Xmn()),o=k7(),s=j7(),c=O7(),l=M7(),u=h(N7()),f=h(Zmn()),m=PJ();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`}})})),$mn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,s(p());var t=(H(),d(em)),n=k7(),r=j7(),i=O7(),a=s(N7()),o=PJ();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})),ehn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,c(p());var t=(H(),d(em)),n=c(R4()),r=k7(),i=j7(),a=O7(),o=c(N7()),s=PJ();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})),thn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=_(p()),n=(H(),d(em)),r=Tan(),i=D2(),a=g(Rmn()),o=A7(),s=k7(),c=j7(),l=O7(),u=M7(),f=g(N7()),m=g(Gmn()),h=PJ();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=(H(),d(em)),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`}})})),nhn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,c(p());var t=(H(),d(em)),n=k7(),r=j7(),i=c(N7()),a=c(P7()),o=F7(),s=PJ();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`)})})]})})}})),rhn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,c(p());var t=(H(),d(em)),n=k7(),r=j7(),i=c(N7()),a=c(P7()),o=F7(),s=PJ();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`)})})]})]})})}})),ihn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,c(p());var t=(H(),d(em)),n=k7(),r=j7(),i=c(N7()),a=c(P7()),o=F7(),s=PJ();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`)})})]})})}})),ahn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.getLimitedValue=m;var t=f(p()),n=(H(),d(em)),r=D2(),i=k7(),a=j7(),o=u(N7()),s=u(P7()),c=F7(),l=PJ();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`)})})]})})}})),ohn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,c(p());var t=(H(),d(em)),n=k7(),r=j7(),i=c(N7()),a=c(P7()),o=F7(),s=PJ();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`)})})]})})}})),shn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,c(p());var t=(H(),d(em)),n=k7(),r=j7(),i=c(N7()),a=c(P7()),o=F7(),s=PJ();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`)})})]})]})})}})),chn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,i(p());var t=r((F4(),d(P4))),n=PJ();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})),lhn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=c(p()),n=(H(),d(em)),r=s(R4()),i=s(chn()),a=k7(),o=PJ();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}}})),uhn=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)})),dhn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=uhn(),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}}})),fhn=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(dhn());e.defaultErrorMap=n.default;var r=n.default;function i(e){r=e}function a(){return r}})),phn=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=fhn(),r=t(dhn());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})),mhn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),hhn=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={}))})),ghn=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=Le;var t=uhn(),n=fhn(),r=hhn(),i=phn(),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 De({schema:this,typeName:Re.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 Oe.create(this,this._def)}nullable(){return ke.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return de.create(this)}promise(){return Ee.create(this,this._def)}or(e){return me.create([this,e],this._def)}and(e){return L.create(this,e,this._def)}transform(e){return new De({...c(this._def),schema:this,typeName:Re.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new Ae({...c(this._def),innerType:this,defaultValue:t,typeName:Re.ZodDefault})}brand(){return new Ne({typeName:Re.ZodBranded,type:this,...c(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new je({...c(this._def),innerType:this,catchValue:t,typeName:Re.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Pe.create(this,e)}readonly(){return Fe.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:Re.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:Re.ZodNumber,coerce:e?.coerce||!1,...c(e)});var M=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=M,M.create=e=>new M({checks:[],typeName:Re.ZodBigInt,coerce:e?.coerce??!1,...c(e)});var ae=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=ae,ae.create=e=>new ae({typeName:Re.ZodBoolean,coerce:e?.coerce||!1,...c(e)});var oe=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=oe,oe.create=e=>new oe({checks:[],coerce:e?.coerce||!1,typeName:Re.ZodDate,...c(e)});var N=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=N,N.create=e=>new N({typeName:Re.ZodSymbol,...c(e)});var se=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=se,se.create=e=>new se({typeName:Re.ZodUndefined,...c(e)});var P=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=P,P.create=e=>new P({typeName:Re.ZodNull,...c(e)});var F=class extends l{constructor(){super(...arguments),this._any=!0}_parse(e){return(0,i.OK)(e.data)}};e.ZodAny=F,F.create=e=>new F({typeName:Re.ZodAny,...c(e)});var ce=class extends l{constructor(){super(...arguments),this._unknown=!0}_parse(e){return(0,i.OK)(e.data)}};e.ZodUnknown=ce,ce.create=e=>new ce({typeName:Re.ZodUnknown,...c(e)});var le=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=le,le.create=e=>new le({typeName:Re.ZodNever,...c(e)});var ue=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=ue,ue.create=e=>new ue({typeName:Re.ZodVoid,...c(e)});var de=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=de,de.create=(e,t)=>new de({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Re.ZodArray,...c(t)});function fe(e){if(e instanceof pe){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=Oe.create(fe(r))}return new pe({...e._def,shape:()=>t})}else if(e instanceof de)return new de({...e._def,type:fe(e.element)});else if(e instanceof Oe)return Oe.create(fe(e.unwrap()));else if(e instanceof ke)return ke.create(fe(e.unwrap()));else if(e instanceof _e)return _e.create(e.items.map(e=>fe(e)));else return e}var pe=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 le&&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 le){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:Re.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 fe(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 Oe;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return Ce(a.util.objectKeys(this.shape))}};e.ZodObject=pe,pe.create=(e,t)=>new pe({shape:()=>e,unknownKeys:`strip`,catchall:le.create(),typeName:Re.ZodObject,...c(t)}),pe.strictCreate=(e,t)=>new pe({shape:()=>e,unknownKeys:`strict`,catchall:le.create(),typeName:Re.ZodObject,...c(t)}),pe.lazycreate=(e,t)=>new pe({shape:e,unknownKeys:`strip`,catchall:le.create(),typeName:Re.ZodObject,...c(t)});var me=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=me,me.create=(e,t)=>new me({options:e,typeName:Re.ZodUnion,...c(t)});var he=e=>e instanceof xe?he(e.schema):e instanceof De?he(e.innerType()):e instanceof Se?[e.value]:e instanceof we?e.options:e instanceof Te?a.util.objectValues(e.enum):e instanceof Ae?he(e._def.innerType):e instanceof se?[void 0]:e instanceof P?[null]:e instanceof Oe?[void 0,...he(e.unwrap())]:e instanceof ke?[null,...he(e.unwrap())]:e instanceof Ne||e instanceof Fe?he(e.unwrap()):e instanceof je?he(e._def.innerType):[],I=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=he(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:Re.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...c(r)})}};e.ZodDiscriminatedUnion=I;function ge(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=ge(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=ge(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 L=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=ge(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=L,L.create=(e,t,n)=>new L({left:e,right:t,typeName:Re.ZodIntersection,...c(n)});var _e=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=_e,_e.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new _e({items:e,typeName:Re.ZodTuple,rest:null,...c(t)})};var ve=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:Re.ZodRecord,...c(r)}):new e({keyType:re.create(),valueType:t,typeName:Re.ZodRecord,...c(n)})}};e.ZodRecord=ve;var ye=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=ye,ye.create=(e,t,n)=>new ye({valueType:t,keyType:e,typeName:Re.ZodMap,...c(n)});var be=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=be,be.create=(e,t)=>new be({valueType:e,minSize:null,maxSize:null,typeName:Re.ZodSet,...c(t)});var R=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 Ee){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:_e.create(t).rest(ce.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||_e.create([]).rest(ce.create()),returns:n||ce.create(),typeName:Re.ZodFunction,...c(r)})}};e.ZodFunction=R;var xe=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=xe,xe.create=(e,t)=>new xe({getter:e,typeName:Re.ZodLazy,...c(t)});var Se=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=Se,Se.create=(e,t)=>new Se({value:e,typeName:Re.ZodLiteral,...c(t)});function Ce(e,t){return new we({values:e,typeName:Re.ZodEnum,...c(t)})}var we=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=we,we.create=Ce;var Te=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=Te,Te.create=(e,t)=>new Te({values:e,typeName:Re.ZodNativeEnum,...c(t)});var Ee=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=Ee,Ee.create=(e,t)=>new Ee({type:e,typeName:Re.ZodPromise,...c(t)});var De=class extends l{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Re.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=De,e.ZodTransformer=De,De.create=(e,t,n)=>new De({schema:e,typeName:Re.ZodEffects,effect:t,...c(n)}),De.createWithPreprocess=(e,t,n)=>new De({schema:t,effect:{type:`preprocess`,transform:e},typeName:Re.ZodEffects,...c(n)});var Oe=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=Oe,Oe.create=(e,t)=>new Oe({innerType:e,typeName:Re.ZodOptional,...c(t)});var ke=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=ke,ke.create=(e,t)=>new ke({innerType:e,typeName:Re.ZodNullable,...c(t)});var Ae=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=Ae,Ae.create=(e,t)=>new Ae({innerType:e,typeName:Re.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...c(t)});var je=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=je,je.create=(e,t)=>new je({innerType:e,typeName:Re.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...c(t)});var Me=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=Me,Me.create=e=>new Me({typeName:Re.ZodNaN,...c(e)}),e.BRAND=Symbol(`zod_brand`);var Ne=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=Ne;var Pe=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:Re.ZodPipeline})}};e.ZodPipeline=Pe;var Fe=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=Fe,Fe.create=(e,t)=>new Fe({innerType:e,typeName:Re.ZodReadonly,...c(t)});function Ie(e,t){let n=typeof e==`function`?e(t):typeof e==`string`?{message:e}:e;return typeof n==`string`?{message:n}:n}function Le(e,t={},n){return e?F.create().superRefine((r,i)=>{let a=e(r);if(a instanceof Promise)return a.then(e=>{if(!e){let e=Ie(t,r),a=e.fatal??n??!0;i.addIssue({code:`custom`,...e,fatal:a})}});if(!a){let e=Ie(t,r),a=e.fatal??n??!0;i.addIssue({code:`custom`,...e,fatal:a})}}):F.create()}e.late={object:pe.lazycreate};var Re;(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`})(Re||(e.ZodFirstPartyTypeKind=Re={})),e.instanceof=(e,t={message:`Input not instance of ${e.name}`})=>Le(t=>t instanceof e,t);var ze=re.create;e.string=ze;var Be=j.create;e.number=Be,e.nan=Me.create,e.bigint=M.create;var Ve=ae.create;e.boolean=Ve,e.date=oe.create,e.symbol=N.create,e.undefined=se.create,e.null=P.create,e.any=F.create,e.unknown=ce.create,e.never=le.create,e.void=ue.create,e.array=de.create,e.object=pe.create,e.strictObject=pe.strictCreate,e.union=me.create,e.discriminatedUnion=I.create,e.intersection=L.create,e.tuple=_e.create,e.record=ve.create,e.map=ye.create,e.set=be.create,e.function=R.create,e.lazy=xe.create,e.literal=Se.create,e.enum=we.create,e.nativeEnum=Te.create,e.promise=Ee.create;var He=De.create;e.effect=He,e.transformer=He,e.optional=Oe.create,e.nullable=ke.create,e.preprocess=De.createWithPreprocess,e.pipeline=Pe.create,e.ostring=()=>ze().optional(),e.onumber=()=>Be().optional(),e.oboolean=()=>Ve().optional(),e.coerce={string:(e=>re.create({...e,coerce:!0})),number:(e=>j.create({...e,coerce:!0})),boolean:(e=>ae.create({...e,coerce:!0})),bigint:(e=>M.create({...e,coerce:!0})),date:(e=>oe.create({...e,coerce:!0}))},e.NEVER=i.INVALID})),_hn=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(fhn(),e),n(phn(),e),n(mhn(),e),n(I7(),e),n(ghn(),e),n(uhn(),e)})),vhn=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(_hn());e.z=a,i(_hn(),e),e.default=a})),yhn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.recommendationPropsSchema=e.calculatorParamsSchema=e.activitySchema=e.activityReductionSchema=void 0;var t=vhn(),n=D2(),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)})})),bhn=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.SyncStatus=e.RecommendationScreen=void 0;var t=O(p()),n=(H(),d(em)),r=(J0(),d(R4t)),i=Tan(),a=D2(),o=D(Imn()),s=D(Kmn()),c=D(qmn()),l=D(Qmn()),u=D($mn()),f=D(ehn()),m=D(thn()),h=D(nhn()),g=D(rhn()),_=D(ihn()),v=D(ahn()),y=D(ohn()),b=D(shn()),x=D(lhn()),S=A7(),C=k7(),w=j7(),T=yhn(),E=PJ();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:M,injectionMethod:ae,transferEditedRecommendation:oe,closeCalculationFooter:N,closeCalculationTimeoutModal:se,deleteCalculation:P,closeCalculationViewInlogbook:F,trackRecommendationTimeout:ce,trackExpandDetails:le}=e,{glucoseReading:ue,carbohydrates:de,activity:fe}=j,pe=(0,t.useRef)((0,i.calculateRecommendation)(j)).current,[me,he]=(0,t.useState)(null),[I,ge]=(0,t.useState)(null),[L,_e]=(0,t.useState)(null),[ve,ye]=(0,t.useState)(null),[be,R]=(0,t.useState)(0),[xe,Se]=(0,t.useState)(0),[Ce,we]=(0,t.useState)(0),[Te,Ee]=(0,t.useState)(!0),[De,Oe]=(0,t.useState)(!1),[ke,Ae]=(0,t.useState)(!1),[je,Me]=(0,t.useState)(!0),[Ne,Pe]=(0,t.useState)(!1),[Fe,Ie]=(0,t.useState)(!1),[Le,Re]=(0,t.useState)(!1),[ze,Be]=(0,t.useState)(!1),[Ve,He]=(0,t.useState)(!1),[Ue,We]=(0,t.useState)(!1),[Ge,Ke]=(0,t.useState)(!1),[qe,Je]=(0,t.useState)(!1),[Ye,Xe]=(0,t.useState)(!1),[Ze,Qe]=(0,t.useState)(!1);(0,t.useEffect)(()=>{ne===k.Failure&&Xe(!0)},[ne]),(0,t.useEffect)(()=>{ie===k.Failure&&Je(!0)},[ie]),(0,t.useEffect)(()=>{re===k.Success&&(he(I),_e(ve))},[ne,re,ve,I,ie]),(0,t.useEffect)(()=>{T.recommendationPropsSchema.parse(e),p(e.language)},[p,e]),(0,t.useEffect)(()=>{pe.wasLimited&&Ke(!0)},[pe.wasLimited]),(0,t.useEffect)(()=>{let e=pe.recommendationDate.getTime(),t=setInterval(()=>{new Date().getTime()-e>S.TIMEOUT_MODAL_TRIGGER&&!Ue&&!Le&&(Re(!0),We(!0),ce())},a.Milliseconds.Second*1);return()=>clearInterval(t)},[Le,Ue,pe,ce]);let $e=(0,t.useCallback)(e=>{let t=pe.recommendationDate.getTime(),n=new Date().getTime()-t>S.TIMEOUT_MODAL_TRIGGER;e===`active`&&n&&!ze&&(We(!0),ce())},[pe,ce,ze]),et=(0,t.useCallback)(()=>(He(!0),!0),[]);(0,t.useEffect)(()=>{let e=n.AppState.addEventListener(`change`,$e),t=null;return n.Platform.OS===`android`&&(t=n.BackHandler.addEventListener(`hardwareBackPress`,et)),()=>{e.remove(),t?.remove()}},[$e,et]);let tt=(0,t.useMemo)(()=>{if(fe)return{activityDuration:fe.activityDuration,activityIntensity:fe.activityIntensity,activityReduction:pe.activityReduction}},[fe,pe.activityReduction]),nt=(0,t.useCallback)(e=>{n.LayoutAnimation.configureNext(n.LayoutAnimation.Presets.easeInEaseOut);let t=(0,i.roundInsulinValue)(pe.bolus,ae),r=Math.round(pe.carbRecommendation),a=e===t?null:e;e===t?(he(null),ge(null)):ge(e),oe({modified:L,suggested:r},{modified:a,suggested:t},pe.recommendationDate)},[pe,ae,L,oe]),rt=(0,t.useCallback)(e=>{n.LayoutAnimation.configureNext(n.LayoutAnimation.Presets.easeInEaseOut);let t=(0,i.roundInsulinValue)(pe.bolus,ae),r=Math.round(pe.carbRecommendation),a=e===r?null:e;e===r?(_e(null),ye(null)):ye(e),oe({modified:a,suggested:r},{modified:me,suggested:t},pe.recommendationDate)},[pe,ae,me,oe]),it=(0,t.useCallback)(()=>{Ne&&P()},[P,Ne]),at=(0,t.useCallback)(()=>{Be(!0),Fe?F():se()},[Fe,se,F]),ot=(0,t.useCallback)(()=>{Ie(!0),We(!1)},[]),st=(0,t.useCallback)(()=>{Pe(!0),He(!1)},[]),ct=(0,t.useCallback)(()=>{re===k.Failure&&Qe(!0)},[re]),lt=(0,t.useCallback)(()=>{Qe(!1)},[]),ut=(0,t.useCallback)((e,t)=>{we(t)},[]),dt=(0,t.useCallback)(()=>{ee?.current?.scrollToEnd(),Ae(!0),setTimeout(()=>Me(!1),1)},[]),ft=(0,t.useCallback)(e=>{let{layoutMeasurement:{height:t},contentOffset:{y:n}}=e.nativeEvent,r=Math.round(t+n),i=r>=Ce-be,a=r>=Math.round(Ce);Oe(i),Te&&Ee(!1),a&&Ae(!0),a&&setTimeout(()=>Me(!1),1)},[be,Ce,Te]),pt=(0,t.useMemo)(()=>Math.round(xe+be),[xe,be]);return Le?(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:Ue,onPressViewInLogbook:ot,onPressCancel:()=>We(!1),onDismiss:at})})}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(n.ScrollView,{ref:ee,scrollEventThrottle:16,style:[te.scrollView,{backgroundColor:D.bgPrimary}],contentContainerStyle:ke&&te.scrollViewContentContainer,testID:`recommendation-screen`,onScroll:ft,onContentSizeChange:ut,children:[(0,E.jsxs)(n.View,{testID:`recommendation-content`,onLayout:({nativeEvent:e})=>Se(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:me!==null}),(0,E.jsx)(m.default,{initialValue:(0,i.roundInsulinValue)(pe.bolus,ae),editedValue:me,injectionMethod:ae,wasLimited:pe.wasLimited,onDismiss:ct,onConfirm:nt}),(0,E.jsx)(c.default,{}),(0,E.jsx)(l.default,{glucoseReading:ue,bloodGlucoseUnit:M,trackExpandDetails:le,carbIntakeValue:Math.round(de),activeInsulin:Math.round(pe.activeInsulin*10)/10,activity:tt})]}),(0,E.jsxs)(n.View,{style:te.carbsContainer,children:[Math.round(pe.carbRecommendation)>0&&(0,E.jsx)(s.default,{carbsRecommendation:Math.round(pe.carbRecommendation),editedCarbsRecommendation:L,onDismiss:ct,onConfirm:rt}),(0,E.jsx)(o.default,{glucoseReading:ue,hasActivity:fe!==null,bloodGlucoseUnit:M})]})]}),pt>A&&je&&(0,E.jsx)(u.default,{prefixTestID:`scroll`,onSave:dt,onDelete:dt,onLayout:({nativeEvent:e})=>R(e.layout.height)})]}),(0,E.jsx)(x.default,{scrollToEnd:dt,isVisibleArrow:pt>A&&Te,isVisibleBlur:pt>A&&!De&&!ke}),(pt<=A||ke)&&(0,E.jsx)(u.default,{prefixTestID:`fixed`,onSave:N,onDelete:()=>He(!0),onLayout:({nativeEvent:e})=>R(e.layout.height)}),(0,E.jsx)(v.default,{isVisible:Ge,activityReduction:pe.activityReduction,onPress:()=>Ke(!1)}),(0,E.jsx)(g.default,{isVisible:Ve,onPressDelete:st,onDismiss:it,onPressCancel:()=>He(!1)}),(0,E.jsx)(h.default,{isVisible:Ye,onPressClose:()=>Xe(!1)}),(0,E.jsx)(y.default,{isVisible:qe,onPressClose:()=>Je(!1)}),(0,E.jsx)(_.default,{isVisible:Ze,onPressClose:lt})]})};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(bhn()),n=yhn();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 xhn(e,t){return+e3(e)==+e3(t)}function Shn(){return Object.assign({},v8())}function Chn(e,t){let n=whn(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 whn(e){return typeof e==`function`&&e.prototype?.constructor===e}var Thn=10,Ehn=class{subPriority=0;validate(e,t){return!0}},Dhn=class extends Ehn{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)}},Ohn=class extends Ehn{priority=Thn;subPriority=-1;constructor(e,t){super(),this.context=e||(e=>$4(t,e))}set(e,t){return t.timestampIsSet?e:$4(e,Chn(e,this.context))}},z7=class{run(e,t,n,r){let i=this.parse(e,t,n,r);return i?{setter:new Dhn(i.value,this.validate,this.set,this.priority,this.subPriority),rest:i.rest}:null}validate(e,t,n){return!0}},khn=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*E9t+a*T9t+o*D9t),rest:t.slice(n[0].length)}}function Ahn(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 jhn(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 Mhn(e){switch(e){case`morning`:return 4;case`evening`:return 17;case`pm`:case`noon`:case`afternoon`:return 12;default:return 0}}function Nhn(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 Phn(e){return e%400==0||e%4==0&&e%100!=0}var Fhn=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=Nhn(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}},Ihn=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=uon(e,r);if(n.isTwoDigitYear){let t=Nhn(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`]},Lhn=class extends z7{priority=130;parse(e,t){return jhn(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`]},Rhn=class extends z7{priority=130;parse(e,t){return jhn(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`]},zhn=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`]},Bhn=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`]},Vhn=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}},Hhn=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 Uhn(e,t,n){let r=e3(e,n?.in),i=fon(r,n)-t;return r.setDate(r.getDate()-i*7),e3(r,n?.in)}var Whn=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(Uhn(e,n,r),r)}incompatibleTokens=[`y`,`R`,`u`,`q`,`Q`,`M`,`L`,`I`,`d`,`D`,`i`,`t`,`T`]};function Ghn(e,t,n){let r=e3(e,n?.in),i=lon(r,n)-t;return r.setDate(r.getDate()-i*7),r}var Khn=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(Ghn(e,n))}incompatibleTokens=[`y`,`Y`,`u`,`q`,`Q`,`M`,`L`,`w`,`d`,`D`,`e`,`c`,`t`,`T`]},qhn=[31,28,31,30,31,30,31,31,30,31,30,31],Jhn=[31,29,31,30,31,30,31,31,30,31,30,31],Yhn=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=Phn(e.getFullYear()),r=e.getMonth();return n?t>=1&&t<=Jhn[r]:t>=1&&t<=qhn[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`]},Xhn=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 Phn(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 Zhn(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 Qhn=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=Zhn(e,n,r),e.setHours(0,0,0,0),e}incompatibleTokens=[`D`,`i`,`e`,`c`,`t`,`T`]},$hn=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=Zhn(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`]},egn=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=Zhn(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 tgn(e,t){let n=e3(e,t?.in).getDay();return n===0?7:n}function ngn(e,t,n){let r=e3(e,n?.in);return K7(r,t-tgn(r,n),n)}var rgn=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=ngn(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`]},ign=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(Mhn(n),0,0,0),e}incompatibleTokens=[`b`,`B`,`H`,`k`,`t`,`T`]},agn=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(Mhn(n),0,0,0),e}incompatibleTokens=[`a`,`B`,`H`,`k`,`t`,`T`]},ogn=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(Mhn(n),0,0,0),e}incompatibleTokens=[`a`,`b`,`t`,`T`]},sgn=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`]},cgn=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`]},lgn=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`]},ugn=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`]},dgn=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`]},fgn=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`]},pgn=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`]},mgn=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`]},hgn=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`]},ggn=class extends z7{priority=40;parse(e){return Ahn(e)}set(e,t,n){return[$4(e,n*1e3),{timestampIsSet:!0}]}incompatibleTokens=`*`},_gn=class extends z7{priority=20;parse(e){return Ahn(e)}set(e,t,n){return[$4(e,n),{timestampIsSet:!0}]}incompatibleTokens=`*`},vgn={G:new khn,y:new Fhn,Y:new Ihn,R:new Lhn,u:new Rhn,Q:new zhn,q:new Bhn,M:new Vhn,L:new Hhn,w:new Whn,I:new Khn,d:new Yhn,D:new Xhn,E:new Qhn,e:new $hn,c:new egn,i:new rgn,a:new ign,b:new agn,B:new ogn,h:new sgn,H:new cgn,K:new lgn,k:new ugn,m:new dgn,s:new fgn,S:new pgn,X:new mgn,x:new hgn,t:new ggn,T:new _gn},ygn=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,bgn=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,xgn=/^'([^]*?)'?$/,Sgn=/''/g,Cgn=/\S/,wgn=/[a-zA-Z]/;function q7(e,t,n,r){let i=()=>$4(r?.in||n,NaN),a=Shn(),o=r?.locale??a.locale??non,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 Ohn(r?.in,n)],d=t.match(bgn).map(e=>{let t=e[0];if(t in von){let n=von[t];return n(e,o.formatLong)}return e}).join(``).match(ygn),f=[];for(let n of d){!r?.useAdditionalWeekYearTokens&&Con(n)&&won(n,t,e),!r?.useAdditionalDayOfYearTokens&&Son(n)&&won(n,t,e);let a=n[0],s=vgn[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(wgn))throw RangeError("Format string contains an unescaped latin alphabet character `"+a+"`");if(n===`''`?n=`'`:a===`'`&&(n=Tgn(n)),e.indexOf(n)===0)e=e.slice(n.length);else return i()}}if(e.length>0&&Cgn.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 Tgn(e){return e.match(xgn)[1].replace(Sgn,`'`)}function Egn(e){let{glucoseLevelTargets:t}=k8;if(t===void 0)throw Error(`[ParameterTimeIntervalsUtils::getBGLParameters] glucoseLevelTargets is undefined.`);let n=t.use===Z.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 Ogn(e,i)}function Dgn(e){let t=k8.treatmentParameters?.use===Z.Usage.Overall,{treatmentParameters:n}=k8;if(n===void 0)throw Error(`[ParameterTimeIntervalsUtils::getInsulinParameters] treatmentParameters is undefined.`);return t?n.overallParameters:Ogn(e,n.parameterIntervals)}function Ogn(e,t){let n=I8(e,`HH:mm`),r=kgn(t),i=q7(n,`HH:mm`,new Date);for(let e=0;e<r.length;e++)if(Agn(r[e],r[(e+1)%r.length],i))return t[e];throw Error(`[ParameterTimeIntervalsUtils::getDailyParameters] The parameter interval has not been found`)}function kgn(e){let t=[];for(let n of e)t.push(q7(n.startTime,`HH:mm`,new Date));return t}function Agn(e,t,n){let r=R7(e,t),i=xhn(e,n)||R7(e,n),a=jgn(e),o=jgn(t,!r),s=jgn(n,!i);return a<=s&&s<o}function jgn(e,t){return e.getMinutes()+(e.getHours()+(t?24:0))*60}H();var Mgn=1600;function Ngn({setRemeasurementNotification:e}){let{t,language:n}=Sq(),{colorScheme:r}=g2(),i=b7(),{selectedEventUUID:a}=a7(),{manualCarbsInput:o,foodIntakeCarbsAmount:s,saveCarbohydrates:c}=L5(),{noteId:l}=B5(),u=A$(),d=(0,U.useRef)(!1),[f,p]=U.useState(!1),[m,h]=U.useState(null),[g,_]=U.useState(null),{glucoseUnit:v,injectionMethod:y,activity:b}=k8;if(v===void 0)throw Error(`[LoadingRecommendationScreen::render] glucoseUnit is undefined`);if(y===void 0)throw Error(`[LoadingRecommendationScreen::render] injectionMethod is undefined`);if(b===void 0)throw Error(`[LoadingRecommendationScreen::render] activity is undefined`);if(i===null)throw Error(`[LoadingRecommendationScreen::render] selectedGlucoseReading is undefined`);let x=(0,U.useMemo)(()=>G8.getRecentBoluses(),[]),S=(0,U.useMemo)(()=>a?S8.getByUUID(a):null,[a]),C=(0,U.useMemo)(()=>{if(!S?.startTimestamp)return null;let e={activitySettings:b,activityDate:new Date(S.startTimestamp),activityDuration:S.durationSeconds/60,activityIntensity:S.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}},[b,S]),w=(0,U.useMemo)(()=>{let{target:e}=Egn(new Date),{carbohydrateRatio:t,insulinSensitivity:a}=Dgn(new Date);return{bloodGlucoseUnit:v,injectionMethod:y,language:n,colorScheme:r,calculatorParams:{glucoseReading:i,activity:C,carbohydrateRatio:t,insulinSensitivity:a,carbohydrates:o+s,targetBGL:e,recentBoluses:x}}},[v,y,n,r,i,C,o,s,x]),T=(0,U.useCallback)(async()=>{let t=L7.recommendationPropsSchema.safeParse(w);if(!t.success){u8(l8.RecommendationInvalid),console.error(t.error),_(Cq.Validation);return}try{let{activeInsulin:t,carbRecommendation:n,bolus:r,activityReduction:a,recentBolusesIds:u,recommendationDate:d}=(0,b8.calculateRecommendation)(w.calculatorParams),f=o+s,p=z8(w.calculatorParams.glucoseReading.value,w.calculatorParams.glucoseReading.unit,Z.BloodGlucoseUnit.MMOL_L),m=(0,b8.roundInsulinValue)(r,w.injectionMethod),g=Math.round(n),v=i.source===`external`||i.source===`forecast`,y=null,b=null;try{let e=await c(d);y=e?.sampleId??null,b=e?.foodIntakeId??null}catch(e){console.error(`[LoadingRecommendationScreen::saveRecommendation] saveCarbohydrates failed:`,e)}let x=await G8.addLogbook(rsn({blood_glucose_millimolar:p,blood_glucose_millimolar_sample_id:v?i.sampleId:null,glucose_sample_source_id:v?i.sourceId:null,entry_timestamp:d,event_uuid:S?S.uuid:null,is_bolus_calculation:!0,carbohydrates_suggested_grams:g,carbohydrates_entered_grams:f+g,carbohydrates_input_grams:f,carbohydrates_sample_id:y,carbohydrates_manual_grams:o||null,carbohydrates_food_grams:s||null,food_intake_id:b,insulin_entered_units:m,insulin_suggested_units:m,active_insulin:t,activity_reduction:a,active_insulin_source_logbook_ids:u,note_id:l}));if(x===null){_(Cq.Sync);return}if(x.blood_glucose_millimolar!==null&&e!==void 0)try{await e(x.blood_glucose_millimolar)}catch(e){console.error(`[LoadingRecommendationScreen::saveRecommendation] Remeasurement reminder failed:`,e)}h(x),u8(l8.RecommendationSuccess)}catch(e){console.error(`[LoadingRecommendationScreen::saveRecommendation] Unexpected error:`,e),_(Cq.System)}},[w,S,i,o,e,s,c,l]);return d.current||(d.current=!0,T().catch(console.error)),(0,U.useEffect)(()=>{setTimeout(()=>{p(!0)},Mgn)},[]),(0,U.useEffect)(()=>(u.setOptions({gestureEnabled:!1}),u.addListener(`beforeRemove`,({preventDefault:e})=>{f||e()})),[f,u]),(0,U.useEffect)(()=>{f&&m!==null&&g===null&&u.replace(F5.Recommendation,{...w,logbookEntry:tsn(m)}),f&&g!==null&&u.navigate(F5.Calculation,{errorType:g})},[g,f,m,w,u]),(0,G.jsxs)(V,{style:J7.animationContainer,children:[(0,G.jsx)(p2,{autoPlay:!0,source:m2.LOADING_RECOMMENDATION,style:J7.animation,webStyle:J7.animation,resizeMode:`cover`,loop:!0}),(0,G.jsx)(Q,{style:J7.text,children:t(`recommendation_loading_title`)})]})}var J7=z.create({animationContainer:{flex:1,justifyContent:`center`,alignItems:`center`},text:{...X.Poppins.bold_Base,marginTop:32},animation:{width:128,height:128}}),Pgn=f7(Ngn),Fgn=5e3,Ign=async()=>{try{return(await T3(`${_q.HEDIA_SERVER_BASE_URL}/ping`,{headers:Dq},Fgn)).ok}catch{return!1}};H(),J0();function Lgn(){let{COLORS:e}=Y(),t=A$(),n=M$(),{manualCarbsInput:r,foodIntakeCarbsAmount:i}=L5(),{colorScheme:a}=g2(),[o,s]=(0,U.useState)(L7.SyncStatus.Idle),[c,l]=(0,U.useState)(L7.SyncStatus.Idle),[u,d]=(0,U.useState)(L7.SyncStatus.Idle),{bloodGlucoseUnit:f,calculatorParams:p,injectionMethod:m,language:h,logbookEntry:g}=n.params,[_,v]=(0,U.useState)(()=>nsn(g));Svt(),(0,U.useEffect)(()=>{t.setOptions({gestureEnabled:!1})},[t]);let y=(0,U.useCallback)(async(e,t)=>{d(L7.SyncStatus.Loading);let n=r+i,a=rsn({..._,insulin_entered_units:t.modified??t.suggested,carbohydrates_overwritten_suggested_grams:e.modified,carbohydrates_entered_grams:n+(e.modified??e.suggested)}),o=await G8.addLogbook(a,_.uuid);o?(v(o),d(L7.SyncStatus.Success)):d(L7.SyncStatus.Failure)},[r,_,i]),b=(0,U.useCallback)(()=>{if(Tq)throw Error(`Recommendation::handleOnCloseCalculationViewInLogbook] Cannot view-in-logbook on web`);t.popTo(F5.MainBottomTabs,{screen:F5.LogbooksTab,params:{logbookEntry:tsn(_)}}),l7()},[t,_]),x=(0,U.useCallback)(()=>{Tq?(window.location.href=`/redirect?status=success`,vq.clearAll()):t.popTo(F5.MainBottomTabs,{screen:F5.DashboardTab,params:{screen:F5.Dashboard}}),l7()},[t]),S=(0,U.useCallback)(async()=>{s(L7.SyncStatus.Loading);let e=await G8.deleteLogbook(_.uuid);Tq?e?(window.location.href=`/redirect?status=success`,l7(),vq.clearAll()):s(L7.SyncStatus.Failure):(l7(),t.popTo(F5.MainBottomTabs,{screen:F5.DashboardTab,params:{screen:F5.Dashboard,params:{action:mvt.Deleted}}}))},[_.uuid,t]),C=(0,U.useCallback)(async()=>{l(L7.SyncStatus.Loading);let e=()=>{l(L7.SyncStatus.Success),l7(),t.replace(F5.LeavingRecommendation,{logbookEntry:tsn(_)})};Tq?await Ign()?e():l(L7.SyncStatus.Failure):e()},[t,_]);return(0,G.jsx)(q0,{style:[Rgn.container,{backgroundColor:e.bgPrimary}],children:(0,G.jsx)(L7.RecommendationScreenWrapper,{deleteStatus:o,saveStatus:c,editStatus:u,bloodGlucoseUnit:f,injectionMethod:m,language:h,colorScheme:a,calculatorParams:p,closeCalculationViewInlogbook:b,closeCalculationFooter:C,closeCalculationTimeoutModal:x,transferEditedRecommendation:y,deleteCalculation:S,trackExpandDetails:()=>{u8(l8.RecommendationViewDetailsPress)},trackRecommendationTimeout:()=>{u8(l8.RecommendationExpired)}})})}var Rgn=z.create({container:{flex:1}}),zgn=e=>[`foods`,`curated`,e],Bgn=e=>{let{data:t=[],isLoading:n,isError:r,refetch:i}=_0({queryKey:zgn(e),queryFn:()=>jan(e),staleTime:1e3*60*5,networkMode:`offlineFirst`,retry:3});return{curatedFoods:t,isCuratedFoodsLoading:n,isCuratedFoodsError:r,refetchCuratedFoods:i}},Vgn=e=>[`foods`,`categories`,e],Y7=()=>{let{language:e}=bq(),{data:t=[],isLoading:n,isError:r,refetch:i}=_0({queryKey:Vgn(e),queryFn:()=>Ran(e),staleTime:1e3*60*5,networkMode:`offlineFirst`,retry:3});return{foodCategories:t,isFoodCategoriesLoading:n,isFoodCategoriesError:r,refetchFoodCategories:i}},Hgn=()=>{let e=A$().getParent(F5.NewCalculationStack),t=(0,U.useCallback)(()=>{e?.goBack()},[e]);return{isInCalculationFlow:e!==void 0,dismissFoodLibrary:t}},X7=e=>{let t=A$(),{isInCalculationFlow:n,dismissFoodLibrary:r}=Hgn(),{addFoodIntakeItem:i}=L5(),{addExtraFoodItem:a}=c7();return{canAddToCalculation:n||!!e,addToCalculation:(0,U.useCallback)((o,s)=>{if(e){a({foodItem:o,amount:s}),n?r():t.popTo(F5.VisualSearch);return}i({foodItem:o,amount:s}),r()},[e,a,n,t,i,r])}},Ugn={tabBarHeight:0,paddingBottomScreenWithTabBar:0},Z7=pq()(hq(e=>({...Ugn,setTabBarHeight:t=>{e({tabBarHeight:t,paddingBottomScreenWithTabBar:t+24})},clear:()=>{e(Ugn)}}),{name:`DIMENSIONS_STORE`,storage:mq(yq)}));H();function Wgn({icon:e,message:t}){let{COLORS:n}=Y();return(0,G.jsxs)(V,{style:Ggn.container,children:[e,(0,G.jsx)(Q,{style:[Ggn.message,{color:n.labelSecondary}],children:t})]})}var Ggn=z.create({container:{flex:1,alignItems:`center`,justifyContent:`center`},message:{...X.Poppins.regular_SM,marginTop:13,textAlign:`center`}}),Q7=(0,U.memo)(Wgn),Kgn=({item:e,expandable:t,isExpanded:n,onExpand:r,onPress:i,onAddToCalculation:a,testID:o})=>{let{t:s}=Sq(),[c,l]=(0,U.useState)(``),u=$5(e.source===`personal`?e.imageId:null);(0,U.useEffect)(()=>{n||l(``)},[n]);let d=(0,U.useMemo)(()=>C8(Number(c||0),e.measures[0].gramsPerUnit,e.nutritionPer100g.carbohydrates.value),[c,e]),f=(0,U.useCallback)(()=>{a(e,Number(c)||0)},[a,e,c]);return(0,G.jsx)(d9t,{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,G.jsx)(U4,{title:s(`foodAmount_button_addToCalculation`),disabled:!c,onPress:f,style:{marginTop:10}})})};H();var qgn=()=>{let{COLORS:e,isDark:t}=Y(),{t:n}=Sq(),r=A$(),{categoryId:i,subcategoryId:a,cameFromVisualSearch:o}=M$().params,{canAddToCalculation:s,addToCalculation:c}=X7(o),l=M5(s&&Eq),{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}=Bgn(a||i),_=t?p?.color.dark:p?.color.light,v=(t?m?.color.dark:m?.color.light)||_;(0,U.useLayoutEffect)(()=>{r.setOptions({header:()=>(0,G.jsx)(P5,{title:m?.title||p?.title,LeftButton:(0,G.jsx)(H5,{}),color:v,skipTopInset:s&&Eq,overlay:!0})})},[r,m,p,v,s]);let[y,b]=(0,U.useState)(null),x=(0,U.useCallback)(({item:e})=>(0,G.jsx)(Kgn,{item:e,expandable:s,isExpanded:y===e.id,onExpand:()=>b(e.id),onPress:()=>{r.navigate(F5.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,U.useCallback)(e=>(0,G.jsx)(X2t,{...e,bottomOffset:16}),[]);return(0,G.jsxs)(V,{style:[$7.screen,{backgroundColor:e.bgPrimary}],children:[v&&(0,G.jsx)(z4.default,{colors:[v,c3(v,0)],style:$7.gradient,pointerEvents:`none`}),g?(0,G.jsx)(b2,{}):(0,G.jsx)(Uc,{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,G.jsx)(Q7,{icon:(0,G.jsx)(q7t,{}),message:n(`food_empty_state_no_food`)})})]})},$7=z.create({screen:{flex:1},gradient:{position:`absolute`,top:0,left:0,right:0,height:`50%`},contentContainer:{gap:8,paddingHorizontal:16},list:{flex:1}}),Jgn=[F5.CuratedFoodItem,F5.PersonalFoodItem],Ygn=(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},Xgn=(e,t)=>{let n=e.routes.filter(e=>!Jgn.includes(e.name)).map(e=>({name:e.name,params:e.params})),r=t[t.length-1],i=n.findIndex(e=>Ygn(e,r));if(i>=0)return n.slice(0,i+1);let a=t.filter(e=>!n.some(t=>Ygn(t,e)));return[...n,...a]},Zgn=()=>{let e=A$();return(0,U.useCallback)(t=>{e.dispatch(e=>{let n=Xgn(e,t);return v$({...e,routes:n,index:n.length-1})})},[e])};H(),F4();var Qgn={ringSize:120,strokeWidth:10,gap:14},$gn={ringSize:36,strokeWidth:4.5,gap:6},e_n=({totalAmount:e=100,carbsValue:t,carbsUnit:n,size:r=`large`})=>{let{COLORS:i}=Y(),{ringSize:a,strokeWidth:o,gap:s}=r===`large`?Qgn:$gn,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,G.jsxs)(V,{style:[e9.ringContainer,{width:a,height:a}],children:[(0,G.jsxs)(E4,{width:a,height:a,style:e9.ringSvg,children:[(0,G.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,G.jsx)(x4,{cx:u,cy:u,r:c,stroke:i.bgFoodCarbsRing,strokeWidth:o,fill:`none`,strokeDasharray:[m,l-m],strokeLinecap:`round`})]}),r===`large`&&(0,G.jsx)(V,{style:e9.ringCenter,children:(0,G.jsxs)(Q,{style:[e9.carbsNumber,{color:i.labelPrimary}],maxFontSizeMultiplier:S2.s0,children:[f,(0,G.jsx)(Q,{style:[e9.carbsUnit,{color:i.labelPrimary}],children:n})]})})]})},e9=z.create({ringContainer:{alignItems:`center`,justifyContent:`center`},ringSvg:{transform:[{rotate:`-90deg`}],position:`absolute`},ringCenter:{alignItems:`center`,justifyContent:`center`},carbsNumber:{...X.Poppins.semiBold_4XL},carbsUnit:{...X.Poppins.medium_Base}});H();var t_n=({title:e,color:t,iconUri:n,onPress:r})=>{let{COLORS:i}=Y();return(0,G.jsxs)(Jf,{style:[n_n.pill,{borderColor:i.border,backgroundColor:t}],onPress:r,testID:`food-category-pill`,children:[!!n&&(0,G.jsx)(Xu,{source:{uri:n},style:n_n.icon}),(0,G.jsx)(Q,{style:[n_n.label,{color:i.textFoodCategoryPill}],children:e})]})},n_n=z.create({pill:{flexDirection:`row`,alignItems:`center`,paddingVertical:6,paddingHorizontal:12,borderRadius:32,borderWidth:1},icon:{width:20,height:20,marginRight:4},label:{...X.Poppins.regular_XS}});H();var r_n=`444`,i_n=({amount:e,onChangeAmount:t,unit:n,carbs:r,autoFocus:i=!1,testID:a})=>{let{t:o}=Sq(),{COLORS:s}=Y(),[c,l]=(0,U.useState)(!1),u=(0,U.useRef)(null),d=(0,U.useCallback)(()=>{c||u.current?.focus()},[c]);return(0,G.jsxs)(V,{style:t9.inputContainer,children:[(0,G.jsx)(Q,{style:[t9.amountLabel,{color:s.labelPrimary}],children:o(`foodAmountInputField_weight`)}),(0,G.jsxs)(Cp,{accessible:!1,onPress:d,style:[t9.inputBox,{backgroundColor:s.bgVsInput,borderColor:c?s.borderInputFocus:s.border}],children:[n===`g`?(0,G.jsx)(l9t,{}):(0,G.jsx)(u9t,{}),(0,G.jsxs)(V,{style:t9.inputValue,children:[(0,G.jsxs)(V,{children:[(0,G.jsx)(Q,{"aria-hidden":!0,style:t9.inputSizer,children:r_n}),(0,G.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,G.jsx)(Q,{style:[t9.inputUnit,{color:s.labelSecondary}],children:n})]})]}),(0,G.jsx)(Q,{style:[t9.carbsResult,{color:s.labelSecondary}],children:`= ${e?r:`-`} ${o(`my_food_add_unit`)}`})]})},t9=z.create({inputContainer:{alignItems:`center`,gap:8},amountLabel:{...X.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:{...X.Poppins.medium_2XL,opacity:0},input:{position:`absolute`,top:0,bottom:0,left:0,right:0,...X.Poppins.medium_2XL,lineHeight:B.select({ios:0,default:X.Poppins.medium_2XL.lineHeight}),includeFontPadding:!1,textAlign:`right`,padding:0},inputUnit:{...X.Poppins.regular_Base},carbsResult:{...X.Poppins.regular_Base,textAlign:`center`}});H();var a_n=({amount:e,onChangeAmount:t,unit:n,carbs:r,onAdd:i,testID:a})=>{let{t:o}=Sq(),{COLORS:s}=Y();return(0,G.jsxs)(V,{style:[o_n.container,{borderColor:s.border,backgroundColor:s.bgInputLayer}],children:[(0,G.jsx)(i_n,{amount:e,onChangeAmount:t,unit:n,carbs:r,autoFocus:!0,testID:a}),(0,G.jsx)(U4,{title:o(`foodAmount_button_addToCalculation`),onPress:i,disabled:!e,style:o_n.addButton})]})},o_n=z.create({container:{alignSelf:`stretch`,padding:16,gap:16,borderWidth:1,borderRadius:24},addButton:{alignSelf:`center`}});H();var s_n=56,c_n=20,l_n=100,n9=(e,t)=>{if(!e)return`-`;let n=e.value*t/100;return`${Math.round(n*10)/10} ${e.unit}`},u_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}}},d_n=()=>{let{t:e}=Sq(),{params:t}=M$(),{COLORS:n,isDark:r}=Y(),{bottomWithScroll:i,topInsideModal:a}=Q4(),o=A$(),{canAddToCalculation:s,addToCalculation:c}=X7(t.cameFromVisualSearch),l=Zgn(),u=[r9.headerRow,{paddingTop:a}],d={paddingTop:a+s_n+c_n,paddingBottom:i},{food:f,isFoodLoading:p,isFoodError:m}=sfn(t.foodId),{foodCategories:h}=Y7(),{foodIntakeItems:g}=L5(),[_,v]=(0,U.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,U.useEffect)(()=>{y||p||m||o.goBack()},[y,p,m,o]);let b=(0,U.useMemo)(()=>y?C8(Number(_||0),y.measures[0].gramsPerUnit,y.nutritionPer100g.carbohydrates.value):0,[y,_]),x=u_n(h,t.categoryId??y?.categoryId),S=r?x?.color.dark:x?.color.light,C=(0,U.useMemo)(()=>{if(!x)return;let e={name:F5.FoodSubcategories,params:{categoryId:x.browseCategoryId}};return x.id===x.browseCategoryId?[e]:[e,{name:F5.CuratedFood,params:{categoryId:x.browseCategoryId,subcategoryId:x.id}}]},[x]),w=(0,U.useCallback)(()=>{C&&l(C)},[C,l]),T=(0,U.useCallback)(()=>{y&&c(y,Number(_)||0)},[y,_,c]),E=s&&Number(_)>0?Number(_):l_n,D=(0,U.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,G.jsxs)(V,{style:r9.screen,children:[!!S&&(0,G.jsx)(z4.default,{colors:[S,c3(S,0)],style:z.absoluteFill,pointerEvents:`none`}),(0,G.jsxs)(ds,{style:r9.scrollableContent,contentContainerStyle:d,keyboardDismissMode:`on-drag`,keyboardShouldPersistTaps:`handled`,children:[(0,G.jsxs)(V,{style:r9.topSection,children:[(0,G.jsx)(Q,{style:[r9.title,{color:n.labelPrimary}],numberOfLines:2,children:y.title}),s?(0,G.jsx)(a_n,{amount:_||``,onChangeAmount:v,unit:y.measures[0].unit,carbs:b,onAdd:T,testID:`curated-food-item-input`}):(0,G.jsxs)(V,{style:r9.carbsContainer,children:[(0,G.jsx)(e_n,{totalAmount:100,carbsValue:y.nutritionPer100g.carbohydrates.value,carbsUnit:y.nutritionPer100g.carbohydrates.unit}),(0,G.jsx)(Q,{style:[r9.carbsLabel,{color:n.labelPrimary}],children:`${Math.round(y.nutritionPer100g.carbohydrates.value*10)/10} carbs / 100${y.nutritionPer100g.carbohydrates.unit}`})]})]}),(0,G.jsxs)(V,{style:r9.section,children:[!!x&&(0,G.jsxs)(V,{style:r9.categorySection,children:[(0,G.jsx)(Q,{style:[r9.categorySectionTitle,{color:n.labelSecondary}],children:e(`food_library_info_category`)}),(0,G.jsx)(t_n,{title:x.title,color:S,iconUri:x.icon,onPress:w})]}),(0,G.jsx)(Q,{style:[r9.contentsTitle,{color:n.labelPrimary}],children:e(`food_library_carb_body`,{amount:E.toString(),unit:y.measures[0].unit})}),D.map(e=>(0,G.jsxs)(V,{style:[r9.contentsRow,{borderBottomColor:n.border}],children:[(0,G.jsx)(Q,{style:[r9.contentsText,{color:n.labelSecondary}],children:e.title}),(0,G.jsx)(Q,{style:[r9.contentsText,{color:n.labelSecondary}],children:e.value})]},e.id)),(0,G.jsx)(V,{style:[r9.contentsRow,{borderBottomColor:n.bgTransparent}],children:(0,G.jsx)(Q,{style:[r9.contentsText,{color:n.labelSecondary}],children:`${e(`food_library_source`)} ${y.provider.name}`})})]})]}),(0,G.jsx)(V,{style:u,children:(0,G.jsx)(U5,{})})]}):(0,G.jsxs)(V,{style:r9.screen,children:[!!S&&(0,G.jsx)(z4.default,{colors:[S,c3(S,0)],style:z.absoluteFill,pointerEvents:`none`}),(0,G.jsx)(V,{style:r9.topSection,children:(0,G.jsx)(V,{style:u,children:(0,G.jsx)(U5,{})})}),m?(0,G.jsx)(Q7,{icon:(0,G.jsx)($7t,{}),message:e(`food_offline_state_default`)}):(0,G.jsx)(b2,{})]})},r9=z.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:{...X.Poppins.medium_2XL,textAlign:`center`,marginBottom:32,paddingHorizontal:16},carbsContainer:{alignItems:`center`},carbsLabel:{...X.Poppins.regular_Base,marginTop:12},scrollableContent:{flex:1},section:{paddingHorizontal:16},categorySection:{flexDirection:`row`,alignItems:`center`,marginBottom:45},categorySectionTitle:{...X.Poppins.regular_SM,marginRight:7},contentsTitle:{...X.Poppins.medium_Base,marginBottom:6},contentsRow:{flexDirection:`row`,justifyContent:`space-between`,paddingVertical:10,borderBottomWidth:1},contentsText:{...X.Poppins.regular_Base}}),f_n=[`foods`,`recent`],p_n=e=>{let{data:t=[],isLoading:n,isError:r,refetch:i}=_0({queryKey:f_n,queryFn:Man,enabled:e,networkMode:`offlineFirst`,retry:3});return{recentFoods:t,isRecentFoodsLoading:n,isRecentFoodsError:r,refetchRecentFoods:i}};H();var m_n=({onPress:e,title:t,description:n,imageUrl:r,color:i})=>{let{COLORS:a}=Y();return(0,G.jsxs)(Jf,{style:[i9.row,{backgroundColor:a.bgSecondary,borderColor:a.buttonBorder}],onPress:e,children:[(0,G.jsx)(V,{style:[i9.imageContainer,{backgroundColor:i}],children:(0,G.jsx)(Xu,{source:{uri:r},style:i9.categoryImage,resizeMode:`contain`})}),(0,G.jsxs)(V,{style:i9.textContainer,children:[(0,G.jsx)(Q,{style:[i9.title,{color:a.labelPrimary}],numberOfLines:1,ellipsizeMode:`tail`,children:t}),!!n&&(0,G.jsx)(Q,{style:[i9.description,{color:a.labelSecondary}],numberOfLines:2,ellipsizeMode:`tail`,children:n})]}),(0,G.jsx)(K4,{width:18,height:18,color:a.labelTertiary})]})},i9=z.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:{...X.Poppins.medium_Base},description:{...X.Poppins.regular_SM,marginTop:2}});H();var h_n=Tq?{outlineStyle:`none`}:{},g_n=({isSearchActive:e,onSearch:t,onClear:n,onFocus:r,onBlur:i})=>{let{t:a}=Sq(),{COLORS:o}=Y(),s=(0,U.useRef)(null),[c,l]=(0,U.useState)(``),u=z3t(t,300),d=(0,U.useCallback)(()=>{u.cancel(),l(``),s.current?.blur(),n()},[u,n]),f=(0,U.useCallback)(()=>{c.length>2&&(u.cancel(),t(c))},[u,t,c]),p=(0,U.useCallback)(e=>{if(l(e),e.length>2){u(e);return}u.cancel(),t(e)},[u,t]),m=(0,U.useCallback)(()=>{s.current?.focus()},[]);return(0,G.jsxs)(Cp,{style:[__n.container,{backgroundColor:o.bgInputActive,borderColor:o.buttonBorder}],onPress:m,accessible:!1,children:[(0,G.jsx)(n9t,{height:24,width:24}),(0,G.jsx)(Ip,{ref:s,testID:`food-searchbar-input`,autoCapitalize:`none`,placeholder:a(`food_search_title`),placeholderTextColor:o.labelSecondary,cursorColor:o.textSearchText,maxFontSizeMultiplier:S2.s3,style:[__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,G.jsx)(Cp,{testID:`food-searchbar-clear`,onPress:d,hitSlop:10,children:(0,G.jsx)(U7t,{color:o.labelSecondary,width:16,height:16})})]})},__n=z.create({container:{flex:1,flexDirection:`row`,alignItems:`center`,height:48,borderRadius:16,borderWidth:1,paddingLeft:16,paddingRight:12,gap:4},searchInput:{...X.Poppins.regular_Base,lineHeight:B.select({ios:0,default:X.Poppins.regular_Base.lineHeight}),flex:1,includeFontPadding:!1,...h_n}});H();function v_n({showScanButton:e,isSearchActive:t,onSearch:n,onClearSearch:r,onSearchFocus:i,onSearchBlur:a,onScanFoodPress:o}){return(0,G.jsxs)(V,{style:y_n.row,children:[(0,G.jsx)(g_n,{isSearchActive:t,onSearch:n,onClear:r,onFocus:i,onBlur:a}),e&&!Tq&&(0,G.jsx)(Z9t,{onPress:o,style:{width:48,height:48}})]})}var y_n=z.create({row:{flexDirection:`row`,alignItems:`center`,gap:10,paddingVertical:12}}),b_n=(0,U.memo)(v_n),x_n=`/assets/webp/heart.webp`;H();var S_n=({onPress:e})=>{let{COLORS:t}=Y(),{t:n}=Sq();return(0,G.jsxs)(Jf,{style:[a9.container,{backgroundColor:t.bgSecondary,borderColor:t.buttonBorder}],onPress:e,children:[(0,G.jsx)(V,{style:[a9.imageContainer,{backgroundColor:t.bgMyFoodCategory}],children:(0,G.jsx)(Xu,{source:x_n,style:a9.heartImage})}),(0,G.jsx)(Q,{style:[a9.title,{color:t.labelPrimary}],numberOfLines:1,children:n(`food_segment_button_my_food`)}),(0,G.jsx)(K4,{width:18,height:18,color:t.labelTertiary})]})},a9=z.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:{...X.Poppins.medium_Base,flex:1}});H();var C_n=e=>`measures`in e,w_n=()=>wf.dismiss(),T_n=()=>{let{t:e}=Sq(),{COLORS:t,isDark:n}=Y(),{paddingBottomScreenWithTabBar:r}=Z7(),{bottomWithScroll:i}=Q4(),a=A$(),o=M$(),{isInCalculationFlow:s}=Hgn(),{canAddToCalculation:c,addToCalculation:l}=X7(o.params?.cameFromVisualSearch),u=M5(c&&Eq),[d,f]=(0,U.useState)(``),[p,m]=(0,U.useState)(!1),[h,g]=(0,U.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}=p_n(y===`recentFoods`),{foodSearchResults:T,isFoodSearchLoading:E,isFoodSearchError:D}=lfn(d);(0,U.useLayoutEffect)(()=>{a.setOptions({headerTransparent:!0,header:()=>(0,G.jsx)(P5,{title:e(`food_library_sheet_navigation`),LeftButton:c?(0,G.jsx)(U5,{}):void 0,color:t.bgPrimary,skipTopInset:c&&Eq,overlay:!0})})},[a,e,c,t]);let O=(0,U.useCallback)(()=>{m(!0)},[]),k=(0,U.useCallback)(()=>{f(``),g(null),m(!1)},[]),A=(0,U.useCallback)(()=>{if(u8(l8.FoodLibraryScanFoodPress),!c7.getState().privacyNoticeAccepted){a.navigate(F5.VisualSearchIntro);return}a.navigate(F5.VisualSearch)},[a]),ee=(0,U.useCallback)(()=>{a.navigate(F5.PersonalFood,{cameFromVisualSearch:o.params?.cameFromVisualSearch})},[a,o.params]),te=(0,U.useCallback)(({item:e})=>{if(C_n(e))return(0,G.jsx)(Kgn,{item:e,expandable:c,isExpanded:h===e.id,onExpand:()=>g(e.id),onPress:()=>{e.source===`curated`?a.navigate(F5.CuratedFoodItem,{foodId:e.id,categoryId:e.categoryId,cameFromVisualSearch:o.params?.cameFromVisualSearch}):a.navigate(F5.PersonalFoodItem,{foodId:e.id,cameFromVisualSearch:o.params?.cameFromVisualSearch})},onAddToCalculation:l,testID:`food-search-item-${e.id}`});let t=()=>{a.navigate(F5.FoodSubcategories,{categoryId:e.id,cameFromVisualSearch:o.params?.cameFromVisualSearch})},r=e.color.light;return n&&(r=e.color.dark),(0,G.jsx)(m_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,U.useMemo)(()=>{let t=(0,G.jsx)(Q7,{icon:(0,G.jsx)($7t,{}),message:e(`food_offline_state_default`)});return y===`categories`?x?t:null:y===`recentFoods`?w?t:C?(0,G.jsx)(b2,{}):null:D?t:E?(0,G.jsx)(b2,{}):(0,G.jsx)(Q7,{icon:(0,G.jsx)(q7t,{}),message:e(`food_empty_state_no_food`)})},[y,x,w,C,D,E,e]),ie=(0,U.useCallback)(e=>(0,G.jsx)(X2t,{...e,bottomOffset:16}),[]),j=(0,U.useMemo)(()=>[o9.contentContainer,{paddingTop:u,paddingBottom:c?i:r}],[u,c,i,r]),M=(0,G.jsxs)(V,{style:o9.listHeader,children:[(0,G.jsx)(b_n,{showScanButton:_,isSearchActive:p,onSearch:f,onClearSearch:k,onSearchFocus:O,onScanFoodPress:A}),y===`categories`&&(0,G.jsx)(S_n,{onPress:ee}),y===`recentFoods`&&S.length>0&&(0,G.jsxs)(V,{style:o9.recentTitleRow,children:[(0,G.jsx)(t9t,{width:16,height:16}),(0,G.jsx)(Q,{style:[o9.recentTitle,{color:t.labelPrimary}],children:e(`food_library_frequent_title`)})]})]});return(0,G.jsxs)(V,{style:[o9.screen,{backgroundColor:t.bgPrimary}],children:[(0,G.jsx)(z4.default,{colors:[t.bgPrimary,c3(t.bgPrimary,0)],style:o9.gradient,pointerEvents:`none`}),(0,G.jsx)(Uc,{style:o9.list,data:ne,keyExtractor:e=>e.id,renderItem:te,ListHeaderComponent:M,ListEmptyComponent:re,contentContainerStyle:j,keyboardDismissMode:Tq?`none`:`on-drag`,keyboardShouldPersistTaps:`handled`,onScroll:Tq?w_n:void 0,renderScrollComponent:ie,scrollEventThrottle:16})]})},o9=z.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:{...X.Poppins.medium_SM},list:{flex:1}});H();var E_n=()=>{let e=M$(),t=A$(),{categoryId:n,cameFromVisualSearch:r}=e.params,{canAddToCalculation:i}=X7(r),{COLORS:a,isDark:o}=Y(),{bottomWithScroll:s}=Q4(),{paddingBottomScreenWithTabBar:c}=Z7(),l=M5(i&&Eq),{foodCategories:u}=Y7(),d=u.find(e=>e.id===n),f=o?d?.color.dark:d?.color.light;(0,U.useLayoutEffect)(()=>{t.setOptions({header:()=>(0,G.jsx)(P5,{title:d?.title,LeftButton:(0,G.jsx)(H5,{}),color:f,skipTopInset:i&&Eq,overlay:!0})})},[t,d,f,i]);let p=(0,U.useCallback)((e,n)=>{t.navigate(F5.CuratedFood,{categoryId:n,subcategoryId:e,cameFromVisualSearch:r})},[t,r]),m=(0,U.useCallback)(({item:e})=>(0,G.jsx)(m_n,{onPress:()=>p(e.id,d?.id),title:e.title,imageUrl:e.icon,color:f??a.bgPrimary}),[a,d,f,p]);return(0,G.jsxs)(V,{style:[s9.screen,{backgroundColor:a.bgPrimary}],children:[f&&(0,G.jsx)(z4.default,{colors:[f,c3(f,0)],style:s9.gradient,pointerEvents:`none`}),(0,G.jsx)(Uc,{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=z.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}});H();var D_n=()=>{let{COLORS:e}=Y(),{t}=Sq(),n=A$(),{params:r}=M$(),{canAddToCalculation:i,addToCalculation:a}=X7(r?.cameFromVisualSearch),o=M5(i&&Eq),{bottomWithScroll:s}=Q4(),{paddingBottomScreenWithTabBar:c}=Z7(),{personalFoods:l,isPersonalFoodsLoading:u}=ifn(),d=l.length===0;(0,U.useLayoutEffect)(()=>{n.setOptions({header:()=>(0,G.jsx)(P5,{title:t(`food_myFood_title`),LeftButton:(0,G.jsx)(H5,{}),color:e.bgMyFoodCategory,skipTopInset:i&&Eq,overlay:!0})})},[n,e,i,t]);let f=(0,U.useCallback)(()=>{n.navigate(F5.CreateFood)},[n]),[p,m]=(0,U.useState)(null),h=(0,U.useCallback)(({item:e})=>(0,G.jsx)(Kgn,{item:e,expandable:i,isExpanded:p===e.id,onExpand:()=>m(e.id),onPress:()=>{n.navigate(F5.PersonalFoodItem,{foodId:e.id,cameFromVisualSearch:r?.cameFromVisualSearch})},onAddToCalculation:a,testID:`personal-food-item-${e.id}`}),[i,n,r?.cameFromVisualSearch,a,p]),g=(0,U.useCallback)(e=>(0,G.jsx)(X2t,{...e,bottomOffset:16}),[]);return(0,G.jsxs)(V,{style:[c9.screen,{backgroundColor:e.bgPrimary}],children:[(0,G.jsx)(z4.default,{colors:[e.bgMyFoodCategory,c3(e.bgMyFoodCategory,0)],style:c9.gradient,pointerEvents:`none`}),u?(0,G.jsx)(b2,{}):(0,G.jsx)(Uc,{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,G.jsx)(V,{children:(0,G.jsx)(Q7,{icon:(0,G.jsx)(q7t,{}),message:t(`food_myFood_empty_state_default`)})}),ListFooterComponent:(0,G.jsx)(U4,{title:t(`food_button_createFood`),onPress:f,type:H4.Secondary})})]})},c9=z.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}});H();var O_n=()=>{let{t:e}=Sq(),t=A$(),{params:n}=M$(),{COLORS:r}=Y(),{topInsideModal:i}=Q4(),{canAddToCalculation:a,addToCalculation:o}=X7(n.cameFromVisualSearch),s=Zgn(),c=(0,U.useCallback)(()=>{s([{name:F5.PersonalFood}])},[s]),l=[l9.headerRow,{paddingTop:i}],{foodIntakeItems:u}=L5(),{food:d,isFoodLoading:f,isFoodError:p}=sfn(n.foodId),[m,h]=(0,U.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,U.useEffect)(()=>{g||f||p||t.goBack()},[g,f,p,t]);let v=(0,U.useCallback)(()=>{g&&t.navigate(F5.CreateFood,{personalFoodId:g.id})},[t,g]),y=(0,U.useMemo)(()=>g?C8(Number(m||0),g.measures[0].gramsPerUnit,g.nutritionPer100g.carbohydrates.value):0,[g,m]),b=(0,U.useCallback)(()=>{g&&o(g,Number(m)||0)},[g,m,o]);if(!g)return(0,G.jsxs)(V,{style:l9.screen,children:[(0,G.jsxs)(V,{style:l9.gradient,children:[(0,G.jsx)(z4.default,{colors:[r.bgMyFoodCategory,c3(r.bgMyFoodCategory,0)],style:z.absoluteFill,pointerEvents:`none`}),(0,G.jsx)(V,{style:l,children:(0,G.jsx)(U5,{})})]}),p?(0,G.jsx)(Q7,{icon:(0,G.jsx)($7t,{}),message:e(`food_offline_state_default`)}):(0,G.jsx)(b2,{})]});let x=`${Math.round(g.nutritionPer100g.carbohydrates.value*10)/10} carbs / 100${g.nutritionPer100g.carbohydrates.unit}`;return(0,G.jsxs)(V,{style:l9.screen,children:[(0,G.jsxs)(V,{style:l9.gradient,children:[(0,G.jsx)(z4.default,{colors:[r.bgMyFoodCategory,c3(r.bgMyFoodCategory,0)],style:z.absoluteFill,pointerEvents:`none`}),(0,G.jsxs)(V,{style:l,children:[(0,G.jsx)(U5,{}),(0,G.jsx)($dn,{onPress:v})]}),(0,G.jsx)(Q,{style:[l9.title,a&&l9.titleInCalculation,{color:r.labelPrimary}],numberOfLines:2,children:g.title}),a?(0,G.jsx)(V,{style:l9.inputCardSection,children:(0,G.jsx)(a_n,{amount:m||``,onChangeAmount:h,unit:g.measures[0].unit,carbs:y,onAdd:b,testID:`personal-food-item-input`})}):(0,G.jsxs)(V,{style:l9.carbsContainer,children:[(0,G.jsx)(e_n,{totalAmount:100,carbsValue:g.nutritionPer100g.carbohydrates.value,carbsUnit:g.nutritionPer100g.carbohydrates.unit}),(0,G.jsx)(Q,{style:[l9.carbsLabel,{color:r.labelPrimary}],children:x})]})]}),(0,G.jsxs)(V,{style:l9.section,children:[(0,G.jsxs)(V,{style:l9.categoryRow,children:[(0,G.jsx)(Q,{style:[l9.categorySectionTitle,{color:r.labelSecondary}],children:e(`food_library_info_category`)}),(0,G.jsx)(t_n,{title:e(`food_segment_button_my_food`),color:r.bgMyFoodCategory,onPress:c})]}),(0,G.jsx)(V,{style:[l9.divider,{backgroundColor:r.border}]}),a&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(V,{style:l9.carbsInfoRow,children:[(0,G.jsx)(Q,{style:[l9.carbsInfoLabel,{color:r.labelPrimary}],children:x}),(0,G.jsx)(e_n,{size:`small`,totalAmount:100,carbsValue:g.nutritionPer100g.carbohydrates.value,carbsUnit:g.nutritionPer100g.carbohydrates.unit})]}),(0,G.jsx)(V,{style:[l9.divider,{backgroundColor:r.border}]})]}),(!!g.description||!!_)&&(0,G.jsxs)(V,{style:l9.notesRow,children:[!!g.description&&(0,G.jsx)(Q,{style:[l9.description,{color:r.labelSecondary}],children:g.description}),!!_&&(0,G.jsx)(Xu,{source:{uri:_},style:l9.foodImage,resizeMode:`cover`})]})]})]})},l9=z.create({screen:{flex:1},gradient:{alignItems:`center`},headerRow:{flexDirection:`row`,justifyContent:`space-between`,alignSelf:`stretch`,paddingHorizontal:16,paddingBottom:10,marginBottom:20},title:{...X.Poppins.medium_2XL,textAlign:`center`,marginBottom:32,paddingHorizontal:16},titleInCalculation:{marginBottom:22},inputCardSection:{alignSelf:`stretch`,paddingHorizontal:16},carbsContainer:{alignItems:`center`},carbsLabel:{...X.Poppins.regular_Base,marginTop:12},notesRow:{flexDirection:`row`,alignItems:`center`,paddingHorizontal:16,gap:8},description:{...X.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:{...X.Poppins.regular_SM,marginRight:7},divider:{height:1},carbsInfoRow:{flexDirection:`row`,alignItems:`center`,justifyContent:`space-between`,paddingHorizontal:16},carbsInfoLabel:{...X.Poppins.regular_Base,flex:1}}),{Group:k_n,Navigator:A_n,Screen:u9}=A5();function j_n(){return(0,G.jsxs)(A_n,{screenOptions:{...K5,header:()=>null,...Q8},children:[(0,G.jsx)(u9,{name:F5.FoodAndDrink,component:T_n}),(0,G.jsx)(u9,{name:F5.FoodSubcategories,component:E_n,options:{headerTransparent:!0}}),(0,G.jsx)(u9,{name:F5.PersonalFood,component:D_n,options:{headerTransparent:!0}}),(0,G.jsx)(u9,{name:F5.CuratedFood,component:qgn,options:{headerTransparent:!0}}),(0,G.jsxs)(k_n,{screenOptions:{...Bsn,headerShown:!1,gestureEnabled:!1},children:[(0,G.jsx)(u9,{name:F5.PersonalFoodItem,component:O_n}),(0,G.jsx)(u9,{name:F5.CuratedFoodItem,component:d_n})]})]})}var{Navigator:M_n,Screen:d9}=A5();function N_n(){let{COLORS:e}=Y();return(0,G.jsxs)(M_n,{id:`NewCalculationStack`,screenOptions:{headerShown:!1,...Q8},children:[(0,G.jsx)(d9,{name:F5.Calculation,component:Tmn,options:{headerShown:!0,cardStyle:{flex:1}}}),(0,G.jsx)(d9,{name:F5.LoadingRecommendation,component:Pgn}),(0,G.jsx)(d9,{name:F5.Recommendation,component:Lgn,options:{...K5,headerStyle:{backgroundColor:e.bgSheet},headerShown:!1}}),(0,G.jsx)(d9,{name:F5.LeavingRecommendation,component:Dmn}),(0,G.jsx)(d9,{name:F5.FoodLibrary,component:j_n,options:{...tfn,...Jsn,headerShown:!1,gestureEnabled:!1}})]})}var P_n=Z.Milliseconds.Minute*20,F_n=()=>{let{pinCode:e,settingsUnlockedTimestamp:t,setSettingsUnlockedTimestamp:n}=E3(),r=(0,U.useMemo)(()=>t===null||Date.now()-t>P_n,[t]);R$((0,U.useCallback)(()=>{if(t===null)return;let e=P_n-(Date.now()-t);if(e<=0)return;let r=setTimeout(()=>n(null),e);return()=>clearTimeout(r)},[t,n]));let i=(0,U.useCallback)(()=>{n(Date.now())},[n]),a=(0,U.useCallback)(()=>{n(null)},[n]);return{areSettingsLocked:r,isPINSet:!!e,unlockSettings:i,lockSettings:a}};H();var I_n=()=>{let{t:e}=Sq(),{COLORS:t}=Y();return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Q,{style:[f9.header,f9.firstHeaderSpacing],testID:`activity-info-title`,children:e(`physical_activity_modal_activity_insulin_title`)}),(0,G.jsx)(Q,{style:[{color:t.labelSecondary},f9.spacing],children:e(`physical_activity_modal_activity_insulin_body`)}),(0,G.jsx)(Q,{style:f9.header,children:e(`physical_activity_modal_adjust_insulin_title`)}),(0,G.jsx)(Q,{style:[{color:t.labelSecondary},f9.spacing],children:e(`physical_activity_modal_adjust_insulin_body`)})]})},f9=z.create({header:{...X.Poppins.semiBold_2XL,marginBottom:8},firstHeaderSpacing:{marginTop:32},spacing:{marginBottom:32}});H();var p9=({text:e,learnMoreText:t,learnMoreOnPress:n})=>{let{t:r}=Sq(),{COLORS:i}=Y();return(0,G.jsxs)(V,{style:[m9.card,{backgroundColor:i.bgSecondary}],children:[(0,G.jsx)(c9t,{}),(0,G.jsxs)(V,{style:m9.rightContainer,children:[(0,G.jsx)(Q,{style:[m9.contactText,{color:i.labelPrimary}],children:e??r(`warning_HCP`)}),t!==void 0&&n!==void 0&&(0,G.jsx)(Jf,{onPress:n,style:m9.learnMoreContainer,children:(0,G.jsx)(Q,{style:[m9.learnMoreText,{color:i.textLink}],children:t})})]})]})},m9=z.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,...X.Poppins.medium_SM},learnMoreText:{flexShrink:1,...X.Poppins.semiBold_SM}});H();var h9=4,L_n=({onFinish:e,ref:t})=>{let{COLORS:n}=Y(),{colorScheme:r}=g2(),i=(0,U.useRef)(Array.from({length:h9},()=>U.createRef())),[a,o]=(0,U.useState)(()=>Array.from({length:h9},()=>``)),[s,c]=(0,U.useState)(0),[l,u]=(0,U.useState)(null);(0,U.useImperativeHandle)(t,()=>({resetDigits(){o(Array.from({length:h9},()=>``)),c(0),u(null),i.current[0].current?.focus()},displayError(e){u(e)}}),[i]);let d=(0,U.useCallback)((e,t)=>{let n=e.replace(/[^0-9]/g,``),r=[...a];r[t]=n,o(r),u(null),n&&t<i.current.length-1&&i.current[t+1].current?.focus(),!e&&t!==0&&i.current[t-1].current?.focus()},[a,i]),f=(0,U.useCallback)(e=>{a[e]===``&&e!==0&&i.current[e-1].current?.focus()},[a,i]);return(0,U.useEffect)(()=>{let t=a.join(``);t.length===h9&&e(t)},[a,e]),(0,G.jsxs)(V,{children:[(0,G.jsx)(V,{style:R_n.inputContainer,children:i.current.map((e,t)=>(0,G.jsx)(Ip,{ref:e,testID:`pin-digit-${t}`,value:a[t],autoFocus:t===0&&Eq,keyboardType:`number-pad`,maxLength:1,onChangeText:e=>d(e,t),onKeyPress:e=>{e.nativeEvent.key===`Backspace`&&f(t)},onFocus:()=>c(t),onBlur:()=>c(null),style:[R_n.input,{borderColor:l===null?s===t?n.borderActivationCodeFocus:r===h2.Light?n.border:n.bgTertiary:n.borderActivationCodeDanger,backgroundColor:n.bgTertiary,color:n.labelPrimary}]},t))}),l!==null&&(0,G.jsx)(Q,{style:[R_n.error,{color:n.textDanger}],children:l})]})},R_n=z.create({inputContainer:{flexDirection:`row`,gap:8,justifyContent:`center`},input:{...X.Poppins.medium_2XL,lineHeight:B.select({ios:0,default:X.Poppins.regular_Base.lineHeight}),width:49,height:55,borderRadius:8,padding:0,textAlign:`center`,textAlignVertical:`center`,borderWidth:2},error:{...X.Poppins.regular_SM,textAlign:`center`,marginTop:8}});H();var z_n=()=>(0,G.jsx)(V,{style:B_n.animationContainer,children:(0,G.jsx)(p2,{autoPlay:!0,source:m2.LEAVING_RECOMMENDATION,style:B_n.animation,loop:!0})}),B_n=z.create({animationContainer:{justifyContent:`center`,alignItems:`center`},animation:{width:75,height:75}});H(),KQ();var V_n=1600,H_n=({isVisible:e,onClose:t,onForgotPIN:n,onModalHide:r,onModalHideWithSuccess:i})=>{let{COLORS:a}=Y(),{t:o}=(0,$_t.useTranslation)(),{pinCode:s}=E3(),[c,l]=(0,U.useState)(`enter_pin`),[u,d]=U.useState(!1),f=(0,U.useRef)(null),p=(0,U.useRef)(null),{height:m}=M2t(),h=lQ(!1),g=lQ(0),_=dQ(()=>({paddingBottom:h.value?g.value:-m.value}));(0,U.useEffect)(()=>{e&&(h.value=!1)},[e,h]),(0,U.useEffect)(()=>(p.current&&=(clearTimeout(p.current),null),c===`success`&&(p.current=setTimeout(()=>{d(!0)},V_n)),()=>{p.current&&=(clearTimeout(p.current),null)}),[c]);let v=(0,U.useCallback)(()=>{g.value=-m.value,h.value=!0,wf.dismiss(),t()},[t,h,g,m]),y=(0,U.useCallback)(()=>{l(`enter_pin`),d(!1),c===`success`?i():r?.()},[i,r,c]);(0,U.useEffect)(()=>{c===`success`&&u&&v()},[u,c,v]);let b=(0,U.useCallback)(e=>{c===`enter_pin`&&(e===s?l(`success`):f.current?.displayError(o(`pin_modal_error_invalid`)))},[c,s,o]),x=(0,U.useCallback)(()=>{g.value=-m.value,h.value=!0,wf.dismiss(),n()},[n,h,g,m]);return(0,G.jsxs)(u3,{testID:`validate_pin_code_modal`,isVisible:e,onModalHide:y,onModalShow:()=>f.current?.resetDigits(),containerStyle:{backgroundColor:a.bgSheet},children:[(0,G.jsx)(V,{style:U_n.header,children:(0,G.jsx)(U5,{onPress:v})}),(0,G.jsx)(Q,{style:U_n.title,children:o(`pin_modal_header_enter`)}),(0,G.jsxs)(GQ.View,{style:[U_n.content,_],children:[c===`success`?(0,G.jsx)(z_n,{}):(0,G.jsx)(L_n,{onFinish:b,ref:f}),(0,G.jsx)(U4,{title:o(`pin_modal_button_forgot`),onPress:x,type:H4.Plain})]})]})},U_n=z.create({title:{...X.Poppins.bold_2XL,marginBottom:6,textAlign:`center`},header:{alignItems:`flex-start`,paddingTop:16,marginBottom:10},content:{paddingTop:10}});H(),KQ();var W_n=1600,G_n=({isVisible:e,onClose:t,onModalHideWithSuccess:n})=>{let{COLORS:r}=Y(),{t:i}=Sq(),[a,o]=(0,U.useState)(`enter_pin`),[s,c]=(0,U.useState)(``),[l,u]=U.useState(!1),d=(0,U.useRef)(null),f=(0,U.useRef)(null),{height:p}=M2t(),m=lQ(!1),h=lQ(0),g=dQ(()=>({paddingBottom:m.value?h.value:-p.value}));(0,U.useEffect)(()=>{e&&(m.value=!1)},[e,m]),(0,U.useEffect)(()=>(f.current&&=(clearTimeout(f.current),null),a===`success`&&(f.current=setTimeout(()=>{u(!0)},W_n)),()=>{f.current&&=(clearTimeout(f.current),null)}),[a]);let _=(0,U.useCallback)(()=>{h.value=-p.value,m.value=!0,wf.dismiss(),t()},[t,m,h,p]),v=(0,U.useCallback)(()=>{o(`enter_pin`),u(!1),a===`success`&&n(s)},[n,s,a]);(0,U.useEffect)(()=>{a===`success`&&l&&_()},[l,a,_]);let y=(0,U.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,G.jsxs)(u3,{testID:`pin_code_modal`,isVisible:e,onModalHide:v,onModalShow:()=>d.current?.resetDigits(),containerStyle:{backgroundColor:r.bgSheet},children:[(0,G.jsx)(V,{style:g9.header,children:(0,G.jsx)(U5,{onPress:_})}),(0,G.jsx)(Q,{style:g9.title,children:i(a===`enter_pin`?`pin_modal_header_enter`:`pin_modal_header_repeat`)}),(0,G.jsxs)(GQ.View,{style:[g9.content,g],children:[a===`success`&&(0,G.jsx)(V,{style:g9.animationContainer,children:(0,G.jsx)(p2,{autoPlay:!0,source:m2.LEAVING_RECOMMENDATION,style:g9.animation,loop:!0})}),a!==`success`&&(0,G.jsx)(L_n,{onFinish:y,ref:d})]})]})},g9=z.create({title:{...X.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}}),K_n=()=>{let{setPINCode:e,isElevatedAuthConfirmed:t,setIsElevatedAuthConfirmed:n}=E3(),[r,i]=(0,U.useState)(!1);return R$((0,U.useCallback)(()=>{t&&(n(!1),i(!0))},[t,n])),(0,G.jsx)(G_n,{isVisible:r,onClose:()=>i(!1),onModalHideWithSuccess:(0,U.useCallback)(t=>{e(t)},[e])})},q_n=({isVisible:e,onModalHide:t,onEnterPIN:n,onCancel:r})=>{let{t:i}=Sq();return(0,G.jsx)(u3,{isVisible:e,title:i(`settings_locked_modal_header`),onModalHide:t,icon:()=>(0,G.jsx)(X7t,{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}]})};H();function _9({columnDisposition:e,disabled:t=!1,testID:n,children:r,style:i}){let{COLORS:a}=Y();return(0,G.jsx)(V,{testID:n,style:[J_n.row,t&&J_n.disabledRow,{backgroundColor:a.bgTableOdd},i],children:U.Children.map(r,(n,r)=>U.isValidElement(n)?U.cloneElement(n,{disabled:t,cellRatio:e?e[r]:void 0}):null)})}var J_n=z.create({row:{flexDirection:`row`,justifyContent:`space-between`},disabledRow:{opacity:.5}});H();function v9({index:e,columnDisposition:t,disabled:n=!1,testID:r,children:i,style:a}){let{COLORS:o}=Y(),s=(0,U.useCallback)(e=>e===void 0?o.bgTableEven:e%2?o.bgTableOdd:o.bgTableEven,[o]);return(0,G.jsx)(V,{testID:r,style:[Y_n.row,{backgroundColor:s(e)},a],children:U.Children.map(i,(e,r)=>U.isValidElement(e)?U.cloneElement(e,{disabled:n,cellRatio:t?t[r]:void 0}):null)})}var Y_n=z.create({row:{flexDirection:`row`,justifyContent:`space-between`}});H();function y9({columnDisposition:e,disabled:t=!1,testID:n,children:r,style:i}){let{COLORS:a}=Y();return(0,G.jsx)(V,{testID:n,style:[X_n.table,{backgroundColor:a.bgSecondary,borderWidth:1,borderColor:a.divider},t&&{backgroundColor:a.bgButtonSecondaryDangerDisabled},i],children:(()=>{let n=0;return U.Children.map(r,r=>{if(U.isValidElement(r)){if(r.type===_9){let n=r;return U.cloneElement(n,{disabled:n.props.disabled??t,columnDisposition:e})}if(r.type===v9){let i=r,a=U.cloneElement(i,{disabled:i.props.disabled??t,index:n,columnDisposition:e});return n+=1,a}return U.cloneElement(r)}return null})})()})}var X_n=z.create({table:{borderRadius:16,overflow:`hidden`}});H();function b9({disabled:e=!1,onPress:t,testID:n,accessibilityLabel:r,accessibilityValue:i,cellRatio:a,children:o,style:s}){let{COLORS:c}=Y();return(0,G.jsx)(Jf,{disabled:!t||e,onPress:t,style:[Z_n.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:U.Children.map(o,t=>{if(U.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 U.cloneElement(n,{...n.props,style:t})}else return U.cloneElement(n)}return null})})}var Z_n=z.create({cell:{justifyContent:`center`,alignItems:`center`,borderTopWidth:1,borderLeftWidth:1,paddingVertical:8}});H();function x9({testID:e,cellRatio:t,children:n,style:r,accessibilityLabel:i,accessibilityValue:a,disabled:o=!1}){let{COLORS:s}=Y();return(0,G.jsx)(V,{style:[Q_n.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 Q_n=z.create({cell:{justifyContent:`space-between`,alignItems:`center`,borderTopWidth:1,borderLeftWidth:1,paddingVertical:8}});H();var $_n=[Z.ActivityIntensity.light,Z.ActivityIntensity.moderate,Z.ActivityIntensity.hard],evn=[Z.ActivityReductionIntervals.fromZero,Z.ActivityReductionIntervals.fromThirty,Z.ActivityReductionIntervals.fromFortysix,Z.ActivityReductionIntervals.fromSixtyone],tvn={[Z.ActivityReductionIntervals.fromZero]:`0-29`,[Z.ActivityReductionIntervals.fromThirty]:`30-45`,[Z.ActivityReductionIntervals.fromFortysix]:`46-60`,[Z.ActivityReductionIntervals.fromSixtyone]:`61-120`},nvn=e=>Math.round((1-e)*100),rvn=e=>e==null?`-`:`${nvn(e).toString()} %`,ivn=e=>Math.round((1-e/100)*100)/100;function avn(){let{t:e}=Sq(),t=A$(),{COLORS:n}=Y(),{modalStoreActions:r}=z5(),{bottomWithScroll:i}=Q4(),a=M5(),[o,s]=(0,U.useState)(!1),[c,l]=(0,U.useState)(!1),[u,d]=(0,U.useState)(!1),[f,p]=(0,U.useState)(null),[m,h]=(0,U.useState)(null),[g,_]=(0,U.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,U.useMemo)(()=>B8(x,Z.BloodGlucoseUnit.MMOL_L,v),[v,x]),{text:D}=(0,U.useMemo)(()=>L8(v),[v]),O=(0,U.useMemo)(()=>({light:w,moderate:T,hard:C}),[w,T,C]),k=(0,U.useMemo)(()=>({post:S}),[S]),A=(0,U.useMemo)(()=>[{title:e(`table_activity_duration`),maxFontSizeMultiplier:S2.s1},{title:R8.light(),maxFontSizeMultiplier:S2.s1},{title:R8.moderate(),maxFontSizeMultiplier:S2.s1},{title:R8.hard(),maxFontSizeMultiplier:S2.s1}],[e]),[ee,te]=(0,U.useState)(!1),[ne,re]=(0,U.useState)(!1),{areSettingsLocked:ie,isPINSet:j,lockSettings:M,unlockSettings:ae}=F_n(),[oe,N]=(0,U.useState)(!1),[se,P]=(0,U.useState)(!1),F=(0,U.useCallback)(()=>{ie?te(!0):M()},[ie,M]);(0,U.useEffect)(()=>{t.setOptions({header:()=>(0,G.jsx)(P5,{title:e(`physical_activity_navigation`),LeftButton:(0,G.jsx)(H5,{}),RightButton:j?(0,G.jsx)(efn,{onPress:F,isLocked:ie}):void 0,overlay:!0})})},[t,ie,j,F,e]);let ce=(0,U.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]),le=(0,U.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]),ue=(0,U.useCallback)((e,t)=>{p({interval:t,intensity:e}),s(!0)},[s,p]),de=(0,U.useCallback)(()=>{p(null),s(!0)},[]),fe=(0,U.useCallback)(async e=>{if(f===null)throw Error(`[ActivitySettings::updateActivity] pressedTableCell is null`);if(ivn(e)!==y[f.intensity][f.interval]){let t=JSON.parse(JSON.stringify(y));t[f.intensity][f.interval]=ivn(e),t.updatedAt=new Date().toISOString(),_(await k8.postUserSettings({activity:t}))}},[y,f]),pe=(0,U.useCallback)(async e=>{let t=z8(e,v,Z.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]),me=(0,U.useCallback)(async e=>{f?await fe(e):await pe(e),s(!1)},[f,fe,pe]),he=(0,U.useMemo)(()=>f===null?v===Z.BloodGlucoseUnit.MMOL_L?Van:Han:a3(0,75),[f,v]),I=(0,U.useMemo)(()=>{if(f===null){let e=B8(x,Z.BloodGlucoseUnit.MMOL_L,v);return he.findIndex(t=>t===e)}let e=y[f.intensity][f.interval];return e===0?0:e?nvn(e):75},[f,y,x,v,he]),ge=async()=>{m===`after`?await le():await ce(),l(!1)},L=()=>{h(`during`),l(!0)},_e=()=>{h(`after`),l(!0)},ve=(0,U.useCallback)(()=>{g===!1&&r.set({showSyncErrorModal:!0}),_(void 0)},[g,r]),ye=(0,U.useCallback)(()=>{oe&&(re(!0),N(!1))},[oe,re,N]),be=(0,U.useCallback)(()=>{N(!0),te(!1)},[N,te]),R=(0,U.useCallback)(()=>{ae()},[ae]),xe=(0,U.useCallback)(e=>j&&ie?(...e)=>te(!0):(...t)=>e(...t),[ie,j]),Se=(0,U.useCallback)(()=>{se&&(P(!1),setTimeout(()=>{t.navigate(F5.ChangePINCode)},500))},[se,t]),Ce=y.updatedAt??b;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(ds,{testID:`settings-activity-scroll`,style:S9.scrollView,contentContainerStyle:[S9.scrollViewContent,{paddingBottom:i,paddingTop:a+16}],children:[(0,G.jsx)(Q,{style:[S9.updatedAtText,{color:n.labelSecondary}],children:e(`settings_lastEdited`,{date:Ce?I8(Ce,`d MMM yyyy`):``})}),(0,G.jsx)(p9,{text:e(`physical_activity_hcp_card_body`),learnMoreText:e(`physical_activity_hcp_card_button`),learnMoreOnPress:()=>{d(!0)}}),(0,G.jsxs)(y9,{children:[(0,G.jsxs)(V,{style:[S9.tableDescripContainer,{borderBottomColor:n.divider}],children:[(0,G.jsx)(Q,{style:[S9.title,{color:n.labelPrimary}],accessibilityRole:`header`,children:e(`physical_activity_target_title`)}),(0,G.jsx)(Q,{style:[S9.subtitle,{color:n.labelSecondary}],children:e(`physical_activity_target_body`)})]}),(0,G.jsx)(Y4,{title:e(`target_activity_input`),value:`${E} ${D}`,style:{backgroundColor:n.bgSecondary},testID:`activity-target`,onPress:xe(de),valueStyle:{color:n.labelBrand}})]}),(0,G.jsxs)(y9,{columnDisposition:[1,1,1,1],children:[(0,G.jsxs)(V,{style:[S9.tableDescripContainer,{borderBottomColor:n.divider}],children:[(0,G.jsx)(Q,{style:[S9.title,{color:n.labelPrimary}],accessibilityRole:`header`,children:e(`target_activity_reduction_title`)}),(0,G.jsx)(Q,{style:[S9.subtitle,{color:n.labelSecondary}],children:e(`target_activity_reduction_body`)})]}),(0,G.jsx)(_9,{children:A.map((e,t)=>(0,G.jsx)(x9,{style:[t===0&&S9.tableFirstCell,S9.noTopBorder],children:(0,G.jsx)(Q,{style:[S9.tableHeaderTitle,{color:n.labelPrimary}],maxFontSizeMultiplier:e.maxFontSizeMultiplier,children:e.title})},e.title))}),evn.map(t=>(0,G.jsxs)(v9,{children:[(0,G.jsxs)(b9,{style:S9.tableFirstCell,children:[(0,G.jsx)(Q,{style:[S9.tableInterval,{color:n.labelPrimary}],children:tvn[t]}),(0,G.jsx)(Q,{style:[S9.minutes,{color:n.textTableSecondary}],children:e(`activity_settings_table_min`)})]}),$_n.map(e=>(0,G.jsx)(b9,{testID:`settings-activity-${e}-${t}`,onPress:xe(()=>{ue(e,t)}),children:(0,G.jsx)(Q,{style:[S9.tablePercentage,{color:n.textTableHighlight}],children:rvn(O[e][t])})},`${t}-${e}`))]},t)),(0,G.jsx)(Jf,{style:[S9.resetContainer,{backgroundColor:n.bgButtonSecondaryDanger,borderColor:n.divider}],onPress:xe(L),testID:`restore-default-activity-settings-during`,children:(0,G.jsx)(Q,{style:[S9.resetText,{color:n.textButtonSecondaryDanger}],children:e(`button_reset_default`)})})]}),(0,G.jsxs)(y9,{children:[(0,G.jsxs)(V,{style:[S9.tableDescripContainer,{borderBottomWidth:0}],children:[(0,G.jsx)(Q,{style:[S9.title,{color:n.labelPrimary}],accessibilityRole:`header`,children:e(`target_activity_reduction_after_title`)}),(0,G.jsx)(Q,{style:[S9.subtitle,{color:n.labelSecondary}],children:e(`target_activity_reduction_after_body`)})]}),evn.map(t=>(0,G.jsxs)(v9,{children:[(0,G.jsxs)(b9,{style:[S9.tableFirstCell,S9.noLeftBorder],children:[(0,G.jsx)(Q,{style:S9.tableInterval,children:tvn[t]}),(0,G.jsx)(Q,{style:[S9.minutes,{color:n.textTableSecondary}],children:e(`activity_settings_table_min`)})]}),(0,G.jsx)(b9,{testID:`settings-activity-post-${t}`,onPress:xe(()=>{ue(`post`,t)}),children:(0,G.jsx)(Q,{style:[S9.tablePercentage,{color:n.textTableHighlight}],children:rvn(k.post[t])})})]},`post-${t}`)),(0,G.jsx)(Jf,{style:[S9.resetContainer,{backgroundColor:n.bgButtonSecondaryDanger,borderColor:n.divider}],onPress:xe(_e),testID:`restore-default-activity-settings-after`,children:(0,G.jsx)(Q,{style:[S9.resetText,{color:n.textButtonSecondaryDanger}],children:e(`button_reset_default`)})})]})]}),(0,G.jsx)(Q5,{initialScrollIndex:I,isVisible:o,onCancel:()=>{s(!1)},onConfirm:me,items:he,onModalHide:ve,testID:`activity-wheel-picker`}),(0,G.jsx)(u3,{title:e(`physical_activity_modal_reset_title `),isVisible:c,onModalHide:ve,buttons:[{title:e(`button_reset`),type:H4.Error,onPress:ge},{title:e(`button_cancel`),type:H4.Secondary,onPress:()=>{l(!1)}}]}),(0,G.jsx)(u3,{isVisible:u,enableScroll:!0,buttons:[{title:e(`button_close`),onPress:()=>{d(!1)},style:S9.activityInfoModalButton}],children:(0,G.jsx)(I_n,{})}),(0,G.jsx)(t7,{onModalHide:()=>{_(void 0)}}),(0,G.jsx)(q_n,{isVisible:ee,onModalHide:ye,onEnterPIN:be,onCancel:()=>te(!1)}),(0,G.jsx)(H_n,{isVisible:ne,onClose:()=>re(!1),onModalHide:Se,onForgotPIN:()=>{P(!0),re(!1)},onModalHideWithSuccess:R}),(0,G.jsx)(K_n,{})]})}var ovn=f7(avn),S9=z.create({scrollView:{paddingHorizontal:16},scrollViewContent:{flexGrow:1,gap:32,paddingTop:32},updatedAtText:{...X.Poppins.regular_SM,textAlign:`center`},tableDescripContainer:{padding:16,borderBottomWidth:1},title:{...X.Poppins.semiBold_Base,marginBottom:8},subtitle:{...X.Poppins.regular_SM},tableFirstCell:{paddingLeft:16,paddingVertical:12,borderLeftWidth:0},resetText:{...X.Poppins.semiBold_Base,textAlign:`center`},resetContainer:{alignItems:`center`,padding:16,borderTopWidth:1},tableHeaderTitle:{...X.Poppins.medium_SM},minutes:{...X.Poppins.regular_XS},tableInterval:{...X.Poppins.medium_Base},tablePercentage:{...X.Poppins.medium_Base},activityInfoModalButton:{marginTop:32},noTopBorder:{borderTopWidth:0,paddingVertical:16},noLeftBorder:{borderLeftWidth:0}});function C9(e,t){return+e3(e)>+e3(t)}function svn(e,t,n){return K7(e,-t,n)}function cvn(e,t){let n=e3(e,t?.in);return n.setMinutes(0,0,0),n}function lvn(e,t,n){let[r,i]=_8(n?.in,e,t);return+cvn(r)==+cvn(i)}H();var w9=Array.from({length:60},(e,t)=>t.toString().padStart(2,`0`));function uvn({isVisible:e,initialValue:t,min:n,max:r,onCancel:i,onConfirm:a,onModalHide:o}){let{COLORS:s}=Y(),{width:c}=$p(),l=(0,U.useRef)(null),u=(0,U.useRef)(null),d=(0,U.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)||lvn(i,t);)e.push(i),i=Von(i,1);return e},[r,n]),f=(0,U.useMemo)(()=>d.map(e=>e.getHours().toString().padStart(2,`0`),[]),[d]),[p,m]=(0,U.useState)(t),h=B3t(e);(0,U.useEffect)(()=>{!h&&e&&m(t)},[h,e,t]);let g=(0,U.useMemo)(()=>d.findIndex(e=>e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()&&e.getHours()===t.getHours()),[d,t]),_=(0,U.useMemo)(()=>{let[,e]=I8(t,`HH:mm`).split(`:`);return w9.indexOf(e)},[t]),v=(0,U.useMemo)(()=>d.findIndex(e=>e.getFullYear()===p.getFullYear()&&e.getMonth()===p.getMonth()&&e.getDate()===p.getDate()&&e.getHours()===p.getHours()),[d,p]),y=(0,U.useMemo)(()=>{let[,e]=I8(p,`HH:mm`).split(`:`);return w9.indexOf(e)},[p]),b=(0,U.useMemo)(()=>n?0:null,[n]),x=(0,U.useMemo)(()=>r?d.length-1:null,[r,d]),S=(0,U.useMemo)(()=>{if(!n)return null;let[,e]=I8(n,`HH:mm`).split(`:`);return w9.indexOf(e)},[n]),C=(0,U.useMemo)(()=>{if(!r)return null;let[,e]=I8(r,`HH:mm`).split(`:`);return w9.indexOf(e)},[r]),w=(0,U.useCallback)(()=>{a(p)},[a,p]),T=(0,U.useCallback)(()=>{m(t),i()},[i,t]),E=(0,U.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,U.useCallback)(e=>{u.current?.scrollToIndex(e)},[]),O=(0,U.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,U.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,G.jsx)(u3,{isVisible:e,containerStyle:{backgroundColor:s.bgTransparent},onModalHide:o,children:(0,G.jsxs)(V,{children:[(0,G.jsxs)(V,{style:T9.pickersContainer,children:[(0,G.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,G.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,G.jsxs)(V,{style:T9.buttonContainer,children:[(0,G.jsx)(X5,{onPress:w}),(0,G.jsx)(Y5,{onPress:T})]})]})})}var dvn=U.memo(uvn),T9=z.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}});H();var fvn=(e,t)=>({startTime:e.startTime,target:B8(e.target,Z.BloodGlucoseUnit.MMOL_L,t)}),pvn=(e,t)=>e.map(e=>fvn(e,t)),mvn=(e,t)=>{let n=e.startTime,r=parseFloat(e.target);return r=z8(r,t,Z.BloodGlucoseUnit.MMOL_L),{startTime:n,target:r}},hvn=(e,t)=>e.map(e=>mvn(e,t));function gvn(){let{t:e}=Sq(),{COLORS:t}=Y(),{modalStoreActions:n}=z5(),{bottomWithScroll:r}=Q4(),i=A$(),a=M5(),[o,s]=(0,U.useState)(),[c,l]=(0,U.useState)(void 0),[u,d]=(0,U.useState)(!1),[f,p]=(0,U.useState)(!1),[m,h]=(0,U.useState)(!1),[g,_]=(0,U.useState)(),[v,y]=(0,U.useState)(!1),[b,x]=(0,U.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===Z.Usage.Overall,O=pvn(T,S),k=fvn(E,S),{areSettingsLocked:A,isPINSet:ee,lockSettings:te,unlockSettings:ne}=F_n(),[re,ie]=(0,U.useState)(!1),[j,M]=(0,U.useState)(!1),ae=(0,U.useCallback)(()=>{A?y(!0):te()},[A,te]);(0,U.useEffect)(()=>{i.setOptions({header:()=>(0,G.jsx)(P5,{title:e(`glucose_navigation`),LeftButton:(0,G.jsx)(H5,{}),RightButton:ee?(0,G.jsx)(efn,{onPress:ae,isLocked:A}):void 0,overlay:!0})})},[i,A,ee,ae,e]);let oe=(0,U.useCallback)(e=>{p(!0),_(e)},[]),N=(0,U.useCallback)(async()=>{let e=Jan(),t=Yan(),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]),se=(0,U.useCallback)(async e=>{if(e!==parseFloat(k.target)){let t={...k};t.target=e.toString();let n=mvn(t,S),r={glucoseLevelTargets:{...C,updatedAt:new Date().toISOString(),overallTargetBGL:n}};l(await k8.postUserSettings(r))}},[S,k,C]),P=(0,U.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=hvn(t,S),i={glucoseLevelTargets:{...C,updatedAt:new Date().toISOString(),targetBGLIntervals:r}};l(await k8.postUserSettings(i))}},[g,O,S,C]),F=(0,U.useCallback)(async e=>{D?await se(e):await P(e),p(!1)},[D,se,P]),ce=(0,U.useCallback)(async()=>{let e=!D,t={glucoseLevelTargets:{...C,use:e?Z.Usage.Overall:Z.Usage.Intervals,updatedAt:new Date().toISOString()}},r=await k8.postUserSettings(t);n.set({showSyncErrorModal:!r})},[D,C,n]),le=(0,U.useMemo)(()=>L8(S).text,[S]),ue=(0,U.useMemo)(()=>{let{min:e,max:t}=S===Z.BloodGlucoseUnit.MMOL_L?Zan():Qan();return S===Z.BloodGlucoseUnit.MG_DL?a3(e,t):o3(e,t)},[S]),de=(0,U.useMemo)(()=>g===void 0?0:D?ue.indexOf(k.target):ue.indexOf(O[g].target),[g,D,ue,O,k.target]),fe=(0,U.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(svn(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]),pe=(0,U.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=hvn(e,S),i={glucoseLevelTargets:{...C,targetBGLIntervals:r,updatedAt:new Date().toISOString()}};l(await k8.postUserSettings(i))}d(!1)},[g,O,S,C]),me=(0,U.useCallback)(()=>{d(!1)},[]),he=(0,U.useCallback)(()=>{p(!1)},[]),I=(0,U.useCallback)(()=>{c===!1&&n.set({showSyncErrorModal:!0}),l(void 0)},[n,c]),ge=(0,U.useCallback)(()=>{re&&(x(!0),ie(!1))},[re,x,ie]),L=(0,U.useCallback)(()=>{ie(!0),y(!1)},[ie,y]),_e=(0,U.useCallback)(()=>{i.navigate(F5.GlucoseUnit)},[i]),ve=(0,U.useCallback)(()=>{ne()},[ne]),ye=(0,U.useCallback)(e=>ee&&A?(...e)=>y(!0):(...t)=>e(...t),[A,ee]),be=(0,U.useCallback)(()=>{j&&(M(!1),setTimeout(()=>{i.navigate(F5.ChangePINCode)},500))},[j,i]),R=C.updatedAt??w;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(ds,{testID:`settings-glucose-scrollview`,style:E9.scrollView,contentContainerStyle:[E9.scrollViewContent,{paddingBottom:r,paddingTop:a+16}],children:[(0,G.jsx)(Q,{style:[E9.updatedAtText,{color:t.labelSecondary}],children:e(`settings_lastEdited`,{date:R?I8(R,`d MMM yyyy`):``})}),(0,G.jsx)(p9,{}),(0,G.jsx)(Y4,{title:e(`glucose_input`),value:le,testID:`glucose-change`,onPress:ye(_e),renderRightSlot:()=>(0,G.jsx)(K4,{})}),(0,G.jsxs)(y9,{columnDisposition:[1,2],children:[(0,G.jsx)(f3,{title:e(`fixed_input_title`),message:e(`fixed_input_body`),value:D,testID:`settings-glucose-overall-switch`,onValueChange:ye(ce),style:E9.switchContainer}),(0,G.jsxs)(_9,{disabled:!D,testID:`settings-glucose-overall-header`,children:[(0,G.jsx)(x9,{style:E9.tableFirstCell,testID:`settings-glucose-overall-header-time`,children:(0,G.jsx)(Q,{style:[E9.headerTitle,{color:t.textTableActive}],maxFontSizeMultiplier:S2.s2,children:e(`table_fixed_time`)})}),(0,G.jsxs)(x9,{testID:`settings-glucose-overall-header-target`,children:[(0,G.jsx)(Q,{style:[E9.headerTitle,{color:t.textTableActive}],maxFontSizeMultiplier:S2.s2,children:e(`table_fixed_target`)}),(0,G.jsx)(Q,{style:[E9.headerSubtitle,{color:t.textTableSecondary}],children:le})]})]}),(0,G.jsxs)(v9,{disabled:!D,children:[(0,G.jsx)(b9,{style:E9.tableFirstCell,children:(0,G.jsx)(Q,{style:[E9.subtitle,{color:t.textTableActive}],children:e(`table_fixed_all_day `)})}),(0,G.jsx)(b9,{onPress:ye(()=>oe(0)),children:(0,G.jsx)(Q,{style:[E9.fixedValueTitle,{color:t.textTableHighlight}],testID:`settings-glucose-overall-all-day-target`,children:k.target})})]}),(0,G.jsx)(Jf,{style:[E9.resetContainer,{borderColor:t.divider}],disabled:!D,onPress:ye(()=>h(!0)),children:(0,G.jsx)(Q,{style:[E9.resetText,D?{color:t.textButtonSecondaryDanger}:{color:t.textButtonSecondaryDangerDisabled}],children:e(`button_reset_default`)})})]}),(0,G.jsxs)(y9,{columnDisposition:[1,2],children:[(0,G.jsx)(f3,{title:e(`table_variable_title`),message:e(`table_variable_body`),value:!D,testID:`daily-interval-switch`,onValueChange:ye(ce),style:E9.switchContainer}),(0,G.jsxs)(_9,{disabled:D,testID:`settings-glucose-variable-header`,children:[(0,G.jsxs)(x9,{style:E9.tableFirstCell,testID:`settings-glucose-variable-header-time`,children:[(0,G.jsx)(Q,{style:[E9.headerTitle,{color:t.textTableActive}],maxFontSizeMultiplier:S2.s2,children:e(`table_variable_time`)}),(0,G.jsx)(Q,{style:[E9.headerSubtitle,{color:t.textTableSecondary}],children:e(`table_variable_time_unit`)})]}),(0,G.jsxs)(x9,{testID:`settings-glucose-variable-header-target`,children:[(0,G.jsx)(Q,{style:[E9.headerTitle,{color:t.textTableActive}],maxFontSizeMultiplier:S2.s2,children:e(`table_fixed_target`)}),(0,G.jsx)(Q,{style:[E9.headerSubtitle,{color:t.textTableSecondary}],children:le})]})]}),O.map((e,n)=>(0,G.jsxs)(v9,{disabled:D,children:[(0,G.jsxs)(b9,{style:E9.tableFirstCell,onPress:ye(()=>{fe(n)}),children:[(0,G.jsx)(Q,{style:[E9.title,{color:t.textTableHighlight}],children:e.startTime}),(0,G.jsx)(Q,{style:[E9.subtitle,{color:t.textTableSecondary}],children:gvt[Object.keys(wq)[n]]()})]}),(0,G.jsx)(b9,{onPress:ye(()=>{oe(n)}),children:(0,G.jsx)(Q,{style:[E9.title,{color:t.textTableHighlight}],testID:`settings-glucose-variable-target-${Object.keys(wq)[n].toLowerCase()}`,children:e.target})})]},e.startTime)),(0,G.jsx)(Jf,{style:[E9.resetContainer,{borderColor:t.divider}],disabled:D,onPress:ye(()=>{h(!0)}),children:(0,G.jsx)(Q,{style:[E9.resetText,D?{color:t.textButtonSecondaryDangerDisabled}:{color:t.textButtonSecondaryDanger}],children:e(`button_reset_default`)})})]})]}),(0,G.jsx)(Q5,{isVisible:f,items:ue,onConfirm:F,onCancel:he,initialScrollIndex:de,onModalHide:I,testID:`settings-glucose-target-wheel-picker`}),(0,G.jsx)(dvn,{isVisible:u,initialValue:o?.current??new Date,min:o?.min,max:o?.max,onConfirm:pe,onCancel:me,onModalHide:I}),(0,G.jsx)(u3,{isVisible:m,title:e(`physical_activity_modal_reset_title `),onModalHide:I,buttons:[{title:e(`button_reset`),type:H4.Error,onPress:N},{title:e(`button_cancel`),type:H4.Secondary,onPress:()=>{h(!1)}}]}),(0,G.jsx)(t7,{onModalHide:()=>{l(void 0)}}),(0,G.jsx)(q_n,{isVisible:v,onModalHide:ge,onEnterPIN:L,onCancel:()=>y(!1)}),(0,G.jsx)(H_n,{isVisible:b,onClose:()=>x(!1),onModalHide:be,onForgotPIN:()=>{M(!0),x(!1)},onModalHideWithSuccess:ve}),(0,G.jsx)(K_n,{})]})}var _vn=f7(gvn),E9=z.create({scrollView:{paddingHorizontal:16},scrollViewContent:{flexGrow:1,gap:32},updatedAtText:{...X.Poppins.regular_SM,textAlign:`center`},tableFirstCell:{alignItems:`flex-start`,paddingLeft:16,borderLeftWidth:0},resetContainer:{alignItems:`center`,padding:16,borderTopWidth:1},resetText:{...X.Poppins.semiBold_Base,textAlign:`center`},headerTitle:{...X.Poppins.medium_SM},headerSubtitle:{...X.Poppins.medium_XS},title:{...X.Poppins.medium_Base},fixedValueTitle:{...X.Poppins.medium_Base,paddingVertical:8},subtitle:{...X.Poppins.regular_XS},switchContainer:{borderBottomLeftRadius:0,borderBottomRightRadius:0}});H();var vvn=e=>{let{t}=Sq(),{COLORS:n}=Y(),{glucoseUnit:r,isError:i,onPressMGDL:a,onPressMMOLL:o}=e,s=r===Z.BloodGlucoseUnit.MMOL_L,c=r===Z.BloodGlucoseUnit.MG_DL;return(0,G.jsxs)(V,{style:D9.unitsContainer,children:[(0,G.jsxs)(Cp,{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,G.jsx)(Q,{style:[D9.unitText,{color:s?n.textLabelActive:n.textLabelInactive}],children:t(`glucose_unit_mmol/l`)}),(0,G.jsx)(Q,{style:[D9.exampleText,{color:s?n.textLabelActive:n.textLabelInactive}],children:t(`example`)}),(0,G.jsx)(Q,{style:[D9.unitExampleText,{color:s?n.textLabelActive:n.textLabelInactive}],maxFontSizeMultiplier:S2.s2,children:t(`glucose_unit_example_mmol/L`)})]}),(0,G.jsxs)(Cp,{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,G.jsx)(Q,{style:[D9.unitText,{color:c?n.textLabelActive:n.textLabelInactive}],children:t(`glucose_unit_mg/dl`)}),(0,G.jsx)(Q,{style:[D9.exampleText,{color:c?n.textLabelActive:n.textLabelInactive}],children:t(`example`)}),(0,G.jsx)(Q,{style:[D9.unitExampleText,{color:c?n.textLabelActive:n.textLabelInactive}],maxFontSizeMultiplier:S2.s2,children:t(`glucose_unit_example_mg/dl`)})]})]})},D9=z.create({unitsContainer:{flexDirection:`row`,justifyContent:`space-between`,gap:12},unitButton:{flex:1,paddingHorizontal:14,paddingVertical:10,borderRadius:16,borderWidth:2},unitText:{...X.Poppins.medium_Base,marginBottom:8},exampleText:{...X.Poppins.medium_XS,marginBottom:4},unitExampleText:{...X.Poppins.regular_XS}});H();var yvn=()=>{let{modalStoreActions:e}=z5(),t=M5(),n=(0,U.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,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(V,{style:[bvn.container,{paddingTop:t+16}],children:(0,G.jsx)(vvn,{onPressMMOLL:()=>n(Z.BloodGlucoseUnit.MMOL_L),onPressMGDL:()=>n(Z.BloodGlucoseUnit.MG_DL),glucoseUnit:k8.glucoseUnit})}),(0,G.jsx)(t7,{})]})},bvn=z.create({container:{paddingHorizontal:16}}),xvn=f7(yvn);H();var Svn=()=>{let{t:e}=Sq(),{COLORS:t}=Y(),n=A$(),{bottomWithScroll:r}=Q4(),i=M5();return(0,G.jsxs)(ds,{contentContainerStyle:[O9.scrollView,{paddingBottom:r,paddingTop:i+16}],testID:`legal-page-scrollview`,children:[(0,G.jsx)(Q,{style:O9.title,children:e(`legal_title`)}),(0,G.jsxs)(V,{style:O9.section,children:[(0,G.jsx)(Q7t,{testID:`manufacturer-symbol`,color:t.bgPrimary}),(0,G.jsx)(Q,{style:[O9.textContainer,{color:t.labelSecondary}],children:ein})]}),(0,G.jsxs)(V,{style:O9.section,children:[(0,G.jsx)(Z7t,{testID:`manual-icon`}),(0,G.jsx)(Q,{testID:`manual-button`,style:[O9.manualText,{color:t.textLink}],onPress:()=>{u8(l8.SettingsIFU),n.navigate(F5.IFU)},children:e(`legal_IFU`)})]}),(0,G.jsxs)(V,{style:O9.section,children:[(0,G.jsx)(r9t,{testID:`SN-symbol`}),(0,G.jsx)(Q,{style:[O9.textContainer,{color:t.labelSecondary}],children:c8})]}),(0,G.jsxs)(V,{style:O9.section,children:[(0,G.jsx)(z7t,{testID:`ce-logo`}),(0,G.jsx)(Q,{style:[O9.alignTop,{color:t.labelSecondary}],children:e(`legal_ce_mark_text`)})]}),(0,G.jsxs)(V,{style:O9.section,children:[(0,G.jsx)(Q7t,{color:t.labelPrimary}),(0,G.jsxs)(V,{style:O9.textContainer,children:[(0,G.jsx)(Q,{style:[O9.sectionTitle,{color:t.labelSecondary}],children:e(`legal_company_name`)}),(0,G.jsx)(Q,{style:{color:t.labelSecondary},children:e(`legal_company_adress`)}),(0,G.jsx)(Q,{style:{color:t.labelSecondary},children:e(`legal_company_country`)}),(0,G.jsx)(Q,{style:{color:t.labelSecondary},children:e(`legal_company_email`)}),(0,G.jsx)(Q,{style:{color:t.labelSecondary},children:e(`legal_company_cvr_vat`)})]})]}),(0,G.jsxs)(V,{style:[O9.section,O9.udiSection],children:[(0,G.jsx)(i9t,{testID:`udi-logo`,style:O9.udiLogo}),(0,G.jsxs)(Q,{style:[O9.textContainer,O9.udiText,{color:t.labelSecondary}],children:[(0,G.jsx)(Q,{style:{color:t.labelSecondary},children:`(01)${nin}(10)`}),(0,G.jsx)(Q,{style:{color:t.labelSecondary},children:`${c8}(8012)${c8}`})]})]}),(0,G.jsxs)(V,{style:O9.sectionColumn,children:[(0,G.jsx)(a9t,{testID:`uk-rep-logo`,style:O9.repIcon}),(0,G.jsx)(Q,{style:{color:t.labelSecondary},children:e(`legal_ukrep`)})]}),Tq?null:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Q,{style:[O9.sectionTitle,{color:t.labelSecondary}],children:e(`more_legal_novo_nordisk_disclaimer_title`)}),(0,G.jsx)(Q,{style:{color:t.labelSecondary},children:e(`more_legal_novo_nordisk_disclaimer_text`)})]})]})},O9=z.create({scrollView:{paddingTop:32,paddingHorizontal:16},title:{...X.Poppins.regular_SM,textAlign:`center`,marginBottom:32},section:{flexDirection:`row`,marginBottom:32},sectionTitle:{...X.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:{...X.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`}});H();var Cvn=()=>{let e=new Date().getFullYear();return[...Array(12).keys()].map(t=>I8(new Date(e,t),`MMM`))},wvn=()=>{let e=1900,t=new Date().getFullYear()-e+1;return Array.from({length:t},(t,n)=>(n+e).toString())},Tvn=(e,t)=>mpn(new Date(e,t)),Evn=Cvn(),Dvn=Array.from({length:31},(e,t)=>(t+1).toString().padStart(2,`0`)),Ovn=wvn();function kvn({isVisible:e,initialValue:t,onCancel:n,onConfirm:r,onModalHide:i}){let{COLORS:a}=Y(),{width:o}=$p(),s=(0,U.useRef)(null),c=(0,U.useRef)(null),l=(0,U.useRef)(null),[u,d]=(0,U.useState)(t);(0,U.useEffect)(()=>{e&&d(e=>e.getTime()===t.getTime()?e:new Date(t))},[t,e]);let f=(0,U.useMemo)(()=>t.getDate()-1,[t]),p=(0,U.useMemo)(()=>t.getMonth(),[t]),m=(0,U.useMemo)(()=>{let e=t.getFullYear();return Ovn.indexOf(e.toString())},[t]),h=(0,U.useMemo)(()=>u.getDate()-1,[u]),g=(0,U.useMemo)(()=>u.getMonth(),[u]),_=(0,U.useMemo)(()=>u.getFullYear(),[u]),v=(0,U.useCallback)(()=>{r(u)},[r,u]),y=(0,U.useCallback)(()=>{d(t),n()},[n,t]),b=(0,U.useCallback)(e=>{let t=Tvn(_,e)-1;d(new Date(_,e,Math.min(h,t)+1)),h>t&&s.current?.scrollToIndex(t)},[h,_]),x=(0,U.useCallback)(e=>{let t=Tvn(_,g)-1;d(new Date(_,g,Math.min(e,t)+1)),e>t&&s.current?.scrollToIndex(t)},[g,_]),S=(0,U.useCallback)(e=>{let t=parseInt(Ovn[e],10),n=Tvn(t,g)-1;d(new Date(t,g,Math.min(h,n)+1)),h>n&&s.current?.scrollToIndex(n)},[h,g]);return(0,G.jsx)(u3,{isVisible:e,containerStyle:{backgroundColor:a.bgTransparent},onModalHide:i,children:(0,G.jsxs)(V,{children:[(0,G.jsxs)(V,{style:k9.pickersContainer,children:[(0,G.jsx)(Z5,{ref:c,initialScrollIndex:p,options:Evn,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,G.jsx)(Z5,{ref:s,initialScrollIndex:f,options:Dvn,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,G.jsx)(Z5,{ref:l,initialScrollIndex:m,options:Ovn,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,G.jsxs)(V,{style:k9.buttonContainer,children:[(0,G.jsx)(X5,{onPress:v}),(0,G.jsx)(Y5,{onPress:y})]})]})})}var Avn=U.memo(kvn),k9=z.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}}),jvn=a3(0,220),Mvn=a3(0,300),Nvn=f7(({isVisible:e,onCancel:t,onModalHide:n})=>{let{t:r}=Sq(),{isOnboardingFinished:i}=E3(),{biologicalSex:a}=s7(),{setSetupCalculatorStoreValues:o}=o7(),{modalStoreActions:s}=z5(),c=i?k8.biologicalSex:a,[l,u]=(0,U.useState)(void 0),d=!k8.biologicalSex,f=+!!d,p=(0,U.useMemo)(()=>{switch(c){case Z.BiologicalSex.Male:return 0;case Z.BiologicalSex.Female:return 1;case Z.BiologicalSex.Unspecified:return 2;default:return 0}},[c]),m=(0,U.useCallback)(async(e,n)=>{if(d&&n===0){o({biologicalSex:void 0}),t();return}let r=n-f,a=Z.BiologicalSex.Male;if(r===1&&(a=Z.BiologicalSex.Female),r===2&&(a=Z.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,U.useCallback)(()=>{l===!1?s.set({showSyncErrorModal:!0}):n&&n(),u(void 0)},[s,l,n]);return(0,G.jsxs)(G.Fragment,{children:[(0,G.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,G.jsx)(t7,{})]})}),Pvn=f7(({isVisible:e,onCancel:t,onModalHide:n})=>{let{t:r}=Sq(),{modalStoreActions:i}=z5(),a=k8.diabetesType,[o,s]=(0,U.useState)(!1),[c,l]=(0,U.useState)(void 0),u=(0,U.useMemo)(()=>a===Z.DiabetesType.Type1?0:1,[a]),d=(0,U.useCallback)(async(e,n)=>{let r=n===0?Z.DiabetesType.Type1:Z.DiabetesType.Type2;if(a===r){t();return}l(await k8.postUserSettings({diabetesType:r})),t()},[a,t]),f=(0,U.useCallback)(()=>{s(!1)},[]),p=(0,U.useCallback)(()=>{c===!1?i.set({showSyncErrorModal:!0}):c&&a===Z.DiabetesType.Type2?s(!0):n&&n(),l(void 0)},[i,c,a,n]);return(0,G.jsxs)(G.Fragment,{children:[(0,G.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,G.jsx)(u3,{title:r(`modal_diabetes2_title`),isVisible:o,message:r(`modal_diabetes2_body`),onModalHide:n,buttons:[{title:r(`button_close`),onPress:f}]}),(0,G.jsx)(t7,{})]})});H(),J0();function Fvn(){let{t:e}=Sq(),{COLORS:t}=Y(),{bottom:n}=V0(),{modalStoreActions:r}=z5(),{colorScheme:i}=g2(),a=C2(i),[o,s]=(0,U.useState)(!1),[c,l]=(0,U.useState)(!1),[u,d]=(0,U.useState)(!1),[f,p]=(0,U.useState)(!1),[m,h]=(0,U.useState)(!1),[g,_]=(0,U.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,U.useMemo)(()=>v?new Date(v):void 0,[v]),w=(0,U.useMemo)(()=>y===Z.DiabetesType.Type1?`type_of_diabetes_type1`:`type_of_diabetes_type2`,[y]),T=(0,U.useCallback)(async e=>{e!==S&&_(await k8.postUserSettings({height:e})),d(!1)},[S]),E=(0,U.useCallback)(async e=>{e!==x&&_(await k8.postUserSettings({weight:e})),p(!1)},[x]),D=(0,U.useMemo)(()=>{if(S===void 0)return 0;let e=Math.round(S*10)/10;return jvn.indexOf(e.toString())},[S]),O=(0,U.useMemo)(()=>{if(x===void 0)return 0;let e=Math.round(x*10)/10;return Mvn.indexOf(e.toString())},[x]),k=async e=>{e.toISOString()!==v&&_(await k8.postUserSettings({birthday:e.toISOString()})),h(!1)},A=(0,U.useCallback)(()=>{g===!1&&r.set({showSyncErrorModal:!0}),_(void 0)},[r,g]),ee=(0,U.useCallback)(()=>{A()},[A]);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(V,{children:(0,G.jsxs)(Y4.Container,{children:[(0,G.jsx)(Y4,{title:e(`my_profile_birth`),value:C?C.toLocaleDateString():`-`,testID:`date-of-birth`,onPress:()=>{h(!0)}}),(0,G.jsx)(Y4,{title:e(`my_profile_diabetes_type`),value:e(w),testID:`diabetes-type`,onPress:()=>{s(!0)}}),(0,G.jsx)(Y4,{title:e(`my_profile_sex`),testID:`biologicalSex`,value:b?_vt[b]():`-`,onPress:()=>{l(!0)}}),(0,G.jsx)(Y4,{title:e(`my_profile_height`),value:`${S??`-`} cm`,testID:`height`,onPress:()=>{d(!0)}}),(0,G.jsx)(Y4,{title:e(`my_profile_weight`),value:`${x??`-`} kg`,testID:`weight`,onPress:()=>{p(!0)}})]})}),Eq?(0,G.jsx)(Vpn,{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:Wpn,customCancelButtonIOS:Gpn,pickerContainerStyleIOS:{backgroundColor:t.iosKeyboardPicker},modalStyleIOS:{paddingBottom:n},themeVariant:a,isDarkModeEnabled:a===`dark`,onHide:ee,pickerStyleIOS:{alignSelf:`center`}}):(0,G.jsx)(Avn,{isVisible:m,initialValue:C??new Date,onConfirm:k,onCancel:()=>{h(!1)},onModalHide:ee}),(0,G.jsx)(Pvn,{isVisible:o,onCancel:()=>{s(!1)},onModalHide:A}),(0,G.jsx)(Nvn,{isVisible:c,onCancel:()=>{l(!1)},onModalHide:A}),(0,G.jsx)(Q5,{isVisible:u,items:jvn,onConfirm:T,onCancel:()=>{d(!1)},initialScrollIndex:D,onModalHide:A,testID:`height_wheel_picker`}),(0,G.jsx)(Q5,{isVisible:f,items:Mvn,onConfirm:E,onCancel:()=>{p(!1)},initialScrollIndex:O,onModalHide:A,testID:`weight_wheel_picker`}),(0,G.jsx)(t7,{onModalHide:()=>{_(void 0)}})]})}var Ivn=f7(Fvn);H();function Lvn(){let{t:e}=Sq();return(0,G.jsxs)(ds,{testID:`profile-screen-scroll`,style:Rvn.scrollView,contentContainerStyle:Rvn.contentContainer,children:[(0,G.jsx)(Y4,{title:e(`my_profile_account`),testID:`first-name`,renderRightSlot:()=>(0,G.jsx)(K4,{}),onPress:()=>{window.location.href=`/account`}}),(0,G.jsx)(Ivn,{})]})}var Rvn=z.create({scrollView:{paddingHorizontal:16},contentContainer:{paddingVertical:32,flexGrow:1,gap:24}});H(),new Df(vi.RNDeviceInfo);var zvn=c({getBaseOs:()=>oyn,getBatteryLevel:()=>nyn,getBatteryLevelSync:()=>ryn,getFreeDiskStorage:()=>lyn,getFreeDiskStorageSync:()=>uyn,getInstallReferrer:()=>Xvn,getInstallReferrerSync:()=>Hvn,getMaxMemory:()=>dyn,getMaxMemorySync:()=>Vvn,getPowerState:()=>myn,getPowerStateSync:()=>hyn,getTotalDiskCapacity:()=>syn,getTotalDiskCapacitySync:()=>cyn,getTotalMemory:()=>pyn,getTotalMemorySync:()=>Kvn,getUsedMemory:()=>fyn,getUsedMemorySync:()=>qvn,getUserAgent:()=>Zvn,getUserAgentSync:()=>Wvn,isAirplaneMode:()=>ayn,isAirplaneModeSync:()=>Uvn,isBatteryCharging:()=>Qvn,isBatteryChargingSync:()=>$vn,isCameraPresent:()=>eyn,isCameraPresentSync:()=>tyn,isLocationEnabled:()=>iyn,isLocationEnabledSync:()=>Gvn}),A9,j9,Bvn,M9,N9,Vvn,Hvn,Uvn,Wvn,Gvn,Kvn,qvn,Jvn,Yvn,Xvn,Zvn,Qvn,$vn,eyn,tyn,nyn,ryn,iyn,ayn,oyn,syn,cyn,lyn,uyn,dyn,fyn,pyn,myn,hyn,gyn=o((()=>{H(),A9=new Df(vi.RNDeviceInfo),j9=!1,Bvn=-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}},Vvn=()=>window.performance&&window.performance.memory?window.performance.memory.jsHeapSizeLimit:-1,Hvn=()=>document.referrer,Uvn=()=>!!navigator.onLine,Wvn=()=>window.navigator.userAgent,Gvn=()=>!!navigator.geolocation,Kvn=()=>navigator.deviceMemory?navigator.deviceMemory*1e9:-1,qvn=()=>window.performance&&window.performance.memory?window.performance.memory.usedJSHeapSize:-1,Jvn=()=>{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;Bvn=t,M9=N9(e),A9.emit(`RNDeviceInfo_batteryLevelDidChange`,t),t<.2&&A9.emit(`RNDeviceInfo_batteryLevelIsLow`,t)})})},Yvn=()=>{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},Jvn(),Xvn=async()=>Hvn(),Zvn=async()=>Wvn(),Qvn=async()=>navigator.getBattery?navigator.getBattery().then(e=>e.charging):!1,$vn=()=>j9,eyn=async()=>navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices?navigator.mediaDevices.enumerateDevices().then(e=>!!e.find(e=>e.kind===`videoinput`)):!1,tyn=()=>(console.log(`[react-native-device-info] isCameraPresentSync not supported - please use isCameraPresent`),!1),nyn=async()=>navigator.getBattery?navigator.getBattery().then(e=>e.level):-1,ryn=()=>Bvn,iyn=async()=>Gvn(),ayn=async()=>Uvn(),oyn=async()=>Yvn(),syn=async()=>navigator.storage&&navigator.storage.estimate?navigator.storage.estimate().then(({quota:e})=>e):-1,cyn=()=>(console.log(`[react-native-device-info] getTotalDiskCapacitySync not supported - please use getTotalDiskCapacity`),-1),lyn=async()=>navigator.storage&&navigator.storage.estimate?navigator.storage.estimate().then(({quota:e,usage:t})=>e-t):-1,uyn=()=>(console.log(`[react-native-device-info] getFreeDiskStorageSync not supported - please use getFreeDiskStorage`),-1),dyn=async()=>Vvn(),fyn=async()=>qvn(),pyn=async()=>Kvn(),myn=async()=>navigator.getBattery?navigator.getBattery().then(e=>N9(e)):{},hyn=()=>M9}));H();var _yn=vi.RNDeviceInfo;if((B.OS===`web`||B.OS===`dom`)&&(_yn=(gyn(),d(zvn))),!_yn&&(B.OS===`android`||B.OS===`ios`||B.OS===`web`||B.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 $=_yn;H();var P9={};function vyn(e,t,n){let r={};return e.filter(e=>B.OS==e).forEach(e=>r[e]=t),B.select({...r,default:n})}function yyn({getter:e,supportedPlatforms:t,defaultValue:n,memoKey:r}){if(r&&P9[r]!=null)return P9[r];{let i=vyn(t,e,()=>n)();return r&&(P9[r]=i),i}}async function byn({getter:e,supportedPlatforms:t,defaultValue:n,memoKey:r}){if(r&&P9[r]!=null)return P9[r];{let i=await vyn(t,e,()=>Promise.resolve(n))();return r&&(P9[r]=i),i}}function F9({syncGetter:e,...t}){return[(...e)=>byn({...t,getter:()=>t.getter(...e)}),(...n)=>yyn({...t,getter:()=>e(...n)})]}H();var[xyn,Syn]=F9({memoKey:`uniqueId`,supportedPlatforms:[`android`,`ios`,`windows`],getter:()=>$.getUniqueId(),syncGetter:()=>$.getUniqueIdSync(),defaultValue:`unknown`}),[Cyn,wyn]=F9({memoKey:`instanceId`,supportedPlatforms:[`android`],getter:()=>$.getInstanceId(),syncGetter:()=>$.getInstanceIdSync(),defaultValue:`unknown`}),[Tyn,Eyn]=F9({memoKey:`serialNumber`,supportedPlatforms:[`android`,`windows`],getter:()=>$.getSerialNumber(),syncGetter:()=>$.getSerialNumberSync(),defaultValue:`unknown`}),[Dyn,Oyn]=F9({memoKey:`androidId`,supportedPlatforms:[`android`],getter:()=>$.getAndroidId(),syncGetter:()=>$.getAndroidIdSync(),defaultValue:`unknown`}),[kyn,Ayn]=F9({supportedPlatforms:[`android`,`ios`,`windows`],getter:()=>$.getIpAddress(),syncGetter:()=>$.getIpAddressSync(),defaultValue:`unknown`}),[jyn,Myn]=F9({supportedPlatforms:[`android`,`windows`,`web`],getter:()=>$.isCameraPresent(),syncGetter:()=>$.isCameraPresentSync(),defaultValue:!1}),[Nyn,Pyn]=F9({memoKey:`manufacturer`,supportedPlatforms:[`android`,`ios`,`windows`],getter:()=>B.OS==`ios`?Promise.resolve(`Apple`):$.getSystemManufacturer(),syncGetter:()=>B.OS==`ios`?`Apple`:$.getSystemManufacturerSync(),defaultValue:`unknown`}),Fyn=()=>yyn({defaultValue:`unknown`,supportedPlatforms:[`ios`,`android`,`windows`],memoKey:`systemName`,getter:()=>B.select({ios:$.systemName,android:`Android`,windows:`Windows`,default:`unknown`})}),Iyn=()=>yyn({defaultValue:`unknown`,getter:()=>$.systemVersion,supportedPlatforms:[`android`,`ios`,`windows`],memoKey:`systemVersion`}),[Lyn,Ryn]=F9({memoKey:`buildId`,supportedPlatforms:[`android`,`ios`,`windows`],getter:()=>$.getBuildId(),syncGetter:()=>$.getBuildIdSync(),defaultValue:`unknown`}),[zyn,Byn]=F9({memoKey:`apiLevel`,supportedPlatforms:[`android`],getter:()=>$.getApiLevel(),syncGetter:()=>$.getApiLevelSync(),defaultValue:-1}),[Vyn,Hyn]=F9({memoKey:`installerPackageName`,supportedPlatforms:[`android`,`windows`,`ios`],getter:()=>$.getInstallerPackageName(),syncGetter:()=>$.getInstallerPackageNameSync(),defaultValue:`unknown`}),[Uyn,Wyn]=F9({supportedPlatforms:[`android`,`ios`,`windows`],getter:()=>$.getDeviceName(),syncGetter:()=>$.getDeviceNameSync(),defaultValue:`unknown`}),[Gyn,Kyn]=F9({supportedPlatforms:[`android`,`ios`,`windows`,`web`],getter:()=>$.getUsedMemory(),syncGetter:()=>$.getUsedMemorySync(),defaultValue:-1}),[qyn,Jyn]=F9({supportedPlatforms:[`android`,`ios`,`windows`],getter:()=>$.getFontScale(),syncGetter:()=>$.getFontScaleSync(),defaultValue:-1}),[Yyn,Xyn]=F9({memoKey:`bootloader`,supportedPlatforms:[`android`],getter:()=>$.getBootloader(),syncGetter:()=>$.getBootloaderSync(),defaultValue:`unknown`}),[Zyn,Qyn]=F9({getter:()=>$.getDevice(),syncGetter:()=>$.getDeviceSync(),defaultValue:`unknown`,memoKey:`device`,supportedPlatforms:[`android`]}),[$yn,ebn]=F9({memoKey:`display`,supportedPlatforms:[`android`],getter:()=>$.getDisplay(),syncGetter:()=>$.getDisplaySync(),defaultValue:`unknown`}),[tbn,nbn]=F9({memoKey:`fingerprint`,supportedPlatforms:[`android`],getter:()=>$.getFingerprint(),syncGetter:()=>$.getFingerprintSync(),defaultValue:`unknown`}),[rbn,ibn]=F9({memoKey:`hardware`,supportedPlatforms:[`android`],getter:()=>$.getHardware(),syncGetter:()=>$.getHardwareSync(),defaultValue:`unknown`}),[abn,obn]=F9({memoKey:`host`,supportedPlatforms:[`android`,`windows`],getter:()=>$.getHost(),syncGetter:()=>$.getHostSync(),defaultValue:`unknown`}),[sbn,cbn]=F9({memoKey:`hostNames`,supportedPlatforms:[`windows`],getter:()=>$.getHostNames(),syncGetter:()=>$.getHostNamesSync(),defaultValue:[]}),[lbn,ubn]=F9({memoKey:`product`,supportedPlatforms:[`android`],getter:()=>$.getProduct(),syncGetter:()=>$.getProductSync(),defaultValue:`unknown`}),[dbn,fbn]=F9({memoKey:`tags`,supportedPlatforms:[`android`],getter:()=>$.getTags(),syncGetter:()=>$.getTagsSync(),defaultValue:`unknown`}),[pbn,mbn]=F9({memoKey:`type`,supportedPlatforms:[`android`],getter:()=>$.getType(),syncGetter:()=>$.getTypeSync(),defaultValue:`unknown`}),[hbn,gbn]=F9({memoKey:`baseOs`,supportedPlatforms:[`android`,`web`,`windows`],getter:()=>$.getBaseOs(),syncGetter:()=>$.getBaseOsSync(),defaultValue:`unknown`}),[_bn,vbn]=F9({memoKey:`previewSdkInt`,supportedPlatforms:[`android`],getter:()=>$.getPreviewSdkInt(),syncGetter:()=>$.getPreviewSdkIntSync(),defaultValue:-1}),[ybn,bbn]=F9({memoKey:`securityPatch`,supportedPlatforms:[`android`],getter:()=>$.getSecurityPatch(),syncGetter:()=>$.getSecurityPatchSync(),defaultValue:`unknown`}),[xbn,Sbn]=F9({memoKey:`codeName`,supportedPlatforms:[`android`],getter:()=>$.getCodename(),syncGetter:()=>$.getCodenameSync(),defaultValue:`unknown`}),[Cbn,wbn]=F9({memoKey:`incremental`,supportedPlatforms:[`android`],getter:()=>$.getIncremental(),syncGetter:()=>$.getIncrementalSync(),defaultValue:`unknown`}),[Tbn,Ebn]=F9({memoKey:`emulator`,supportedPlatforms:[`android`,`ios`,`windows`],getter:()=>$.isEmulator(),syncGetter:()=>$.isEmulatorSync(),defaultValue:!1}),[Dbn,Obn]=F9({supportedPlatforms:[`android`,`ios`,`windows`],getter:()=>$.isPinOrFingerprintSet(),syncGetter:()=>$.isPinOrFingerprintSetSync(),defaultValue:!1}),[kbn,Abn]=F9({supportedPlatforms:[`android`],getter:()=>$.hasGms(),syncGetter:()=>$.hasGmsSync(),defaultValue:!1}),[jbn,Mbn]=F9({supportedPlatforms:[`android`],getter:()=>$.hasHms(),syncGetter:()=>$.hasHmsSync(),defaultValue:!1}),[Nbn,Pbn]=F9({memoKey:`firstInstallTime`,supportedPlatforms:[`android`,`ios`,`windows`],getter:()=>$.getFirstInstallTime(),syncGetter:()=>$.getFirstInstallTimeSync(),defaultValue:-1}),[Fbn,Ibn]=F9({memoKey:`installReferrer`,supportedPlatforms:[`android`,`windows`,`web`],getter:()=>$.getInstallReferrer(),syncGetter:()=>$.getInstallReferrerSync(),defaultValue:`unknown`}),[Lbn,Rbn]=F9({memoKey:`lastUpdateTime`,supportedPlatforms:[`android`],getter:()=>$.getLastUpdateTime(),syncGetter:()=>$.getLastUpdateTimeSync(),defaultValue:-1}),[zbn,Bbn]=F9({memoKey:`startupTime`,supportedPlatforms:[`android`,`ios`],getter:()=>$.getStartupTime(),syncGetter:()=>$.getStartupTimeSync(),defaultValue:-1}),[Vbn,Hbn]=F9({supportedPlatforms:[`android`,`ios`],getter:()=>$.getCarrier(),syncGetter:()=>$.getCarrierSync(),defaultValue:`unknown`}),[Ubn,Wbn]=F9({memoKey:`totalMemory`,supportedPlatforms:[`android`,`ios`,`windows`,`web`],getter:()=>$.getTotalMemory(),syncGetter:()=>$.getTotalMemorySync(),defaultValue:-1}),[Gbn,Kbn]=F9({memoKey:`maxMemory`,supportedPlatforms:[`android`,`windows`,`web`],getter:()=>$.getMaxMemory(),syncGetter:()=>$.getMaxMemorySync(),defaultValue:-1}),[qbn,Jbn]=F9({supportedPlatforms:[`android`,`ios`,`windows`,`web`],getter:()=>$.getTotalDiskCapacity(),syncGetter:()=>$.getTotalDiskCapacitySync(),defaultValue:-1}),[Ybn,Xbn]=F9({supportedPlatforms:[`android`,`ios`,`windows`,`web`],getter:(e=`total`)=>B.OS===`ios`?$.getFreeDiskStorage(e):$.getFreeDiskStorage(),syncGetter:(e=`total`)=>B.OS===`ios`?$.getFreeDiskStorageSync(e):$.getFreeDiskStorageSync(),defaultValue:-1}),[Zbn,Qbn]=F9({supportedPlatforms:[`android`,`ios`,`windows`,`web`],getter:()=>$.getBatteryLevel(),syncGetter:()=>$.getBatteryLevelSync(),defaultValue:-1}),[$bn,exn]=F9({supportedPlatforms:[`ios`,`android`,`windows`,`web`],getter:()=>$.getPowerState(),syncGetter:()=>$.getPowerStateSync(),defaultValue:{}}),[txn,nxn]=F9({supportedPlatforms:[`android`,`ios`,`windows`,`web`],getter:()=>$.isBatteryCharging(),syncGetter:()=>$.isBatteryChargingSync(),defaultValue:!1}),[rxn,ixn]=F9({supportedPlatforms:[`android`,`web`],getter:()=>$.isAirplaneMode(),syncGetter:()=>$.isAirplaneModeSync(),defaultValue:!1}),[axn,oxn]=F9({memoKey:`_supportedAbis`,supportedPlatforms:[`android`,`ios`,`windows`],getter:()=>$.getSupportedAbis(),syncGetter:()=>$.getSupportedAbisSync(),defaultValue:[]}),[sxn,cxn]=F9({memoKey:`_supported32BitAbis`,supportedPlatforms:[`android`],getter:()=>$.getSupported32BitAbis(),syncGetter:()=>$.getSupported32BitAbisSync(),defaultValue:[]}),[lxn,uxn]=F9({memoKey:`_supported64BitAbis`,supportedPlatforms:[`android`],getter:()=>$.getSupported64BitAbis(),syncGetter:()=>$.getSupported64BitAbisSync(),defaultValue:[]}),[dxn,fxn]=F9({supportedPlatforms:[`android`],getter:()=>$.getSystemAvailableFeatures(),syncGetter:()=>$.getSystemAvailableFeaturesSync(),defaultValue:[]}),[pxn,mxn]=F9({supportedPlatforms:[`android`,`ios`,`web`],getter:()=>$.isLocationEnabled(),syncGetter:()=>$.isLocationEnabledSync(),defaultValue:!1}),[hxn,gxn]=F9({supportedPlatforms:[`android`,`ios`],getter:()=>$.isHeadphonesConnected(),syncGetter:()=>$.isHeadphonesConnectedSync(),defaultValue:!1}),[_xn,vxn]=F9({supportedPlatforms:[`android`,`ios`],getter:()=>$.isWiredHeadphonesConnected(),syncGetter:()=>$.isWiredHeadphonesConnectedSync(),defaultValue:!1}),[yxn,bxn]=F9({supportedPlatforms:[`android`,`ios`],getter:()=>$.isBluetoothHeadphonesConnected(),syncGetter:()=>$.isBluetoothHeadphonesConnectedSync(),defaultValue:!1}),[xxn,Sxn]=F9({supportedPlatforms:[`windows`],getter:()=>$.isMouseConnected(),syncGetter:()=>$.isMouseConnectedSync(),defaultValue:!1}),[Cxn,wxn]=F9({supportedPlatforms:[`windows`],getter:()=>$.isKeyboardConnected(),syncGetter:()=>$.isKeyboardConnectedSync(),defaultValue:!1}),[Txn,Exn]=F9({supportedPlatforms:[`android`],getter:()=>$.getSupportedMediaTypeList(),syncGetter:()=>$.getSupportedMediaTypeListSync(),defaultValue:[]}),[Dxn,Oxn]=F9({supportedPlatforms:[`android`,`ios`],getter:()=>$.getAvailableLocationProviders(),syncGetter:()=>$.getAvailableLocationProvidersSync(),defaultValue:{}}),[kxn,Axn]=F9({supportedPlatforms:[`ios`],getter:()=>$.getBrightness(),syncGetter:()=>$.getBrightnessSync(),defaultValue:-1});new Df(vi.RNDeviceInfo),H();var jxn=()=>{let{t:e}=Sq(),{COLORS:t}=Y(),{navigate:n}=A$(),r=(0,U.useCallback)(async()=>{if(Tq)n(F5.SupportContact);else{let e=`App version: ${c8}\n${Fyn()} version: ${Iyn()}`;await Lre.openURL(`mailto:support@hedia.com?subject=Hedia support&body=${e}`)}},[n]);return(0,G.jsxs)(ds,{contentContainerStyle:Mxn.wrapper,children:[(0,G.jsx)(Q,{style:[Mxn.title,{color:t.labelPrimary}],children:e(`support_title`)}),(0,G.jsxs)(V,{style:Mxn.buttons,children:[(0,G.jsx)(U4,{title:e(`button_email`),onPress:r,testID:`send_email_button`}),(0,G.jsx)(U4,{title:e(`button_support_page`),onPress:()=>{n(F5.SupportWebView)},testID:`open_support_page_button`,type:H4.Secondary}),(0,G.jsx)(U4,{title:e(`button_instructions`),onPress:()=>{u8(l8.SettingsIFU),n(F5.IFU)},testID:`open_ifu_page_button`,type:H4.Secondary})]})]})},Mxn=z.create({wrapper:{flex:1,justifyContent:`center`,paddingHorizontal:16},title:{...X.Poppins.bold_2XL,marginBottom:48,textAlign:`center`},buttons:{gap:16}});H();var Nxn=()=>{let{t:e}=Sq(),{COLORS:t}=Y(),{colorScheme:n,setColorScheme:r}=g2(),i=M5(),{bottomWithScroll:a}=Q4(),o=(0,U.useCallback)(e=>{let t=`colorScheme-${e.toLowerCase()}`;return h2[e]===n?`${t}-selected`:t},[n]),s=(0,U.useCallback)(e=>{h2[e]!==n&&r(h2[e])},[n,r]);return(0,G.jsxs)(ds,{contentContainerStyle:[I9.scrollView,{paddingTop:i+16,paddingBottom:a}],children:[(0,G.jsxs)(Y4.Container,{children:[(0,G.jsx)(Y4,{title:e(`theme_system`),renderRightSlot:()=>(0,G.jsx)(V,{style:I9.checkmarkContainer,children:h2.System===n?(0,G.jsx)(G4,{width:24,height:24}):null}),onPress:()=>{s(`System`)},testID:o(`System`),displayType:J4.ListItem}),(0,G.jsx)(Y4,{title:e(`theme_dark`),renderRightSlot:()=>(0,G.jsx)(V,{style:I9.checkmarkContainer,children:h2.Dark===n?(0,G.jsx)(G4,{width:24,height:24}):null}),onPress:()=>{s(`Dark`)},testID:o(`Dark`),displayType:J4.ListItem}),(0,G.jsx)(Y4,{title:e(`theme_light`),renderRightSlot:()=>(0,G.jsx)(V,{style:I9.checkmarkContainer,children:h2.Light===n?(0,G.jsx)(G4,{width:24,height:24}):null}),onPress:()=>{s(`Light`)},testID:o(`Light`),displayType:J4.ListItem})]}),(0,G.jsx)(Q,{style:[I9.description,{color:t.labelSecondary}],testID:`settings-colorScheme-hint`,children:e(`theme_subtitle`)})]})},I9=z.create({scrollView:{paddingHorizontal:16,flexGrow:1},checkmarkContainer:{width:24,height:24},description:{...X.Poppins.regular_SM,margin:16}});H();var Pxn=()=>{let{COLORS:e}=Y(),{fontScale:t}=$p(),n=t.toFixed(3);return(0,G.jsxs)(V,{style:{backgroundColor:e.textWarning,borderRadius:16,padding:8},children:[(0,G.jsx)(Q,{style:[Fxn.text,{color:e.bgPrimary}],children:`Font scale: ${n}`}),(0,G.jsx)(Q,{style:[Fxn.textBold,{color:e.bgPrimary}],children:_q.HEDIA_SERVER_BASE_URL})]})},Fxn=z.create({text:{...X.Poppins.regular_Base,textAlign:`center`},textBold:{...X.Poppins.semiBold_Base,textAlign:`center`}});H();function Ixn(){let{t:e}=Sq(),{COLORS:t}=Y(),n=A$(),[r,i]=(0,U.useState)(!0),a=(0,U.useCallback)(()=>{u8(l8.SettingsProfile),n.navigate(F5.Profile)},[n]),o=(0,U.useCallback)(()=>{u8(l8.SettingsGlucose),n.navigate(F5.GlucoseSettings)},[n]),s=(0,U.useCallback)(()=>{u8(l8.SettingsInsulin),n.navigate(F5.InsulinSettingsStack,{screen:F5.InsulinSettings})},[n]),c=(0,U.useCallback)(()=>{u8(l8.SettingsActivity),n.navigate(F5.ActivitySettings)},[n]),l=(0,U.useCallback)(()=>{u8(l8.SettingsSupport),n.navigate(F5.Support)},[n]),u=(0,U.useCallback)(()=>{u8(l8.SettingsLegal),n.navigate(F5.Legal)},[n]);return(0,G.jsxs)(ds,{testID:`scroll-settings`,style:L9.scrollView,contentContainerStyle:L9.scrollViewContentContainer,contentInsetAdjustmentBehavior:`automatic`,children:[(0,G.jsx)(Y4,{title:e(`settings_card_my_profile`),testID:`edit-profile-button`,renderRightSlot:()=>(0,G.jsx)(K4,{}),onPress:a}),(0,G.jsxs)(Y4.Container,{children:[(0,G.jsx)(Y4,{title:e(`settings_card_glucose`),testID:`settings-glucose`,onPress:o,renderRightSlot:()=>(0,G.jsx)(K4,{})}),(0,G.jsx)(Y4,{title:e(`settings_card_insulin_settings`),testID:`settings-insulin`,onPress:s,renderRightSlot:()=>(0,G.jsx)(K4,{})}),(0,G.jsx)(Y4,{title:e(`settings_card_physical_activity`),testID:`settings-activity`,onPress:c,renderRightSlot:()=>(0,G.jsx)(K4,{})})]}),(0,G.jsxs)(Y4.Container,{children:[(0,G.jsx)(Y4,{title:e(`settings_support`),testID:`settings-support`,onPress:l,renderRightSlot:()=>(0,G.jsx)(K4,{})}),(0,G.jsx)(Y4,{title:e(`settings_card_legal`),testID:`settings-legal`,onPress:u,renderRightSlot:()=>(0,G.jsx)(K4,{})})]}),(0,G.jsx)(Jf,{onPress:()=>{i(!r)},style:L9.versionContainer,children:(0,G.jsx)(Q,{style:[L9.versionText,{color:t.labelSecondary}],children:r?c8:`(${tin})`})}),_q.IS_PRODUCTION!==`true`&&(0,G.jsx)(V,{children:(0,G.jsx)(Pxn,{})})]})}var L9=z.create({scrollView:{flex:1,paddingHorizontal:16},scrollViewContentContainer:{paddingVertical:32,flexGrow:1,gap:24},versionContainer:{alignItems:`center`,marginTop:`auto`},versionText:{...X.Poppins.regular_Base}});H();function Lxn(){let{COLORS:e}=Y();return(0,G.jsx)(V,{style:[Rxn.separator,{backgroundColor:e.divider}]})}var Rxn=z.create({separator:{height:1}}),R9=o3(Z.CONSTANTS.INSULIN_TO_CARBS_RATIO_MIN,Z.CONSTANTS.INSULIN_TO_CARBS_RATIO_MAX),z9=function(e){return e.DividendNumber=`109`,e.ExampleInsulinSensitivity=`2.2`,e}({}),zxn=function(e){return e.DividendNumber=`1960`,e.ExampleInsulinSensitivity=`39.2`,e}({}),Bxn=o3(Z.CONSTANTS.INSULIN_SENSITIVITY_MIN,Z.CONSTANTS.INSULIN_SENSITIVITY_MAX),Vxn=a3(5,393);H();var Hxn=({onPress:e,isVisible:t})=>{let{t:n}=Sq(),{COLORS:r}=Y();return(0,G.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,G.jsx)(Q,{testID:`insulin_settings_modal_carb_ratio_body`,style:[Uxn.bodyText,{color:r.labelSecondary}],children:n(`insulin_settings_modal_carb_ratio_body`)}),(0,G.jsx)(Q,{testID:`insulin_settings_modal_carb_ratio_example`,style:{color:r.labelSecondary},children:n(`insulin_settings_modal_carb_example_body`)})]})},Uxn=z.create({bodyText:{marginTop:12,marginBottom:16}});H();var Wxn=({glucoseUnit:e,onPress:t,isVisible:n})=>{let{t:r}=Sq(),{COLORS:i}=Y(),{text:a}=L8(e),o=e===Z.BloodGlucoseUnit.MMOL_L?z9.DividendNumber:zxn.DividendNumber,s=e===Z.BloodGlucoseUnit.MMOL_L?z9.ExampleInsulinSensitivity:zxn.ExampleInsulinSensitivity;return(0,G.jsxs)(u3,{title:r(`modal_insulin_seneitivity_title`),isVisible:n,enableScroll:!0,buttons:[{title:r(`button_close`),onPress:t,testID:`close-button`}],children:[(0,G.jsx)(Q,{testID:`insulin_sensitivity_modal_body`,style:[Gxn.bodyText,{color:i.labelSecondary}],children:r(`insulin_sensitivity_modal_body`,{dividerNumber:o})}),(0,G.jsx)(Q,{testID:`insulin_sensitivity_modal_example`,style:{color:i.labelSecondary},children:r(`insulin_sensitivity_modal_example`,{dividerNumber:o,displayResult:s,displayUnit:a})})]})},Gxn=z.create({bodyText:{marginTop:12,marginBottom:16}});H();var Kxn=()=>{let{t:e}=Sq(),{bloodGlucoseUnits:t}=s7(),n=k8.glucoseUnit??t;if(n===void 0)throw Error(`[HelpCalculatingSection::render] glucoseUnit must be defined.`);let[r,i]=(0,U.useState)(!1),[a,o]=(0,U.useState)(!1),s=n===Z.BloodGlucoseUnit.MMOL_L?z9.DividendNumber:zxn.DividendNumber;return(0,G.jsxs)(V,{children:[(0,G.jsx)(d3,{title:e(`insulin_settings_learn_more_title`)}),(0,G.jsxs)(Y4.Container,{children:[(0,G.jsx)(Y4,{testID:`info-insulin-carbs-ratio`,title:e(`insulin_settings_learn_more_carb_ratio`),onPress:()=>{o(!0)},displayType:J4.ListItem}),(0,G.jsx)(Y4,{testID:`info-insulin-sensitivity-${s}`,title:e(`insulin_settings_learn_more_sensitivity`),onPress:()=>{i(!0)},displayType:J4.ListItem})]}),(0,G.jsx)(Wxn,{onPress:()=>{i(!1)},glucoseUnit:n,isVisible:r}),(0,G.jsx)(Hxn,{onPress:()=>{o(!1)},isVisible:a})]})};H();var qxn=({withLockedSettings:e})=>{let{t}=Sq(),{COLORS:n}=Y(),{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,U.useState)(!1),[l,u]=(0,U.useState)(!1),[d,f]=(0,U.useState)(void 0),[p,m]=(0,U.useState)(0),[h,g]=(0,U.useState)(!1),[_,v]=(0,U.useState)(),y=(0,U.useCallback)(async e=>{let t=z8(e,i,Z.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,U.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,U.useMemo)(()=>[{title:t(`table_variable_insulin_time`),subtitle:t(`table_variable_time_unit`),scale:S2.s2},{title:t(`table_variable_insulin_sensitivity`),subtitle:t(`table_variable_insulin_sensitivity_unit`,{displayUnit:x}),scale:S2.s2},{title:t(`table_variable_insulin_carb`),subtitle:t(`table_variable_insulin_carb_unit`),scale:S2.s2}],[x,t]),C=(0,U.useMemo)(()=>i===Z.BloodGlucoseUnit.MG_DL?Vxn:Bxn,[i]),w=(0,U.useMemo)(()=>{let e=a.parameterIntervals[p].insulinSensitivity,t=B8(e,Z.BloodGlucoseUnit.MMOL_L,i);return C.findIndex(e=>e===t)},[C,i,a.parameterIntervals,p]),T=(0,U.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`,svn(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,U.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,U.useCallback)(()=>{g(!1)},[]),ee=(0,U.useCallback)(async e=>{let t={...a,use:e?Z.Usage.Intervals:Z.Usage.Overall,updatedAt:new Date().toISOString()},n=await k8.postUserSettings({parameters:t});r.set({showSyncErrorModal:!n})},[a,r]),te=(0,U.useCallback)(()=>{d===!1&&r.set({showSyncErrorModal:!0}),f(void 0)},[r,d]);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(y9,{columnDisposition:[2,3,3],children:[(0,G.jsx)(f3,{testID:`daily-interval-switch`,title:t(`variable_insulin_settings_title`),message:t(`variable_insulin_settings_body`),value:o===Z.Usage.Intervals,onValueChange:e(ee),style:B9.switchContainer}),(0,G.jsx)(_9,{disabled:o!==Z.Usage.Intervals,children:S.map((e,t)=>(0,G.jsxs)(x9,{style:t===0&&B9.firstTableCell,children:[(0,G.jsx)(Q,{maxFontSizeMultiplier:e.scale,style:[B9.tableHeaderTitle,{color:n.labelPrimary},t!==0&&B9.tableHeaderTitleWithMargin],children:e.title}),(0,G.jsx)(Q,{style:[B9.tableSubtitle,{color:n.textTableSecondary}],children:e.subtitle})]},e.title))}),Object.keys(wq).map((t,r)=>(0,G.jsxs)(v9,{disabled:o!==Z.Usage.Intervals,children:[(0,G.jsxs)(b9,{onPress:e(()=>{E(r)}),style:B9.firstTableCell,children:[(0,G.jsx)(Q,{maxFontSizeMultiplier:S2.s2,style:[B9.tableTitle,{color:n.textTableHighlight}],children:a.parameterIntervals[r].startTime}),(0,G.jsx)(Q,{style:[B9.tableSubtitle,{color:n.textTableSecondary}],children:gvt[t]()})]}),(0,G.jsx)(b9,{testID:`${t.toLowerCase()}-insulin`,onPress:e(()=>{D(r)}),children:(0,G.jsx)(Q,{maxFontSizeMultiplier:S2.s2,style:[B9.tableText,{color:n.textTableHighlight}],children:B8(a.parameterIntervals[r].insulinSensitivity,Z.BloodGlucoseUnit.MMOL_L,i)})}),(0,G.jsx)(b9,{testID:`${t.toLowerCase()}-carbs`,onPress:e(()=>{O(r)}),children:(0,G.jsx)(Q,{maxFontSizeMultiplier:S2.s2,style:[B9.tableText,{color:n.textTableHighlight}],children:a.parameterIntervals[r].carbohydrateRatio.toFixed(1)})})]},t))]}),(0,G.jsx)(dvn,{isVisible:h,initialValue:_?.current??new Date,min:_?.min,max:_?.max,onConfirm:k,onCancel:A,onModalHide:te}),(0,G.jsx)(Q5,{isVisible:s,items:C,initialScrollIndex:w,onConfirm:y,onCancel:()=>{c(!1)},onModalHide:te,testID:`insulin_sensitivity_picker`}),(0,G.jsx)(Q5,{isVisible:l,items:R9,initialScrollIndex:T,onConfirm:b,onCancel:()=>{u(!1)},onModalHide:te,testID:`insulin_to_carb_ratio_picker`})]})},B9=z.create({switchContainer:{borderBottomLeftRadius:0,borderBottomRightRadius:0},firstTableCell:{paddingLeft:16,alignItems:`flex-start`,justifyContent:`space-between`,borderLeftWidth:0},tableHeaderTitle:{...X.Poppins.medium_SM,textAlign:`center`},tableHeaderTitleWithMargin:{marginHorizontal:8},tableTitle:{...X.Poppins.medium_Base},tableSubtitle:{...X.Poppins.regular_XS},tableText:{...X.Poppins.medium_Base}}),Jxn=f7(qxn);H();var Yxn={Lantus:()=>xq(`long-acting_insulin_option1`),Basaglar:()=>xq(`long-acting_insulin_option2`),Tuojeo:()=>xq(`long-acting_insulin_option3`),Levemir:()=>xq(`long-acting_insulin_option4`),Tresiba:()=>xq(`long-acting_insulin_option5`),Other:()=>xq(`long-acting_insulin_option6`),None:()=>xq(`long-acting_insulin_option7`)},Xxn=()=>{let{modalStoreActions:e}=z5(),t=M5(),{longActingInsulin:n,treatmentParameters:r}=k8,i=(0,U.useCallback)(async t=>{t!==n&&(await k8.postUserSettings({longActingInsulin:Z.LongActingInsulin[t],parameters:r?{...r,updatedAt:new Date().toISOString()}:void 0})||e.set({showSyncErrorModal:!0}))},[n,r,e]);return(0,G.jsxs)(ds,{testID:`scroll`,contentContainerStyle:[Zxn.scrollView,{paddingTop:t+16}],children:[(0,G.jsx)(Y4.Container,{children:Object.keys(Z.LongActingInsulin).map(e=>(0,G.jsx)(Y4,{title:Yxn[e](),renderRightSlot:()=>(0,G.jsx)(V,{style:Zxn.checkmarkContainer,children:Z.LongActingInsulin[e]===n?(0,G.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,G.jsx)(t7,{})]})},Zxn=z.create({scrollView:{paddingVertical:32,paddingHorizontal:16,flexGrow:1},checkmarkContainer:{width:24,height:24}}),Qxn=f7(Xxn);H();var $xn={Novorapid:()=>xq(`rapid-acting_insulin_option1`),Fiasp:()=>xq(`rapid-acting_insulin_option2`),Humalog:()=>xq(`rapid-acting_insulin_option3`),Apidra:()=>xq(`rapid-acting_insulin_option4`),Other:()=>xq(`rapid-acting_insulin_option5`),None:()=>xq(`rapid-acting_insulin_option6`)},eSn=()=>{let{modalStoreActions:e}=z5(),t=M5(),{fastActingInsulin:n,treatmentParameters:r}=k8,i=(0,U.useCallback)(async t=>{t!==n&&(await k8.postUserSettings({fastActingInsulin:Z.FastActingInsulin[t],parameters:r?{...r,updatedAt:new Date().toISOString()}:void 0})||e.set({showSyncErrorModal:!0}))},[n,r,e]);return(0,G.jsxs)(ds,{testID:`scroll`,contentContainerStyle:[tSn.scrollView,{paddingTop:t+16}],children:[(0,G.jsx)(Y4.Container,{children:Object.keys(Z.FastActingInsulin).map(e=>(0,G.jsx)(Y4,{title:$xn[e](),renderRightSlot:()=>(0,G.jsx)(V,{style:tSn.checkmarkContainer,children:Z.FastActingInsulin[e]===n?(0,G.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,G.jsx)(t7,{})]})},tSn=z.create({scrollView:{paddingVertical:32,paddingHorizontal:16,flexGrow:1},checkmarkContainer:{width:24,height:24}}),nSn=f7(eSn);H();var V9={PenHalf:()=>xq(`treatment_type_option1`),PenWhole:()=>xq(`treatment_type_option2`),Pump:()=>xq(`treatment_type_option3`)},rSn=()=>{let{modalStoreActions:e}=z5(),t=M5(),{injectionMethod:n,treatmentParameters:r}=k8,i=(0,U.useCallback)(async t=>{t!==n&&(await k8.postUserSettings({treatmentType:Z.InjectionMethod[t],parameters:r?{...r,updatedAt:new Date().toISOString()}:void 0})||e.set({showSyncErrorModal:!0}))},[n,r,e]);return(0,G.jsxs)(ds,{testID:`scroll`,contentContainerStyle:[{...iSn.scrollView,paddingTop:t+16}],children:[(0,G.jsx)(Y4.Container,{children:Object.keys(Z.InjectionMethod).map(e=>(0,G.jsx)(Y4,{title:V9[e](),renderRightSlot:()=>(0,G.jsx)(V,{style:iSn.checkmarkContainer,children:Z.InjectionMethod[e]===n?(0,G.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,G.jsx)(t7,{})]})},iSn=z.create({scrollView:{paddingVertical:32,paddingHorizontal:16,flexGrow:1},checkmarkContainer:{width:24,height:24}}),aSn=f7(rSn);H();function oSn({withLockedSettings:e}){let{t}=Sq(),n=A$(),{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,U.useMemo)(()=>V9[R9t(Z.InjectionMethod,r)](),[r]),s=(0,U.useMemo)(()=>i?$xn[i]():`-`,[i]),c=(0,U.useMemo)(()=>a?Yxn[a]():`-`,[a]);return(0,G.jsxs)(V,{children:[(0,G.jsx)(Y4,{title:t(`my_profile_treatment_type`),value:o,testID:`treatment-type`,onPress:e(()=>{n.navigate(F5.TreatmentType)}),renderRightSlot:()=>(0,G.jsx)(K4,{}),style:{marginBottom:24}}),(0,G.jsxs)(Y4.Container,{children:[(0,G.jsx)(Y4,{title:t(`my_profile_rapid-acting_insulin`),value:s,testID:`fast-acting-insulin`,onPress:e(()=>{n.navigate(F5.RapidActingInsulin)}),renderRightSlot:()=>(0,G.jsx)(K4,{})}),(0,G.jsx)(Y4,{title:t(`my_profile_long-acting_insulin`),value:c,testID:`long-acting-insulin`,onPress:e(()=>{n.navigate(F5.LongActingInsulin)}),renderRightSlot:()=>(0,G.jsx)(K4,{})})]})]})}var sSn=f7(oSn);H();var{MMOL_L:H9}=Z.BloodGlucoseUnit,cSn=()=>{let e=A$(),{t}=Sq(),{COLORS:n}=Y(),{modalStoreActions:r}=z5(),{bottomWithScroll:i}=Q4(),a=M5(),{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===Z.Usage.Overall,{text:u}=L8(o),{carbohydrateRatio:d,insulinSensitivity:f}=s.overallParameters,[p,m]=(0,U.useState)(!1),[h,g]=(0,U.useState)(!1),[_,v]=(0,U.useState)(void 0),[y,b]=(0,U.useState)(!1),[x,S]=(0,U.useState)(!1),{areSettingsLocked:C,isPINSet:w,lockSettings:T,unlockSettings:E}=F_n(),[D,O]=(0,U.useState)(!1),[k,A]=(0,U.useState)(!1),ee=(0,U.useCallback)(()=>{C?b(!0):T()},[C,T]);(0,U.useEffect)(()=>{e.setOptions({header:()=>(0,G.jsx)(P5,{title:t(`insulin_settings_navigation`),LeftButton:(0,G.jsx)(H5,{}),RightButton:w?(0,G.jsx)(efn,{onPress:ee,isLocked:C}):void 0,overlay:!0})})},[e,C,w,ee,t]);let te=(0,U.useMemo)(()=>o===H9?Bxn:Vxn,[o]),ne=()=>{m(!0)},re=()=>{g(!0)},ie=(0,U.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,U.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]),M=(0,U.useMemo)(()=>{let e=B8(f,H9,o);return te.findIndex(t=>t===e)},[te,o,f]),ae=(0,U.useMemo)(()=>R9.findIndex(e=>e===d.toFixed(1)),[d]),oe=(0,U.useCallback)(()=>{_===!1&&r.set({showSyncErrorModal:!0}),v(void 0)},[r,_]),N=(0,U.useCallback)(async e=>{let t={...s,use:e?Z.Usage.Overall:Z.Usage.Intervals,updatedAt:new Date().toISOString()},n=await k8.postUserSettings({parameters:t});r.set({showSyncErrorModal:!n})},[s,r]),se=(0,U.useCallback)(()=>{D&&(S(!0),O(!1))},[D,S,O]),P=(0,U.useCallback)(()=>{O(!0),b(!1)},[O,b]),F=(0,U.useCallback)(()=>{E()},[E]),ce=(0,U.useCallback)(e=>w&&C?(...e)=>b(!0):(...t)=>e(...t),[C,w]),le=(0,U.useCallback)(()=>{k&&(A(!1),setTimeout(()=>{e.navigate(F5.ChangePINCode)},500))},[k,e]),ue=s.updatedAt??c;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(ds,{testID:`scroll`,contentContainerStyle:[U9.scrollView,{paddingBottom:i,paddingTop:a+16}],children:[(0,G.jsx)(Q,{style:[U9.updatedAtText,{color:n.labelSecondary}],children:t(`settings_lastEdited`,{date:ue?I8(ue,`d MMM yyyy`):``})}),(0,G.jsx)(sSn,{withLockedSettings:ce}),(0,G.jsx)(V,{style:U9.spacing}),(0,G.jsx)(p9,{}),(0,G.jsx)(V,{style:U9.spacing}),(0,G.jsxs)(Y4.Container,{containerStyle:{backgroundColor:n.bgSecondary,borderColor:n.divider,borderWidth:1},children:[(0,G.jsx)(f3,{testID:`insulin-settings-overall-switch`,title:t(`fixed_insulin_settings_title`),message:t(`fixed_insulin_settings_body`),value:l,onValueChange:ce(N),style:U9.switchContainer}),(0,G.jsx)(Lxn,{}),(0,G.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:ce(()=>l?re():void 0),containerStyle:l?U9.active:U9.inactive,valueStyle:l?{color:n.textTableHighlight}:{color:n.labelSecondary}}),(0,G.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:ce(()=>l?ne():void 0),containerStyle:l?U9.active:U9.inactive,valueStyle:l?{color:n.textTableHighlight}:{color:n.labelSecondary}})]}),(0,G.jsx)(V,{style:U9.spacing}),(0,G.jsx)(Jxn,{withLockedSettings:ce}),(0,G.jsx)(V,{style:U9.spacing}),(0,G.jsx)(Kxn,{})]}),(0,G.jsx)(Q5,{isVisible:p,items:te,initialScrollIndex:M,onConfirm:ie,onCancel:()=>{m(!1)},onModalHide:oe,testID:`insulin_sensitivity_picker`}),(0,G.jsx)(Q5,{isVisible:h,items:R9,initialScrollIndex:ae,onConfirm:j,onCancel:()=>{g(!1)},onModalHide:oe,testID:`insulin_to_carb_ratio_picker`}),(0,G.jsx)(t7,{onModalHide:()=>{v(void 0)}}),(0,G.jsx)(q_n,{isVisible:y,onModalHide:se,onEnterPIN:P,onCancel:()=>b(!1)}),(0,G.jsx)(H_n,{isVisible:x,onClose:()=>S(!1),onModalHide:le,onForgotPIN:()=>{A(!0),S(!1)},onModalHideWithSuccess:F}),(0,G.jsx)(K_n,{})]})},U9=z.create({scrollView:{paddingTop:32,paddingHorizontal:16,flexGrow:1},spacing:{height:32},updatedAtText:{...X.Poppins.regular_SM,textAlign:`center`,marginBottom:24},active:{opacity:1},inactive:{opacity:.5},switchContainer:{borderBottomLeftRadius:0,borderBottomRightRadius:0}}),lSn=f7(cSn),{Navigator:uSn,Screen:W9}=A5(),dSn=()=>{let{t:e}=Sq();return(0,G.jsxs)(uSn,{screenOptions:{...K5,...Q8},children:[(0,G.jsx)(W9,{name:F5.InsulinSettings,component:lSn,options:{header:()=>(0,G.jsx)(P5,{LeftButton:(0,G.jsx)(H5,{}),title:e(`insulin_settings_navigation`),overlay:!0})}}),(0,G.jsx)(W9,{name:F5.TreatmentType,component:aSn,options:{header:()=>(0,G.jsx)(P5,{LeftButton:(0,G.jsx)(H5,{}),title:e(`treatment_type_navigation`),overlay:!0})}}),(0,G.jsx)(W9,{name:F5.RapidActingInsulin,component:nSn,options:{header:()=>(0,G.jsx)(P5,{LeftButton:(0,G.jsx)(H5,{}),title:e(`rapid-acting_insulin_navigation`),overlay:!0})}}),(0,G.jsx)(W9,{name:F5.LongActingInsulin,component:Qxn,options:{header:()=>(0,G.jsx)(P5,{LeftButton:(0,G.jsx)(H5,{}),title:e(`long-acting_insulin_navigation`),overlay:!0})}})]})},{Navigator:fSn,Screen:G9}=A5(),pSn=()=>{let{t:e}=Sq(),{COLORS:t}=Y();return(0,G.jsxs)(fSn,{screenOptions:{...K5,...Q8,headerStyle:{backgroundColor:t.bgNavigationBar}},children:[(0,G.jsx)(G9,{name:F5.Settings,component:Ixn,options:{header:()=>(0,G.jsx)(P5,{LeftButton:(0,G.jsx)(U5,{}),title:e(`settings_navigation`)})}}),(0,G.jsx)(G9,{name:F5.Profile,component:Lvn,options:{header:()=>(0,G.jsx)(P5,{LeftButton:(0,G.jsx)(H5,{}),title:e(`my_profile_navigation`)})}}),(0,G.jsx)(G9,{name:F5.GlucoseSettings,component:_vn,options:{header:()=>(0,G.jsx)(P5,{LeftButton:(0,G.jsx)(H5,{}),title:e(`glucose_navigation`),overlay:!0})}}),(0,G.jsx)(G9,{name:F5.GlucoseUnit,component:xvn,options:{header:()=>(0,G.jsx)(P5,{LeftButton:(0,G.jsx)(H5,{}),title:e(`glucose_unit_navigation`),overlay:!0})}}),(0,G.jsx)(G9,{name:F5.ActivitySettings,component:ovn,options:{header:()=>(0,G.jsx)(P5,{LeftButton:(0,G.jsx)(H5,{}),title:e(`physical_activity_navigation`),overlay:!0})}}),(0,G.jsx)(G9,{name:F5.InsulinSettingsStack,component:dSn,options:{headerShown:!1}}),(0,G.jsx)(G9,{name:F5.Theme,component:Nxn,options:{header:()=>(0,G.jsx)(P5,{LeftButton:(0,G.jsx)(H5,{}),title:e(`navigation_title_theme`),overlay:!0})}}),(0,G.jsx)(G9,{name:F5.Support,component:jxn,options:{header:()=>(0,G.jsx)(P5,{LeftButton:(0,G.jsx)(H5,{}),title:e(`support_navigation`)})}}),(0,G.jsx)(G9,{name:F5.Legal,component:Svn,options:{header:()=>(0,G.jsx)(P5,{LeftButton:(0,G.jsx)(H5,{}),title:e(`legal_navigation`),overlay:!0})}})]})},mSn=e=>!(!e||e.authenticationContextClassReference!==`urn:hedia:acr:elevated`||(Date.now()-Date.parse(e.authenticationTime))/6e4>60),hSn=()=>{let e=A$();return(0,U.useEffect)(()=>{(async()=>{try{mSn(await Den())?e.replace(F5.SettingsStack,{screen:F5.Settings}):window.location.href=`/reauthenticate`}catch{e.goBack()}})()},[e]),(0,G.jsx)(b2,{})};H();function gSn(){return(0,G.jsx)(Hfn,{style:_Sn.iframe,uri:`https://www.hedia.com/contact#contactsupport`})}var _Sn=z.create({iframe:{flex:1}}),{Navigator:vSn,Screen:K9,Group:ySn}=A5(),bSn=()=>{let{t:e}=Sq();return(0,G.jsxs)(vSn,{children:[(0,G.jsxs)(ySn,{screenOptions:{headerShown:!1},children:[(0,G.jsx)(K9,{name:F5.NewCalculationStack,component:N_n}),(0,G.jsx)(K9,{name:F5.SettingsStack,component:pSn})]}),(0,G.jsxs)(ySn,{screenOptions:{...tfn},children:[(0,G.jsx)(K9,{name:F5.CreateFood,component:Vfn}),(0,G.jsx)(K9,{name:F5.IFU,component:Wfn,options:{header:()=>(0,G.jsx)(P5,{LeftButton:(0,G.jsx)(U5,{}),title:e(`IFU_navigation`)})}}),(0,G.jsx)(K9,{name:F5.SupportWebView,component:Xfn,options:{header:()=>(0,G.jsx)(P5,{LeftButton:(0,G.jsx)(U5,{}),title:e(`support_navigation`)})}}),(0,G.jsx)(K9,{name:F5.SupportContact,component:gSn,options:{header:()=>(0,G.jsx)(P5,{LeftButton:(0,G.jsx)(U5,{}),title:e(`support_navigation`)})}}),(0,G.jsx)(K9,{name:F5.ConfirmPINCode,component:hSn,options:{headerShown:!1}})]})]})};H();var xSn=({title:e,subtitle:t,stepChecked:n,onAnimationFinished:r})=>{let{t:i}=Sq(),{COLORS:a}=Y();return(0,U.useEffect)(()=>{r?.()},[r]),(0,G.jsxs)(ds,{contentContainerStyle:q9.container,style:{backgroundColor:a.bgPrimary},children:[(0,G.jsx)(Q,{style:q9.title,children:e}),(0,G.jsx)(Q,{style:[q9.subtitle,{color:a.labelSecondary}],children:t}),(0,G.jsxs)(V,{style:q9.stepsWrapper,children:[(0,G.jsxs)(V,{style:q9.stepContainer,children:[(0,G.jsx)(Q,{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,G.jsx)(G4,{width:24,height:24,color:a.labelPrimary})]}),(0,G.jsxs)(V,{style:q9.stepContainer,children:[(0,G.jsx)(Q,{style:[q9.text,n===2||n===3?{color:a.labelPrimary}:{color:a.labelSecondary}],children:`2. `+i(`overview2`)}),(n===2||n===3)&&(0,G.jsx)(G4,{width:24,height:24,color:a.labelPrimary})]}),(0,G.jsxs)(V,{style:q9.stepContainer,children:[(0,G.jsx)(Q,{style:[q9.text,n===3?{color:a.labelPrimary}:{color:a.labelSecondary}],children:`3. `+i(`overview3`)}),n===3&&(0,G.jsx)(G4,{width:24,height:24,color:a.labelPrimary})]})]})]})},q9=z.create({container:{flex:1,justifyContent:`center`,paddingHorizontal:16},title:{...X.Poppins.bold_4XL,paddingHorizontal:16,marginBottom:2},subtitle:{...X.Poppins.regular_Base,paddingHorizontal:16,marginBottom:32},stepsWrapper:{padding:16,gap:8},stepContainer:{flexDirection:`row`,alignItems:`center`,gap:8},text:{marginBottom:8}}),SSn=()=>{let{t:e}=Sq(),{setIsOnboardingFinished:t}=E3(),n=(0,U.useCallback)(()=>{setTimeout(()=>{t(!0)},1e3)},[t]);return(0,G.jsx)(xSn,{title:e(`guide_end_title`),subtitle:e(`guide_end_body`),stepChecked:3,onAnimationFinished:n})};H();var J9=({currentStep:e,text:t,onPress:n,inactive:r,isBackVisible:i=!0,onBackPress:a})=>{let{t:o}=Sq(),{COLORS:s}=Y(),{goBack:c}=A$();return(0,G.jsx)(tpn,{children:(0,G.jsxs)(V,{style:[CSn.buttonsWrapper,{borderColor:s.bgTransparent}],children:[i&&(0,G.jsx)(U4,{title:o(`button_back`),onPress:a||c,testID:`back${e}`,style:CSn.button,type:H4.Secondary}),(0,G.jsx)(U4,{title:t??o(`button_next`),onPress:n,inactive:r,testID:`next${e}`,style:CSn.button})]})})},CSn=z.create({buttonsWrapper:{flexDirection:`row`,paddingTop:16,gap:8,borderWidth:1},button:{flex:1}});H();var wSn=()=>{let{t:e}=Sq(),{COLORS:t}=Y(),{top:n}=Q4(),{navigate:r}=A$(),i=(0,U.useCallback)(()=>{r(I5.QuickGuideStack,{screen:I5.QuickGuide}),u8(l8.QuickGuideStartPress)},[r]);return(0,G.jsxs)(V,{style:{flex:1,backgroundColor:t.bgSecondary,paddingTop:n},children:[(0,G.jsx)(xSn,{title:e(`guide_quick_guide_title`),subtitle:e(`guide_quick_guide_body`),stepChecked:2}),(0,G.jsx)(J9,{currentStep:1,isBackVisible:!1,onPress:i,text:e(`button_start`)})]})},TSn=`/assets/webp/1_EN.webp`,ESn=`/assets/webp/2_EN.webp`,DSn=`/assets/webp/3_EN.webp`,OSn=`/assets/webp/4_EN2.webp`,kSn=`/assets/webp/1_EN2.webp`,ASn=`/assets/webp/2_EN2.webp`,jSn=`/assets/webp/3_EN2.webp`,MSn=`/assets/webp/4_EN.webp`;H();var NSn=()=>{let{t:e}=Sq(),t=A$(),{COLORS:n}=Y(),r=(0,U.useRef)(null),[i,a]=(0,U.useState)(2),[o,s]=(0,U.useState)(0),{colorScheme:c}=g2(),l=C2(c),{width:u}=$p(),d=(0,U.useMemo)(()=>[{title:e(`guide_recent_insulin_title`),body:e(`guide_recent_insulin_body`),image:l===`dark`?TSn:kSn},{title:e(`web_guide_no_import_title`),body:e(`web_guide_no_import_body`),image:l===`dark`?ESn:ASn},{title:e(`guide_glucose_title`),body:e(`guide_glucose_body`),image:l===`dark`?DSn:jSn},{title:e(`guide_recommendation_title`),body:e(`guide_recommendation_body`),image:l===`dark`?OSn:MSn}],[l,e]),f=(0,U.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`)}},[]),p=(0,U.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`)}},[]),m=(0,U.useCallback)(()=>{if(o===d.length-1)u8(l8.QuickGuideFinishPress),t.navigate(I5.QuickGuideAllSet);else{let e=o+1;r.current?.scrollToIndex({index:e,animated:!0}),a(i+1),s(e),u8(p(i))}},[o,i,p,t,d.length]),h=(0,U.useCallback)(()=>{if(o===0)t.navigate(I5.QuickGuideStart);else{let e=o-1;r.current?.scrollToIndex({index:e,animated:!0}),a(i-1),s(e)}u8(f(i))},[o,i,f,t]);return(0,G.jsxs)(V,{style:{flex:1,backgroundColor:n.bgSecondary},children:[(0,G.jsx)(Uc,{ref:r,data:d,initialNumToRender:1,scrollEnabled:!1,horizontal:!0,showsHorizontalScrollIndicator:!1,renderItem:({item:e,index:t})=>(0,G.jsxs)(V,{style:[Y9.container,{width:u,backgroundColor:n.bgPrimary}],children:[(0,G.jsx)(Xu,{source:e.image,style:[Y9.image,{bottom:t===0?64:0,width:t===1?`55%`:`100%`,height:t===1?`55%`:`60%`}],resizeMode:`contain`}),(0,G.jsxs)(V,{style:Y9.contentContainer,children:[(0,G.jsx)(Q,{style:Y9.title,maxFontSizeMultiplier:S2.s2,children:e.title}),(0,G.jsx)(Q,{style:[Y9.body,{color:n.labelSecondary}],maxFontSizeMultiplier:S2.s2,children:e.body})]})]})}),(0,G.jsx)(J9,{currentStep:i,onPress:m,onBackPress:h,text:o===d.length-1?e(`button_complete`):e(`button_next`)})]})},Y9=z.create({container:{alignItems:`center`,justifyContent:`flex-end`},image:{width:`100%`,height:`60%`,marginTop:64},contentContainer:{minHeight:`25%`,paddingTop:12,marginBottom:84},title:{...X.Poppins.semiBold_2XL,marginBottom:2,paddingHorizontal:16,textAlign:`center`},body:{...X.Poppins.regular_Base,paddingHorizontal:Lu.getFontScale()>S2.s0?16:32,textAlign:`center`}}),{Navigator:PSn,Screen:FSn}=A5(),ISn=()=>(0,G.jsxs)(PSn,{screenOptions:{...K5,headerShown:!1},children:[(0,G.jsx)(FSn,{name:I5.QuickGuideStart,component:wSn}),(0,G.jsx)(FSn,{name:I5.QuickGuide,component:NSn}),(0,G.jsx)(FSn,{name:I5.QuickGuideAllSet,component:SSn})]});H();function LSn({onOptionSelect:e,setNextEnabled:t,ref:n}){let{t:r}=Sq(),{COLORS:i}=Y(),{width:a}=$p(),o=M5(),[s,c]=(0,U.useState)(null),l=(0,U.useCallback)(n=>{c(n),e(n),t(!0)},[e,t]);return(0,U.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,G.jsxs)(ds,{contentContainerStyle:[X9.container,{width:a,paddingTop:o+16}],style:{backgroundColor:i.bgPrimary},children:[(0,G.jsx)(Q,{style:[X9.header,{color:i.labelPrimary}],children:r(`insulin_settings_title`)}),(0,G.jsxs)(V,{style:X9.buttonsContainer,children:[(0,G.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,G.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=z.create({container:{flex:1,paddingHorizontal:16,paddingTop:32},header:{...X.Poppins.bold_2XL,paddingHorizontal:16,marginBottom:24},buttonsContainer:{flexDirection:`row`,marginBottom:24,gap:12},button:{flex:1}});function RSn(e,t){let n=e3(e)-+e3(t);return n<0?-1:n>0?1:n}function zSn(e,t,n){let[r,i]=_8(n?.in,e,t);return r.getFullYear()-i.getFullYear()}function BSn(e,t,n){let[r,i]=_8(n?.in,e,t),a=RSn(r,i),o=Math.abs(zSn(r,i));r.setFullYear(1584),i.setFullYear(1584);let s=a*(o-+(RSn(r,i)===-a));return s===0?0:s}H(),J0();function VSn({setNextEnabled:e,ref:t}){let{t:n}=Sq(),{COLORS:r}=Y(),{width:i}=$p(),{bottom:a}=V0(),{bottomWithFooterButton:o}=Q4(),s=M5(),{birthday:c,biologicalSex:l,diabetesType:u,bloodGlucoseUnits:d}=s7(),{setSetupCalculatorStoreValues:f}=o7(),{colorScheme:p}=g2(),m=C2(p),[h,g]=(0,U.useState)(!1),[_,v]=(0,U.useState)(!1),[y,b]=(0,U.useState)(!1),[x,S]=(0,U.useState)(``),[C,w]=(0,U.useState)(``),[T,E]=(0,U.useState)(!1),D=(0,U.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=BSn(r,t)>=18;f({birthday:t.toISOString()}),S(``),w(i?``:n(`setup_birthday_hint_under18`))},[f,n]),O=(0,U.useCallback)(e=>{D(e),g(!1)},[D]),k=(0,U.useCallback)(()=>{f({diabetesType:Z.DiabetesType.Type2}),v(!0)},[f]),A=(0,U.useCallback)(()=>!!(c&&l&&u&&d),[c,d,u,l]);return(0,U.useEffect)(()=>{e(A())},[e,A]),(0,U.useImperativeHandle)(t,()=>({onBackPress(){u8(l8.SetupGeneralBackPress)},onNextPressed:()=>(E(!0),!c&&S(n(`birthday_error`)),A()?(e(!0),u8(l8.SetupGeneralNextPress),{transitionAllowed:!0}):(e(!1),{transitionAllowed:!1})),validateData(){return{isValid:A()}}}),[c,n,A,e]),(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(ds,{testID:`step_2`,contentContainerStyle:[Z9.container,{width:i,paddingTop:s+16,paddingBottom:o}],style:{backgroundColor:r.bgPrimary},children:[(0,G.jsx)(Y4,{testID:`birthday`,title:n(`general_input_birthday`),renderRightSlot:()=>(0,G.jsx)(V,{style:[Z9.pillButton,{backgroundColor:r.bgPill}],children:(0,G.jsx)(Q,{style:[Z9.pillText,{color:h?r.textLink:r.labelPrimary}],children:c?I8(new Date(c),`dd-MM-yyyy`):`DD-MM-YYYY`})}),errorMessage:x,warningMessage:C,containerStyle:Z9.wrapper,style:Z9.customRow,onPress:()=>{g(!0)}}),(0,G.jsx)(V,{style:Z9.wrapper,children:(0,G.jsx)(B4,{isAnimated:T&&!l,children:(0,G.jsx)(Y4,{title:n(`my_profile_sex`),testID:`biological-sex`,value:l?_vt[l]():`-`,onPress:()=>{b(!0)},errorMessage:T&&!l?n(`diabetes_error`):void 0})})}),(0,G.jsxs)(V,{style:Z9.wrapper,children:[(0,G.jsx)(d3,{title:n(`type_of_diabetes_title`)}),(0,G.jsx)(B4,{isAnimated:T&&!u,message:n(`diabetes_error`),children:(0,G.jsxs)(V,{style:[Z9.row,{backgroundColor:r.bgSegmentContainer,borderColor:r.buttonBorder}],children:[(0,G.jsx)(m9t,{title:n(`type_of_diabetes_type1`),isActive:u===Z.DiabetesType.Type1,testID:`type-1`,onPress:()=>{f({diabetesType:Z.DiabetesType.Type1})},isError:T&&!u}),!u&&(0,G.jsx)(V,{style:[Z9.separator,{backgroundColor:r.divider}]}),(0,G.jsx)(m9t,{title:n(`type_of_diabetes_type2`),isActive:u===Z.DiabetesType.Type2,testID:`type-2`,onPress:k,isError:T&&!u})]})})]}),(0,G.jsxs)(V,{style:Z9.wrapper,children:[(0,G.jsx)(d3,{title:n(`glucose_unit_title`)}),(0,G.jsx)(B4,{isAnimated:T&&!d,message:n(`glucose_unit_error`),children:(0,G.jsx)(vvn,{glucoseUnit:d,onPressMMOLL:()=>{f({bloodGlucoseUnits:Z.BloodGlucoseUnit.MMOL_L})},onPressMGDL:()=>{f({bloodGlucoseUnits:Z.BloodGlucoseUnit.MG_DL})},isError:T&&!d})})]})]}),Eq?(0,G.jsx)(Vpn,{testID:`birthday-date-picker`,display:`spinner`,date:c?new Date(c):new Date,isVisible:h,onConfirm:O,onCancel:()=>{g(!1)},customConfirmButtonIOS:Wpn,customCancelButtonIOS:Gpn,pickerContainerStyleIOS:{backgroundColor:r.iosKeyboardPicker},modalStyleIOS:{paddingBottom:a},themeVariant:m,isDarkModeEnabled:m===`dark`,pickerStyleIOS:Z9.alignCenter,minimumDate:new Date(1900,0,1),maximumDate:new Date(2100,0,1)}):(0,G.jsx)(Avn,{isVisible:h,initialValue:c?new Date(c):new Date,onConfirm:O,onCancel:()=>{g(!1)}}),(0,G.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,G.jsx)(Nvn,{isVisible:y,onCancel:()=>{b(!1)}})]})}var Z9=z.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:{...X.Poppins.regular_SM,paddingHorizontal:8,paddingVertical:6}});H();function HSn({setNextEnabled:e,ref:t}){let{COLORS:n}=Y(),{t:r}=Sq(),{width:i}=$p(),a=M5(),{parameters:o,treatmentType:s}=s7(),{setSetupCalculatorStoreValues:c}=o7(),[l,u]=(0,U.useState)(!1);(0,U.useEffect)(()=>{o||c({parameters:O8(0,0,Z.Usage.Overall)})},[o,c]),(0,U.useEffect)(()=>{e(!!s)},[e,s]);let d=(0,U.useCallback)(e=>{c({treatmentType:Z.InjectionMethod[e]})},[c]);return(0,U.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,G.jsxs)(V,{testID:`step_3`,style:[USn.container,{width:i,backgroundColor:n.bgPrimary,paddingTop:a+16}],children:[(0,G.jsx)(d3,{title:r(`treatment_units_title`)}),(0,G.jsx)(B4,{isAnimated:l&&!s,message:r(`treatment_type_input_error`),children:(0,G.jsx)(Y4.Container,{children:Object.keys(Z.InjectionMethod).map(e=>(0,G.jsx)(Y4,{title:V9[e](),renderRightSlot:()=>(0,G.jsx)(V,{style:USn.checkmarkContainer,children:Z.InjectionMethod[e]===s?(0,G.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 USn=z.create({container:{paddingHorizontal:16,paddingVertical:32},checkmarkContainer:{width:24,height:24}}),WSn=a3(5,350);H();function GSn({setNextEnabled:e,ref:t}){let{t:n}=Sq(),{COLORS:r}=Y(),{width:i}=$p(),a=M5(),{bottomWithFooterButton:o}=Q4(),{bloodGlucoseUnits:s,parameters:c}=s7();if(!s||!c)throw Error(`[Step4::render] are not defined`);let l=dpn(),{setSetupCalculatorStoreValues:u,setTotalDailyDosage:d}=o7(),[f,p]=(0,U.useState)(!1),[m,h]=(0,U.useState)(void 0),g=(0,U.useMemo)(()=>l?{carbohydrateRatio:parseFloat((500/l).toFixed(1)),insulinSensitivityMMOLL:Number(z9.DividendNumber)/l}:{carbohydrateRatio:0,insulinSensitivityMMOLL:0},[l]);(0,U.useEffect)(()=>{let{carbohydrateRatio:e,insulinSensitivityMMOLL:t}=g;u({parameters:O8(t,e,Z.Usage.Overall)})},[s,g,u]);let _=(0,U.useMemo)(()=>l?WSn.findIndex(e=>e===l.toString()):WSn.findIndex(e=>e===`50`),[l]);(0,U.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,U.useCallback)(t=>{d(t),p(!1),h(void 0),e(!0)},[e,d]),{text:y}=(0,U.useMemo)(()=>L8(s),[s]),b=(0,U.useMemo)(()=>`${B8(c.overallParameters.insulinSensitivity,Z.BloodGlucoseUnit.MMOL_L,s)} ${n(`fixed_insulin_settings_sensitivity_unit`,{displayUnit:y})}`,[c,y,n,s]),x=(0,U.useMemo)(()=>c.overallParameters.carbohydrateRatio+` `+n(`insulin_helper_carb_ratio_unit`),[c,n]);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(ds,{contentContainerStyle:[Q9.container,{width:i,paddingTop:a+16,paddingBottom:o}],style:{backgroundColor:r.bgPrimary},children:[(0,G.jsxs)(V,{children:[(0,G.jsx)(d3,{title:n(`daily_insulin_dosage_title`)}),(0,G.jsx)(Q,{style:[Q9.subheader,{color:r.labelSecondary}],children:n(`daily_insulin_dosage_body`)}),(0,G.jsx)(B4,{isAnimated:!!m,children:(0,G.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,G.jsxs)(V,{style:[Q9.explanation,{backgroundColor:r.bgSecondary}],children:[(0,G.jsx)(Q,{style:[Q9.description,{color:r.labelPrimary,borderBottomColor:r.divider}],children:n(`insulin_helper_body`)}),(0,G.jsxs)(V,{style:Q9.row,children:[(0,G.jsx)(Q,{style:[Q9.textSemiBold,{color:r.labelPrimary}],children:n(`insulin_helper_carb_ratio_input`)}),(0,G.jsx)(Q,{style:[Q9.textSemiBold,{color:r.labelSecondary}],children:x})]}),(0,G.jsx)(Lxn,{}),(0,G.jsxs)(V,{style:Q9.row,children:[(0,G.jsx)(Q,{style:[Q9.textSemiBold,{color:r.labelPrimary}],children:n(`insulin_helper_insulin_sensitivity_input`)}),(0,G.jsx)(Q,{style:[Q9.textSemiBold,{color:r.labelSecondary}],children:b})]})]}),(0,G.jsx)(p9,{}),(0,G.jsx)(V,{children:(0,G.jsx)(Kxn,{})})]}),(0,G.jsx)(Q5,{testID:`daily_insulin_dosage_picker`,onCancel:()=>{p(!1)},onConfirm:v,initialScrollIndex:_,isVisible:f,items:WSn})]})}var Q9=z.create({container:{paddingVertical:32,paddingHorizontal:16,gap:24},subheader:{...X.Poppins.regular_SM,marginBottom:8},explanation:{borderRadius:8,paddingBottom:0},row:{flexDirection:`row`,justifyContent:`space-between`},description:{...X.Poppins.regular_SM,padding:16,borderBottomWidth:1},textSemiBold:{...X.Poppins.medium_SM,padding:16}});H();function KSn({setNextEnabled:e,ref:t}){let{t:n}=Sq(),{COLORS:r}=Y(),{width:i}=$p(),a=M5(),{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,U.useState)(void 0),[p,m]=(0,U.useState)(void 0),[h,g]=(0,U.useState)(!1),[_,v]=(0,U.useState)(!1),{text:y}=(0,U.useMemo)(()=>L8(s),[s]),{carbohydrateRatio:b,insulinSensitivity:x}=(0,U.useMemo)(()=>c.overallParameters,[c]),S=(0,U.useCallback)(e=>n(`insulin_settings_input_error`,{inputTypeTranslated:n(e===`IS`?`insulin_sensitivity_input`:`insulin-to-carb_ratio_input`)}),[n]);(0,U.useEffect)(()=>{e(!!(x&&b))},[b,x,e]),(0,U.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,U.useCallback)(e=>{let t=z8(e,s,Z.BloodGlucoseUnit.MMOL_L);l({parameters:{...c,overallParameters:{...c.overallParameters,insulinSensitivity:t}}}),u(null),f(void 0),g(!1)},[s,c,l,u]),w=(0,U.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,U.useMemo)(()=>s===Z.BloodGlucoseUnit.MMOL_L?Bxn:Vxn,[s]),E=(0,U.useMemo)(()=>{let e=s===Z.BloodGlucoseUnit.MMOL_L?2 .toFixed(1):`36`;if(x===0)return T.findIndex(t=>t===e);let t=B8(x,Z.BloodGlucoseUnit.MMOL_L,s);return T.findIndex(e=>e===t)},[T,s,x]),D=(0,U.useMemo)(()=>b===0?R9.findIndex(e=>e===10 .toFixed(1)):R9.findIndex(e=>e===b.toFixed(1)),[b]),O=(0,U.useMemo)(()=>{let e=B8(x,Z.BloodGlucoseUnit.MMOL_L,s);return`${x?e:`-`} ${n(`fixed_insulin_settings_sensitivity_unit`,{displayUnit:y})}`},[x,s,y,n]);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(ds,{contentContainerStyle:[qSn.contentContainer,{width:i,paddingTop:a+16,paddingBottom:o}],style:{backgroundColor:r.bgPrimary},children:[(0,G.jsxs)(V,{children:[(0,G.jsx)(d3,{title:n(`insulin-to-carb_ratio_title`)}),(0,G.jsx)(B4,{isAnimated:!!p,children:(0,G.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,G.jsxs)(V,{children:[(0,G.jsx)(d3,{title:n(`insulin_sensitivity_title`)}),(0,G.jsx)(B4,{isAnimated:!!d,children:(0,G.jsx)(Y4,{title:n(`insulin_sensitivity_input`),value:O,valueStyle:{color:r.labelBrand},testID:`insulin_sensitivity`,onPress:()=>{g(!0)},errorMessage:d})})]}),(0,G.jsx)(p9,{}),(0,G.jsx)(Kxn,{})]}),(0,G.jsx)(Q5,{testID:`insulin_sensitivity_picker`,isVisible:h,items:T,initialScrollIndex:E,onConfirm:C,onCancel:()=>{g(!1)}}),(0,G.jsx)(Q5,{testID:`insulin_to_carb_ratio_picker`,isVisible:_,items:R9,initialScrollIndex:D,onConfirm:w,onCancel:()=>{v(!1)}})]})}var qSn=z.create({contentContainer:{paddingTop:32,paddingHorizontal:16,gap:24}});H();function JSn({setNextEnabled:e,ref:t}){let{t:n}=Sq(),{COLORS:r}=Y(),{width:i}=$p(),a=M5(),{bottomWithFooterButton:o}=Q4(),{bloodGlucoseUnits:s,parameters:c,treatmentType:l,diabetesType:u,birthday:d,biologicalSex:f}=s7(),p=dpn(),{modalStoreActions:m}=z5(),h=(0,U.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,Z.Usage.Overall);return k8.postUserSettings({parameters:n,activity:w8(),notifications:ton(),glucoseLevelTargets:Xan(),bloodGlucoseUnits:s,treatmentType:l,diabetesType:u,birthday:d,biologicalSex:f})},[d,s,u,f,c,l]);(0,U.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,U.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=R9t(Z.InjectionMethod,l),r=u===Z.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,U.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,Z.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,G.jsxs)(ds,{testID:`scroll`,contentContainerStyle:[YSn.scrollContent,{width:i,paddingTop:a+16,paddingBottom:o}],style:{backgroundColor:r.bgPrimary},children:[(0,G.jsx)(p9,{}),(0,G.jsx)(V,{style:YSn.spacer}),(0,G.jsx)(d3,{title:n(`summary_setup_general_title`)}),(0,G.jsx)(Y4.Container,{children:g.map(({testID:e,label:t,value:n,unit:i})=>(0,G.jsx)(Y4,{testID:e,title:t,displayStyle:f9t.List,displayType:J4.ListItem,titleStyle:{color:r.labelPrimary},valueStyle:{color:r.labelSecondary},value:`${n} ${i??``}`},e))}),(0,G.jsx)(V,{style:YSn.spacer}),(0,G.jsx)(d3,{title:n(`summary_setup_insuling_settings_title`)}),(0,G.jsx)(Y4.Container,{children:_.map(({testID:e,label:t,value:n,unit:i})=>(0,G.jsx)(Y4,{testID:e,title:t,displayStyle:f9t.List,displayType:J4.ListItem,titleStyle:{color:r.labelPrimary},valueStyle:{color:r.labelSecondary},value:`${n} ${i??``}`},e))}),(0,G.jsx)(t7,{})]})}var YSn=z.create({scrollContent:{paddingHorizontal:16},spacer:{height:24}});H();var XSn=()=>{let{t:e}=Sq(),{COLORS:t}=Y(),{width:n}=$p(),{clear:r}=o7(),{setHasCompletedSetupFlow:i,setIsPinSetupShouldBeShown:a}=E3(),o=A$(),[s,c]=(0,U.useState)(2),[l,u]=(0,U.useState)(0),[d,f]=(0,U.useState)(0),[p,m]=(0,U.useState)(!1),[h,g]=(0,U.useState)(!1),_=(0,U.useRef)(null),v=(0,U.useRef)(null);(0,U.useEffect)(()=>{r()},[r]);let y=(0,U.useCallback)(e=>{m(e)},[]),b=(0,U.useCallback)(e=>{g(e===`yes`)},[]),x=(0,U.useMemo)(()=>[{title:e(`general_navigation`),stepNumber:2,renderComponent:e=>(0,G.jsx)(VSn,{ref:e,setNextEnabled:y})},{title:e(`treatment_navigation`),stepNumber:3,renderComponent:e=>(0,G.jsx)(HSn,{ref:e,setNextEnabled:y})},{title:e(`insulin_settings_navigation`),stepNumber:4,renderComponent:e=>(0,G.jsx)(LSn,{ref:e,onOptionSelect:b,setNextEnabled:y})},{title:e(`insulin_settings_navigation`),stepNumber:4,renderComponent:e=>h?(0,G.jsx)(KSn,{ref:e,setNextEnabled:y}):(0,G.jsx)(GSn,{ref:e,setNextEnabled:y})},{title:e(`summary_setup_navigation`),stepNumber:5,renderComponent:e=>(0,G.jsx)(JSn,{ref:e,setNextEnabled:y})}],[b,y,h,e]);(0,U.useEffect)(()=>{o.setOptions({headerTransparent:!0,header:()=>(0,G.jsx)(P5,{title:x[l].title,overlay:!0})})},[l,o,x]),(0,U.useEffect)(()=>{if(!v.current)return;let{isValid:e}=v.current.validateData();m(e)},[l,x]);let S=(0,U.useCallback)(async()=>{if(!v.current)return;let{transitionAllowed:e}=await v.current.onNextPressed();if(e)if(l===x.length-1){Tq||a(!0),i(!0);let e=Tq?{name:I5.QuickGuideStack}:{name:I5.PINCodeSetup,params:{comingFrom:I5.Setup}};o.dispatch(v$({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,U.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 R$((0,U.useCallback)(()=>{let e=Sf.addEventListener(`hardwareBackPress`,()=>(C(),!0));return()=>{e.remove()}},[C])),(0,G.jsxs)(V,{style:[ZSn.container,{backgroundColor:t.bgSecondary}],children:[(0,G.jsx)(Uc,{ref:_,data:x,renderItem:({item:e,index:t})=>t<=d?e.renderComponent(t===l?v:null):(0,G.jsx)(V,{style:{width:n}}),scrollEnabled:!1,horizontal:!0,initialNumToRender:1,showsHorizontalScrollIndicator:!1}),(0,G.jsx)(J9,{currentStep:s,onPress:S,onBackPress:C,inactive:!p,text:l===x.length-1?e(`button_complete`):e(`button_next`)})]})},ZSn=z.create({container:{flex:1}});H();var QSn=({isVisible:e,onCancelPress:t,onContinuePress:n,onModalHide:r})=>{let{t:i}=Sq(),{COLORS:a}=Y(),[o,s]=(0,U.useState)([!1,!1]),[c,l]=(0,U.useState)(!1),u=(0,U.useMemo)(()=>o.every(Boolean),[o]);(0,U.useEffect)(()=>{e&&(s([!1,!1]),l(!1))},[e]);let d=(0,U.useCallback)(e=>{s(t=>t.map((t,n)=>n===e?!t:t))},[]),f=(0,U.useCallback)(()=>{c&&u&&r()},[u,c,r]),p=(0,U.useCallback)(()=>{l(!0),n()},[n]);return(0,G.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,G.jsx)(Q,{style:$9.title,children:i(`welcome_modal_title`)}),(0,G.jsx)(Q,{style:[$9.subtitle,{color:a.labelSecondary}],children:i(`welcome_modal_body`)}),(0,G.jsxs)(Cp,{testID:`restrictions_checkmark_1`,onPress:()=>{d(0)},style:({pressed:e})=>[{opacity:e?.5:1},$9.checkmarkContainer],children:[o[0]?(0,G.jsx)(V7t,{}):(0,G.jsx)(B7t,{}),(0,G.jsxs)(V,{style:$9.checkmarkTextContainer,children:[(0,G.jsx)(Q,{style:$9.checkmarkTitle,children:i(`welcome_modal_pregnancy_title`)}),(0,G.jsx)(Q,{style:[$9.checkmarkSubtitle,{color:a.labelSecondary}],children:i(`welcome_modal_pregnancy_body`)})]})]}),(0,G.jsx)(V,{style:[$9.separatorLine,{backgroundColor:a.divider}]}),(0,G.jsxs)(Cp,{testID:`restrictions_checkmark_2`,onPress:()=>{d(1)},style:({pressed:e})=>[{opacity:e?.5:1},$9.checkmarkContainer],children:[o[1]?(0,G.jsx)(V7t,{}):(0,G.jsx)(B7t,{}),(0,G.jsxs)(V,{style:$9.checkmarkTextContainer,children:[(0,G.jsx)(Q,{style:$9.checkmarkTitle,children:i(`welcome_modal_gestational_title`)}),(0,G.jsx)(Q,{style:[$9.checkmarkSubtitle,{color:a.labelSecondary}],children:i(`welcome_modal_gestational_body`)})]})]})]})},$9=z.create({title:{...X.Poppins.bold_2XL,marginTop:32,marginBottom:8},subtitle:{...X.Poppins.regular_Base,marginBottom:16},checkmarkContainer:{paddingVertical:16,flexDirection:`row`,justifyContent:`space-between`},checkmarkTextContainer:{flex:1,marginLeft:8},checkmarkTitle:{...X.Poppins.semiBold_Base,marginBottom:2},checkmarkSubtitle:{...X.Poppins.regular_SM},separatorLine:{width:`100%`,height:1}});H();var $Sn=()=>{let{t:e}=Sq(),{navigate:t}=A$(),{clear:n}=o7(),{COLORS:r}=Y(),[i,a]=(0,U.useState)(!1);(0,U.useEffect)(()=>{n()},[n]);let o=(0,U.useCallback)(()=>{a(!0),u8(l8.SetupIntroStartPress)},[]);return(0,G.jsxs)(V,{style:[eCn.container,{backgroundColor:r.bgSecondary}],children:[(0,G.jsx)(xSn,{title:e(`setup_account_title`),subtitle:e(`setup_account_body`),stepChecked:1}),(0,G.jsx)(J9,{currentStep:1,isBackVisible:!1,onPress:o,text:e(`button_start`)}),(0,G.jsx)(QSn,{isVisible:i,onCancelPress:()=>{a(!1)},onContinuePress:()=>{a(!1)},onModalHide:()=>{t(I5.Setup)}})]})},eCn=z.create({container:{flex:1}}),{Navigator:tCn,Screen:nCn}=A5(),rCn=()=>{let{t:e}=Sq();return(0,G.jsxs)(tCn,{screenOptions:{...K5},children:[(0,G.jsx)(nCn,{name:I5.SetupStart,component:$Sn,options:{header:()=>(0,G.jsx)(P5,{title:e(`setup_account_navigation`),overlay:!0})}}),(0,G.jsx)(nCn,{name:I5.Setup,component:XSn,options:{header:()=>(0,G.jsx)(P5,{title:e(`general_navigation`),overlay:!0})}})]})},{Navigator:iCn,Screen:aCn}=A5(),oCn=()=>{let{hasCompletedSetupFlow:e}=E3(),t=U.useMemo(()=>e?I5.QuickGuideStack:I5.SetupBolusCalculator,[e]);return(0,G.jsxs)(iCn,{initialRouteName:t,screenOptions:{...K5,headerShown:!1},children:[(0,G.jsx)(aCn,{name:I5.SetupBolusCalculator,component:rCn}),(0,G.jsx)(aCn,{name:I5.QuickGuideStack,component:ISn})]},t)},sCn=()=>{let{isOnboardingFinished:e,setIsOnboardingFinished:t}=E3(),[n,r]=U.useState(!1),i=(0,U.useCallback)(async()=>{if(await K8.syncAll(),!k8.uuid){if(_q.IS_PRODUCTION===`true`)throw window.location.href=`/redirect?status=error`,Error(`[App::syncData] User settings not found`);k8.updateMockUserSettings()}t(Z6t(Z.BloodGlucoseUnit).safeParse(k8.glucoseUnit).success)},[t]);return(0,U.useEffect)(()=>{i().catch(console.error).finally(()=>{r(!0)})},[i]),!n||e===void 0?(0,G.jsx)(b2,{}):e?(0,G.jsx)(bSn,{}):(0,G.jsx)(oCn,{})},cCn={prefixes:[],config:{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`}}}}};J0();var lCn=vWt(),uCn=document.querySelector(`meta[name="sentry-environment"]`)?.content;_q.SENTRY_ENABLED===`true`&&U1t({dsn:_q.SENTRY_DSN,environment:uCn||_q.SENTRY_ENVIRONMENT,release:`hedia-web@3.9.0+1220`,dist:`1220`,beforeSend:(e,t)=>{let n=e.exception?.values?.[0],r=[n?.type,n?.value].filter(Boolean).join(`: `);if(r.includes(hvt.NetworkErrorFailure)||r.includes(hvt.NetworkErrorTimeout)||_q.IS_PRODUCTION===`false`&&r.includes(hvt.TranslationError))return null;if(t.originalException instanceof T2){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 dCn=()=>{let{colorScheme:e}=g2(),{COLORS:t}=Y(),n=e===`light`?PKt:SKt;return(0,G.jsx)(H3t,{children:(0,G.jsx)(oSt,{children:(0,G.jsx)(x4t,{children:(0,G.jsx)(S2t,{children:(0,G.jsx)(R0t,{client:z4t,children:(0,G.jsx)(NKt,{theme:{...n,colors:{...n.colors,background:t.bgPrimary,border:t.divider,text:t.labelPrimary},fonts:{...n.fonts,regular:{...n.fonts.regular,fontFamily:x2.PoppinsRegular},medium:{...n.fonts.medium,fontFamily:x2.PoppinsMedium},bold:{...n.fonts.bold,fontFamily:x2.PoppinsSemiBold},heavy:{...n.fonts.heavy,fontFamily:x2.PoppinsBold}}},ref:lCn,linking:cCn,children:(0,G.jsx)(IUt,{children:(0,G.jsx)(sCn,{})})})})})})})})},fCn=u(y());xvt(),fCn.createRoot(document.getElementById(`root`)).render((0,G.jsx)(dCn,{}));
|