@nizza/core 0.6.0-beta.8 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var Ql=Object.defineProperty;var Xl=(t,e,n)=>e in t?Ql(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var w=(t,e,n)=>(Xl(t,typeof e!="symbol"?e+"":e,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("react"),fs=require("react-dom"),hs=require("@tanstack/react-query"),Zl=require("react/jsx-runtime");function eu(t,e){for(var n=0;n<e.length;n++){const i=e[n];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in t)){const a=Object.getOwnPropertyDescriptor(i,r);a&&Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Z={NZ_AWS_REGION:"us-east-1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1,STAGE:"dev"};let tu=0;function zn(t,e){const n=`atom${++tu}`,i={toString:()=>n};return typeof t=="function"?i.read=t:(i.init=t,i.read=nu,i.write=iu),i}function nu(t){return t(this)}function iu(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}const bi=(t,e)=>t.unstable_is?t.unstable_is(e):e===t,_i=t=>"init"in t,Si=t=>!!t.write,En=new WeakMap,ru=(t,e)=>{En.set(t,e),t.catch(()=>{}).finally(()=>En.delete(t))},Qr=(t,e)=>{const n=En.get(t);n&&(En.delete(t),n(e))},Xr=(t,e)=>{t.status="fulfilled",t.value=e},Zr=(t,e)=>{t.status="rejected",t.reason=e},au=t=>typeof(t==null?void 0:t.then)=="function",_t=(t,e)=>!!t&&"v"in t&&"v"in e&&Object.is(t.v,e.v),ea=(t,e)=>!!t&&"e"in t&&"e"in e&&Object.is(t.e,e.e),Xe=t=>!!t&&"v"in t&&t.v instanceof Promise,su=(t,e)=>"v"in t&&"v"in e&&t.v.orig&&t.v.orig===e.v.orig,sn=t=>{if("e"in t)throw t.e;return t.v},ps=()=>{const t=new WeakMap,e=new WeakMap,n=[],i=new WeakMap;let r,a;(Z?"production":void 0)!=="production"&&(r=new Set,a=new Set);const s=y=>t.get(y),o=(y,C)=>{C.d.forEach((F,S)=>{var E;if(!i.has(S)){const A=s(S);(E=n[n.length-1])==null||E.add(S),i.set(S,[A,new Set]),A&&o(S,A)}i.get(S)[1].add(y)})},l=(y,C)=>{var F;(Z?"production":void 0)!=="production"&&Object.freeze(C);const S=s(y);if(t.set(y,C),i.has(y)||((F=n[n.length-1])==null||F.add(y),i.set(y,[S,new Set]),o(y,C)),Xe(S)){const E="v"in C?C.v instanceof Promise?C.v:Promise.resolve(C.v):Promise.reject(C.e);S.v!==E&&Qr(S.v,E)}},u=(y,C,F,S)=>{const E=new Map(S?C.d:null);let A=!1;F.forEach((h,g)=>{!h&&bi(y,g)&&(h=C),h?(E.set(g,h),C.d.get(g)!==h&&(A=!0)):(Z?"production":void 0)!=="production"&&console.warn("[Bug] atom state not found")}),(A||C.d.size!==E.size)&&(C.d=E)},c=(y,C,F,S)=>{const E=s(y),A={d:(E==null?void 0:E.d)||new Map,v:C};if(F&&u(y,A,F,S),_t(E,A)&&E.d===A.d)return E;if(Xe(E)&&Xe(A)&&su(E,A)){if(E.d===A.d)return E;A.v=E.v}return l(y,A),A},d=(y,C,F,S)=>{if(au(C)){let E;const A=()=>{const g=s(y);if(!Xe(g)||g.v!==h)return;const x=c(y,h,F);e.has(y)&&g.d!==x.d&&L(y,x,g.d)},h=new Promise((g,x)=>{let I=!1;C.then(D=>{I||(I=!0,Xr(h,D),g(D),A())},D=>{I||(I=!0,Zr(h,D),x(D),A())}),E=D=>{I||(I=!0,D.then(j=>Xr(h,j),j=>Zr(h,j)),g(D))}});return h.orig=C,h.status="pending",ru(h,g=>{g&&E(g),S==null||S()}),c(y,h,F,!0)}return c(y,C,F)},f=(y,C,F)=>{const S=s(y),E={d:(S==null?void 0:S.d)||new Map,e:C};return F&&u(y,E,F),ea(S,E)&&S.d===E.d?S:(l(y,E),E)},v=(y,C)=>{const F=s(y);if(!C&&F&&(e.has(y)||Array.from(F.d).every(([I,D])=>{if(I===y)return!0;const j=v(I);return j===D||_t(j,D)})))return F;const S=new Map;let E=!0;const A=I=>{if(bi(y,I)){const j=s(I);if(j)return S.set(I,j),sn(j);if(_i(I))return S.set(I,void 0),I.init;throw new Error("no atom init")}const D=v(I);return S.set(I,D),sn(D)};let h,g;const x={get signal(){return h||(h=new AbortController),h.signal},get setSelf(){return(Z?"production":void 0)!=="production"&&!Si(y)&&console.warn("setSelf function cannot be used with read-only atom"),!g&&Si(y)&&(g=(...I)=>{if((Z?"production":void 0)!=="production"&&E&&console.warn("setSelf function cannot be called in sync"),!E)return _(y,...I)}),g}};try{const I=y.read(A,x);return d(y,I,S,()=>h==null?void 0:h.abort())}catch(I){return f(y,I,S)}finally{E=!1}},p=y=>sn(v(y)),m=y=>{const C=h=>{var g,x;const I=new Set((g=e.get(h))==null?void 0:g.t);return(x=i.get(h))==null||x[1].forEach(D=>{I.add(D)}),I},F=new Array,S=new Set,E=h=>{if(!S.has(h)){S.add(h);for(const g of C(h))h!==g&&E(g);F.push(h)}};E(y);const A=new Set([y]);for(let h=F.length-1;h>=0;--h){const g=F[h],x=s(g);if(!x)continue;let I=!1;for(const D of x.d.keys())if(D!==g&&A.has(D)){I=!0;break}if(I){const D=v(g,!0);_t(x,D)||A.add(g)}}},N=(y,...C)=>{const F=A=>sn(v(A)),S=(A,...h)=>{const g=n.length>0;g||n.push(new Set([A]));let x;if(bi(y,A)){if(!_i(A))throw new Error("atom not writable");const I=s(A),D=d(A,h[0]);_t(I,D)||m(A)}else x=N(A,...h);if(!g){const I=M(n.pop());(Z?"production":void 0)!=="production"&&r.forEach(D=>D({type:"async-write",flushed:I}))}return x};return y.write(F,S,...C)},_=(y,...C)=>{n.push(new Set([y]));const F=N(y,...C),S=M(n.pop());return(Z?"production":void 0)!=="production"&&r.forEach(E=>E({type:"write",flushed:S})),F},P=(y,C,F)=>{var S;const E=e.get(y);if(E)return C&&E.t.add(C),E;const A=F||[];(S=s(y))==null||S.d.forEach((g,x)=>{x!==y&&P(x,y,A)}),v(y);const h={t:new Set(C&&[C]),l:new Set};if(e.set(y,h),(Z?"production":void 0)!=="production"&&a.add(y),Si(y)&&y.onMount){const{onMount:g}=y;A.push(()=>{const x=g((...I)=>_(y,...I));x&&(h.u=x)})}return F||A.forEach(g=>g()),h},V=(y,C)=>!C.l.size&&(!C.t.size||C.t.size===1&&C.t.has(y)),T=(y,C)=>{if(!V(y,C))return;const F=C.u;F&&F(),e.delete(y),(Z?"production":void 0)!=="production"&&a.delete(y);const S=s(y);S?(Xe(S)&&Qr(S.v),S.d.forEach((E,A)=>{if(A!==y){const h=e.get(A);h&&(h.t.delete(y),T(A,h))}})):(Z?"production":void 0)!=="production"&&console.warn("[Bug] could not find atom state to unmount",y)},L=(y,C,F)=>{const S=new Set(C.d.keys()),E=new Set;F==null||F.forEach((A,h)=>{if(S.has(h)){S.delete(h);return}E.add(h);const g=e.get(h);g&&g.t.delete(y)}),S.forEach(A=>{P(A,y)}),E.forEach(A=>{const h=e.get(A);h&&T(A,h)})},M=y=>{let C;(Z?"production":void 0)!=="production"&&(C=new Set);const F=[],S=E=>{var A;if(!i.has(E))return;const[h,g]=i.get(E);i.delete(E),F.push([E,h]),g.forEach(S),(A=s(E))==null||A.d.forEach((x,I)=>S(I))};if(y.forEach(S),F.forEach(([E,A])=>{const h=s(E);if(!h){(Z?"production":void 0)!=="production"&&console.warn("[Bug] no atom state to flush");return}if(h!==A){const g=e.get(E);g&&h.d!==(A==null?void 0:A.d)&&L(E,h,A==null?void 0:A.d),g&&!(!Xe(A)&&(_t(A,h)||ea(A,h)))&&(g.l.forEach(x=>x()),(Z?"production":void 0)!=="production"&&C.add(E))}}),(Z?"production":void 0)!=="production")return C},G=(y,C)=>{const F=P(y),S=M([y]),E=F.l;return E.add(C),(Z?"production":void 0)!=="production"&&r.forEach(A=>A({type:"sub",flushed:S})),()=>{E.delete(C),T(y,F),(Z?"production":void 0)!=="production"&&r.forEach(A=>A({type:"unsub"}))}};return(Z?"production":void 0)!=="production"?{get:p,set:_,sub:G,dev_subscribe_store:y=>(r.add(y),()=>{r.delete(y)}),dev_get_mounted_atoms:()=>a.values(),dev_get_atom_state:y=>t.get(y),dev_get_mounted:y=>e.get(y),dev_restore_atoms:y=>{n.push(new Set);for(const[F,S]of y)_i(F)&&(d(F,S),m(F));const C=M(n.pop());r.forEach(F=>F({type:"restore",flushed:C}))}}:{get:p,set:_,sub:G}};let St;const ou=()=>(St||(St=ps(),(Z?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=St),globalThis.__JOTAI_DEFAULT_STORE__!==St&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),St),lu=ps,uu=ou;var cu={NZ_AWS_REGION:"us-east-1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1,STAGE:"dev"};const du=B.createContext(void 0),ms=t=>B.useContext(du)||uu(),fu=t=>typeof(t==null?void 0:t.then)=="function",hu=B.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}),t)});function zi(t,e){const n=ms(),[[i,r,a],s]=B.useReducer(u=>{const c=n.get(t);return Object.is(u[0],c)&&u[1]===n&&u[2]===t?u:[c,n,t]},void 0,()=>[n.get(t),n,t]);let o=i;return(r!==n||a!==t)&&(s(),o=n.get(t)),B.useEffect(()=>{const u=n.sub(t,()=>{s()});return s(),u},[n,t,void 0]),B.useDebugValue(o),fu(o)?hu(o):o}function vr(t,e){const n=ms();return B.useCallback((...r)=>{if((cu?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return n.set(t,...r)},[n,t])}function hn(t,e){return[zi(t),vr(t)]}const Hn=zn(null);Hn.debugLabel="accountAtom";var pu={NZ_AWS_REGION:"us-east-1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1,STAGE:"dev"};const{NZ_AWS_REGION:mu,NZ_BACKOFFICE_BACK_URL:gu,NZ_CORE_SERVICES_GRAPHQL_URL:vu,NZ_CORE_SERVICES_REST_URL:yu}=pu,yr={AWS:{region:mu,cognito:{userPoolId:"us-east-1_knSlGEmJ0",userPoolWebClientId:"3hmbfhf7nl3kq20qr9i5lihf1p"}},apiUrls:{restV1:gu||"https://pabprg32bj.execute-api.us-east-1.amazonaws.com",restV2:yu||"https://core-services-dev.nizza.com/api",graphql:vu||"https://core-services-dev.nizza.com/graphql",corsProxy:"https://1qmd8jteh1.execute-api.us-east-1.amazonaws.com"},publicUrls:{platformSite:"https://platformdev.nizza.com",nizzaCdn:"https://cdn.nizza.com",bundleSite:"https://bundledev.nizza.com",wssIVSChat:"wss://edge.ivschat.us-east-1.amazonaws.com"}};function gs(t,e){let n=null;const i=()=>{n||(n=e().log.createLogger(t))},r=(s,o)=>typeof s[o]=="function",a={get(s,o,l){i();const u=c=>(...d)=>{if(!n)return;const f=n[c];if(typeof f=="function")return f.apply(n,d)};return n&&r(n,o)?u(o):n?n[o]:void 0}};return new Proxy({},a)}function q(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];throw new Error(typeof t=="number"?"[MobX] minified error nr: "+t+(n.length?" "+n.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+t)}var ku={};function kr(){return typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:ku}var vs=Object.assign,An=Object.getOwnPropertyDescriptor,be=Object.defineProperty,qn=Object.prototype,Hi=[];Object.freeze(Hi);var ys={};Object.freeze(ys);var bu=typeof Proxy!="undefined",_u=Object.toString();function ks(){bu||q("Proxy not available")}function bs(t){var e=!1;return function(){if(!e)return e=!0,t.apply(this,arguments)}}var at=function(){};function he(t){return typeof t=="function"}function Be(t){var e=typeof t;switch(e){case"string":case"symbol":case"number":return!0}return!1}function Gn(t){return t!==null&&typeof t=="object"}function De(t){if(!Gn(t))return!1;var e=Object.getPrototypeOf(t);if(e==null)return!0;var n=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n.toString()===_u}function _s(t){var e=t==null?void 0:t.constructor;return e?e.name==="GeneratorFunction"||e.displayName==="GeneratorFunction":!1}function Kn(t,e,n){be(t,e,{enumerable:!1,writable:!0,configurable:!0,value:n})}function Ss(t,e,n){be(t,e,{enumerable:!1,writable:!1,configurable:!0,value:n})}function Ge(t,e){var n="isMobX"+t;return e.prototype[n]=!0,function(i){return Gn(i)&&i[n]===!0}}function pt(t){return t instanceof Map}function Wt(t){return t instanceof Set}var Ns=typeof Object.getOwnPropertySymbols!="undefined";function Su(t){var e=Object.keys(t);if(!Ns)return e;var n=Object.getOwnPropertySymbols(t);return n.length?[].concat(e,n.filter(function(i){return qn.propertyIsEnumerable.call(t,i)})):e}var Wn=typeof Reflect!="undefined"&&Reflect.ownKeys?Reflect.ownKeys:Ns?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames;function Es(t){return t===null?null:typeof t=="object"?""+t:t}function Ae(t,e){return qn.hasOwnProperty.call(t,e)}var Nu=Object.getOwnPropertyDescriptors||function(e){var n={};return Wn(e).forEach(function(i){n[i]=An(e,i)}),n};function Eu(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,wu(i.key),i)}}function br(t,e,n){return e&&Eu(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Pe(){return Pe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Pe.apply(this,arguments)}function As(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,qi(t,e)}function qi(t,e){return qi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,r){return i.__proto__=r,i},qi(t,e)}function Ni(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Au(t,e){if(t){if(typeof t=="string")return ta(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ta(t,e)}}function ta(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function st(t,e){var n=typeof Symbol!="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=Au(t))||e){n&&(t=n);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
1
+ "use strict";var Ql=Object.defineProperty;var Xl=(t,e,n)=>e in t?Ql(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var w=(t,e,n)=>(Xl(t,typeof e!="symbol"?e+"":e,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("react"),fs=require("react-dom"),hs=require("@tanstack/react-query"),Zl=require("react/jsx-runtime");function eu(t,e){for(var n=0;n<e.length;n++){const i=e[n];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in t)){const a=Object.getOwnPropertyDescriptor(i,r);a&&Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Z={NZ_AWS_REGION:"us-east-1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1,STAGE:"prod"};let tu=0;function zn(t,e){const n=`atom${++tu}`,i={toString:()=>n};return typeof t=="function"?i.read=t:(i.init=t,i.read=nu,i.write=iu),i}function nu(t){return t(this)}function iu(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}const bi=(t,e)=>t.unstable_is?t.unstable_is(e):e===t,_i=t=>"init"in t,Si=t=>!!t.write,En=new WeakMap,ru=(t,e)=>{En.set(t,e),t.catch(()=>{}).finally(()=>En.delete(t))},Qr=(t,e)=>{const n=En.get(t);n&&(En.delete(t),n(e))},Xr=(t,e)=>{t.status="fulfilled",t.value=e},Zr=(t,e)=>{t.status="rejected",t.reason=e},au=t=>typeof(t==null?void 0:t.then)=="function",_t=(t,e)=>!!t&&"v"in t&&"v"in e&&Object.is(t.v,e.v),ea=(t,e)=>!!t&&"e"in t&&"e"in e&&Object.is(t.e,e.e),Xe=t=>!!t&&"v"in t&&t.v instanceof Promise,su=(t,e)=>"v"in t&&"v"in e&&t.v.orig&&t.v.orig===e.v.orig,sn=t=>{if("e"in t)throw t.e;return t.v},ps=()=>{const t=new WeakMap,e=new WeakMap,n=[],i=new WeakMap;let r,a;(Z?"production":void 0)!=="production"&&(r=new Set,a=new Set);const s=y=>t.get(y),o=(y,C)=>{C.d.forEach((F,S)=>{var E;if(!i.has(S)){const A=s(S);(E=n[n.length-1])==null||E.add(S),i.set(S,[A,new Set]),A&&o(S,A)}i.get(S)[1].add(y)})},l=(y,C)=>{var F;(Z?"production":void 0)!=="production"&&Object.freeze(C);const S=s(y);if(t.set(y,C),i.has(y)||((F=n[n.length-1])==null||F.add(y),i.set(y,[S,new Set]),o(y,C)),Xe(S)){const E="v"in C?C.v instanceof Promise?C.v:Promise.resolve(C.v):Promise.reject(C.e);S.v!==E&&Qr(S.v,E)}},u=(y,C,F,S)=>{const E=new Map(S?C.d:null);let A=!1;F.forEach((h,g)=>{!h&&bi(y,g)&&(h=C),h?(E.set(g,h),C.d.get(g)!==h&&(A=!0)):(Z?"production":void 0)!=="production"&&console.warn("[Bug] atom state not found")}),(A||C.d.size!==E.size)&&(C.d=E)},c=(y,C,F,S)=>{const E=s(y),A={d:(E==null?void 0:E.d)||new Map,v:C};if(F&&u(y,A,F,S),_t(E,A)&&E.d===A.d)return E;if(Xe(E)&&Xe(A)&&su(E,A)){if(E.d===A.d)return E;A.v=E.v}return l(y,A),A},d=(y,C,F,S)=>{if(au(C)){let E;const A=()=>{const g=s(y);if(!Xe(g)||g.v!==h)return;const x=c(y,h,F);e.has(y)&&g.d!==x.d&&L(y,x,g.d)},h=new Promise((g,x)=>{let I=!1;C.then(D=>{I||(I=!0,Xr(h,D),g(D),A())},D=>{I||(I=!0,Zr(h,D),x(D),A())}),E=D=>{I||(I=!0,D.then(j=>Xr(h,j),j=>Zr(h,j)),g(D))}});return h.orig=C,h.status="pending",ru(h,g=>{g&&E(g),S==null||S()}),c(y,h,F,!0)}return c(y,C,F)},f=(y,C,F)=>{const S=s(y),E={d:(S==null?void 0:S.d)||new Map,e:C};return F&&u(y,E,F),ea(S,E)&&S.d===E.d?S:(l(y,E),E)},v=(y,C)=>{const F=s(y);if(!C&&F&&(e.has(y)||Array.from(F.d).every(([I,D])=>{if(I===y)return!0;const j=v(I);return j===D||_t(j,D)})))return F;const S=new Map;let E=!0;const A=I=>{if(bi(y,I)){const j=s(I);if(j)return S.set(I,j),sn(j);if(_i(I))return S.set(I,void 0),I.init;throw new Error("no atom init")}const D=v(I);return S.set(I,D),sn(D)};let h,g;const x={get signal(){return h||(h=new AbortController),h.signal},get setSelf(){return(Z?"production":void 0)!=="production"&&!Si(y)&&console.warn("setSelf function cannot be used with read-only atom"),!g&&Si(y)&&(g=(...I)=>{if((Z?"production":void 0)!=="production"&&E&&console.warn("setSelf function cannot be called in sync"),!E)return _(y,...I)}),g}};try{const I=y.read(A,x);return d(y,I,S,()=>h==null?void 0:h.abort())}catch(I){return f(y,I,S)}finally{E=!1}},p=y=>sn(v(y)),m=y=>{const C=h=>{var g,x;const I=new Set((g=e.get(h))==null?void 0:g.t);return(x=i.get(h))==null||x[1].forEach(D=>{I.add(D)}),I},F=new Array,S=new Set,E=h=>{if(!S.has(h)){S.add(h);for(const g of C(h))h!==g&&E(g);F.push(h)}};E(y);const A=new Set([y]);for(let h=F.length-1;h>=0;--h){const g=F[h],x=s(g);if(!x)continue;let I=!1;for(const D of x.d.keys())if(D!==g&&A.has(D)){I=!0;break}if(I){const D=v(g,!0);_t(x,D)||A.add(g)}}},N=(y,...C)=>{const F=A=>sn(v(A)),S=(A,...h)=>{const g=n.length>0;g||n.push(new Set([A]));let x;if(bi(y,A)){if(!_i(A))throw new Error("atom not writable");const I=s(A),D=d(A,h[0]);_t(I,D)||m(A)}else x=N(A,...h);if(!g){const I=M(n.pop());(Z?"production":void 0)!=="production"&&r.forEach(D=>D({type:"async-write",flushed:I}))}return x};return y.write(F,S,...C)},_=(y,...C)=>{n.push(new Set([y]));const F=N(y,...C),S=M(n.pop());return(Z?"production":void 0)!=="production"&&r.forEach(E=>E({type:"write",flushed:S})),F},P=(y,C,F)=>{var S;const E=e.get(y);if(E)return C&&E.t.add(C),E;const A=F||[];(S=s(y))==null||S.d.forEach((g,x)=>{x!==y&&P(x,y,A)}),v(y);const h={t:new Set(C&&[C]),l:new Set};if(e.set(y,h),(Z?"production":void 0)!=="production"&&a.add(y),Si(y)&&y.onMount){const{onMount:g}=y;A.push(()=>{const x=g((...I)=>_(y,...I));x&&(h.u=x)})}return F||A.forEach(g=>g()),h},V=(y,C)=>!C.l.size&&(!C.t.size||C.t.size===1&&C.t.has(y)),T=(y,C)=>{if(!V(y,C))return;const F=C.u;F&&F(),e.delete(y),(Z?"production":void 0)!=="production"&&a.delete(y);const S=s(y);S?(Xe(S)&&Qr(S.v),S.d.forEach((E,A)=>{if(A!==y){const h=e.get(A);h&&(h.t.delete(y),T(A,h))}})):(Z?"production":void 0)!=="production"&&console.warn("[Bug] could not find atom state to unmount",y)},L=(y,C,F)=>{const S=new Set(C.d.keys()),E=new Set;F==null||F.forEach((A,h)=>{if(S.has(h)){S.delete(h);return}E.add(h);const g=e.get(h);g&&g.t.delete(y)}),S.forEach(A=>{P(A,y)}),E.forEach(A=>{const h=e.get(A);h&&T(A,h)})},M=y=>{let C;(Z?"production":void 0)!=="production"&&(C=new Set);const F=[],S=E=>{var A;if(!i.has(E))return;const[h,g]=i.get(E);i.delete(E),F.push([E,h]),g.forEach(S),(A=s(E))==null||A.d.forEach((x,I)=>S(I))};if(y.forEach(S),F.forEach(([E,A])=>{const h=s(E);if(!h){(Z?"production":void 0)!=="production"&&console.warn("[Bug] no atom state to flush");return}if(h!==A){const g=e.get(E);g&&h.d!==(A==null?void 0:A.d)&&L(E,h,A==null?void 0:A.d),g&&!(!Xe(A)&&(_t(A,h)||ea(A,h)))&&(g.l.forEach(x=>x()),(Z?"production":void 0)!=="production"&&C.add(E))}}),(Z?"production":void 0)!=="production")return C},G=(y,C)=>{const F=P(y),S=M([y]),E=F.l;return E.add(C),(Z?"production":void 0)!=="production"&&r.forEach(A=>A({type:"sub",flushed:S})),()=>{E.delete(C),T(y,F),(Z?"production":void 0)!=="production"&&r.forEach(A=>A({type:"unsub"}))}};return(Z?"production":void 0)!=="production"?{get:p,set:_,sub:G,dev_subscribe_store:y=>(r.add(y),()=>{r.delete(y)}),dev_get_mounted_atoms:()=>a.values(),dev_get_atom_state:y=>t.get(y),dev_get_mounted:y=>e.get(y),dev_restore_atoms:y=>{n.push(new Set);for(const[F,S]of y)_i(F)&&(d(F,S),m(F));const C=M(n.pop());r.forEach(F=>F({type:"restore",flushed:C}))}}:{get:p,set:_,sub:G}};let St;const ou=()=>(St||(St=ps(),(Z?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=St),globalThis.__JOTAI_DEFAULT_STORE__!==St&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),St),lu=ps,uu=ou;var cu={NZ_AWS_REGION:"us-east-1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1,STAGE:"prod"};const du=B.createContext(void 0),ms=t=>B.useContext(du)||uu(),fu=t=>typeof(t==null?void 0:t.then)=="function",hu=B.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}),t)});function zi(t,e){const n=ms(),[[i,r,a],s]=B.useReducer(u=>{const c=n.get(t);return Object.is(u[0],c)&&u[1]===n&&u[2]===t?u:[c,n,t]},void 0,()=>[n.get(t),n,t]);let o=i;return(r!==n||a!==t)&&(s(),o=n.get(t)),B.useEffect(()=>{const u=n.sub(t,()=>{s()});return s(),u},[n,t,void 0]),B.useDebugValue(o),fu(o)?hu(o):o}function vr(t,e){const n=ms();return B.useCallback((...r)=>{if((cu?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return n.set(t,...r)},[n,t])}function hn(t,e){return[zi(t),vr(t)]}const Hn=zn(null);Hn.debugLabel="accountAtom";var pu={NZ_AWS_REGION:"us-east-1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1,STAGE:"prod"};const{NZ_AWS_REGION:mu,NZ_BACKOFFICE_BACK_URL:gu,NZ_CORE_SERVICES_GRAPHQL_URL:vu,NZ_CORE_SERVICES_REST_URL:yu}=pu,yr={AWS:{region:mu,cognito:{userPoolId:"us-east-1_EZ7wuZ4ig",userPoolWebClientId:"2jok7cst8ebf6ppscrhji57gvr"}},apiUrls:{restV1:gu||"https://b133h34s56.execute-api.us-east-1.amazonaws.com",restV2:yu||"https://core-services-prod.nizza.com/api",graphql:vu||"https://core-services-prod.nizza.com/graphql",corsProxy:"https://3hvqfl2xcg.execute-api.us-east-1.amazonaws.com"},publicUrls:{platformSite:"https://platform.nizza.com",nizzaCdn:"https://cdn.nizza.com",bundleSite:"https://bundle.nizza.com",wssIVSChat:"wss://edge.ivschat.us-east-1.amazonaws.com"}};function gs(t,e){let n=null;const i=()=>{n||(n=e().log.createLogger(t))},r=(s,o)=>typeof s[o]=="function",a={get(s,o,l){i();const u=c=>(...d)=>{if(!n)return;const f=n[c];if(typeof f=="function")return f.apply(n,d)};return n&&r(n,o)?u(o):n?n[o]:void 0}};return new Proxy({},a)}function q(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];throw new Error(typeof t=="number"?"[MobX] minified error nr: "+t+(n.length?" "+n.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+t)}var ku={};function kr(){return typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:ku}var vs=Object.assign,An=Object.getOwnPropertyDescriptor,be=Object.defineProperty,qn=Object.prototype,Hi=[];Object.freeze(Hi);var ys={};Object.freeze(ys);var bu=typeof Proxy!="undefined",_u=Object.toString();function ks(){bu||q("Proxy not available")}function bs(t){var e=!1;return function(){if(!e)return e=!0,t.apply(this,arguments)}}var at=function(){};function he(t){return typeof t=="function"}function Be(t){var e=typeof t;switch(e){case"string":case"symbol":case"number":return!0}return!1}function Gn(t){return t!==null&&typeof t=="object"}function De(t){if(!Gn(t))return!1;var e=Object.getPrototypeOf(t);if(e==null)return!0;var n=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n.toString()===_u}function _s(t){var e=t==null?void 0:t.constructor;return e?e.name==="GeneratorFunction"||e.displayName==="GeneratorFunction":!1}function Kn(t,e,n){be(t,e,{enumerable:!1,writable:!0,configurable:!0,value:n})}function Ss(t,e,n){be(t,e,{enumerable:!1,writable:!1,configurable:!0,value:n})}function Ge(t,e){var n="isMobX"+t;return e.prototype[n]=!0,function(i){return Gn(i)&&i[n]===!0}}function pt(t){return t instanceof Map}function Wt(t){return t instanceof Set}var Ns=typeof Object.getOwnPropertySymbols!="undefined";function Su(t){var e=Object.keys(t);if(!Ns)return e;var n=Object.getOwnPropertySymbols(t);return n.length?[].concat(e,n.filter(function(i){return qn.propertyIsEnumerable.call(t,i)})):e}var Wn=typeof Reflect!="undefined"&&Reflect.ownKeys?Reflect.ownKeys:Ns?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames;function Es(t){return t===null?null:typeof t=="object"?""+t:t}function Ae(t,e){return qn.hasOwnProperty.call(t,e)}var Nu=Object.getOwnPropertyDescriptors||function(e){var n={};return Wn(e).forEach(function(i){n[i]=An(e,i)}),n};function Eu(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,wu(i.key),i)}}function br(t,e,n){return e&&Eu(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Pe(){return Pe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Pe.apply(this,arguments)}function As(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,qi(t,e)}function qi(t,e){return qi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,r){return i.__proto__=r,i},qi(t,e)}function Ni(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Au(t,e){if(t){if(typeof t=="string")return ta(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ta(t,e)}}function ta(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function st(t,e){var n=typeof Symbol!="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=Au(t))||e){n&&(t=n);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ou(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function wu(t){var e=Ou(t,"string");return typeof e=="symbol"?e:String(e)}var ge=Symbol("mobx-stored-annotations");function _e(t){function e(n,i){if(Jt(i))return t.decorate_20223_(n,i);mt(n,i,t)}return Object.assign(e,t)}function mt(t,e,n){Ae(t,ge)||Kn(t,ge,Pe({},t[ge])),Lu(n)||(t[ge][e]=n)}function Tu(t){return Ae(t,ge)||Kn(t,ge,Pe({},t[ge])),t[ge]}function Jt(t){return typeof t=="object"&&typeof t.kind=="string"}var U=Symbol("mobx administration"),Yt=function(){function t(n){n===void 0&&(n="Atom"),this.name_=void 0,this.isPendingUnobservation_=!1,this.isBeingObserved_=!1,this.observers_=new Set,this.diffValue_=0,this.lastAccessedBy_=0,this.lowestObserverState_=K.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=n}var e=t.prototype;return e.onBO=function(){this.onBOL&&this.onBOL.forEach(function(i){return i()})},e.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(i){return i()})},e.reportObserved=function(){return zs(this)},e.reportChanged=function(){ae(),Hs(this),se()},e.toString=function(){return this.name_},t}(),_r=Ge("Atom",Yt);function Os(t,e,n){e===void 0&&(e=at),n===void 0&&(n=at);var i=new Yt(t);return e!==at&&jc(i,e),n!==at&&Ys(i,n),i}function Cu(t,e){return t===e}function xu(t,e){return Or(t,e)}function Fu(t,e){return Or(t,e,1)}function Ru(t,e){return Object.is?Object.is(t,e):t===e?t!==0||1/t===1/e:t!==t&&e!==e}var On={identity:Cu,structural:xu,default:Ru,shallow:Fu};function ze(t,e,n){return eo(t)?t:Array.isArray(t)?X.array(t,{name:n}):De(t)?X.object(t,void 0,{name:n}):pt(t)?X.map(t,{name:n}):Wt(t)?X.set(t,{name:n}):typeof t=="function"&&!ei(t)&&!Ut(t)?_s(t)?ct(t):Vt(n,t):t}function Iu(t,e,n){if(t==null||ni(t)||ti(t)||We(t)||gt(t))return t;if(Array.isArray(t))return X.array(t,{name:n,deep:!1});if(De(t))return X.object(t,void 0,{name:n,deep:!1});if(pt(t))return X.map(t,{name:n,deep:!1});if(Wt(t))return X.set(t,{name:n,deep:!1})}function Jn(t){return t}function Du(t,e){return Or(t,e)?e:t}var Pu="override";function Lu(t){return t.annotationType_===Pu}function Qt(t,e){return{annotationType_:t,options_:e,make_:$u,extend_:Vu,decorate_20223_:Uu}}function $u(t,e,n,i){var r;if((r=this.options_)!=null&&r.bound)return this.extend_(t,e,n,!1)===null?0:1;if(i===t.target_)return this.extend_(t,e,n,!1)===null?0:2;if(ei(n.value))return 1;var a=ws(t,this,e,n,!1);return be(i,e,a),2}function Vu(t,e,n,i){var r=ws(t,this,e,n);return t.defineProperty_(e,r,i)}function Uu(t,e){var n=e.kind,i=e.name,r=e.addInitializer,a=this,s=function(u){var c,d,f,v;return Le((c=(d=a.options_)==null?void 0:d.name)!=null?c:i.toString(),u,(f=(v=a.options_)==null?void 0:v.autoAction)!=null?f:!1)};if(n=="field"){r(function(){mt(this,i,a)});return}if(n=="method"){var o;return ei(t)||(t=s(t)),(o=this.options_)!=null&&o.bound&&r(function(){var l=this,u=l[i].bind(l);u.isMobxAction=!0,l[i]=u}),t}q("Cannot apply '"+a.annotationType_+"' to '"+String(i)+"' (kind: "+n+"):"+(`
3
3
  '`+a.annotationType_+"' can only be used on properties with a function value."))}function ju(t,e,n,i){e.annotationType_,i.value}function ws(t,e,n,i,r){var a,s,o,l,u,c,d;r===void 0&&(r=O.safeDescriptors),ju(t,e,n,i);var f=i.value;if((a=e.options_)!=null&&a.bound){var v;f=f.bind((v=t.proxy_)!=null?v:t.target_)}return{value:Le((s=(o=e.options_)==null?void 0:o.name)!=null?s:n.toString(),f,(l=(u=e.options_)==null?void 0:u.autoAction)!=null?l:!1,(c=e.options_)!=null&&c.bound?(d=t.proxy_)!=null?d:t.target_:void 0),configurable:r?t.isPlainObject_:!0,enumerable:!1,writable:!r}}function Ts(t,e){return{annotationType_:t,options_:e,make_:Mu,extend_:Bu,decorate_20223_:zu}}function Mu(t,e,n,i){var r;if(i===t.target_)return this.extend_(t,e,n,!1)===null?0:2;if((r=this.options_)!=null&&r.bound&&(!Ae(t.target_,e)||!Ut(t.target_[e]))&&this.extend_(t,e,n,!1)===null)return 0;if(Ut(n.value))return 1;var a=Cs(t,this,e,n,!1,!1);return be(i,e,a),2}function Bu(t,e,n,i){var r,a=Cs(t,this,e,n,(r=this.options_)==null?void 0:r.bound);return t.defineProperty_(e,a,i)}function zu(t,e){var n,i=e.name,r=e.addInitializer;return Ut(t)||(t=ct(t)),(n=this.options_)!=null&&n.bound&&r(function(){var a=this,s=a[i].bind(a);s.isMobXFlow=!0,a[i]=s}),t}function Hu(t,e,n,i){e.annotationType_,i.value}function Cs(t,e,n,i,r,a){a===void 0&&(a=O.safeDescriptors),Hu(t,e,n,i);var s=i.value;if(Ut(s)||(s=ct(s)),r){var o;s=s.bind((o=t.proxy_)!=null?o:t.target_),s.isMobXFlow=!0}return{value:s,configurable:a?t.isPlainObject_:!0,enumerable:!1,writable:!a}}function Sr(t,e){return{annotationType_:t,options_:e,make_:qu,extend_:Gu,decorate_20223_:Ku}}function qu(t,e,n){return this.extend_(t,e,n,!1)===null?0:1}function Gu(t,e,n,i){return Wu(t,this,e,n),t.defineComputedProperty_(e,Pe({},this.options_,{get:n.get,set:n.set}),i)}function Ku(t,e){var n=this,i=e.name,r=e.addInitializer;return r(function(){var a=vt(this)[U],s=Pe({},n.options_,{get:t,context:this});s.name||(s.name="ObservableObject."+i.toString()),a.values_.set(i,new ut(s))}),function(){return this[U].getObservablePropValue_(i)}}function Wu(t,e,n,i){e.annotationType_,i.get}function Yn(t,e){return{annotationType_:t,options_:e,make_:Ju,extend_:Yu,decorate_20223_:Qu}}function Ju(t,e,n){return this.extend_(t,e,n,!1)===null?0:1}function Yu(t,e,n,i){var r,a;return Xu(t,this),t.defineObservableProperty_(e,n.value,(r=(a=this.options_)==null?void 0:a.enhancer)!=null?r:ze,i)}function Qu(t,e){var n=this,i=e.kind,r=e.name,a=new WeakSet;function s(o,l){var u,c,d=vt(o)[U],f=new je(l,(u=(c=n.options_)==null?void 0:c.enhancer)!=null?u:ze,"ObservableObject."+r.toString(),!1);d.values_.set(r,f),a.add(o)}if(i=="accessor")return{get:function(){return a.has(this)||s(this,t.get.call(this)),this[U].getObservablePropValue_(r)},set:function(l){return a.has(this)||s(this,l),this[U].setObservablePropValue_(r,l)},init:function(l){return a.has(this)||s(this,l),l}}}function Xu(t,e,n,i){e.annotationType_}var Zu="true",ec=xs();function xs(t){return{annotationType_:Zu,options_:t,make_:tc,extend_:nc,decorate_20223_:ic}}function tc(t,e,n,i){var r,a;if(n.get)return Fe.make_(t,e,n,i);if(n.set){var s=Le(e.toString(),n.set);return i===t.target_?t.defineProperty_(e,{configurable:O.safeDescriptors?t.isPlainObject_:!0,set:s})===null?0:2:(be(i,e,{configurable:!0,set:s}),2)}if(i!==t.target_&&typeof n.value=="function"){var o;if(_s(n.value)){var l,u=(l=this.options_)!=null&&l.autoBind?ct.bound:ct;return u.make_(t,e,n,i)}var c=(o=this.options_)!=null&&o.autoBind?Vt.bound:Vt;return c.make_(t,e,n,i)}var d=((r=this.options_)==null?void 0:r.deep)===!1?X.ref:X;if(typeof n.value=="function"&&(a=this.options_)!=null&&a.autoBind){var f;n.value=n.value.bind((f=t.proxy_)!=null?f:t.target_)}return d.make_(t,e,n,i)}function nc(t,e,n,i){var r,a;if(n.get)return Fe.extend_(t,e,n,i);if(n.set)return t.defineProperty_(e,{configurable:O.safeDescriptors?t.isPlainObject_:!0,set:Le(e.toString(),n.set)},i);if(typeof n.value=="function"&&(r=this.options_)!=null&&r.autoBind){var s;n.value=n.value.bind((s=t.proxy_)!=null?s:t.target_)}var o=((a=this.options_)==null?void 0:a.deep)===!1?X.ref:X;return o.extend_(t,e,n,i)}function ic(t,e){q("'"+this.annotationType_+"' cannot be used as a decorator")}var rc="observable",ac="observable.ref",sc="observable.shallow",oc="observable.struct",Fs={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(Fs);function on(t){return t||Fs}var Gi=Yn(rc),lc=Yn(ac,{enhancer:Jn}),uc=Yn(sc,{enhancer:Iu}),cc=Yn(oc,{enhancer:Du}),Rs=_e(Gi);function ln(t){return t.deep===!0?ze:t.deep===!1?Jn:fc(t.defaultDecorator)}function dc(t){var e;return t?(e=t.defaultDecorator)!=null?e:xs(t):void 0}function fc(t){var e,n;return t&&(e=(n=t.options_)==null?void 0:n.enhancer)!=null?e:ze}function Is(t,e,n){if(Jt(e))return Gi.decorate_20223_(t,e);if(Be(e)){mt(t,e,Gi);return}return eo(t)?t:De(t)?X.object(t,e,n):Array.isArray(t)?X.array(t,e):pt(t)?X.map(t,e):Wt(t)?X.set(t,e):typeof t=="object"&&t!==null?t:X.box(t,e)}vs(Is,Rs);var hc={box:function(e,n){var i=on(n);return new je(e,ln(i),i.name,!0,i.equals)},array:function(e,n){var i=on(n);return(O.useProxies===!1||i.proxy===!1?fd:nd)(e,ln(i),i.name)},map:function(e,n){var i=on(n);return new so(e,ln(i),i.name)},set:function(e,n){var i=on(n);return new uo(e,ln(i),i.name)},object:function(e,n,i){return Je(function(){return Hc(O.useProxies===!1||(i==null?void 0:i.proxy)===!1?vt({},i):Zc({},i),e,n)})},ref:_e(lc),shallow:_e(uc),deep:Rs,struct:_e(cc)},X=vs(Is,hc),Ds="computed",pc="computed.struct",Ki=Sr(Ds),mc=Sr(pc,{equals:On.structural}),Fe=function(e,n){if(Jt(n))return Ki.decorate_20223_(e,n);if(Be(n))return mt(e,n,Ki);if(De(e))return _e(Sr(Ds,e));var i=De(n)?n:{};return i.get=e,i.name||(i.name=e.name||""),new ut(i)};Object.assign(Fe,Ki);Fe.struct=_e(mc);var na,ia,wn=0,gc=1,vc=(na=(ia=An(function(){},"name"))==null?void 0:ia.configurable)!=null?na:!1,ra={value:"action",configurable:!0,writable:!1,enumerable:!1};function Le(t,e,n,i){n===void 0&&(n=!1);function r(){return yc(t,n,e,i||this,arguments)}return r.isMobxAction=!0,r.toString=function(){return e.toString()},vc&&(ra.value=t,be(r,"name",ra)),r}function yc(t,e,n,i,r){var a=kc(t,e);try{return n.apply(i,r)}catch(s){throw a.error_=s,s}finally{bc(a)}}function kc(t,e,n,i){var r=!1,a=0,s=O.trackingDerivation,o=!e||!s;ae();var l=O.allowStateChanges;o&&(Ke(),l=Qn(!0));var u=Nr(!0),c={runAsAction_:o,prevDerivation_:s,prevAllowStateChanges_:l,prevAllowStateReads_:u,notifySpy_:r,startTime_:a,actionId_:gc++,parentActionId_:wn};return wn=c.actionId_,c}function bc(t){wn!==t.actionId_&&q(30),wn=t.parentActionId_,t.error_!==void 0&&(O.suppressReactionErrors=!0),Xn(t.prevAllowStateChanges_),Ct(t.prevAllowStateReads_),se(),t.runAsAction_&&Oe(t.prevDerivation_),O.suppressReactionErrors=!1}function _c(t,e){var n=Qn(t);try{return e()}finally{Xn(n)}}function Qn(t){var e=O.allowStateChanges;return O.allowStateChanges=t,e}function Xn(t){O.allowStateChanges=t}var Ps;Ps=Symbol.toPrimitive;var je=function(t){As(e,t);function e(i,r,a,s,o){var l;return a===void 0&&(a="ObservableValue"),o===void 0&&(o=On.default),l=t.call(this,a)||this,l.enhancer=void 0,l.name_=void 0,l.equals=void 0,l.hasUnreportedChange_=!1,l.interceptors_=void 0,l.changeListeners_=void 0,l.value_=void 0,l.dehancer=void 0,l.enhancer=r,l.name_=a,l.equals=o,l.value_=r(i,void 0,a),l}var n=e.prototype;return n.dehanceValue=function(r){return this.dehancer!==void 0?this.dehancer(r):r},n.set=function(r){this.value_,r=this.prepareNewValue_(r),r!==O.UNCHANGED&&this.setNewValue_(r)},n.prepareNewValue_=function(r){if(ie(this)){var a=re(this,{object:this,type:Se,newValue:r});if(!a)return O.UNCHANGED;r=a.newValue}return r=this.enhancer(r,this.value_,this.name_),this.equals(this.value_,r)?O.UNCHANGED:r},n.setNewValue_=function(r){var a=this.value_;this.value_=r,this.reportChanged(),de(this)&&fe(this,{type:Se,object:this,newValue:r,oldValue:a})},n.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},n.intercept_=function(r){return Xt(this,r)},n.observe_=function(r,a){return a&&r({observableKind:"value",debugObjectName:this.name_,object:this,type:Se,newValue:this.value_,oldValue:void 0}),Zt(this,r)},n.raw=function(){return this.value_},n.toJSON=function(){return this.get()},n.toString=function(){return this.name_+"["+this.value_+"]"},n.valueOf=function(){return Es(this.get())},n[Ps]=function(){return this.valueOf()},e}(Yt),Ls;Ls=Symbol.toPrimitive;var ut=function(){function t(n){this.dependenciesState_=K.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.isBeingObserved_=!1,this.isPendingUnobservation_=!1,this.observers_=new Set,this.diffValue_=0,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=K.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new Cn(null),this.name_=void 0,this.triggeredBy_=void 0,this.isComputing_=!1,this.isRunningSetter_=!1,this.derivation=void 0,this.setter_=void 0,this.isTracing_=Tn.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,n.get||q(31),this.derivation=n.get,this.name_=n.name||"ComputedValue",n.set&&(this.setter_=Le("ComputedValue-setter",n.set)),this.equals_=n.equals||(n.compareStructural||n.struct?On.structural:On.default),this.scope_=n.context,this.requiresReaction_=n.requiresReaction,this.keepAlive_=!!n.keepAlive}var e=t.prototype;return e.onBecomeStale_=function(){Oc(this)},e.onBO=function(){this.onBOL&&this.onBOL.forEach(function(i){return i()})},e.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(i){return i()})},e.get=function(){if(this.isComputing_&&q(32,this.name_,this.derivation),O.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)Wi(this)&&(this.warnAboutUntrackedRead_(),ae(),this.value_=this.computeValue_(!1),se());else if(zs(this),Wi(this)){var i=O.trackingContext;this.keepAlive_&&!i&&(O.trackingContext=this),this.trackAndCompute()&&Ac(this),O.trackingContext=i}var r=this.value_;if(pn(r))throw r.cause;return r},e.set=function(i){if(this.setter_){this.isRunningSetter_&&q(33,this.name_),this.isRunningSetter_=!0;try{this.setter_.call(this.scope_,i)}finally{this.isRunningSetter_=!1}}else q(34,this.name_)},e.trackAndCompute=function(){var i=this.value_,r=this.dependenciesState_===K.NOT_TRACKING_,a=this.computeValue_(!0),s=r||pn(i)||pn(a)||!this.equals_(i,a);return s&&(this.value_=a),s},e.computeValue_=function(i){this.isComputing_=!0;var r=Qn(!1),a;if(i)a=$s(this,this.derivation,this.scope_);else if(O.disableErrorBoundaries===!0)a=this.derivation.call(this.scope_);else try{a=this.derivation.call(this.scope_)}catch(s){a=new Cn(s)}return Xn(r),this.isComputing_=!1,a},e.suspend_=function(){this.keepAlive_||(Ji(this),this.value_=void 0)},e.observe_=function(i,r){var a=this,s=!0,o=void 0;return Js(function(){var l=a.get();if(!s||r){var u=Ke();i({observableKind:"computed",debugObjectName:a.name_,type:Se,object:a,newValue:l,oldValue:o}),Oe(u)}s=!1,o=l})},e.warnAboutUntrackedRead_=function(){},e.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},e.valueOf=function(){return Es(this.get())},e[Ls]=function(){return this.valueOf()},t}(),Zn=Ge("ComputedValue",ut),K;(function(t){t[t.NOT_TRACKING_=-1]="NOT_TRACKING_",t[t.UP_TO_DATE_=0]="UP_TO_DATE_",t[t.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",t[t.STALE_=2]="STALE_"})(K||(K={}));var Tn;(function(t){t[t.NONE=0]="NONE",t[t.LOG=1]="LOG",t[t.BREAK=2]="BREAK"})(Tn||(Tn={}));var Cn=function(e){this.cause=void 0,this.cause=e};function pn(t){return t instanceof Cn}function Wi(t){switch(t.dependenciesState_){case K.UP_TO_DATE_:return!1;case K.NOT_TRACKING_:case K.STALE_:return!0;case K.POSSIBLY_STALE_:{for(var e=Nr(!0),n=Ke(),i=t.observing_,r=i.length,a=0;a<r;a++){var s=i[a];if(Zn(s)){if(O.disableErrorBoundaries)s.get();else try{s.get()}catch{return Oe(n),Ct(e),!0}if(t.dependenciesState_===K.STALE_)return Oe(n),Ct(e),!0}}return Us(t),Oe(n),Ct(e),!1}}}function $s(t,e,n){var i=Nr(!0);Us(t),t.newObserving_=new Array(t.runId_===0?100:t.observing_.length),t.unboundDepsCount_=0,t.runId_=++O.runId;var r=O.trackingDerivation;O.trackingDerivation=t,O.inBatch++;var a;if(O.disableErrorBoundaries===!0)a=e.call(n);else try{a=e.call(n)}catch(s){a=new Cn(s)}return O.inBatch--,O.trackingDerivation=r,Sc(t),Ct(i),a}function Sc(t){for(var e=t.observing_,n=t.observing_=t.newObserving_,i=K.UP_TO_DATE_,r=0,a=t.unboundDepsCount_,s=0;s<a;s++){var o=n[s];o.diffValue_===0&&(o.diffValue_=1,r!==s&&(n[r]=o),r++),o.dependenciesState_>i&&(i=o.dependenciesState_)}for(n.length=r,t.newObserving_=null,a=e.length;a--;){var l=e[a];l.diffValue_===0&&Ms(l,t),l.diffValue_=0}for(;r--;){var u=n[r];u.diffValue_===1&&(u.diffValue_=0,Ec(u,t))}i!==K.UP_TO_DATE_&&(t.dependenciesState_=i,t.onBecomeStale_())}function Ji(t){var e=t.observing_;t.observing_=[];for(var n=e.length;n--;)Ms(e[n],t);t.dependenciesState_=K.NOT_TRACKING_}function Vs(t){var e=Ke();try{return t()}finally{Oe(e)}}function Ke(){var t=O.trackingDerivation;return O.trackingDerivation=null,t}function Oe(t){O.trackingDerivation=t}function Nr(t){var e=O.allowStateReads;return O.allowStateReads=t,e}function Ct(t){O.allowStateReads=t}function Us(t){if(t.dependenciesState_!==K.UP_TO_DATE_){t.dependenciesState_=K.UP_TO_DATE_;for(var e=t.observing_,n=e.length;n--;)e[n].lowestObserverState_=K.UP_TO_DATE_}}var mn=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},gn=!0,js=!1,O=function(){var t=kr();return t.__mobxInstanceCount>0&&!t.__mobxGlobals&&(gn=!1),t.__mobxGlobals&&t.__mobxGlobals.version!==new mn().version&&(gn=!1),gn?t.__mobxGlobals?(t.__mobxInstanceCount+=1,t.__mobxGlobals.UNCHANGED||(t.__mobxGlobals.UNCHANGED={}),t.__mobxGlobals):(t.__mobxInstanceCount=1,t.__mobxGlobals=new mn):(setTimeout(function(){js||q(35)},1),new mn)}();function Nc(){if((O.pendingReactions.length||O.inBatch||O.isRunningReactions)&&q(36),js=!0,gn){var t=kr();--t.__mobxInstanceCount===0&&(t.__mobxGlobals=void 0),O=new mn}}function Ec(t,e){t.observers_.add(e),t.lowestObserverState_>e.dependenciesState_&&(t.lowestObserverState_=e.dependenciesState_)}function Ms(t,e){t.observers_.delete(e),t.observers_.size===0&&Bs(t)}function Bs(t){t.isPendingUnobservation_===!1&&(t.isPendingUnobservation_=!0,O.pendingUnobservations.push(t))}function ae(){O.inBatch++}function se(){if(--O.inBatch===0){qs();for(var t=O.pendingUnobservations,e=0;e<t.length;e++){var n=t[e];n.isPendingUnobservation_=!1,n.observers_.size===0&&(n.isBeingObserved_&&(n.isBeingObserved_=!1,n.onBUO()),n instanceof ut&&n.suspend_())}O.pendingUnobservations=[]}}function zs(t){var e=O.trackingDerivation;return e!==null?(e.runId_!==t.lastAccessedBy_&&(t.lastAccessedBy_=e.runId_,e.newObserving_[e.unboundDepsCount_++]=t,!t.isBeingObserved_&&O.trackingContext&&(t.isBeingObserved_=!0,t.onBO())),t.isBeingObserved_):(t.observers_.size===0&&O.inBatch>0&&Bs(t),!1)}function Hs(t){t.lowestObserverState_!==K.STALE_&&(t.lowestObserverState_=K.STALE_,t.observers_.forEach(function(e){e.dependenciesState_===K.UP_TO_DATE_&&e.onBecomeStale_(),e.dependenciesState_=K.STALE_}))}function Ac(t){t.lowestObserverState_!==K.STALE_&&(t.lowestObserverState_=K.STALE_,t.observers_.forEach(function(e){e.dependenciesState_===K.POSSIBLY_STALE_?e.dependenciesState_=K.STALE_:e.dependenciesState_===K.UP_TO_DATE_&&(t.lowestObserverState_=K.UP_TO_DATE_)}))}function Oc(t){t.lowestObserverState_===K.UP_TO_DATE_&&(t.lowestObserverState_=K.POSSIBLY_STALE_,t.observers_.forEach(function(e){e.dependenciesState_===K.UP_TO_DATE_&&(e.dependenciesState_=K.POSSIBLY_STALE_,e.onBecomeStale_())}))}var $t=function(){function t(n,i,r,a){n===void 0&&(n="Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=K.NOT_TRACKING_,this.diffValue_=0,this.runId_=0,this.unboundDepsCount_=0,this.isDisposed_=!1,this.isScheduled_=!1,this.isTrackPending_=!1,this.isRunning_=!1,this.isTracing_=Tn.NONE,this.name_=n,this.onInvalidate_=i,this.errorHandler_=r,this.requiresObservable_=a}var e=t.prototype;return e.onBecomeStale_=function(){this.schedule_()},e.schedule_=function(){this.isScheduled_||(this.isScheduled_=!0,O.pendingReactions.push(this),qs())},e.isScheduled=function(){return this.isScheduled_},e.runReaction_=function(){if(!this.isDisposed_){ae(),this.isScheduled_=!1;var i=O.trackingContext;if(O.trackingContext=this,Wi(this)){this.isTrackPending_=!0;try{this.onInvalidate_()}catch(r){this.reportExceptionInDerivation_(r)}}O.trackingContext=i,se()}},e.track=function(i){if(!this.isDisposed_){ae(),this.isRunning_=!0;var r=O.trackingContext;O.trackingContext=this;var a=$s(this,i,void 0);O.trackingContext=r,this.isRunning_=!1,this.isTrackPending_=!1,this.isDisposed_&&Ji(this),pn(a)&&this.reportExceptionInDerivation_(a.cause),se()}},e.reportExceptionInDerivation_=function(i){var r=this;if(this.errorHandler_){this.errorHandler_(i,this);return}if(O.disableErrorBoundaries)throw i;var a="[mobx] uncaught error in '"+this+"'";O.suppressReactionErrors||console.error(a,i),O.globalReactionErrorHandlers.forEach(function(s){return s(i,r)})},e.dispose=function(){this.isDisposed_||(this.isDisposed_=!0,this.isRunning_||(ae(),Ji(this),se()))},e.getDisposer_=function(i){var r=this,a=function s(){r.dispose(),i==null||i.removeEventListener==null||i.removeEventListener("abort",s)};return i==null||i.addEventListener==null||i.addEventListener("abort",a),a[U]=this,a},e.toString=function(){return"Reaction["+this.name_+"]"},e.trace=function(i){},t}(),wc=100,Yi=function(e){return e()};function qs(){O.inBatch>0||O.isRunningReactions||Yi(Tc)}function Tc(){O.isRunningReactions=!0;for(var t=O.pendingReactions,e=0;t.length>0;){++e===wc&&(console.error("[mobx] cycle in reaction: "+t[0]),t.splice(0));for(var n=t.splice(0),i=0,r=n.length;i<r;i++)n[i].runReaction_()}O.isRunningReactions=!1}var xn=Ge("Reaction",$t);function Cc(t){var e=Yi;Yi=function(i){return t(function(){return e(i)})}}function xt(){return!1}function xc(t){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var Gs="action",Fc="action.bound",Ks="autoAction",Rc="autoAction.bound",Ic="<unnamed action>",Qi=Qt(Gs),Dc=Qt(Fc,{bound:!0}),Xi=Qt(Ks,{autoAction:!0}),Pc=Qt(Rc,{autoAction:!0,bound:!0});function Ws(t){var e=function(i,r){if(he(i))return Le(i.name||Ic,i,t);if(he(r))return Le(i,r,t);if(Jt(r))return(t?Xi:Qi).decorate_20223_(i,r);if(Be(r))return mt(i,r,t?Xi:Qi);if(Be(i))return _e(Qt(t?Ks:Gs,{name:i,autoAction:t}))};return e}var ve=Ws(!1);Object.assign(ve,Qi);var Vt=Ws(!0);Object.assign(Vt,Xi);ve.bound=_e(Dc);Vt.bound=_e(Pc);function ei(t){return he(t)&&t.isMobxAction===!0}function Js(t,e){var n,i,r,a,s;e===void 0&&(e=ys);var o=(n=(i=e)==null?void 0:i.name)!=null?n:"Autorun",l=!e.scheduler&&!e.delay,u;if(l)u=new $t(o,function(){this.track(f)},e.onError,e.requiresObservable);else{var c=$c(e),d=!1;u=new $t(o,function(){d||(d=!0,c(function(){d=!1,u.isDisposed_||u.track(f)}))},e.onError,e.requiresObservable)}function f(){t(u)}return(r=e)!=null&&(a=r.signal)!=null&&a.aborted||u.schedule_(),u.getDisposer_((s=e)==null?void 0:s.signal)}var Lc=function(e){return e()};function $c(t){return t.scheduler?t.scheduler:t.delay?function(e){return setTimeout(e,t.delay)}:Lc}var Vc="onBO",Uc="onBUO";function jc(t,e,n){return Qs(Vc,t,e,n)}function Ys(t,e,n){return Qs(Uc,t,e,n)}function Qs(t,e,n,i){var r=In(e),a=he(i)?i:n,s=t+"L";return r[s]?r[s].add(a):r[s]=new Set([a]),function(){var o=r[s];o&&(o.delete(a),o.size===0&&delete r[s])}}var Mc="never",un="always",Bc="observed";function zc(t){t.isolateGlobalState===!0&&Nc();var e=t.useProxies,n=t.enforceActions;if(e!==void 0&&(O.useProxies=e===un?!0:e===Mc?!1:typeof Proxy!="undefined"),e==="ifavailable"&&(O.verifyProxies=!0),n!==void 0){var i=n===un?un:n===Bc;O.enforceActions=i,O.allowStateChanges=!(i===!0||i===un)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(r){r in t&&(O[r]=!!t[r])}),O.allowStateReads=!O.observableRequiresReaction,t.reactionScheduler&&Cc(t.reactionScheduler)}function Hc(t,e,n,i){var r=Nu(e);return Je(function(){var a=vt(t,i)[U];Wn(r).forEach(function(s){a.extend_(s,r[s],n&&s in n?n[s]:!0)})}),t}function qc(t,e){return Xs(In(t,e))}function Xs(t){var e={name:t.name_};return t.observing_&&t.observing_.length>0&&(e.dependencies=Gc(t.observing_).map(Xs)),e}function Gc(t){return Array.from(new Set(t))}var Kc=0;function Zs(){this.message="FLOW_CANCELLED"}Zs.prototype=Object.create(Error.prototype);var Ei=Ts("flow"),Wc=Ts("flow.bound",{bound:!0}),ct=Object.assign(function(e,n){if(Jt(n))return Ei.decorate_20223_(e,n);if(Be(n))return mt(e,n,Ei);var i=e,r=i.name||"<unnamed flow>",a=function(){var o=this,l=arguments,u=++Kc,c=ve(r+" - runid: "+u+" - init",i).apply(o,l),d,f=void 0,v=new Promise(function(p,m){var N=0;d=m;function _(T){f=void 0;var L;try{L=ve(r+" - runid: "+u+" - yield "+N++,c.next).call(c,T)}catch(M){return m(M)}V(L)}function P(T){f=void 0;var L;try{L=ve(r+" - runid: "+u+" - yield "+N++,c.throw).call(c,T)}catch(M){return m(M)}V(L)}function V(T){if(he(T==null?void 0:T.then)){T.then(V,m);return}return T.done?p(T.value):(f=Promise.resolve(T.value),f.then(_,P))}_(void 0)});return v.cancel=ve(r+" - runid: "+u+" - cancel",function(){try{f&&aa(f);var p=c.return(void 0),m=Promise.resolve(p.value);m.then(at,at),aa(m),d(new Zs)}catch(N){d(N)}}),v};return a.isMobXFlow=!0,a},Ei);ct.bound=_e(Wc);function aa(t){he(t.cancel)&&t.cancel()}function Ut(t){return(t==null?void 0:t.isMobXFlow)===!0}function Jc(t,e){return t?ni(t)||!!t[U]||_r(t)||xn(t)||Zn(t):!1}function eo(t){return Jc(t)}function Ee(t,e){e===void 0&&(e=void 0),ae();try{return t.apply(e)}finally{se()}}function Yc(t,e,n){return arguments.length===1||e&&typeof e=="object"?Qc(t,e):to(t,e,{})}function to(t,e,n){var i;if(typeof n.timeout=="number"){var r=new Error("WHEN_TIMEOUT");i=setTimeout(function(){if(!s[U].isDisposed_)if(s(),n.onError)n.onError(r);else throw r},n.timeout)}n.name="When";var a=Le("When-effect",e),s=Js(function(o){var l=_c(!1,t);l&&(o.dispose(),i&&clearTimeout(i),a())},n);return s}function Qc(t,e){var n;if(e!=null&&(n=e.signal)!=null&&n.aborted)return Object.assign(Promise.reject(new Error("WHEN_ABORTED")),{cancel:function(){return null}});var i,r,a=new Promise(function(s,o){var l,u=to(t,s,Pe({},e,{onError:o}));i=function(){u(),o(new Error("WHEN_CANCELLED"))},r=function(){u(),o(new Error("WHEN_ABORTED"))},e==null||(l=e.signal)==null||l.addEventListener==null||l.addEventListener("abort",r)}).finally(function(){var s;return e==null||(s=e.signal)==null||s.removeEventListener==null?void 0:s.removeEventListener("abort",r)});return a.cancel=i,a}function Ze(t){return t[U]}var Xc={has:function(e,n){return Ze(e).has_(n)},get:function(e,n){return Ze(e).get_(n)},set:function(e,n,i){var r;return Be(n)?(r=Ze(e).set_(n,i,!0))!=null?r:!0:!1},deleteProperty:function(e,n){var i;return Be(n)?(i=Ze(e).delete_(n,!0))!=null?i:!0:!1},defineProperty:function(e,n,i){var r;return(r=Ze(e).defineProperty_(n,i))!=null?r:!0},ownKeys:function(e){return Ze(e).ownKeys_()},preventExtensions:function(e){q(13)}};function Zc(t,e){var n,i;return ks(),t=vt(t,e),(i=(n=t[U]).proxy_)!=null?i:n.proxy_=new Proxy(t,Xc)}function ie(t){return t.interceptors_!==void 0&&t.interceptors_.length>0}function Xt(t,e){var n=t.interceptors_||(t.interceptors_=[]);return n.push(e),bs(function(){var i=n.indexOf(e);i!==-1&&n.splice(i,1)})}function re(t,e){var n=Ke();try{for(var i=[].concat(t.interceptors_||[]),r=0,a=i.length;r<a&&(e=i[r](e),e&&!e.type&&q(14),!!e);r++);return e}finally{Oe(n)}}function de(t){return t.changeListeners_!==void 0&&t.changeListeners_.length>0}function Zt(t,e){var n=t.changeListeners_||(t.changeListeners_=[]);return n.push(e),bs(function(){var i=n.indexOf(e);i!==-1&&n.splice(i,1)})}function fe(t,e){var n=Ke(),i=t.changeListeners_;if(i){i=i.slice();for(var r=0,a=i.length;r<a;r++)i[r](e);Oe(n)}}function no(t,e,n){return Je(function(){var i,r=vt(t,n)[U];(i=e)!=null||(e=Tu(t)),Wn(e).forEach(function(a){return r.make_(a,e[a])})}),t}var sa="splice",Se="update",ed=1e4,td={get:function(e,n){var i=e[U];return n===U?i:n==="length"?i.getArrayLength_():typeof n=="string"&&!isNaN(n)?i.get_(parseInt(n)):Ae(Fn,n)?Fn[n]:e[n]},set:function(e,n,i){var r=e[U];return n==="length"&&r.setArrayLength_(i),typeof n=="symbol"||isNaN(n)?e[n]=i:r.set_(parseInt(n),i),!0},preventExtensions:function(){q(15)}},Er=function(){function t(n,i,r,a){n===void 0&&(n="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_=r,this.legacyMode_=a,this.atom_=new Yt(n),this.enhancer_=function(s,o){return i(s,o,"ObservableArray[..]")}}var e=t.prototype;return e.dehanceValue_=function(i){return this.dehancer!==void 0?this.dehancer(i):i},e.dehanceValues_=function(i){return this.dehancer!==void 0&&i.length>0?i.map(this.dehancer):i},e.intercept_=function(i){return Xt(this,i)},e.observe_=function(i,r){return r===void 0&&(r=!1),r&&i({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),Zt(this,i)},e.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},e.setArrayLength_=function(i){(typeof i!="number"||isNaN(i)||i<0)&&q("Out of range: "+i);var r=this.values_.length;if(i!==r)if(i>r){for(var a=new Array(i-r),s=0;s<i-r;s++)a[s]=void 0;this.spliceWithArray_(r,0,a)}else this.spliceWithArray_(i,r-i)},e.updateArrayLength_=function(i,r){i!==this.lastKnownLength_&&q(16),this.lastKnownLength_+=r,this.legacyMode_&&r>0&&po(i+r+1)},e.spliceWithArray_=function(i,r,a){var s=this;this.atom_;var o=this.values_.length;if(i===void 0?i=0:i>o?i=o:i<0&&(i=Math.max(0,o+i)),arguments.length===1?r=o-i:r==null?r=0:r=Math.max(0,Math.min(r,o-i)),a===void 0&&(a=Hi),ie(this)){var l=re(this,{object:this.proxy_,type:sa,index:i,removedCount:r,added:a});if(!l)return Hi;r=l.removedCount,a=l.added}if(a=a.length===0?a:a.map(function(d){return s.enhancer_(d,void 0)}),this.legacyMode_){var u=a.length-r;this.updateArrayLength_(o,u)}var c=this.spliceItemsIntoValues_(i,r,a);return(r!==0||a.length!==0)&&this.notifyArraySplice_(i,a,c),this.dehanceValues_(c)},e.spliceItemsIntoValues_=function(i,r,a){if(a.length<ed){var s;return(s=this.values_).splice.apply(s,[i,r].concat(a))}else{var o=this.values_.slice(i,i+r),l=this.values_.slice(i+r);this.values_.length+=a.length-r;for(var u=0;u<a.length;u++)this.values_[i+u]=a[u];for(var c=0;c<l.length;c++)this.values_[i+a.length+c]=l[c];return o}},e.notifyArrayChildUpdate_=function(i,r,a){var s=!this.owned_&&xt(),o=de(this),l=o||s?{observableKind:"array",object:this.proxy_,type:Se,debugObjectName:this.atom_.name_,index:i,newValue:r,oldValue:a}:null;this.atom_.reportChanged(),o&&fe(this,l)},e.notifyArraySplice_=function(i,r,a){var s=!this.owned_&&xt(),o=de(this),l=o||s?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:sa,index:i,removed:a,added:r,removedCount:a.length,addedCount:r.length}:null;this.atom_.reportChanged(),o&&fe(this,l)},e.get_=function(i){if(this.legacyMode_&&i>=this.values_.length){console.warn("[mobx] Out of bounds read: "+i);return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[i])},e.set_=function(i,r){var a=this.values_;if(this.legacyMode_&&i>a.length&&q(17,i,a.length),i<a.length){this.atom_;var s=a[i];if(ie(this)){var o=re(this,{type:Se,object:this.proxy_,index:i,newValue:r});if(!o)return;r=o.newValue}r=this.enhancer_(r,s);var l=r!==s;l&&(a[i]=r,this.notifyArrayChildUpdate_(i,r,s))}else{for(var u=new Array(i+1-a.length),c=0;c<u.length-1;c++)u[c]=void 0;u[u.length-1]=r,this.spliceWithArray_(a.length,0,u)}},t}();function nd(t,e,n,i){return n===void 0&&(n="ObservableArray"),i===void 0&&(i=!1),ks(),Je(function(){var r=new Er(n,e,i,!1);Ss(r.values_,U,r);var a=new Proxy(r.values_,td);return r.proxy_=a,t&&t.length&&r.spliceWithArray_(0,0,t),a})}var Fn={clear:function(){return this.splice(0)},replace:function(e){var n=this[U];return n.spliceWithArray_(0,n.values_.length,e)},toJSON:function(){return this.slice()},splice:function(e,n){for(var i=arguments.length,r=new Array(i>2?i-2:0),a=2;a<i;a++)r[a-2]=arguments[a];var s=this[U];switch(arguments.length){case 0:return[];case 1:return s.spliceWithArray_(e);case 2:return s.spliceWithArray_(e,n)}return s.spliceWithArray_(e,n,r)},spliceWithArray:function(e,n,i){return this[U].spliceWithArray_(e,n,i)},push:function(){for(var e=this[U],n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return e.spliceWithArray_(e.values_.length,0,i),e.values_.length},pop:function(){return this.splice(Math.max(this[U].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var e=this[U],n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return e.spliceWithArray_(0,0,i),e.values_.length},reverse:function(){return O.trackingDerivation&&q(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){O.trackingDerivation&&q(37,"sort");var e=this.slice();return e.sort.apply(e,arguments),this.replace(e),this},remove:function(e){var n=this[U],i=n.dehanceValues_(n.values_).indexOf(e);return i>-1?(this.splice(i,1),!0):!1}};W("at",ne);W("concat",ne);W("flat",ne);W("includes",ne);W("indexOf",ne);W("join",ne);W("lastIndexOf",ne);W("slice",ne);W("toString",ne);W("toLocaleString",ne);W("toSorted",ne);W("toSpliced",ne);W("with",ne);W("every",pe);W("filter",pe);W("find",pe);W("findIndex",pe);W("findLast",pe);W("findLastIndex",pe);W("flatMap",pe);W("forEach",pe);W("map",pe);W("some",pe);W("toReversed",pe);W("reduce",io);W("reduceRight",io);function W(t,e){typeof Array.prototype[t]=="function"&&(Fn[t]=e(t))}function ne(t){return function(){var e=this[U];e.atom_.reportObserved();var n=e.dehanceValues_(e.values_);return n[t].apply(n,arguments)}}function pe(t){return function(e,n){var i=this,r=this[U];r.atom_.reportObserved();var a=r.dehanceValues_(r.values_);return a[t](function(s,o){return e.call(n,s,o,i)})}}function io(t){return function(){var e=this,n=this[U];n.atom_.reportObserved();var i=n.dehanceValues_(n.values_),r=arguments[0];return arguments[0]=function(a,s,o){return r(a,s,o,e)},i[t].apply(i,arguments)}}var id=Ge("ObservableArrayAdministration",Er);function ti(t){return Gn(t)&&id(t[U])}var ro,ao,rd={},Re="add",Rn="delete";ro=Symbol.iterator;ao=Symbol.toStringTag;var so=function(){function t(n,i,r){var a=this;i===void 0&&(i=ze),r===void 0&&(r="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[U]=rd,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_=i,this.name_=r,he(Map)||q(18),Je(function(){a.keysAtom_=Os("ObservableMap.keys()"),a.data_=new Map,a.hasMap_=new Map,n&&a.merge(n)})}var e=t.prototype;return e.has_=function(i){return this.data_.has(i)},e.has=function(i){var r=this;if(!O.trackingDerivation)return this.has_(i);var a=this.hasMap_.get(i);if(!a){var s=a=new je(this.has_(i),Jn,"ObservableMap.key?",!1);this.hasMap_.set(i,s),Ys(s,function(){return r.hasMap_.delete(i)})}return a.get()},e.set=function(i,r){var a=this.has_(i);if(ie(this)){var s=re(this,{type:a?Se:Re,object:this,newValue:r,name:i});if(!s)return this;r=s.newValue}return a?this.updateValue_(i,r):this.addValue_(i,r),this},e.delete=function(i){var r=this;if(this.keysAtom_,ie(this)){var a=re(this,{type:Rn,object:this,name:i});if(!a)return!1}if(this.has_(i)){var s=xt(),o=de(this),l=o||s?{observableKind:"map",debugObjectName:this.name_,type:Rn,object:this,oldValue:this.data_.get(i).value_,name:i}:null;return Ee(function(){var u;r.keysAtom_.reportChanged(),(u=r.hasMap_.get(i))==null||u.setNewValue_(!1);var c=r.data_.get(i);c.setNewValue_(void 0),r.data_.delete(i)}),o&&fe(this,l),!0}return!1},e.updateValue_=function(i,r){var a=this.data_.get(i);if(r=a.prepareNewValue_(r),r!==O.UNCHANGED){var s=xt(),o=de(this),l=o||s?{observableKind:"map",debugObjectName:this.name_,type:Se,object:this,oldValue:a.value_,name:i,newValue:r}:null;a.setNewValue_(r),o&&fe(this,l)}},e.addValue_=function(i,r){var a=this;this.keysAtom_,Ee(function(){var u,c=new je(r,a.enhancer_,"ObservableMap.key",!1);a.data_.set(i,c),r=c.value_,(u=a.hasMap_.get(i))==null||u.setNewValue_(!0),a.keysAtom_.reportChanged()});var s=xt(),o=de(this),l=o||s?{observableKind:"map",debugObjectName:this.name_,type:Re,object:this,name:i,newValue:r}:null;o&&fe(this,l)},e.get=function(i){return this.has(i)?this.dehanceValue_(this.data_.get(i).get()):this.dehanceValue_(void 0)},e.dehanceValue_=function(i){return this.dehancer!==void 0?this.dehancer(i):i},e.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},e.values=function(){var i=this,r=this.keys();return jt({next:function(){var s=r.next(),o=s.done,l=s.value;return{done:o,value:o?void 0:i.get(l)}}})},e.entries=function(){var i=this,r=this.keys();return jt({next:function(){var s=r.next(),o=s.done,l=s.value;return{done:o,value:o?void 0:[l,i.get(l)]}}})},e[ro]=function(){return this.entries()},e.forEach=function(i,r){for(var a=st(this),s;!(s=a()).done;){var o=s.value,l=o[0],u=o[1];i.call(r,u,l,this)}},e.merge=function(i){var r=this;return We(i)&&(i=new Map(i)),Ee(function(){De(i)?Su(i).forEach(function(a){return r.set(a,i[a])}):Array.isArray(i)?i.forEach(function(a){var s=a[0],o=a[1];return r.set(s,o)}):pt(i)?(i.constructor!==Map&&q(19,i),i.forEach(function(a,s){return r.set(s,a)})):i!=null&&q(20,i)}),this},e.clear=function(){var i=this;Ee(function(){Vs(function(){for(var r=st(i.keys()),a;!(a=r()).done;){var s=a.value;i.delete(s)}})})},e.replace=function(i){var r=this;return Ee(function(){for(var a=ad(i),s=new Map,o=!1,l=st(r.data_.keys()),u;!(u=l()).done;){var c=u.value;if(!a.has(c)){var d=r.delete(c);if(d)o=!0;else{var f=r.data_.get(c);s.set(c,f)}}}for(var v=st(a.entries()),p;!(p=v()).done;){var m=p.value,N=m[0],_=m[1],P=r.data_.has(N);if(r.set(N,_),r.data_.has(N)){var V=r.data_.get(N);s.set(N,V),P||(o=!0)}}if(!o)if(r.data_.size!==s.size)r.keysAtom_.reportChanged();else for(var T=r.data_.keys(),L=s.keys(),M=T.next(),G=L.next();!M.done;){if(M.value!==G.value){r.keysAtom_.reportChanged();break}M=T.next(),G=L.next()}r.data_=s}),this},e.toString=function(){return"[object ObservableMap]"},e.toJSON=function(){return Array.from(this)},e.observe_=function(i,r){return Zt(this,i)},e.intercept_=function(i){return Xt(this,i)},br(t,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:ao,get:function(){return"Map"}}]),t}(),We=Ge("ObservableMap",so);function ad(t){if(pt(t)||We(t))return t;if(Array.isArray(t))return new Map(t);if(De(t)){var e=new Map;for(var n in t)e.set(n,t[n]);return e}else return q(21,t)}var oo,lo,sd={};oo=Symbol.iterator;lo=Symbol.toStringTag;var uo=function(){function t(n,i,r){var a=this;i===void 0&&(i=ze),r===void 0&&(r="ObservableSet"),this.name_=void 0,this[U]=sd,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_=r,he(Set)||q(22),this.enhancer_=function(s,o){return i(s,o,r)},Je(function(){a.atom_=Os(a.name_),n&&a.replace(n)})}var e=t.prototype;return e.dehanceValue_=function(i){return this.dehancer!==void 0?this.dehancer(i):i},e.clear=function(){var i=this;Ee(function(){Vs(function(){for(var r=st(i.data_.values()),a;!(a=r()).done;){var s=a.value;i.delete(s)}})})},e.forEach=function(i,r){for(var a=st(this),s;!(s=a()).done;){var o=s.value;i.call(r,o,o,this)}},e.add=function(i){var r=this;if(this.atom_,ie(this)){var a=re(this,{type:Re,object:this,newValue:i});if(!a)return this}if(!this.has(i)){Ee(function(){r.data_.add(r.enhancer_(i,void 0)),r.atom_.reportChanged()});var s=!1,o=de(this),l=o||s?{observableKind:"set",debugObjectName:this.name_,type:Re,object:this,newValue:i}:null;o&&fe(this,l)}return this},e.delete=function(i){var r=this;if(ie(this)){var a=re(this,{type:Rn,object:this,oldValue:i});if(!a)return!1}if(this.has(i)){var s=!1,o=de(this),l=o||s?{observableKind:"set",debugObjectName:this.name_,type:Rn,object:this,oldValue:i}:null;return Ee(function(){r.atom_.reportChanged(),r.data_.delete(i)}),o&&fe(this,l),!0}return!1},e.has=function(i){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(i))},e.entries=function(){var i=0,r=Array.from(this.keys()),a=Array.from(this.values());return jt({next:function(){var o=i;return i+=1,o<a.length?{value:[r[o],a[o]],done:!1}:{done:!0}}})},e.keys=function(){return this.values()},e.values=function(){this.atom_.reportObserved();var i=this,r=0,a=Array.from(this.data_.values());return jt({next:function(){return r<a.length?{value:i.dehanceValue_(a[r++]),done:!1}:{done:!0}}})},e.replace=function(i){var r=this;return gt(i)&&(i=new Set(i)),Ee(function(){Array.isArray(i)?(r.clear(),i.forEach(function(a){return r.add(a)})):Wt(i)?(r.clear(),i.forEach(function(a){return r.add(a)})):i!=null&&q("Cannot initialize set from "+i)}),this},e.observe_=function(i,r){return Zt(this,i)},e.intercept_=function(i){return Xt(this,i)},e.toJSON=function(){return Array.from(this)},e.toString=function(){return"[object ObservableSet]"},e[oo]=function(){return this.values()},br(t,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:lo,get:function(){return"Set"}}]),t}(),gt=Ge("ObservableSet",uo),oa=Object.create(null),la="remove",co=function(){function t(n,i,r,a){i===void 0&&(i=new Map),a===void 0&&(a=ec),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_=n,this.values_=i,this.name_=r,this.defaultAnnotation_=a,this.keysAtom_=new Yt("ObservableObject.keys"),this.isPlainObject_=De(this.target_)}var e=t.prototype;return e.getObservablePropValue_=function(i){return this.values_.get(i).get()},e.setObservablePropValue_=function(i,r){var a=this.values_.get(i);if(a instanceof ut)return a.set(r),!0;if(ie(this)){var s=re(this,{type:Se,object:this.proxy_||this.target_,name:i,newValue:r});if(!s)return null;r=s.newValue}if(r=a.prepareNewValue_(r),r!==O.UNCHANGED){var o=de(this),l=!1,u=o||l?{type:Se,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:a.value_,name:i,newValue:r}:null;a.setNewValue_(r),o&&fe(this,u)}return!0},e.get_=function(i){return O.trackingDerivation&&!Ae(this.target_,i)&&this.has_(i),this.target_[i]},e.set_=function(i,r,a){return a===void 0&&(a=!1),Ae(this.target_,i)?this.values_.has(i)?this.setObservablePropValue_(i,r):a?Reflect.set(this.target_,i,r):(this.target_[i]=r,!0):this.extend_(i,{value:r,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,a)},e.has_=function(i){if(!O.trackingDerivation)return i in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var r=this.pendingKeys_.get(i);return r||(r=new je(i in this.target_,Jn,"ObservableObject.key?",!1),this.pendingKeys_.set(i,r)),r.get()},e.make_=function(i,r){if(r===!0&&(r=this.defaultAnnotation_),r!==!1){if(!(i in this.target_)){var a;if((a=this.target_[ge])!=null&&a[i])return;q(1,r.annotationType_,this.name_+"."+i.toString())}for(var s=this.target_;s&&s!==qn;){var o=An(s,i);if(o){var l=r.make_(this,i,o,s);if(l===0)return;if(l===1)break}s=Object.getPrototypeOf(s)}ca(this,r,i)}},e.extend_=function(i,r,a,s){if(s===void 0&&(s=!1),a===!0&&(a=this.defaultAnnotation_),a===!1)return this.defineProperty_(i,r,s);var o=a.extend_(this,i,r,s);return o&&ca(this,a,i),o},e.defineProperty_=function(i,r,a){a===void 0&&(a=!1),this.keysAtom_;try{ae();var s=this.delete_(i);if(!s)return s;if(ie(this)){var o=re(this,{object:this.proxy_||this.target_,name:i,type:Re,newValue:r.value});if(!o)return null;var l=o.newValue;r.value!==l&&(r=Pe({},r,{value:l}))}if(a){if(!Reflect.defineProperty(this.target_,i,r))return!1}else be(this.target_,i,r);this.notifyPropertyAddition_(i,r.value)}finally{se()}return!0},e.defineObservableProperty_=function(i,r,a,s){s===void 0&&(s=!1),this.keysAtom_;try{ae();var o=this.delete_(i);if(!o)return o;if(ie(this)){var l=re(this,{object:this.proxy_||this.target_,name:i,type:Re,newValue:r});if(!l)return null;r=l.newValue}var u=ua(i),c={configurable:O.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:u.get,set:u.set};if(s){if(!Reflect.defineProperty(this.target_,i,c))return!1}else be(this.target_,i,c);var d=new je(r,a,"ObservableObject.key",!1);this.values_.set(i,d),this.notifyPropertyAddition_(i,d.value_)}finally{se()}return!0},e.defineComputedProperty_=function(i,r,a){a===void 0&&(a=!1),this.keysAtom_;try{ae();var s=this.delete_(i);if(!s)return s;if(ie(this)){var o=re(this,{object:this.proxy_||this.target_,name:i,type:Re,newValue:void 0});if(!o)return null}r.name||(r.name="ObservableObject.key"),r.context=this.proxy_||this.target_;var l=ua(i),u={configurable:O.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:l.get,set:l.set};if(a){if(!Reflect.defineProperty(this.target_,i,u))return!1}else be(this.target_,i,u);this.values_.set(i,new ut(r)),this.notifyPropertyAddition_(i,void 0)}finally{se()}return!0},e.delete_=function(i,r){if(r===void 0&&(r=!1),this.keysAtom_,!Ae(this.target_,i))return!0;if(ie(this)){var a=re(this,{object:this.proxy_||this.target_,name:i,type:la});if(!a)return null}try{var s,o;ae();var l=de(this),u=!1,c=this.values_.get(i),d=void 0;if(!c&&(l||u)){var f;d=(f=An(this.target_,i))==null?void 0:f.value}if(r){if(!Reflect.deleteProperty(this.target_,i))return!1}else delete this.target_[i];if(c&&(this.values_.delete(i),c instanceof je&&(d=c.value_),Hs(c)),this.keysAtom_.reportChanged(),(s=this.pendingKeys_)==null||(o=s.get(i))==null||o.set(i in this.target_),l||u){var v={type:la,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:d,name:i};l&&fe(this,v)}}finally{se()}return!0},e.observe_=function(i,r){return Zt(this,i)},e.intercept_=function(i){return Xt(this,i)},e.notifyPropertyAddition_=function(i,r){var a,s,o=de(this),l=!1;if(o||l){var u=o||l?{type:Re,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:i,newValue:r}:null;o&&fe(this,u)}(a=this.pendingKeys_)==null||(s=a.get(i))==null||s.set(!0),this.keysAtom_.reportChanged()},e.ownKeys_=function(){return this.keysAtom_.reportObserved(),Wn(this.target_)},e.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},t}();function vt(t,e){var n;if(Ae(t,U))return t;var i=(n=e==null?void 0:e.name)!=null?n:"ObservableObject",r=new co(t,new Map,String(i),dc(e));return Kn(t,U,r),t}var od=Ge("ObservableObjectAdministration",co);function ua(t){return oa[t]||(oa[t]={get:function(){return this[U].getObservablePropValue_(t)},set:function(n){return this[U].setObservablePropValue_(t,n)}})}function ni(t){return Gn(t)?od(t[U]):!1}function ca(t,e,n){var i;(i=t.target_[ge])==null||delete i[n]}var ld=ho(0),ud=function(){var t=!1,e={};return Object.defineProperty(e,"0",{set:function(){t=!0}}),Object.create(e)[0]=1,t===!1}(),Ai=0,fo=function(){};function cd(t,e){Object.setPrototypeOf?Object.setPrototypeOf(t.prototype,e):t.prototype.__proto__!==void 0?t.prototype.__proto__=e:t.prototype=e}cd(fo,Array.prototype);var Ar=function(t,e,n){As(i,t);function i(a,s,o,l){var u;return o===void 0&&(o="ObservableArray"),l===void 0&&(l=!1),u=t.call(this)||this,Je(function(){var c=new Er(o,s,l,!0);c.proxy_=Ni(u),Ss(Ni(u),U,c),a&&a.length&&u.spliceWithArray(0,0,a),ud&&Object.defineProperty(Ni(u),"0",ld)}),u}var r=i.prototype;return r.concat=function(){this[U].atom_.reportObserved();for(var s=arguments.length,o=new Array(s),l=0;l<s;l++)o[l]=arguments[l];return Array.prototype.concat.apply(this.slice(),o.map(function(u){return ti(u)?u.slice():u}))},r[n]=function(){var a=this,s=0;return jt({next:function(){return s<a.length?{value:a[s++],done:!1}:{done:!0,value:void 0}}})},br(i,[{key:"length",get:function(){return this[U].getArrayLength_()},set:function(s){this[U].setArrayLength_(s)}},{key:e,get:function(){return"Array"}}]),i}(fo,Symbol.toStringTag,Symbol.iterator);Object.entries(Fn).forEach(function(t){var e=t[0],n=t[1];e!=="concat"&&Kn(Ar.prototype,e,n)});function ho(t){return{enumerable:!1,configurable:!0,get:function(){return this[U].get_(t)},set:function(n){this[U].set_(t,n)}}}function dd(t){be(Ar.prototype,""+t,ho(t))}function po(t){if(t>Ai){for(var e=Ai;e<t+100;e++)dd(e);Ai=t}}po(1e3);function fd(t,e,n){return new Ar(t,e,n)}function In(t,e){if(typeof t=="object"&&t!==null){if(ti(t))return e!==void 0&&q(23),t[U].atom_;if(gt(t))return t.atom_;if(We(t)){if(e===void 0)return t.keysAtom_;var n=t.data_.get(e)||t.hasMap_.get(e);return n||q(25,e,Zi(t)),n}if(ni(t)){if(!e)return q(26);var i=t[U].values_.get(e);return i||q(27,e,Zi(t)),i}if(_r(t)||Zn(t)||xn(t))return t}else if(he(t)&&xn(t[U]))return t[U];q(28)}function hd(t,e){if(t||q(29),_r(t)||Zn(t)||xn(t)||We(t)||gt(t))return t;if(t[U])return t[U];q(24,t)}function Zi(t,e){var n;if(e!==void 0)n=In(t,e);else{if(ei(t))return t.name;ni(t)||We(t)||gt(t)?n=hd(t):n=In(t)}return n.name_}function Je(t){var e=Ke(),n=Qn(!0);ae();try{return t()}finally{se(),Xn(n),Oe(e)}}var da=qn.toString;function Or(t,e,n){return n===void 0&&(n=-1),er(t,e,n)}function er(t,e,n,i,r){if(t===e)return t!==0||1/t===1/e;if(t==null||e==null)return!1;if(t!==t)return e!==e;var a=typeof t;if(a!=="function"&&a!=="object"&&typeof e!="object")return!1;var s=da.call(t);if(s!==da.call(e))return!1;switch(s){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:+t==0?1/+t===1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return typeof Symbol!="undefined"&&Symbol.valueOf.call(t)===Symbol.valueOf.call(e);case"[object Map]":case"[object Set]":n>=0&&n++;break}t=fa(t),e=fa(e);var o=s==="[object Array]";if(!o){if(typeof t!="object"||typeof e!="object")return!1;var l=t.constructor,u=e.constructor;if(l!==u&&!(he(l)&&l instanceof l&&he(u)&&u instanceof u)&&"constructor"in t&&"constructor"in e)return!1}if(n===0)return!1;n<0&&(n=-1),i=i||[],r=r||[];for(var c=i.length;c--;)if(i[c]===t)return r[c]===e;if(i.push(t),r.push(e),o){if(c=t.length,c!==e.length)return!1;for(;c--;)if(!er(t[c],e[c],n-1,i,r))return!1}else{var d=Object.keys(t),f;if(c=d.length,Object.keys(e).length!==c)return!1;for(;c--;)if(f=d[c],!(Ae(e,f)&&er(t[f],e[f],n-1,i,r)))return!1}return i.pop(),r.pop(),!0}function fa(t){return ti(t)?t.slice():pt(t)||We(t)||Wt(t)||gt(t)?Array.from(t.entries()):t}function jt(t){return t[Symbol.iterator]=pd,t}function pd(){return this}["Symbol","Map","Set"].forEach(function(t){var e=kr();typeof e[t]=="undefined"&&q("MobX requires global '"+t+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:xc,extras:{getDebugName:Zi},$mobx:U});class mo{constructor(e,n){w(this,"logger");w(this,"channel");w(this,"listeners",new Map);w(this,"eventQueue",new Map);this.logger=$e.withPrefix(n,"EventBus");try{this.logger.debug(`Creating BroadcastChannel with name "${e}"`),this.channel=new BroadcastChannel(e),this.channel.onmessage=i=>this.handleMessage(i),this.channel.onmessageerror=i=>this.logger.error("NizzaBroadcastChannel error:",i)}catch(i){throw this.logger.error("Failed to create NizzaBroadcastChannel:",i),i}}on(e,n){return this.logger.debug(`Subscribing to pattern "${e}"`),this.subscribeToEvent(e,n),{off:()=>this.unsubscribeFromEvent(e,n)}}emit(e,n,i={}){this.logger.debug(`Emitting event "${e}" with data`,n),this.emitEvent(e,n,i)}handleMessage(e){const n=e.data,{name:i}=n;this.logger.debug(`Received message "${i}" with data`,n);for(const[r,a]of this.listeners.entries())this.matchWildcard(r,i)&&(this.logger.debug(`Matching pattern "${r}" for event "${i}"`),a.forEach(s=>s({...n,wildcard:r})))}subscribeToEvent(e,n){if(typeof e!="string"||typeof n!="function"){const r=new Error("Invalid arguments");throw this.logger.error(r),r}this.listeners.has(e)||(this.logger.debug(`Adding new pattern "${e}"`),this.listeners.set(e,new Set));const i=Array.from(this.eventQueue).filter(([r])=>{const a=this.matchWildcard(e,r);return a&&(this.eventQueue.delete(r),this.logger.debug(`Dequeued pending events for "${r}".`)),a}).flatMap(([,r])=>r);for(const[r,a]of this.listeners.entries())this.matchWildcard(r,e)&&(this.logger.debug(`Adding listener to pattern "${r}"`),a.add(n),i.length&&(this.logger.debug(`Delivering pending events for "${e}".`),i.forEach(s=>{n({...s,wildcard:r})})))}emitEvent(e,n,i){if(typeof e!="string"){const s=new Error("Invalid arguments");throw this.logger.error(s),s}const r={name:e,data:n,attrs:i},a=Array.from(this.getMatchingListeners(e));if(a.length){this.logger.debug(`Delivering event "${e}" to listeners`);for(const[s,o]of a)o({...r,wildcard:s})}else this.logger.debug(`No listeners for event "${e}", enqueuing`),this.eventQueue.has(e)||this.eventQueue.set(e,[]),this.eventQueue.get(e).push(r);this.logger.debug("Posting message to channel",r),this.channel.postMessage(r)}*getMatchingListeners(e){this.logger.debug(`Getting matching listeners for event "${e}"`);for(const[n,i]of this.listeners.entries())if(this.matchWildcard(n,e))for(const r of i)yield[n,r]}unsubscribeFromEvent(e,n){if(this.listeners.has(e)){this.logger.debug(`Unsubscribing from event "${e}"`);const i=this.listeners.get(e);i.delete(n),i.size===0&&(this.logger.debug(`No more listeners for event "${e}", deleting`),this.listeners.delete(e))}}matchWildcard(e,n){const i=e.replace(/\*/g,"[^:]*").replace(/\*\*/g,".*"),a=new RegExp(`^${i}$`).test(n);return this.logger.debug(`Wildcard "${e}" matches with pattern "${n}": ${a}`),a}}const md="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let gd=(t=21)=>{let e="",n=crypto.getRandomValues(new Uint8Array(t));for(;t--;)e+=md[n[t]&63];return e};const wr=(t=8)=>gd(t),vd=t=>{const e=Object.entries(t).reduce((n,[i,r])=>r!==void 0?`${n}${n?"&":""}${i}=${r}`:n,"");return e?`?${e}`:""},go=t=>{const e=document.getElementById(t);return e?new URL(e.src).searchParams:new URLSearchParams};function yd(){const t=new Error().stack.split(`
4
4
  `);return t.length<3?"":t[2].trim().substring(3)}function kd(t){return new Promise(e=>setTimeout(e,t))}var Tr=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Cr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var vo={exports:{}};(function(t){(function(e,n){t.exports?t.exports=n():e.log=n()})(Tr,function(){var e=function(){},n="undefined",i=typeof window!==n&&typeof window.navigator!==n&&/Trident\/|MSIE /.test(window.navigator.userAgent),r=["trace","debug","info","warn","error"],a={},s=null;function o(m,N){var _=m[N];if(typeof _.bind=="function")return _.bind(m);try{return Function.prototype.bind.call(_,m)}catch{return function(){return Function.prototype.apply.apply(_,[m,arguments])}}}function l(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function u(m){return m==="debug"&&(m="log"),typeof console===n?!1:m==="trace"&&i?l:console[m]!==void 0?o(console,m):console.log!==void 0?o(console,"log"):e}function c(){for(var m=this.getLevel(),N=0;N<r.length;N++){var _=r[N];this[_]=N<m?e:this.methodFactory(_,m,this.name)}if(this.log=this.debug,typeof console===n&&m<this.levels.SILENT)return"No console available for logging"}function d(m){return function(){typeof console!==n&&(c.call(this),this[m].apply(this,arguments))}}function f(m,N,_){return u(m)||d.apply(this,arguments)}function v(m,N){var _=this,P,V,T,L="loglevel";typeof m=="string"?L+=":"+m:typeof m=="symbol"&&(L=void 0);function M(S){var E=(r[S]||"silent").toUpperCase();if(!(typeof window===n||!L)){try{window.localStorage[L]=E;return}catch{}try{window.document.cookie=encodeURIComponent(L)+"="+E+";"}catch{}}}function G(){var S;if(!(typeof window===n||!L)){try{S=window.localStorage[L]}catch{}if(typeof S===n)try{var E=window.document.cookie,A=encodeURIComponent(L),h=E.indexOf(A+"=");h!==-1&&(S=/^([^;]+)/.exec(E.slice(h+A.length+1))[1])}catch{}return _.levels[S]===void 0&&(S=void 0),S}}function y(){if(!(typeof window===n||!L)){try{window.localStorage.removeItem(L)}catch{}try{window.document.cookie=encodeURIComponent(L)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function C(S){var E=S;if(typeof E=="string"&&_.levels[E.toUpperCase()]!==void 0&&(E=_.levels[E.toUpperCase()]),typeof E=="number"&&E>=0&&E<=_.levels.SILENT)return E;throw new TypeError("log.setLevel() called with invalid level: "+S)}_.name=m,_.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},_.methodFactory=N||f,_.getLevel=function(){return T!=null?T:V!=null?V:P},_.setLevel=function(S,E){return T=C(S),E!==!1&&M(T),c.call(_)},_.setDefaultLevel=function(S){V=C(S),G()||_.setLevel(S,!1)},_.resetLevel=function(){T=null,y(),c.call(_)},_.enableAll=function(S){_.setLevel(_.levels.TRACE,S)},_.disableAll=function(S){_.setLevel(_.levels.SILENT,S)},_.rebuild=function(){if(s!==_&&(P=C(s.getLevel())),c.call(_),s===_)for(var S in a)a[S].rebuild()},P=C(s?s.getLevel():"WARN");var F=G();F!=null&&(T=C(F)),c.call(_)}s=new v,s.getLogger=function(N){if(typeof N!="symbol"&&typeof N!="string"||N==="")throw new TypeError("You must supply a name when creating a logger.");var _=a[N];return _||(_=a[N]=new v(N,s.methodFactory)),_};var p=typeof window!==n?window.log:void 0;return s.noConflict=function(){return typeof window!==n&&window.log===s&&(window.log=p),s},s.getLoggers=function(){return a},s.default=s,s})})(vo);var yo=vo.exports;const Oi=Cr(yo);var ko={exports:{}};(function(t){(function(e,n){t.exports?t.exports=n():e.prefix=n(e)})(Tr,function(e){var n=function(c){for(var d=1,f=arguments.length,v;d<f;d++)for(v in arguments[d])Object.prototype.hasOwnProperty.call(arguments[d],v)&&(c[v]=arguments[d][v]);return c},i={template:"[%t] %l:",levelFormatter:function(c){return c.toUpperCase()},nameFormatter:function(c){return c||"root"},timestampFormatter:function(c){return c.toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/,"$1")},format:void 0},r,a={},s=function(c){if(!c||!c.getLogger)throw new TypeError("Argument is not a root logger");r=c},o=function(c,d){if(!c||!c.setLevel)throw new TypeError("Argument is not a logger");var f=c.methodFactory,v=c.name||"",p=a[v]||a[""]||i;function m(N,_,P){var V=f(N,_,P),T=a[P]||a[""],L=T.template.indexOf("%t")!==-1,M=T.template.indexOf("%l")!==-1,G=T.template.indexOf("%n")!==-1;return function(){for(var y="",C=arguments.length,F=Array(C),S=0;S<C;S++)F[S]=arguments[S];if(v||!a[P]){var E=T.timestampFormatter(new Date),A=T.levelFormatter(N),h=T.nameFormatter(P);T.format?y+=T.format(A,h,E):(y+=T.template,L&&(y=y.replace(/%t/,E)),M&&(y=y.replace(/%l/,A)),G&&(y=y.replace(/%n/,h))),F.length&&typeof F[0]=="string"?F[0]=y+" "+F[0]:F.unshift(y)}V.apply(void 0,F)}}return a[v]||(c.methodFactory=m),d=d||{},d.template&&(d.format=void 0),a[v]=n({},p,d),c.setLevel(c.getLevel()),r||c.warn("It is necessary to call the function reg() of loglevel-plugin-prefix before calling apply. From the next release, it will throw an error. See more: https://github.com/kutuluk/loglevel-plugin-prefix/blob/master/README.md"),c},l={reg:s,apply:o},u;return e&&(u=e.prefix,l.noConflict=function(){return e.prefix===l&&(e.prefix=u),l}),l})})(ko);var bd=ko.exports;const ha=Cr(bd);var lt;let $e=(lt=class{constructor(e=""){w(this,"provider",Oi);w(this,"defaultLevel",yo.levels.INFO);this.namePrefix=e,this.namePrefix=e?`${e}-`:"",this.provider.setDefaultLevel(this.defaultLevel),ha.reg(Oi),ha.apply(Oi,{template:"%t %l [%n]",nameFormatter:n=>{var i;return(i=n==null?void 0:n.toLowerCase())!=null?i:""},timestampFormatter:()=>new Date().toTimeString().slice(0,8)})}createLogger(e){const n=`${this.namePrefix}${e.toLowerCase()}`,i=this.provider.getLogger(n),r=localStorage.getItem(`loglevel:${n}`);return i.setLevel(r||this.defaultLevel),i}static withPrefix(e,n){const i=/\(\w+\)/,r={get(a,s){const o=a[s];return typeof o=="function"&&lt.LOG_METHODS.includes(s)?(...l)=>(typeof l[0]=="string"&&!i.test(l[0])&&(l[0]=`(${n}) ${l[0]}`),o.apply(a,l)):o}};return new Proxy(e,r)}},w(lt,"LOG_METHODS",["trace","debug","info","warn","error","log"]),lt);const ce=class ce{constructor(){w(this,"instanceId",wr());w(this,"log",new $e("nz"));w(this,"coreLogger",this.log.createLogger("core"));w(this,"_config",null);w(this,"_account");w(this,"_accountStatus","idle");w(this,"_productDataSource");w(this,"_eventBus",new mo("nizza",this.coreLogger));this.coreLogger=$e.withPrefix(this.coreLogger,"NizzaStore"),no(this,{_config:X,_account:X,_productDataSource:X,config:Fe,account:Fe,accountName:Fe,accountStatus:Fe,configure:ve,setProductDataSource:ve,setAddToCartConfig:ve,setProductId:ve},{name:"NizzaStore",autoBind:!0})}static instance(){var n;if(!!((n=window==null?void 0:window.nizza)!=null&&n.store))ce._instance=window.nizza.store;else{const i=new ce;ce._instance=i}return window.nizza||(window.nizza={},window.nz={},ce._instance.coreLogger.debug("Initialized nizza window object")),window.nizza.store=ce._instance,window.nz=window.nizza,ce._instance}async configure(e){var n;try{const i=(n=this._config)==null?void 0:n.account;if(this._config=e,i!==e.account){this.setAccountStatus("loading");const r=await tl(e.account);this.setAccount(r),this.setAccountStatus("success")}if(e.getProductDataSource){const r=await e.getProductDataSource();this.setProductDataSource(r)}}catch(i){this.setAccountStatus("error"),this.coreLogger.error("Error running configure:",i)}}setAccount(e){this._account=e}setAccountStatus(e){this._accountStatus=e}setProductDataSource(e){this._productDataSource=e}setProductId(e){this._config&&(this._config.productId=e)}setOrderFormId(e){this._config&&(this._config.orderFormId=e)}setAddToCartConfig(e){if(!this._config)throw new Error("you cannot set addToCartConfig before running configure()");this._config.addToCartConfig=e}get version(){return ce.version}get config(){return this._config}get account(){return this._account}get accountStatus(){return this._accountStatus}get accountName(){var e;return(e=this._config)==null?void 0:e.account}get productDataSource(){return this._productDataSource}get eventBus(){return this._eventBus}};w(ce,"version","5"),w(ce,"_instance");let Dn=ce;const Ye=t=>{const e=Dn.instance();return Yc(()=>!!e.account,()=>t==null?void 0:t(e)),e};function it(t){return t!=null&&typeof t=="object"&&t["@@functional/placeholder"]===!0}function vn(t){return function e(n){return arguments.length===0||it(n)?e:t.apply(this,arguments)}}function xr(t){return function e(n,i){switch(arguments.length){case 0:return e;case 1:return it(n)?e:vn(function(r){return t(n,r)});default:return it(n)&&it(i)?e:it(n)?vn(function(r){return t(r,i)}):it(i)?vn(function(r){return t(n,r)}):t(n,i)}}}const _d=Number.isInteger||function(e){return e<<0===e};function Sd(t){return Object.prototype.toString.call(t)==="[object String]"}var Nd=xr(function(e,n){var i=e<0?n.length+e:e;return Sd(n)?n.charAt(i):n[i]}),Ed=vn(function(e){return e==null}),Ad=xr(function(e,n){return e.map(function(i){for(var r=n,a=0,s;a<i.length;){if(r==null)return;s=i[a],r=_d(s)?Nd(s,r):r[s],a+=1}return r})}),Od=xr(function(e,n){return Ad([e],n)[0]});class yt extends Error{constructor(e,n,i){super(n),this.value=i,this.name=e}toDTO(){return{name:this.name,message:this.message,...this.value&&{value:this.value}}}}class bo extends yt{constructor(e){super("RESOURCE_NOT_FOUND_ERROR",`Resource with id '${e}' not found.`,e)}}class Fr extends yt{constructor(e){var n;super("APP_UNEXPECTED_ERROR",(n=e.message)!=null?n:"An unexpected error occurred.",e)}}class _o extends yt{constructor(){super("APP_ACCOUNT_INVALID_ERROR","Account not defined")}}class So extends yt{constructor(e){super("INVALID_NIZZA_GLOBAL_OBJECT_ERROR",`