Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Update react code

Roland Geider226179f98de8
diff --git a/wger/core/static/react/main.js b/wger/core/static/react/main.js
index 48b0eb105..9c545d9fb 100644
--- a/wger/core/static/react/main.js
+++ b/wger/core/static/react/main.js
@@ -265,7 +265,7 @@ export default theme;`}function J$(e={},...t){const{breakpoints:n,mixins:r={},sp
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[_6]=this[_6]={accessors:{}}).accessors,o=this.prototype;function i(a){const s=e0(a);r[s]||(dDe(o,a),r[s]=!0)}return Ue.isArray(t)?t.forEach(i):i(t),this}};Ia.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Ue.reduceDescriptors(Ia.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});Ue.freezeMethods(Ia);function jR(e,t){const n=this||dw,r=t||n,o=Ia.from(r.headers);let i=r.data;return Ue.forEach(e,function(s){i=s.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function ire(e){return!!(e&&e.__CANCEL__)}function uv(e,t,n){Sn.call(this,e??"canceled",Sn.ERR_CANCELED,t,n),this.name="CanceledError"}Ue.inherits(uv,Sn,{__CANCEL__:!0});function are(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Sn("Request failed with status code "+n.status,[Sn.ERR_BAD_REQUEST,Sn.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function fDe(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function pDe(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,i=0,a;return t=t!==void 0?t:1e3,function(l){const c=Date.now(),u=r[i];a||(a=c),n[o]=l,r[o]=c;let f=i,h=0;for(;f!==o;)h+=n[f++],f=f%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),c-a<t)return;const m=u&&c-u;return m?Math.round(h*1e3/m):void 0}}function hDe(e,t){let n=0,r=1e3/t,o,i;const a=(c,u=Date.now())=>{n=u,o=null,i&&(clearTimeout(i),i=null),e.apply(null,c)};return[(...c)=>{const u=Date.now(),f=u-n;f>=r?a(c,u):(o=c,i||(i=setTimeout(()=>{i=null,a(o)},r-f)))},()=>o&&a(o)]}const eT=(e,t,n=3)=>{let r=0;const o=pDe(50,250);return hDe(i=>{const a=i.loaded,s=i.lengthComputable?i.total:void 0,l=a-r,c=o(l),u=a<=s;r=a;const f={loaded:a,total:s,progress:s?a/s:void 0,bytes:l,rate:c||void 0,estimated:c&&s&&u?(s-a)/c:void 0,event:i,lengthComputable:s!=null,[t?"download":"upload"]:!0};e(f)},n)},$6=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},N6=e=>(...t)=>Ue.asap(()=>e(...t)),mDe=Ni.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Ni.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Ni.origin),Ni.navigator&&/(msie|trident)/i.test(Ni.navigator.userAgent)):()=>!0,gDe=Ni.hasStandardBrowserEnv?{write(e,t,n,r,o,i){const a=[e+"="+encodeURIComponent(t)];Ue.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),Ue.isString(r)&&a.push("path="+r),Ue.isString(o)&&a.push("domain="+o),i===!0&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function yDe(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function vDe(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function sre(e,t,n){let r=!yDe(t);return e&&(r||n==!1)?vDe(e,t):t}const L6=e=>e instanceof Ia?{...e}:e;function yh(e,t){t=t||{};const n={};function r(c,u,f,h){return Ue.isPlainObject(c)&&Ue.isPlainObject(u)?Ue.merge.call({caseless:h},c,u):Ue.isPlainObject(u)?Ue.merge({},u):Ue.isArray(u)?u.slice():u}function o(c,u,f,h){if(Ue.isUndefined(u)){if(!Ue.isUndefined(c))return r(void 0,c,f,h)}else return r(c,u,f,h)}function i(c,u){if(!Ue.isUndefined(u))return r(void 0,u)}function a(c,u){if(Ue.isUndefined(u)){if(!Ue.isUndefined(c))return r(void 0,c)}else return r(void 0,u)}function s(c,u,f){if(f in t)return r(c,u);if(f in e)return r(void 0,c)}const l={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(c,u,f)=>o(L6(c),L6(u),f,!0)};return Ue.forEach(Object.keys(Object.assign({},e,t)),function(u){const f=l[u]||o,h=f(e[u],t[u],u);Ue.isUndefined(h)&&f!==s||(n[u]=h)}),n}const lre=e=>{const t=yh({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:a,auth:s}=t;t.headers=a=Ia.from(a),t.url=nre(sre(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&a.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):"")));let l;if(Ue.isFormData(n)){if(Ni.hasStandardBrowserEnv||Ni.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((l=a.getContentType())!==!1){const[c,...u]=l?l.split(";").map(f=>f.trim()).filter(Boolean):[];a.setContentType([c||"multipart/form-data",...u].join("; "))}}if(Ni.hasStandardBrowserEnv&&(r&&Ue.isFunction(r)&&(r=r(t)),r||r!==!1&&mDe(t.url))){const c=o&&i&&gDe.read(i);c&&a.set(o,c)}return t},bDe=typeof XMLHttpRequest<"u",xDe=bDe&&function(e){return new Promise(function(n,r){const o=lre(e);let i=o.data;const a=Ia.from(o.headers).normalize();let{responseType:s,onUploadProgress:l,onDownloadProgress:c}=o,u,f,h,m,g;function y(){m&&m(),g&&g(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let v=new XMLHttpRequest;v.open(o.method.toUpperCase(),o.url,!0),v.timeout=o.timeout;function w(){if(!v)return;const E=Ia.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),O={data:!s||s==="text"||s==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:E,config:e,request:v};are(function(R){n(R),y()},function(R){r(R),y()},O),v=null}"onloadend"in v?v.onloadend=w:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.indexOf("file:")===0)||setTimeout(w)},v.onabort=function(){v&&(r(new Sn("Request aborted",Sn.ECONNABORTED,e,v)),v=null)},v.onerror=function(){r(new Sn("Network Error",Sn.ERR_NETWORK,e,v)),v=null},v.ontimeout=function(){let I=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const O=o.transitional||rre;o.timeoutErrorMessage&&(I=o.timeoutErrorMessage),r(new Sn(I,O.clarifyTimeoutError?Sn.ETIMEDOUT:Sn.ECONNABORTED,e,v)),v=null},i===void 0&&a.setContentType(null),"setRequestHeader"in v&&Ue.forEach(a.toJSON(),function(I,O){v.setRequestHeader(O,I)}),Ue.isUndefined(o.withCredentials)||(v.withCredentials=!!o.withCredentials),s&&s!=="json"&&(v.responseType=o.responseType),c&&([h,g]=eT(c,!0),v.addEventListener("progress",h)),l&&v.upload&&([f,m]=eT(l),v.upload.addEventListener("progress",f),v.upload.addEventListener("loadend",m)),(o.cancelToken||o.signal)&&(u=E=>{v&&(r(!E||E.type?new uv(null,e,v):E),v.abort(),v=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const C=fDe(o.url);if(C&&Ni.protocols.indexOf(C)===-1){r(new Sn("Unsupported protocol "+C+":",Sn.ERR_BAD_REQUEST,e));return}v.send(i||null)})},SDe=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,o;const i=function(c){if(!o){o=!0,s();const u=c instanceof Error?c:this.reason;r.abort(u instanceof Sn?u:new uv(u instanceof Error?u.message:u))}};let a=t&&setTimeout(()=>{a=null,i(new Sn(`timeout ${t} of ms exceeded`,Sn.ETIMEDOUT))},t);const s=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(i):c.removeEventListener("abort",i)}),e=null)};e.forEach(c=>c.addEventListener("abort",i));const{signal:l}=r;return l.unsubscribe=()=>Ue.asap(s),l}},wDe=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,o;for(;r<n;)o=r+t,yield e.slice(r,o),r=o},CDe=async function*(e,t){for await(const n of EDe(e))yield*wDe(n,t)},EDe=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},F6=(e,t,n,r)=>{const o=CDe(e,t);let i=0,a,s=l=>{a||(a=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:c,value:u}=await o.next();if(c){s(),l.close();return}let f=u.byteLength;if(n){let h=i+=f;n(h)}l.enqueue(new Uint8Array(u))}catch(c){throw s(c),c}},cancel(l){return s(l),o.return()}},{highWaterMark:2})},bI=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",cre=bI&&typeof ReadableStream=="function",TDe=bI&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),ure=(e,...t)=>{try{return!!e(...t)}catch{return!1}},ODe=cre&&ure(()=>{let e=!1;const t=new Request(Ni.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),j6=64*1024,jN=cre&&ure(()=>Ue.isReadableStream(new Response("").body)),tT={stream:jN&&(e=>e.body)};bI&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!tT[t]&&(tT[t]=Ue.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new Sn(`Response type '${t}' is not supported`,Sn.ERR_NOT_SUPPORT,r)})})})(new Response);const IDe=async e=>{if(e==null)return 0;if(Ue.isBlob(e))return e.size;if(Ue.isSpecCompliantForm(e))return(await new Request(Ni.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(Ue.isArrayBufferView(e)||Ue.isArrayBuffer(e))return e.byteLength;if(Ue.isURLSearchParams(e)&&(e=e+""),Ue.isString(e))return(await TDe(e)).byteLength},PDe=async(e,t)=>{const n=Ue.toFiniteNumber(e.getContentLength());return n??IDe(t)},ADe=bI&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:i,timeout:a,onDownloadProgress:s,onUploadProgress:l,responseType:c,headers:u,withCredentials:f="same-origin",fetchOptions:h}=lre(e);c=c?(c+"").toLowerCase():"text";let m=SDe([o,i&&i.toAbortSignal()],a),g;const y=m&&m.unsubscribe&&(()=>{m.unsubscribe()});let v;try{if(l&&ODe&&n!=="get"&&n!=="head"&&(v=await PDe(u,r))!==0){let O=new Request(t,{method:"POST",body:r,duplex:"half"}),P;if(Ue.isFormData(r)&&(P=O.headers.get("content-type"))&&u.setContentType(P),O.body){const[R,D]=$6(v,eT(N6(l)));r=F6(O.body,j6,R,D)}}Ue.isString(f)||(f=f?"include":"omit");const w="credentials"in Request.prototype;g=new Request(t,{...h,signal:m,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:w?f:void 0});let C=await fetch(g);const E=jN&&(c==="stream"||c==="response");if(jN&&(s||E&&y)){const O={};["status","statusText","headers"].forEach(M=>{O[M]=C[M]});const P=Ue.toFiniteNumber(C.headers.get("content-length")),[R,D]=s&&$6(P,eT(N6(s),!0))||[];C=new Response(F6(C.body,j6,R,()=>{D&&D(),y&&y()}),O)}c=c||"text";let I=await tT[Ue.findKey(tT,c)||"text"](C,e);return!E&&y&&y(),await new Promise((O,P)=>{are(O,P,{data:I,headers:Ia.from(C.headers),status:C.status,statusText:C.statusText,config:e,request:g})})}catch(w){throw y&&y(),w&&w.name==="TypeError"&&/Load failed|fetch/i.test(w.message)?Object.assign(new Sn("Network Error",Sn.ERR_NETWORK,e,g),{cause:w.cause||w}):Sn.from(w,w&&w.code,e,g)}}),BN={http:URe,xhr:xDe,fetch:ADe};Ue.forEach(BN,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const B6=e=>`- ${e}`,MDe=e=>Ue.isFunction(e)||e===null||e===!1,dre={getAdapter:e=>{e=Ue.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let i=0;i<t;i++){n=e[i];let a;if(r=n,!MDe(n)&&(r=BN[(a=String(n)).toLowerCase()],r===void 0))throw new Sn(`Unknown adapter '${a}'`);if(r)break;o[a||"#"+i]=r}if(!r){const i=Object.entries(o).map(([s,l])=>`adapter ${s} `+(l===!1?"is not supported by the environment":"is not available in the build"));let a=t?i.length>1?`since :
`+i.map(B6).join(`
`):" "+B6(i[0]):"as no adapter specified";throw new Sn("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:BN};function BR(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new uv(null,e)}function z6(e){return BR(e),e.headers=Ia.from(e.headers),e.data=jR.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),dre.getAdapter(e.adapter||dw.adapter)(e).then(function(r){return BR(e),r.data=jR.call(e,e.transformResponse,r),r.headers=Ia.from(r.headers),r},function(r){return ire(r)||(BR(e),r&&r.response&&(r.response.data=jR.call(e,e.transformResponse,r.response),r.response.headers=Ia.from(r.response.headers))),Promise.reject(r)})}const fre="1.9.0",xI={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{xI[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const V6={};xI.transitional=function(t,n,r){function o(i,a){return"[Axios v"+fre+"] Transitional option '"+i+"'"+a+(r?". "+r:"")}return(i,a,s)=>{if(t===!1)throw new Sn(o(a," has been removed"+(n?" in "+n:"")),Sn.ERR_DEPRECATED);return n&&!V6[a]&&(V6[a]=!0,console.warn(o(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,a,s):!0}};xI.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function RDe(e,t,n){if(typeof e!="object")throw new Sn("options must be an object",Sn.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],a=t[i];if(a){const s=e[i],l=s===void 0||a(s,i,e);if(l!==!0)throw new Sn("option "+i+" must be "+l,Sn.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Sn("Unknown option "+i,Sn.ERR_BAD_OPTION)}}const vE={assertOptions:RDe,validators:xI},uc=vE.validators;let rh=class{constructor(t){this.defaults=t||{},this.interceptors={request:new k6,response:new k6}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
-`+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=yh(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&vE.assertOptions(r,{silentJSONParsing:uc.transitional(uc.boolean),forcedJSONParsing:uc.transitional(uc.boolean),clarifyTimeoutError:uc.transitional(uc.boolean)},!1),o!=null&&(Ue.isFunction(o)?n.paramsSerializer={serialize:o}:vE.assertOptions(o,{encode:uc.function,serialize:uc.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),vE.assertOptions(n,{baseUrl:uc.spelling("baseURL"),withXsrfToken:uc.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&Ue.merge(i.common,i[n.method]);i&&Ue.forEach(["delete","get","head","post","put","patch","common"],g=>{delete i[g]}),n.headers=Ia.concat(a,i);const s=[];let l=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(n)===!1||(l=l&&y.synchronous,s.unshift(y.fulfilled,y.rejected))});const c=[];this.interceptors.response.forEach(function(y){c.push(y.fulfilled,y.rejected)});let u,f=0,h;if(!l){const g=[z6.bind(this),void 0];for(g.unshift.apply(g,s),g.push.apply(g,c),h=g.length,u=Promise.resolve(n);f<h;)u=u.then(g[f++],g[f++]);return u}h=s.length;let m=n;for(f=0;f<h;){const g=s[f++],y=s[f++];try{m=g(m)}catch(v){y.call(this,v);break}}try{u=z6.call(this,m)}catch(g){return Promise.reject(g)}for(f=0,h=c.length;f<h;)u=u.then(c[f++],c[f++]);return u}getUri(t){t=yh(this.defaults,t);const n=sre(t.baseURL,t.url,t.allowAbsoluteUrls);return nre(n,t.params,t.paramsSerializer)}};Ue.forEach(["delete","get","head","options"],function(t){rh.prototype[t]=function(n,r){return this.request(yh(r||{},{method:t,url:n,data:(r||{}).data}))}});Ue.forEach(["post","put","patch"],function(t){function n(r){return function(i,a,s){return this.request(yh(s||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}rh.prototype[t]=n(),rh.prototype[t+"Form"]=n(!0)});let DDe=class pre{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(o=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const a=new Promise(s=>{r.subscribe(s),i=s}).then(o);return a.cancel=function(){r.unsubscribe(i)},a},t(function(i,a,s){r.reason||(r.reason=new uv(i,a,s),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new pre(function(o){t=o}),cancel:t}}};function kDe(e){return function(n){return e.apply(null,n)}}function _De(e){return Ue.isObject(e)&&e.isAxiosError===!0}const zN={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(zN).forEach(([e,t])=>{zN[t]=e});function hre(e){const t=new rh(e),n=Une(rh.prototype.request,t);return Ue.extend(n,rh.prototype,t,{allOwnKeys:!0}),Ue.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return hre(yh(e,o))},n}const it=hre(dw);it.Axios=rh;it.CanceledError=uv;it.CancelToken=DDe;it.isCancel=ire;it.VERSION=fre;it.toFormData=vI;it.AxiosError=Sn;it.Cancel=it.CanceledError;it.all=function(t){return Promise.all(t)};it.spread=kDe;it.isAxiosError=_De;it.mergeConfig=yh;it.AxiosHeaders=Ia;it.formToJSON=e=>ore(Ue.isHTMLForm(e)?new FormData(e):e);it.getAdapter=dre.getAdapter;it.HttpStatusCode=zN;it.default=it;const{Axios:dAt,AxiosError:fAt,CanceledError:pAt,isCancel:hAt,CancelToken:mAt,VERSION:gAt,all:yAt,Cancel:vAt,isAxiosError:bAt,spread:xAt,toFormData:SAt,AxiosHeaders:wAt,HttpStatusCode:CAt,formToJSON:EAt,getAdapter:TAt,mergeConfig:OAt}=it,_g={protein:4,carbohydrates:4,fat:9};class qa{constructor(t){Ce(this,"bodyWeight",0);Ce(this,"energy",0);Ce(this,"protein",0);Ce(this,"carbohydrates",0);Ce(this,"carbohydratesSugar",0);Ce(this,"fat",0);Ce(this,"fatSaturated",0);Ce(this,"fiber",0);Ce(this,"sodium",0);this.energy=(t==null?void 0:t.energy)??0,this.protein=(t==null?void 0:t.protein)??0,this.carbohydrates=(t==null?void 0:t.carbohydrates)??0,this.carbohydratesSugar=(t==null?void 0:t.carbohydratesSugar)??0,this.fat=(t==null?void 0:t.fat)??0,this.fatSaturated=(t==null?void 0:t.fatSaturated)??0,this.fiber=(t==null?void 0:t.fiber)??0,this.sodium=(t==null?void 0:t.sodium)??0,this.bodyWeight=(t==null?void 0:t.bodyWeight)??0}get energyKj(){return this.energy*4.184}get isEmpty(){return this.energy===0&&this.protein===0&&this.carbohydrates===0&&this.fat===0}get percent(){return{protein:this.protein>0?this.protein*_g.protein/this.energy*100:0,carbohydrates:this.carbohydrates>0?this.carbohydrates*_g.carbohydrates/this.energy*100:0,fat:this.fat>0?this.fat*_g.fat/this.energy*100:0}}get perBodyKg(){return{protein:this.bodyWeight>0?this.protein/this.bodyWeight:0,carbohydrates:this.bodyWeight>0?this.carbohydrates/this.bodyWeight:0,fat:this.bodyWeight>0?this.fat/this.bodyWeight:0}}static fromIngredient(t,n,r){const o=new qa,i=r===null?n:n*r.amount*r.grams;return o.energy=t.energy*i/100,o.protein=t.protein*i/100,o.carbohydrates=t.carbohydrates*i/100,o.carbohydratesSugar=t.carbohydratesSugar?t.carbohydratesSugar*i/100:0,o.fat=t.fat*i/100,o.fatSaturated=t.fatSaturated?t.fatSaturated*i/100:0,o.fiber=t.fiber?t.fiber*i/100:0,o.sodium=t.sodium?t.sodium*i/100:0,o}add(t){return this.energy+=t.energy,this.protein+=t.protein,this.carbohydrates+=t.carbohydrates,this.carbohydratesSugar+=t.carbohydratesSugar,this.fat+=t.fat,this.fatSaturated+=t.fatSaturated,this.fiber+=t.fiber,this.sodium+=t.sodium,this}toString(){return`e: ${this.energy}, p: ${this.protein}, c: ${this.carbohydrates}, cS: ${this.carbohydratesSugar}, f: ${this.fat}, fS: ${this.fatSaturated}, fi: ${this.fiber}, s: ${this.sodium}`}equals(t){return this.energy===t.energy&&this.protein===t.protein&&this.carbohydrates===t.carbohydrates&&this.carbohydratesSugar===t.carbohydratesSugar&&this.fat===t.fat&&this.fatSaturated===t.fatSaturated&&this.fiber===t.fiber&&this.sodium===t.sodium}}function Jn(e){return e.toISOString().split("T")[0]}function xa(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function nT(e,t){return e==null?null:e.toLocaleTimeString(t?[t]:[],{hour:"2-digit",minute:"2-digit"})}function Dx(e){if(e==null)return null;const[t,n]=e.toTimeString().split(":");return`${t}:${n}`}function VN(e){if(e==null)return null;const[t,n]=e.split(":",2),r=new Date;return r.setHours(parseInt(t)),r.setMinutes(parseInt(n)),r}function $De(e,t=new Date){const r={lastWeek:()=>t.setDate(t.getDate()-7),lastMonth:()=>t.setMonth(t.getMonth()-1),lastHalfYear:()=>t.setMonth(t.getMonth()-6),lastYear:()=>t.setFullYear(t.getFullYear()-1),"":void 0}[e];if(r)r();else return;return Jn(t)}class mre{constructor(t,n,r,o){Ce(this,"items",[]);Ce(this,"diaryEntries",[]);this.id=t,this.order=n,this.time=r,this.name=o}get timeHHMMLocale(){return nT(this.time)}get displayName(){return this.name?this.name:this.timeHHMMLocale}get diaryEntriesToday(){return this.diaryEntries.filter(t=>xa(t.datetime,new Date))}get plannedNutritionalValues(){const t=new qa;for(const n of this.items)t.add(n.nutritionalValues);return t}get loggedNutritionalValuesToday(){const t=new qa;for(const n of this.diaryEntriesToday)t.add(n.nutritionalValues);return t}}class xB{fromJson(t){return new mre(t.id,t.order,VN(t.time),t.name)}toJson(t){return{name:t.name,order:t.order,time:nT(t.time)}}}const bE=-1;class SI{constructor(t){Ce(this,"id");Ce(this,"creationDate");Ce(this,"start");Ce(this,"end");Ce(this,"description");Ce(this,"onlyLogging");Ce(this,"goalEnergy");Ce(this,"goalProtein");Ce(this,"goalCarbohydrates");Ce(this,"goalFiber");Ce(this,"goalSodium");Ce(this,"goalFat");Ce(this,"goalFatsSaturated");Ce(this,"meals",[]);Ce(this,"diaryEntries",[]);this.id=t.id??null,this.creationDate=t.creationDate??new Date,this.start=t.start??this.creationDate,this.end=t.end??null,this.description=t.description??"",this.onlyLogging=t.onlyLogging??!1,this.goalEnergy=t.goalEnergy??null,this.goalProtein=t.goalProtein??null,this.goalCarbohydrates=t.goalCarbohydrates??null,this.goalFiber=t.goalFiber??null,this.goalSodium=t.goalSodium??null,this.goalFat=t.goalFat??null,this.goalFatsSaturated=t.goalFatsSaturated??null}get hasAnyGoals(){return this.goalEnergy!==null||this.goalProtein!==null||this.goalCarbohydrates!==null||this.goalFat!==null}get hasAnyAdvancedGoals(){return this.goalFiber!==null||this.goalSodium!==null||this.goalFatsSaturated!==null}get hasAnyPlanned(){return this.hasAnyGoals||this.plannedNutritionalValues.energy>0}get plannedNutritionalValues(){if(this.hasAnyGoals)return new qa({energy:this.goalEnergy,carbohydrates:this.goalCarbohydrates,protein:this.goalProtein,fat:this.goalFat});const t=new qa;for(const n of this.meals)t.add(n.plannedNutritionalValues);return t}get loggedNutritionalValues7DayAvg(){const t=new Date,n=new Date(t.getTime()-7*24*60*60*1e3),r=this.diaryEntries.filter(o=>o.datetime>=n);return this.getAverageNutritionalValuesFromDiaryEntries(r)}get loggedNutritionalValuesToday(){const t=this.diaryEntries.filter(n=>xa(n.datetime,new Date));return this.getNutritionalValuesFromDiaryEntries(t)}get groupDiaryEntries(){return this.diaryEntries.reduce((t,n)=>{const r=n.datetime.toISOString().split("T")[0],o=t.get(r)||{entries:[],nutritionalValues:new qa};return o.entries.push(n),o.nutritionalValues.add(n.nutritionalValues),t.set(r,o),t},new Map)}get percentageValuesLoggedToday(){return new qa({protein:this.loggedNutritionalValuesToday.protein/this.plannedNutritionalValues.protein*100,carbohydrates:this.loggedNutritionalValuesToday.carbohydrates/this.plannedNutritionalValues.carbohydrates*100,fat:this.loggedNutritionalValuesToday.fat/this.plannedNutritionalValues.fat*100})}copyWith(t){return new SI({id:t.id!==void 0?t.id:this.id,creationDate:t.creationDate!==void 0?t.creationDate:this.creationDate,start:t.start!==void 0?t.start:this.start,end:t.end!==void 0?t.end:this.end,description:t.description!==void 0?t.description:this.description,onlyLogging:t.onlyLogging!==void 0?t.onlyLogging:this.onlyLogging,goalEnergy:t.goalEnergy!==void 0?t.goalEnergy:this.goalEnergy,goalProtein:t.goalProtein!==void 0?t.goalProtein:this.goalProtein,goalCarbohydrates:t.goalCarbohydrates!==void 0?t.goalCarbohydrates:this.goalCarbohydrates,goalFiber:t.goalFiber!==void 0?t.goalFiber:this.goalFiber,goalSodium:t.goalSodium!==void 0?t.goalSodium:this.goalSodium,goalFat:t.goalFat!==void 0?t.goalFat:this.goalFat,goalFatsSaturated:t.goalFatsSaturated!==void 0?t.goalFatsSaturated:this.goalFatsSaturated})}pseudoMealOthers(t){const n=new mre(bE,-1,null,t);return n.diaryEntries=this.diaryEntries.filter(r=>r.mealId===null),n}loggedNutritionalValuesDate(t){return this.getNutritionalValuesFromDiaryEntries(this.loggedEntriesDate(t))}loggedEntriesDate(t){return this.diaryEntries.filter(n=>xa(n.datetime,t))}getAverageNutritionalValuesFromDiaryEntries(t){const n=t.length,r=this.getNutritionalValuesFromDiaryEntries(t);return n===0||(r.energy=r.energy/n,r.protein=r.protein/n,r.carbohydrates=r.carbohydrates/n,r.carbohydratesSugar=r.carbohydratesSugar/n,r.fat=r.fat/n,r.fatSaturated=r.fatSaturated/n,r.fiber=r.fiber/n,r.sodium=r.sodium/n),r}getNutritionalValuesFromDiaryEntries(t){return t.reduce((n,r)=>n.add(r.nutritionalValues),new qa)}}class NDe{fromJson(t){return new SI({id:t.id,creationDate:new Date(t.creation_date),start:new Date(t.start),end:t.end!==null?new Date(t.end):null,description:t.description,onlyLogging:t.only_logging,goalEnergy:t.goal_energy,goalProtein:t.goal_protein,goalCarbohydrates:t.goal_carbohydrates,goalFiber:t.goal_fiber,goalSodium:null,goalFat:t.goal_fat,goalFatsSaturated:null})}toJson(t){return{...t.id!=null?{id:t.id}:{},start:Jn(t.start),end:t.end?Jn(t.end):null,description:t.description,only_logging:t.onlyLogging,goal_energy:t.goalEnergy,goal_protein:t.goalProtein,goal_carbohydrates:t.goalCarbohydrates,goal_fiber:t.goalFiber,goal_sodium:t.goalSodium,goal_fat:t.goalFat,goal_fats_saturated:t.goalFatsSaturated}}}const ly=new NDe;class gre{constructor(t,n,r){this.date=t,this.weight=n,this.id=r}}class SB{fromJson(t){return new gre(new Date(t.date),parseFloat(t.weight),t.id)}toJson(t){return{id:t.id,date:Jn(t.date),weight:t.weight}}}const LDe="/static/react",wB="",FDe="",jDe=void 0;var xE={exports:{}},BDe=xE.exports,H6;function zDe(){return H6||(H6=1,function(e){(function(t){let n;function r(u,f){const h=u.charCodeAt(f);if(isNaN(h))throw new RangeError("Index "+f+' out of range for string "'+u+'"; please open an issue at https://github.com/Trott/slug/issues/new');if(h<55296||h>57343)return[u.charAt(f),f];if(h>=55296&&h<=56319){if(u.length<=f+1)return[" ",f];const g=u.charCodeAt(f+1);return g<56320||g>57343?[" ",f]:[u.charAt(f)+u.charAt(f+1),f+1]}if(f===0)return[" ",f];const m=u.charCodeAt(f-1);if(m<55296||m>56319)return[" ",f];throw new Error('String "'+u+'" reaches code believed to be unreachable; please open an issue at https://github.com/Trott/slug/issues/new')}typeof window<"u"?window.btoa?n=function(u){return btoa(unescape(encodeURIComponent(u)))}:n=function(u){const f=unescape(encodeURIComponent(u+""));let h="";for(let m,g,y=0,v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";f.charAt(y|0)||(v="=",y%1);h+=v.charAt(63&m>>8-y%1*8)){if(g=f.charCodeAt(y+=3/4),g>255)throw new Error("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");m=m<<8|g}return h}:n=function(u){return Buffer.from(u).toString("base64")};function o(u,f){let h=s(u,f);if((f&&f.fallback!==void 0?f.fallback:o.defaults.fallback)===!0&&h===""){let g="";for(let y=0;y<u.length;y++){const v=r(u,y);y=v[1],g+=v[0]}h=s(n(g),f)}return h}const i={bg:{Й:"Y",й:"y",X:"H",x:"h",Ц:"Ts",ц:"ts",Щ:"Sht",щ:"sht",Ъ:"A",ъ:"a",Ь:"Y",ь:"y"},de:{Ä:"AE",ä:"ae",Ö:"OE",ö:"oe",Ü:"UE",ü:"ue"},sr:{đ:"dj",Đ:"DJ"},uk:{И:"Y",и:"y",Й:"Y",й:"y",Ц:"Ts",ц:"ts",Х:"Kh",х:"kh",Щ:"Shch",щ:"shch",Г:"H",г:"h"}};let a={};function s(u,f){if(typeof u!="string")throw new Error("slug() requires a string argument, received "+typeof u);typeof f=="string"&&(f={replacement:f}),f=f?Object.assign({},f):{},f.mode=f.mode||o.defaults.mode;const h=o.defaults.modes[f.mode],m=["replacement","multicharmap","charmap","remove","lower","trim"];for(let C,E=0,I=m.length;E<I;E++)C=m[E],f[C]=C in f?f[C]:h[C];const g=i[f.locale]||a;let y=[];for(const C in f.multicharmap){if(!Object.prototype.hasOwnProperty.call(f.multicharmap,C))continue;const E=C.length;y.indexOf(E)===-1&&y.push(E)}y=y.sort(function(C,E){return E-C});const v=f.mode==="rfc3986"?/[^\w\s\-.~]/:/[^A-Za-z0-9\s]/;let w="";for(let C,E=0,I=u.length;E<I;E++){C=u[E];let O=!1;for(let P=0;P<y.length;P++){const R=y[P],D=u.substr(E,R);if(f.multicharmap[D]){E+=R-1,C=f.multicharmap[D],O=!0;break}}O||(g[C]?C=g[C]:f.charmap[C]?C=f.charmap[C].replace(f.replacement," "):C.includes(f.replacement)?C=C.replace(f.replacement," "):C=C.replace(v,"")),w+=C}return f.remove&&(w=w.replace(f.remove,"")),f.trim&&(w=w.trim()),w=w.replace(/\s+/g,f.replacement),f.lower&&(w=w.toLowerCase()),w}const l={फ़:"Fi",ग़:"Ghi",ख़:"Khi",क़:"Qi",ड़:"ugDha",ढ़:"ugDhha",य़:"Yi",ज़:"Za",בִי:"i",בֵ:"e",בֵי:"e",בֶ:"e",בַ:"a",בָ:"a",בֹ:"o",וֹ:"o",בֻ:"u",וּ:"u",בּ:"b",כּ:"k",ךּ:"k",פּ:"p",שׁ:"sh",שׂ:"s",בְ:"e",חֱ:"e",חֲ:"a",חֳ:"o",בִ:"i"},c={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Æ:"AE",Ç:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ő:"O",Ø:"O",Ō:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ű:"U",Ý:"Y",Þ:"TH",ß:"ss",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",æ:"ae",ç:"c",è:"e",é:"e",ê:"e",ë:"e",ì:"i",í:"i",î:"i",ï:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ő:"o",ø:"o",ō:"o",Œ:"OE",œ:"oe",ù:"u",ú:"u",û:"u",ü:"u",ű:"u",ý:"y",þ:"th",ÿ:"y","ẞ":"SS",α:"a",β:"b",γ:"g",δ:"d",ε:"e",ζ:"z",η:"h",θ:"th",ι:"i",κ:"k",λ:"l",μ:"m",ν:"n",ξ:"3",ο:"o",π:"p",ρ:"r",σ:"s",τ:"t",υ:"y",φ:"f",χ:"x",ψ:"ps",ω:"w",ά:"a",έ:"e",ί:"i",ό:"o",ύ:"y",ή:"h",ώ:"w",ς:"s",ϊ:"i",ΰ:"y",ϋ:"y",ΐ:"i",Α:"A",Β:"B",Γ:"G",Δ:"D",Ε:"E",Ζ:"Z",Η:"H",Θ:"Th",Ι:"I",Κ:"K",Λ:"L",Μ:"M",Ν:"N",Ξ:"3",Ο:"O",Π:"P",Ρ:"R",Σ:"S",Τ:"T",Υ:"Y",Φ:"F",Χ:"X",Ψ:"PS",Ω:"W",Ά:"A",Έ:"E",Ί:"I",Ό:"O",Ύ:"Y",Ή:"H",Ώ:"W",Ϊ:"I",Ϋ:"Y",ş:"s",Ş:"S",ı:"i",İ:"I",ğ:"g",Ğ:"G",а:"a",б:"b",в:"v",г:"g",д:"d",е:"e",ё:"yo",ж:"zh",з:"z",и:"i",й:"j",к:"k",л:"l",м:"m",н:"n",о:"o",п:"p",р:"r",с:"s",т:"t",у:"u",ф:"f",х:"h",ц:"c",ч:"ch",ш:"sh",щ:"sh",ъ:"u",ы:"y",ь:"",э:"e",ю:"yu",я:"ya",А:"A",Б:"B",В:"V",Г:"G",Д:"D",Е:"E",Ё:"Yo",Ж:"Zh",З:"Z",И:"I",Й:"J",К:"K",Л:"L",М:"M",Н:"N",О:"O",П:"P",Р:"R",С:"S",Т:"T",У:"U",Ф:"F",Х:"H",Ц:"C",Ч:"Ch",Ш:"Sh",Щ:"Sh",Ъ:"U",Ы:"Y",Ь:"",Э:"E",Ю:"Yu",Я:"Ya",Є:"Ye",І:"I",Ї:"Yi",Ґ:"G",є:"ye",і:"i",ї:"yi",ґ:"g",č:"c",ď:"d",ě:"e",ň:"n",ř:"r",š:"s",ť:"t",ů:"u",ž:"z",Č:"C",Ď:"D",Ě:"E",Ň:"N",Ř:"R",Š:"S",Ť:"T",Ů:"U",Ž:"Z",ľ:"l",ĺ:"l",ŕ:"r",Ľ:"L",Ĺ:"L",Ŕ:"R",ą:"a",ć:"c",ę:"e",ł:"l",ń:"n",ś:"s",ź:"z",ż:"z",Ą:"A",Ć:"C",Ę:"E",Ł:"L",Ń:"N",Ś:"S",Ź:"Z",Ż:"Z",ā:"a",ē:"e",ģ:"g",ī:"i",ķ:"k",ļ:"l",ņ:"n",ū:"u",Ā:"A",Ē:"E",Ģ:"G",Ī:"I",Ķ:"K",Ļ:"L",Ņ:"N",Ū:"U",أ:"a",إ:"i",ب:"b",ت:"t",ث:"th",ج:"g",ح:"h",خ:"kh",د:"d",ذ:"th",ر:"r",ز:"z",س:"s",ش:"sh",ص:"s",ض:"d",ط:"t",ظ:"th",ع:"aa",غ:"gh",ف:"f",ق:"k",ك:"k",ل:"l",م:"m",ن:"n",ه:"h",و:"o",ي:"y",ء:"aa",ة:"a",آ:"a",ا:"a",پ:"p",ژ:"zh",گ:"g",چ:"ch",ک:"k",ی:"i",ė:"e",į:"i",ų:"u",Ė:"E",Į:"I",Ų:"U",ț:"t",Ț:"T",ţ:"t",Ţ:"T",ș:"s",Ș:"S",ă:"a",Ă:"A",Ạ:"A",Ả:"A",Ầ:"A",Ấ:"A",Ậ:"A",Ẩ:"A",Ẫ:"A",Ằ:"A",Ắ:"A",Ặ:"A",Ẳ:"A",Ẵ:"A",Ẹ:"E",Ẻ:"E",Ẽ:"E",Ề:"E",Ế:"E",Ệ:"E",Ể:"E",Ễ:"E",Ị:"I",Ỉ:"I",Ĩ:"I",Ọ:"O",Ỏ:"O",Ồ:"O",Ố:"O",Ộ:"O",Ổ:"O",Ỗ:"O",Ơ:"O",Ờ:"O",Ớ:"O",Ợ:"O",Ở:"O",Ỡ:"O",Ụ:"U",Ủ:"U",Ũ:"U",Ư:"U",Ừ:"U",Ứ:"U",Ự:"U",Ử:"U",Ữ:"U",Ỳ:"Y",Ỵ:"Y",Ỷ:"Y",Ỹ:"Y",Đ:"D",ạ:"a",ả:"a",ầ:"a",ấ:"a",ậ:"a",ẩ:"a",ẫ:"a",ằ:"a",ắ:"a",ặ:"a",ẳ:"a",ẵ:"a",ẹ:"e",ẻ:"e",ẽ:"e",ề:"e",ế:"e",ệ:"e",ể:"e",ễ:"e",ị:"i",ỉ:"i",ĩ:"i",ọ:"o",ỏ:"o",ồ:"o",ố:"o",ộ:"o",ổ:"o",ỗ:"o",ơ:"o",ờ:"o",ớ:"o",ợ:"o",ở:"o",ỡ:"o",ụ:"u",ủ:"u",ũ:"u",ư:"u",ừ:"u",ứ:"u",ự:"u",ử:"u",ữ:"u",ỳ:"y",ỵ:"y",ỷ:"y",ỹ:"y",đ:"d",Ә:"AE",ә:"ae",Ғ:"GH",ғ:"gh",Қ:"KH",қ:"kh",Ң:"NG",ң:"ng",Ү:"UE",ү:"ue",Ұ:"U",ұ:"u",Һ:"H",һ:"h",Ө:"OE",ө:"oe",ђ:"dj",ј:"j",љ:"lj",њ:"nj",ћ:"c",џ:"dz",Ђ:"Dj",Ј:"j",Љ:"Lj",Њ:"Nj",Ћ:"C",Џ:"Dz",nj:"nj",lj:"lj",Nj:"NJ",Lj:"LJ",अ:"a",आ:"aa",ए:"e",ई:"ii",ऍ:"ei",ऎ:"ae",ऐ:"ai",इ:"i",ओ:"o",ऑ:"oi",ऒ:"oii",ऊ:"uu",औ:"ou",उ:"u",ब:"B",भ:"Bha",च:"Ca",छ:"Chha",ड:"Da",ढ:"Dha",फ:"Fa",ग:"Ga",घ:"Gha",ग़:"Ghi",ह:"Ha",ज:"Ja",झ:"Jha",क:"Ka",ख:"Kha",ख़:"Khi",ल:"L",ळ:"Li",ऌ:"Li",ऴ:"Lii",ॡ:"Lii",म:"Ma",न:"Na",ङ:"Na",ञ:"Nia",ण:"Nae",ऩ:"Ni",ॐ:"oms",प:"Pa",क़:"Qi",र:"Ra",ऋ:"Ri",ॠ:"Ri",ऱ:"Ri",स:"Sa",श:"Sha",ष:"Shha",ट:"Ta",त:"Ta",ठ:"Tha",द:"Tha",थ:"Tha",ध:"Thha",ड़:"ugDha",ढ़:"ugDhha",व:"Va",य:"Ya",य़:"Yi",ज़:"Za",ə:"e",Ə:"E",ა:"a",ბ:"b",გ:"g",დ:"d",ე:"e",ვ:"v",ზ:"z",თ:"t",ი:"i",კ:"k",ლ:"l",მ:"m",ნ:"n",ო:"o",პ:"p",ჟ:"zh",რ:"r",ს:"s",ტ:"t",უ:"u",ფ:"p",ქ:"k",ღ:"gh",ყ:"q",შ:"sh",ჩ:"ch",ც:"ts",ძ:"dz",წ:"ts",ჭ:"ch",ხ:"kh",ჯ:"j",ჰ:"h",ב:"v",גּ:"g",ג:"g",ד:"d",דּ:"d",ה:"h",ו:"v",ז:"z",ח:"h",ט:"t",י:"y",כ:"kh",ך:"kh",ל:"l",מ:"m",ם:"m",נ:"n",ן:"n",ס:"s",פ:"f",ף:"f",ץ:"ts",צ:"ts",ק:"k",ר:"r",תּ:"t",ת:"t"};o.charmap=Object.assign({},c),o.multicharmap=Object.assign({},l),o.defaults={charmap:o.charmap,mode:"pretty",modes:{rfc3986:{replacement:"-",remove:null,lower:!0,charmap:o.charmap,multicharmap:o.multicharmap,trim:!0},pretty:{replacement:"-",remove:null,lower:!0,charmap:o.charmap,multicharmap:o.multicharmap,trim:!0}},multicharmap:o.multicharmap,fallback:!0},o.reset=function(){o.defaults.modes.rfc3986.charmap=o.defaults.modes.pretty.charmap=o.charmap=o.defaults.charmap=Object.assign({},c),o.defaults.modes.rfc3986.multicharmap=o.defaults.modes.pretty.multicharmap=o.multicharmap=o.defaults.multicharmap=Object.assign({},l),a=""},o.extend=function(u){const f=Object.keys(u),h={},m={};for(let g=0;g<f.length;g++)f[g].length>1?h[f[g]]=u[f[g]]:m[f[g]]=u[f[g]];Object.assign(o.charmap,m),Object.assign(o.multicharmap,h)},o.setLocale=function(u){a=i[u]||{}},e.exports?e.exports=o:t.slug=o})(BDe)}(xE)),xE.exports}var VDe=zDe();const yre=Gn(VDe);function ft(e,t){t=t||{};const r=[t.server||FDe,"api","v2",e];if(t.id&&r.push(t.id.toString()),t.objectMethod&&r.push(t.objectMethod),r.push(""),t.query){const o=[];for(const i in t.query)Object.hasOwn(t.query,i)&&o.push(`${encodeURIComponent(i)}=${encodeURIComponent(t.query[i])}`);r.pop(),r.push(`?${o.join("&")}`)}return r.join("/")}var Qt=(e=>(e[e.DASHBOARD=0]="DASHBOARD",e[e.ROUTINE_OVERVIEW=1]="ROUTINE_OVERVIEW",e[e.ROUTINE_DETAIL=2]="ROUTINE_DETAIL",e[e.ROUTINE_EDIT=3]="ROUTINE_EDIT",e[e.ROUTINE_DETAIL_TABLE=4]="ROUTINE_DETAIL_TABLE",e[e.ROUTINE_EDIT_PROGRESSION=5]="ROUTINE_EDIT_PROGRESSION",e[e.ROUTINE_ADD=6]="ROUTINE_ADD",e[e.ROUTINE_LOGS_OVERVIEW=7]="ROUTINE_LOGS_OVERVIEW",e[e.ROUTINE_STATS_OVERVIEW=8]="ROUTINE_STATS_OVERVIEW",e[e.ROUTINE_PDF_TABLE=9]="ROUTINE_PDF_TABLE",e[e.ROUTINE_PDF_LOGS=10]="ROUTINE_PDF_LOGS",e[e.ROUTINE_ICAL=11]="ROUTINE_ICAL",e[e.ROUTINE_COPY=12]="ROUTINE_COPY",e[e.ROUTINE_ADD_LOG=13]="ROUTINE_ADD_LOG",e[e.TEMPLATE_DETAIL=14]="TEMPLATE_DETAIL",e[e.PRIVATE_TEMPLATE_OVERVIEW=15]="PRIVATE_TEMPLATE_OVERVIEW",e[e.PUBLIC_TEMPLATE_OVERVIEW=16]="PUBLIC_TEMPLATE_OVERVIEW",e[e.EXERCISE_DETAIL=17]="EXERCISE_DETAIL",e[e.EXERCISE_OVERVIEW=18]="EXERCISE_OVERVIEW",e[e.EXERCISE_CONTRIBUTE=19]="EXERCISE_CONTRIBUTE",e[e.WEIGHT_OVERVIEW=20]="WEIGHT_OVERVIEW",e[e.WEIGHT_ADD=21]="WEIGHT_ADD",e[e.MEASUREMENT_OVERVIEW=22]="MEASUREMENT_OVERVIEW",e[e.MEASUREMENT_DETAIL=23]="MEASUREMENT_DETAIL",e[e.NUTRITION_OVERVIEW=24]="NUTRITION_OVERVIEW",e[e.NUTRITION_DETAIL=25]="NUTRITION_DETAIL",e[e.NUTRITION_PLAN_PDF=26]="NUTRITION_PLAN_PDF",e[e.NUTRITION_PLAN_COPY=27]="NUTRITION_PLAN_COPY",e[e.NUTRITION_DIARY=28]="NUTRITION_DIARY",e[e.INGREDIENT_DETAIL=29]="INGREDIENT_DETAIL",e[e.CALENDAR=30]="CALENDAR",e))(Qt||{});function cn(e,t,n){t=t||"en-us";const r=t.split("-")[0];switch(e){case 1:return`/${r}/routine/overview`;case 2:return`/${r}/routine/${n.id}/view`;case 4:return`/${r}/routine/${n.id}/table`;case 3:return`/${r}/routine/${n.id}/edit`;case 5:return`/${r}/routine/${n.id}/edit/progression/${n.id2}`;case 6:return`/${r}/routine/add`;case 12:return`/${r}/routine/${n.id}/copy`;case 9:return`/${r}/routine/${n.id}/pdf/table`;case 10:return`/${r}/routine/${n.id}/pdf/log`;case 11:return`/${r}/routine/${n.id}/ical`;case 7:return`/${r}/routine/${n.id}/logs`;case 8:return`/${r}/routine/${n.id}/statistics`;case 13:return`/${r}/routine/${n.id}/day/${n.id2}/add-logs`;case 30:return`/${r}/routine/calendar`;case 14:return`/${r}/routine/templates/${n.id}/view`;case 15:return`/${r}/routine/templates/overview/private`;case 16:return`/${r}/routine/templates/overview/public`;case 19:return`/${r}/exercise/contribute`;case 17:return n.slug?`/${r}/exercise/${n.id}/view/${yre(n.slug)}`:`/${r}/exercise/${n.id}/view`;case 18:return`/${r}/exercise/overview`;case 20:return`/${r}/weight/overview`;case 21:return`/${r}/weight/add`;case 22:return`/${r}/measurement/overview`;case 23:return`/${r}/measurement/category/${n.id}`;case 24:return`/${r}/nutrition/overview`;case 25:return`/${r}/nutrition/${n.id}/view`;case 28:return`/${r}/nutrition/${n.id}/${n.date}`;case 26:return`/${r}/nutrition/${n.id}/pdf`;case 27:return`/${r}/nutrition/${n.id}/copy`;case 29:return`/${r}/nutrition/ingredient/${n.id}/view`;case 0:default:return"/"}}function HDe(e){let t=null;if(document.cookie&&document.cookie!==""){const n=document.cookie.split(";");for(let r=0;r<n.length;r++){const o=n[r].trim();if(o.substring(0,e.length+1)===e+"="){t=decodeURIComponent(o.substring(e.length+1));break}}}return t}function ht(e){e=e||jDe;const t="csrftoken",n={};n["Content-Type"]="application/json",e&&(n.Authorization=`Token ${e}`);const r=HDe(t);return r!=null&&(n["X-CSRFToken"]=r),n}const wI="weightentry",UDe=async(e="")=>{const t=$De(e),n=ft(wI,{query:{ordering:"-date",limit:900,...t&&{date__gte:t}}}),{data:r}=await it.get(n,{headers:ht()});return r.results.map(o=>new SB().fromJson(o))},GDe=async e=>(await it.delete(ft(wI,{id:e}),{headers:ht()})).status,qDe=async e=>{const t=new SB,n=await it.patch(ft(wI,{id:e.id}),t.toJson(e),{headers:ht()});return t.fromJson(n)},WDe=async e=>{const t=new SB,n=await it.post(ft(wI),t.toJson(e),{headers:ht()});return t.fromJson(n.data)},gn=e=>typeof e=="string",t0=()=>{let e,t;const n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n},U6=e=>e==null?"":""+e,KDe=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},YDe=/###/g,G6=e=>e&&e.indexOf("###")>-1?e.replace(YDe,"."):e,q6=e=>!e||gn(e),Z0=(e,t,n)=>{const r=gn(t)?t.split("."):t;let o=0;for(;o<r.length-1;){if(q6(e))return{};const i=G6(r[o]);!e[i]&&n&&(e[i]=new n),Object.prototype.hasOwnProperty.call(e,i)?e=e[i]:e={},++o}return q6(e)?{}:{obj:e,k:G6(r[o])}},W6=(e,t,n)=>{const{obj:r,k:o}=Z0(e,t,Object);if(r!==void 0||t.length===1){r[o]=n;return}let i=t[t.length-1],a=t.slice(0,t.length-1),s=Z0(e,a,Object);for(;s.obj===void 0&&a.length;)i=`${a[a.length-1]}.${i}`,a=a.slice(0,a.length-1),s=Z0(e,a,Object),s!=null&&s.obj&&typeof s.obj[`${s.k}.${i}`]<"u"&&(s.obj=void 0);s.obj[`${s.k}.${i}`]=n},QDe=(e,t,n,r)=>{const{obj:o,k:i}=Z0(e,t,Object);o[i]=o[i]||[],o[i].push(n)},rT=(e,t)=>{const{obj:n,k:r}=Z0(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},XDe=(e,t,n)=>{const r=rT(e,n);return r!==void 0?r:rT(t,n)},vre=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?gn(e[r])||e[r]instanceof String||gn(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):vre(e[r],t[r],n):e[r]=t[r]);return e},Um=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var JDe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const ZDe=e=>gn(e)?e.replace(/[&<>"'\/]/g,t=>JDe[t]):e;class eke{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const tke=[" ",",","?","!",";"],nke=new eke(20),rke=(e,t,n)=>{t=t||"",n=n||"";const r=tke.filter(a=>t.indexOf(a)<0&&n.indexOf(a)<0);if(r.length===0)return!0;const o=nke.getRegExp(`(${r.map(a=>a==="?"?"\\?":a).join("|")})`);let i=!o.test(e);if(!i){const a=e.indexOf(n);a>0&&!o.test(e.substring(0,a))&&(i=!0)}return i},HN=(e,t,n=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(n);let o=e;for(let i=0;i<r.length;){if(!o||typeof o!="object")return;let a,s="";for(let l=i;l<r.length;++l)if(l!==i&&(s+=n),s+=r[l],a=o[s],a!==void 0){if(["string","number","boolean"].indexOf(typeof a)>-1&&l<r.length-1)continue;i+=l-i+1;break}o=a}return o},kx=e=>e==null?void 0:e.replace("_","-"),oke={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var n,r;(r=(n=console==null?void 0:console[e])==null?void 0:n.apply)==null||r.call(n,console,t)}};class oT{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||oke,this.options=n,this.debug=n.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,o){return o&&!this.debug?null:(gn(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new oT(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new oT(this.logger,t)}}var xc=new oT;let CI=class{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const o=this.observers[r].get(n)||0;this.observers[r].set(n,o+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t,...n){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([o,i])=>{for(let a=0;a<i;a++)o(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([o,i])=>{for(let a=0;a<i;a++)o.apply(o,[t,...n])})}};class K6 extends CI{constructor(t,n={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r,o={}){var c,u;const i=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,a=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let s;t.indexOf(".")>-1?s=t.split("."):(s=[t,n],r&&(Array.isArray(r)?s.push(...r):gn(r)&&i?s.push(...r.split(i)):s.push(r)));const l=rT(this.data,s);return!l&&!n&&!r&&t.indexOf(".")>-1&&(t=s[0],n=s[1],r=s.slice(2).join(".")),l||!a||!gn(r)?l:HN((u=(c=this.data)==null?void 0:c[t])==null?void 0:u[n],r,i)}addResource(t,n,r,o,i={silent:!1}){const a=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let s=[t,n];r&&(s=s.concat(a?r.split(a):r)),t.indexOf(".")>-1&&(s=t.split("."),o=n,n=s[1]),this.addNamespaces(n),W6(this.data,s,o),i.silent||this.emit("added",t,n,r,o)}addResources(t,n,r,o={silent:!1}){for(const i in r)(gn(r[i])||Array.isArray(r[i]))&&this.addResource(t,n,i,r[i],{silent:!0});o.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,o,i,a={silent:!1,skipCopy:!1}){let s=[t,n];t.indexOf(".")>-1&&(s=t.split("."),o=r,r=n,n=s[1]),this.addNamespaces(n);let l=rT(this.data,s)||{};a.skipCopy||(r=JSON.parse(JSON.stringify(r))),o?vre(l,r,i):l={...l,...r},W6(this.data,s,l),a.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(o=>n[o]&&Object.keys(n[o]).length>0)}toJSON(){return this.data}}var bre={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach(i=>{var a;t=((a=this.processors[i])==null?void 0:a.process(t,n,r,o))??t}),t}};const Y6={},Q6=e=>!gn(e)&&typeof e!="boolean"&&typeof e!="number";class iT extends CI{constructor(t,n={}){super(),KDe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=xc.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const r={...n};if(t==null)return!1;const o=this.resolve(t,r);return(o==null?void 0:o.res)!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let i=n.ns||this.options.defaultNS||[];const a=r&&t.indexOf(r)>-1,s=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!rke(t,r,o);if(a&&!s){const l=t.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:t,namespaces:gn(i)?[i]:i};const c=t.split(r);(r!==o||r===o&&this.options.ns.indexOf(c[0])>-1)&&(i=c.shift()),t=c.join(o)}return{key:t,namespaces:gn(i)?[i]:i}}translate(t,n,r){let o=typeof n=="object"?{...n}:n;if(typeof o!="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),typeof options=="object"&&(o={...o}),o||(o={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const i=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,{key:s,namespaces:l}=this.extractFromKey(t[t.length-1],o),c=l[l.length-1];let u=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;u===void 0&&(u=":");const f=o.lng||this.language,h=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((f==null?void 0:f.toLowerCase())==="cimode")return h?i?{res:`${c}${u}${s}`,usedKey:s,exactUsedKey:s,usedLng:f,usedNS:c,usedParams:this.getUsedParamsDetails(o)}:`${c}${u}${s}`:i?{res:s,usedKey:s,exactUsedKey:s,usedLng:f,usedNS:c,usedParams:this.getUsedParamsDetails(o)}:s;const m=this.resolve(t,o);let g=m==null?void 0:m.res;const y=(m==null?void 0:m.usedKey)||s,v=(m==null?void 0:m.exactUsedKey)||s,w=["[object Number]","[object Function]","[object RegExp]"],C=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,E=!this.i18nFormat||this.i18nFormat.handleAsObject,I=o.count!==void 0&&!gn(o.count),O=iT.hasDefaultValue(o),P=I?this.pluralResolver.getSuffix(f,o.count,o):"",R=o.ordinal&&I?this.pluralResolver.getSuffix(f,o.count,{ordinal:!1}):"",D=I&&!o.ordinal&&o.count===0,M=D&&o[`defaultValue${this.options.pluralSeparator}zero`]||o[`defaultValue${P}`]||o[`defaultValue${R}`]||o.defaultValue;let A=g;E&&!g&&O&&(A=M);const _=Q6(A),N=Object.prototype.toString.apply(A);if(E&&A&&_&&w.indexOf(N)<0&&!(gn(C)&&Array.isArray(A))){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const B=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,A,{...o,ns:l}):`key '${s} (${this.language})' returned an object instead of string.`;return i?(m.res=B,m.usedParams=this.getUsedParamsDetails(o),m):B}if(a){const B=Array.isArray(A),H=B?[]:{},j=B?v:y;for(const L in A)if(Object.prototype.hasOwnProperty.call(A,L)){const V=`${j}${a}${L}`;O&&!g?H[L]=this.translate(V,{...o,defaultValue:Q6(M)?M[L]:void 0,joinArrays:!1,ns:l}):H[L]=this.translate(V,{...o,joinArrays:!1,ns:l}),H[L]===V&&(H[L]=A[L])}g=H}}else if(E&&gn(C)&&Array.isArray(g))g=g.join(C),g&&(g=this.extendTranslation(g,t,o,r));else{let B=!1,H=!1;!this.isValidLookup(g)&&O&&(B=!0,g=M),this.isValidLookup(g)||(H=!0,g=s);const L=(o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&H?void 0:g,V=O&&M!==g&&this.options.updateMissing;if(H||B||V){if(this.logger.log(V?"updateKey":"missingKey",f,c,s,V?M:g),a){const q=this.resolve(s,{...o,keySeparator:!1});q&&q.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let W=[];const K=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&K&&K[0])for(let q=0;q<K.length;q++)W.push(K[q]);else this.options.saveMissingTo==="all"?W=this.languageUtils.toResolveHierarchy(o.lng||this.language):W.push(o.lng||this.language);const G=(q,Y,Z)=>{var se;const ie=O&&Z!==g?Z:L;this.options.missingKeyHandler?this.options.missingKeyHandler(q,c,Y,ie,V,o):(se=this.backendConnector)!=null&&se.saveMissing&&this.backendConnector.saveMissing(q,c,Y,ie,V,o),this.emit("missingKey",q,c,Y,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&I?W.forEach(q=>{const Y=this.pluralResolver.getSuffixes(q,o);D&&o[`defaultValue${this.options.pluralSeparator}zero`]&&Y.indexOf(`${this.options.pluralSeparator}zero`)<0&&Y.push(`${this.options.pluralSeparator}zero`),Y.forEach(Z=>{G([q],s+Z,o[`defaultValue${Z}`]||M)})}):G(W,s,M))}g=this.extendTranslation(g,t,o,m,r),H&&g===s&&this.options.appendNamespaceToMissingKey&&(g=`${c}${u}${s}`),(H||B)&&this.options.parseMissingKeyHandler&&(g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}${u}${s}`:s,B?g:void 0,o))}return i?(m.res=g,m.usedParams=this.getUsedParamsDetails(o),m):g}extendTranslation(t,n,r,o,i){var l,c;if((l=this.i18nFormat)!=null&&l.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const u=gn(t)&&(((c=r==null?void 0:r.interpolation)==null?void 0:c.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(u){const m=t.match(this.interpolator.nestingRegexp);f=m&&m.length}let h=r.replace&&!gn(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(h={...this.options.interpolation.defaultVariables,...h}),t=this.interpolator.interpolate(t,h,r.lng||this.language||o.usedLng,r),u){const m=t.match(this.interpolator.nestingRegexp),g=m&&m.length;f<g&&(r.nest=!1)}!r.lng&&o&&o.res&&(r.lng=this.language||o.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,(...m)=>(i==null?void 0:i[0])===m[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${m[0]} in key: ${n[0]}`),null):this.translate(...m,n),r)),r.interpolation&&this.interpolator.reset()}const a=r.postProcess||this.options.postProcess,s=gn(a)?[a]:a;return t!=null&&(s!=null&&s.length)&&r.applyPostProcessor!==!1&&(t=bre.handle(s,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t,n={}){let r,o,i,a,s;return gn(t)&&(t=[t]),t.forEach(l=>{if(this.isValidLookup(r))return;const c=this.extractFromKey(l,n),u=c.key;o=u;let f=c.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const h=n.count!==void 0&&!gn(n.count),m=h&&!n.ordinal&&n.count===0,g=n.context!==void 0&&(gn(n.context)||typeof n.context=="number")&&n.context!=="",y=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(v=>{var w,C;this.isValidLookup(r)||(s=v,!Y6[`${y[0]}-${v}`]&&((w=this.utils)!=null&&w.hasLoadedNamespace)&&!((C=this.utils)!=null&&C.hasLoadedNamespace(s))&&(Y6[`${y[0]}-${v}`]=!0,this.logger.warn(`key "${o}" for languages "${y.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),y.forEach(E=>{var P;if(this.isValidLookup(r))return;a=E;const I=[u];if((P=this.i18nFormat)!=null&&P.addLookupKeys)this.i18nFormat.addLookupKeys(I,u,E,v,n);else{let R;h&&(R=this.pluralResolver.getSuffix(E,n.count,n));const D=`${this.options.pluralSeparator}zero`,M=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(I.push(u+R),n.ordinal&&R.indexOf(M)===0&&I.push(u+R.replace(M,this.options.pluralSeparator)),m&&I.push(u+D)),g){const A=`${u}${this.options.contextSeparator}${n.context}`;I.push(A),h&&(I.push(A+R),n.ordinal&&R.indexOf(M)===0&&I.push(A+R.replace(M,this.options.pluralSeparator)),m&&I.push(A+D))}}let O;for(;O=I.pop();)this.isValidLookup(r)||(i=O,r=this.getResource(E,v,O,n))}))})}),{res:r,usedKey:o,exactUsedKey:i,usedLng:a,usedNS:s}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r,o={}){var i;return(i=this.i18nFormat)!=null&&i.getResource?this.i18nFormat.getResource(t,n,r,o):this.resourceStore.getResource(t,n,r,o)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!gn(t.replace);let o=r?t.replace:t;if(r&&typeof t.count<"u"&&(o.count=t.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!r){o={...o};for(const i of n)delete o[i]}return o}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}class X6{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=xc.create("languageUtils")}getScriptPartFromCode(t){if(t=kx(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=kx(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(gn(t)&&t.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const o=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(o))&&(n=o)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const o=this.getScriptPartFromCode(r);if(this.isSupportedCode(o))return n=o;const i=this.getLanguagePartFromCode(r);if(this.isSupportedCode(i))return n=i;n=this.options.supportedLngs.find(a=>{if(a===i)return a;if(!(a.indexOf("-")<0&&i.indexOf("-")<0)&&(a.indexOf("-")>0&&i.indexOf("-")<0&&a.substring(0,a.indexOf("-"))===i||a.indexOf(i)===0&&i.length>1))return a})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),gn(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),o=[],i=a=>{a&&(this.isSupportedCode(a)?o.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return gn(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(t))):gn(t)&&i(this.formatLanguageCode(t)),r.forEach(a=>{o.indexOf(a)<0&&i(this.formatLanguageCode(a))}),o}}const J6={zero:0,one:1,two:2,few:3,many:4,other:5},Z6={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class ike{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=xc.create("pluralResolver"),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const r=kx(t==="dev"?"en":t),o=n.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:r,type:o});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(r,{type:o})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Z6;if(!t.match(/-|_/))return Z6;const l=this.languageUtils.getLanguagePartFromCode(t);a=this.getRule(l,n)}return this.pluralRulesCache[i]=a,a}needsPlural(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),(r==null?void 0:r.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,n,r={}){return this.getSuffixes(t,r).map(o=>`${n}${o}`)}getSuffixes(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((o,i)=>J6[o]-J6[i]).map(o=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${o}`):[]}getSuffix(t,n,r={}){const o=this.getRule(t,r);return o?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${o.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}}const eq=(e,t,n,r=".",o=!0)=>{let i=XDe(e,t,n);return!i&&o&&gn(n)&&(i=HN(e,n,r),i===void 0&&(i=HN(t,n,r))),i},zR=e=>e.replace(/\$/g,"$$$$");class ake{constructor(t={}){var n;this.logger=xc.create("interpolator"),this.options=t,this.format=((n=t==null?void 0:t.interpolation)==null?void 0:n.format)||(r=>r),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:o,prefix:i,prefixEscaped:a,suffix:s,suffixEscaped:l,formatSeparator:c,unescapeSuffix:u,unescapePrefix:f,nestingPrefix:h,nestingPrefixEscaped:m,nestingSuffix:g,nestingSuffixEscaped:y,nestingOptionsSeparator:v,maxReplaces:w,alwaysFormat:C}=t.interpolation;this.escape=n!==void 0?n:ZDe,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=i?Um(i):a||"{{",this.suffix=s?Um(s):l||"}}",this.formatSeparator=c||",",this.unescapePrefix=u?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=h?Um(h):m||Um("$t("),this.nestingSuffix=g?Um(g):y||Um(")"),this.nestingOptionsSeparator=v||",",this.maxReplaces=w||1e3,this.alwaysFormat=C!==void 0?C:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>(n==null?void 0:n.source)===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,n,r,o){var m;let i,a,s;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=g=>{if(g.indexOf(this.formatSeparator)<0){const C=eq(n,l,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(C,void 0,r,{...o,...n,interpolationkey:g}):C}const y=g.split(this.formatSeparator),v=y.shift().trim(),w=y.join(this.formatSeparator).trim();return this.format(eq(n,l,v,this.options.keySeparator,this.options.ignoreJSONStructure),w,r,{...o,...n,interpolationkey:v})};this.resetRegExp();const u=(o==null?void 0:o.missingInterpolationHandler)||this.options.missingInterpolationHandler,f=((m=o==null?void 0:o.interpolation)==null?void 0:m.skipOnVariables)!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>zR(g)},{regex:this.regexp,safeValue:g=>this.escapeValue?zR(this.escape(g)):zR(g)}].forEach(g=>{for(s=0;i=g.regex.exec(t);){const y=i[1].trim();if(a=c(y),a===void 0)if(typeof u=="function"){const w=u(t,i,o);a=gn(w)?w:""}else if(o&&Object.prototype.hasOwnProperty.call(o,y))a="";else if(f){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${y} for interpolating ${t}`),a="";else!gn(a)&&!this.useRawValueToEscape&&(a=U6(a));const v=g.safeValue(a);if(t=t.replace(i[0],v),f?(g.regex.lastIndex+=a.length,g.regex.lastIndex-=i[0].length):g.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),t}nest(t,n,r={}){let o,i,a;const s=(l,c)=>{const u=this.nestingOptionsSeparator;if(l.indexOf(u)<0)return l;const f=l.split(new RegExp(`${u}[ ]*{`));let h=`{${f[1]}`;l=f[0],h=this.interpolate(h,a);const m=h.match(/'/g),g=h.match(/"/g);(((m==null?void 0:m.length)??0)%2===0&&!g||g.length%2!==0)&&(h=h.replace(/'/g,'"'));try{a=JSON.parse(h),c&&(a={...c,...a})}catch(y){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,y),`${l}${u}${h}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,l};for(;o=this.nestingRegexp.exec(t);){let l=[];a={...r},a=a.replace&&!gn(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=!1;if(o[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(o[1])){const u=o[1].split(this.formatSeparator).map(f=>f.trim());o[1]=u.shift(),l=u,c=!0}if(i=n(s.call(this,o[1].trim(),a),a),i&&o[0]===t&&!gn(i))return i;gn(i)||(i=U6(i)),i||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${t}`),i=""),c&&(i=l.reduce((u,f)=>this.format(u,f,r.lng,{...r,interpolationkey:o[1].trim()}),i.trim())),t=t.replace(o[0],i),this.regexp.lastIndex=0}return t}}const ske=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const o=r[1].substring(0,r[1].length-1);t==="currency"&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):t==="relativetime"&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach(a=>{if(a){const[s,...l]=a.split(":"),c=l.join(":").trim().replace(/^'+|'+$/g,""),u=s.trim();n[u]||(n[u]=c),c==="false"&&(n[u]=!1),c==="true"&&(n[u]=!0),isNaN(c)||(n[u]=parseInt(c,10))}})}return{formatName:t,formatOptions:n}},tq=e=>{const t={};return(n,r,o)=>{let i=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(i={...i,[o.interpolationkey]:void 0});const a=r+JSON.stringify(i);let s=t[a];return s||(s=e(kx(r),o),t[a]=s),s(n)}},lke=e=>(t,n,r)=>e(kx(n),r)(t);let cke=class{constructor(t={}){this.logger=xc.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const r=n.cacheInBuiltFormats?tq:lke;this.formats={number:r((o,i)=>{const a=new Intl.NumberFormat(o,{...i});return s=>a.format(s)}),currency:r((o,i)=>{const a=new Intl.NumberFormat(o,{...i,style:"currency"});return s=>a.format(s)}),datetime:r((o,i)=>{const a=new Intl.DateTimeFormat(o,{...i});return s=>a.format(s)}),relativetime:r((o,i)=>{const a=new Intl.RelativeTimeFormat(o,{...i});return s=>a.format(s,i.range||"day")}),list:r((o,i)=>{const a=new Intl.ListFormat(o,{...i});return s=>a.format(s)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=tq(n)}format(t,n,r,o={}){const i=n.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find(s=>s.indexOf(")")>-1)){const s=i.findIndex(l=>l.indexOf(")")>-1);i[0]=[i[0],...i.splice(1,s)].join(this.formatSeparator)}return i.reduce((s,l)=>{var f;const{formatName:c,formatOptions:u}=ske(l);if(this.formats[c]){let h=s;try{const m=((f=o==null?void 0:o.formatParams)==null?void 0:f[o.interpolationkey])||{},g=m.locale||m.lng||o.locale||o.lng||r;h=this.formats[c](s,g,{...u,...o,...m})}catch(m){this.logger.warn(m)}return h}else this.logger.warn(`there was no format function for ${c}`);return s},t)}};const uke=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class dke extends CI{constructor(t,n,r,o={}){var i,a;super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=o,this.logger=xc.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],(a=(i=this.backend)==null?void 0:i.init)==null||a.call(i,r,o.backend,o)}queueLoad(t,n,r,o){const i={},a={},s={},l={};return t.forEach(c=>{let u=!0;n.forEach(f=>{const h=`${c}|${f}`;!r.reload&&this.store.hasResourceBundle(c,f)?this.state[h]=2:this.state[h]<0||(this.state[h]===1?a[h]===void 0&&(a[h]=!0):(this.state[h]=1,u=!1,a[h]===void 0&&(a[h]=!0),i[h]===void 0&&(i[h]=!0),l[f]===void 0&&(l[f]=!0)))}),u||(s[c]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}loaded(t,n,r){const o=t.split("|"),i=o[0],a=o[1];n&&this.emit("failedLoading",i,a,n),!n&&r&&this.store.addResourceBundle(i,a,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const s={};this.queue.forEach(l=>{QDe(l.loaded,[i],a),uke(l,t),n&&l.errors.push(n),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(c=>{s[c]||(s[c]={});const u=l.loaded[c];u.length&&u.forEach(f=>{s[c][f]===void 0&&(s[c][f]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(l=>!l.done)}read(t,n,r,o=0,i=this.retryTimeout,a){if(!t.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:o,wait:i,callback:a});return}this.readingCalls++;const s=(c,u)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(c&&u&&o<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,o+1,i*2,a)},i);return}a(c,u)},l=this.backend[r].bind(this.backend);if(l.length===2){try{const c=l(t,n);c&&typeof c.then=="function"?c.then(u=>s(null,u)).catch(s):s(null,c)}catch(c){s(c)}return}return l(t,n,s)}prepareLoading(t,n,r={},o){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();gn(t)&&(t=this.languageUtils.toResolveHierarchy(t)),gn(n)&&(n=[n]);const i=this.queueLoad(t,n,r,o);if(!i.toLoad.length)return i.pending.length||o(),null;i.toLoad.forEach(a=>{this.loadOne(a)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t,n=""){const r=t.split("|"),o=r[0],i=r[1];this.read(o,i,"read",void 0,void 0,(a,s)=>{a&&this.logger.warn(`${n}loading namespace ${i} for language ${o} failed`,a),!a&&s&&this.logger.log(`${n}loaded namespace ${i} for language ${o}`,s),this.loaded(t,a,s)})}saveMissing(t,n,r,o,i,a={},s=()=>{}){var l,c,u,f,h;if((c=(l=this.services)==null?void 0:l.utils)!=null&&c.hasLoadedNamespace&&!((f=(u=this.services)==null?void 0:u.utils)!=null&&f.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if((h=this.backend)!=null&&h.create){const m={...a,isUpdate:i},g=this.backend.create.bind(this.backend);if(g.length<6)try{let y;g.length===5?y=g(t,n,r,o,m):y=g(t,n,r,o),y&&typeof y.then=="function"?y.then(v=>s(null,v)).catch(s):s(null,y)}catch(y){s(y)}else g(t,n,r,o,s,m)}!t||!t[0]||this.store.addResource(t[0],n,r,o)}}}const nq=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),gn(e[1])&&(t.defaultValue=e[1]),gn(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),rq=e=>{var t,n;return gn(e.ns)&&(e.ns=[e.ns]),gn(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),gn(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),((n=(t=e.supportedLngs)==null?void 0:t.indexOf)==null?void 0:n.call(t,"cimode"))<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e},I1=()=>{},fke=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class _x extends CI{constructor(t={},n){if(super(),this.options=rq(t),this.services={},this.logger=xc,this.modules={external:[]},fke(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(t={},n){this.isInitializing=!0,typeof t=="function"&&(n=t,t={}),t.defaultNS==null&&t.ns&&(gn(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=nq();this.options={...r,...this.options,...rq(t)},this.options.interpolation={...r.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator);const o=c=>c?typeof c=="function"?new c:c:null;if(!this.options.isClone){this.modules.logger?xc.init(o(this.modules.logger),this.options):xc.init(null,this.options);let c;this.modules.formatter?c=this.modules.formatter:c=cke;const u=new X6(this.options);this.store=new K6(this.options.resources,this.options);const f=this.services;f.logger=xc,f.resourceStore=this.store,f.languageUtils=u,f.pluralResolver=new ike(u,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),c&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(f.formatter=o(c),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new ake(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new dke(o(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",(h,...m)=>{this.emit(h,...m)}),this.modules.languageDetector&&(f.languageDetector=o(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=o(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new iT(this.services,this.options),this.translator.on("*",(h,...m)=>{this.emit(h,...m)}),this.modules.external.forEach(h=>{h.init&&h.init(this)})}if(this.format=this.options.interpolation.format,n||(n=I1),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&c[0]!=="dev"&&(this.options.lng=c[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(c=>{this[c]=(...u)=>this.store[c](...u)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(c=>{this[c]=(...u)=>(this.store[c](...u),this)});const s=t0(),l=()=>{const c=(u,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),s.resolve(f),n(u,f)};if(this.languages&&!this.isInitialized)return c(null,this.t.bind(this));this.changeLanguage(this.options.lng,c)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,0),s}loadResources(t,n=I1){var i,a;let r=n;const o=gn(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if((o==null?void 0:o.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const s=[],l=c=>{if(!c||c==="cimode")return;this.services.languageUtils.toResolveHierarchy(c).forEach(f=>{f!=="cimode"&&s.indexOf(f)<0&&s.push(f)})};o?l(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(u=>l(u)),(a=(i=this.options.preload)==null?void 0:i.forEach)==null||a.call(i,c=>l(c)),this.services.backendConnector.load(s,this.options.ns,c=>{!c&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(c)})}else r(null)}reloadResources(t,n,r){const o=t0();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=I1),this.services.backendConnector.reload(t,n,i=>{o.resolve(),r(i)}),o}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&bre.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1)){for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,n){this.isLanguageChangingTo=t;const r=t0();this.emit("languageChanging",t);const o=s=>{this.language=s,this.languages=this.services.languageUtils.toResolveHierarchy(s),this.resolvedLanguage=void 0,this.setResolvedLanguage(s)},i=(s,l)=>{l?this.isLanguageChangingTo===t&&(o(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,r.resolve((...c)=>this.t(...c)),n&&n(s,(...c)=>this.t(...c))},a=s=>{var u,f;!t&&!s&&this.services.languageDetector&&(s=[]);const l=gn(s)?s:s&&s[0],c=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(gn(s)?[s]:s);c&&(this.language||o(c),this.translator.language||this.translator.changeLanguage(c),(f=(u=this.services.languageDetector)==null?void 0:u.cacheUserLanguage)==null||f.call(u,c)),this.loadResources(c,h=>{i(h,c)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(t),r}getFixedT(t,n,r){const o=(i,a,...s)=>{let l;typeof a!="object"?l=this.options.overloadTranslationOptionHandler([i,a].concat(s)):l={...a},l.lng=l.lng||o.lng,l.lngs=l.lngs||o.lngs,l.ns=l.ns||o.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||r||o.keyPrefix);const c=this.options.keySeparator||".";let u;return l.keyPrefix&&Array.isArray(i)?u=i.map(f=>`${l.keyPrefix}${c}${f}`):u=l.keyPrefix?`${l.keyPrefix}${c}${i}`:i,this.t(u,l)};return gn(t)?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=r,o}t(...t){var n;return(n=this.translator)==null?void 0:n.translate(...t)}exists(...t){var n;return(n=this.translator)==null?void 0:n.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const a=(s,l)=>{const c=this.services.backendConnector.state[`${s}|${l}`];return c===-1||c===0||c===2};if(n.precheck){const s=n.precheck(this,a);if(s!==void 0)return s}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(r,t)&&(!o||a(i,t)))}loadNamespaces(t,n){const r=t0();return this.options.ns?(gn(t)&&(t=[t]),t.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=t0();gn(t)&&(t=[t]);const o=this.options.preload||[],i=t.filter(a=>o.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return i.length?(this.options.preload=o.concat(i),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}dir(t){var o,i;if(t||(t=this.resolvedLanguage||(((o=this.languages)==null?void 0:o.length)>0?this.languages[0]:this.language)),!t)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=((i=this.services)==null?void 0:i.languageUtils)||new X6(nq());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){return new _x(t,n)}cloneInstance(t={},n=I1){const r=t.forkResourceStore;r&&delete t.forkResourceStore;const o={...this.options,...t,isClone:!0},i=new _x(o);if((t.debug!==void 0||t.prefix!==void 0)&&(i.logger=i.logger.clone(t)),["store","services","language"].forEach(s=>{i[s]=this[s]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},r){const s=Object.keys(this.store.data).reduce((l,c)=>(l[c]={...this.store.data[c]},l[c]=Object.keys(l[c]).reduce((u,f)=>(u[f]={...l[c][f]},u),l[c]),l),{});i.store=new K6(s,o),i.services.resourceStore=i.store}return i.translator=new iT(i.services,o),i.translator.on("*",(s,...l)=>{i.emit(s,...l)}),i.init(o,n),i.translator.options=o,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const hr=_x.createInstance();hr.createInstance=_x.createInstance;hr.createInstance;hr.dir;hr.init;hr.loadResources;hr.reloadResources;hr.use;hr.changeLanguage;hr.getFixedT;hr.t;hr.exists;hr.setDefaultNamespace;hr.hasLoadedNamespace;hr.loadNamespaces;hr.loadLanguages;const pke=22;function hke(e,t=pke){return e.length>t?e.slice(0,t)+"…":e}function mke(e){return e.toLowerCase().replace(/\s/g,"_").replace("(","_").replace(")","_").replace("-","_")}function CB(e){return e===void 0?(console.warn("called getTranslationKey with undefined name"),""):`server.${mke(e)}`}class gke{constructor(t,n,r,o){this.id=t,this.name=n,this.nameEn=r,this.isFront=o}get translatedName(){return hr.t(CB(this.nameEn),{defaultValue:this.nameEn})}getName(){return this.nameEn?`${this.name} (${this.translatedName})`:this.name}}class xre{fromJson(t){return new gke(t.id,t.name,t.name_en,t.is_front)}toJson(t){return{}}}const yke="muscle",vke=async()=>{const e=ft(yke),{data:t}=await it.get(e,{headers:ht()}),n=new xre;return t.results.map(r=>n.fromJson(r))},{slice:bke,forEach:xke}=[];function Ske(e){return xke.call(bke.call(arguments,1),t=>{if(t)for(const n in t)e[n]===void 0&&(e[n]=t[n])}),e}const oq=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,wke=function(e,t){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},o=encodeURIComponent(t);let i=`${e}=${o}`;if(r.maxAge>0){const a=r.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");i+=`; Max-Age=${Math.floor(a)}`}if(r.domain){if(!oq.test(r.domain))throw new TypeError("option domain is invalid");i+=`; Domain=${r.domain}`}if(r.path){if(!oq.test(r.path))throw new TypeError("option path is invalid");i+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");i+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(i+="; HttpOnly"),r.secure&&(i+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i},iq={create(e,t,n,r){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+n*60*1e3)),r&&(o.domain=r),document.cookie=wke(e,encodeURIComponent(t),o)},read(e){const t=`${e}=`,n=document.cookie.split(";");for(let r=0;r<n.length;r++){let o=n[r];for(;o.charAt(0)===" ";)o=o.substring(1,o.length);if(o.indexOf(t)===0)return o.substring(t.length,o.length)}return null},remove(e){this.create(e,"",-1)}};var Cke={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&typeof document<"u")return iq.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:n,cookieMinutes:r,cookieDomain:o,cookieOptions:i}=t;n&&typeof document<"u"&&iq.create(n,e,r,o,i)}},Eke={name:"querystring",lookup(e){var r;let{lookupQuerystring:t}=e,n;if(typeof window<"u"){let{search:o}=window.location;!window.location.search&&((r=window.location.hash)==null?void 0:r.indexOf("?"))>-1&&(o=window.location.hash.substring(window.location.hash.indexOf("?")));const a=o.substring(1).split("&");for(let s=0;s<a.length;s++){const l=a[s].indexOf("=");l>0&&a[s].substring(0,l)===t&&(n=a[s].substring(l+1))}}return n}};let Gm=null;const aq=()=>{if(Gm!==null)return Gm;try{if(Gm=typeof window<"u"&&window.localStorage!==null,!Gm)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{Gm=!1}return Gm};var Tke={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&aq())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&aq()&&window.localStorage.setItem(n,e)}};let qm=null;const sq=()=>{if(qm!==null)return qm;try{if(qm=typeof window<"u"&&window.sessionStorage!==null,!qm)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{qm=!1}return qm};var Oke={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&sq())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&sq()&&window.sessionStorage.setItem(n,e)}},Ike={name:"navigator",lookup(e){const t=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:o}=navigator;if(n)for(let i=0;i<n.length;i++)t.push(n[i]);r&&t.push(r),o&&t.push(o)}return t.length>0?t:void 0}},Pke={name:"htmlTag",lookup(e){let{htmlTag:t}=e,n;const r=t||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},Ake={name:"path",lookup(e){var o;let{lookupFromPathIndex:t}=e;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?(o=n[typeof t=="number"?t:0])==null?void 0:o.replace("/",""):void 0}},Mke={name:"subdomain",lookup(e){var o,i;let{lookupFromSubdomainIndex:t}=e;const n=typeof t=="number"?t+1:1,r=typeof window<"u"&&((i=(o=window.location)==null?void 0:o.hostname)==null?void 0:i.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(r)return r[n]}};let Sre=!1;try{document.cookie,Sre=!0}catch{}const wre=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Sre||wre.splice(1,1);const Rke=()=>({order:wre,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class Cre{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,n)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=Ske(n,this.options||{},Rke()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=o=>o.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(Cke),this.addDetector(Eke),this.addDetector(Tke),this.addDetector(Oke),this.addDetector(Ike),this.addDetector(Pke),this.addDetector(Ake),this.addDetector(Mke)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,n=[];return t.forEach(r=>{if(this.detectors[r]){let o=this.detectors[r].lookup(this.options);o&&typeof o=="string"&&(o=[o]),o&&(n=n.concat(o))}}),n=n.map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(t,this.options)}))}}Cre.type="languageDetector";function UN(e){"@babel/helpers - typeof";return UN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},UN(e)}function Ere(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":UN(XMLHttpRequest))==="object"}function Dke(e){return!!e&&typeof e.then=="function"}function kke(e){return Dke(e)?e:Promise.resolve(e)}function lq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function cq(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lq(Object(n),!0).forEach(function(r){_ke(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lq(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _ke(e,t,n){return(t=$ke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $ke(e){var t=Nke(e,"string");return vh(t)=="symbol"?t:t+""}function Nke(e,t){if(vh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(vh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vh(e){"@babel/helpers - typeof";return vh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vh(e)}var Of=typeof fetch=="function"?fetch:void 0;typeof global<"u"&&global.fetch?Of=global.fetch:typeof window<"u"&&window.fetch&&(Of=window.fetch);var $x;Ere()&&(typeof global<"u"&&global.XMLHttpRequest?$x=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&($x=window.XMLHttpRequest));var aT;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?aT=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(aT=window.ActiveXObject));typeof Of!="function"&&(Of=void 0);if(!Of&&!$x&&!aT)try{iSe(()=>import("./browser-ponyfill-C61aqKwl.js").then(e=>e.b),[]).then(function(e){Of=e.default}).catch(function(){})}catch{}var GN=function(t,n){if(n&&vh(n)==="object"){var r="";for(var o in n)r+="&"+encodeURIComponent(o)+"="+encodeURIComponent(n[o]);if(!r)return t;t=t+(t.indexOf("?")!==-1?"&":"?")+r.slice(1)}return t},uq=function(t,n,r,o){var i=function(l){if(!l.ok)return r(l.statusText||"Error",{status:l.status});l.text().then(function(c){r(null,{status:l.status,data:c})}).catch(r)};if(o){var a=o(t,n);if(a instanceof Promise){a.then(i).catch(r);return}}typeof fetch=="function"?fetch(t,n).then(i).catch(r):Of(t,n).then(i).catch(r)},dq=!1,Lke=function(t,n,r,o){t.queryStringParams&&(n=GN(n,t.queryStringParams));var i=cq({},typeof t.customHeaders=="function"?t.customHeaders():t.customHeaders);typeof window>"u"&&typeof global<"u"&&typeof global.process<"u"&&global.process.versions&&global.process.versions.node&&(i["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),r&&(i["Content-Type"]="application/json");var a=typeof t.requestOptions=="function"?t.requestOptions(r):t.requestOptions,s=cq({method:r?"POST":"GET",body:r?t.stringify(r):void 0,headers:i},dq?{}:a),l=typeof t.alternateFetch=="function"&&t.alternateFetch.length>=1?t.alternateFetch:void 0;try{uq(n,s,o,l)}catch(c){if(!a||Object.keys(a).length===0||!c.message||c.message.indexOf("not implemented")<0)return o(c);try{Object.keys(a).forEach(function(u){delete s[u]}),uq(n,s,o,l),dq=!0}catch(u){o(u)}}},Fke=function(t,n,r,o){r&&vh(r)==="object"&&(r=GN("",r).slice(1)),t.queryStringParams&&(n=GN(n,t.queryStringParams));try{var i=$x?new $x:new aT("MSXML2.XMLHTTP.3.0");i.open(r?"POST":"GET",n,1),t.crossDomain||i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.withCredentials=!!t.withCredentials,r&&i.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),i.overrideMimeType&&i.overrideMimeType("application/json");var a=t.customHeaders;if(a=typeof a=="function"?a():a,a)for(var s in a)i.setRequestHeader(s,a[s]);i.onreadystatechange=function(){i.readyState>3&&o(i.status>=400?i.statusText:null,{status:i.status,data:i.responseText})},i.send(r)}catch(l){console&&console.log(l)}},jke=function(t,n,r,o){if(typeof r=="function"&&(o=r,r=void 0),o=o||function(){},Of&&n.indexOf("file:")!==0)return Lke(t,n,r,o);if(Ere()||typeof ActiveXObject=="function")return Fke(t,n,r,o);o(new Error("No fetch and no xhr implementation found!"))};function cy(e){"@babel/helpers - typeof";return cy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cy(e)}function fq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function VR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fq(Object(n),!0).forEach(function(r){Tre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fq(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Bke(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zke(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,Ore(r.key),r)}}function Vke(e,t,n){return t&&zke(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Tre(e,t,n){return(t=Ore(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ore(e){var t=Hke(e,"string");return cy(t)=="symbol"?t:t+""}function Hke(e,t){if(cy(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(cy(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Uke=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:function(n){return JSON.parse(n)},stringify:JSON.stringify,parsePayload:function(n,r,o){return Tre({},r,o||"")},parseLoadPayload:function(n,r){},request:jke,reloadInterval:typeof window<"u"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},Ire=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Bke(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}return Vke(e,[{key:"init",value:function(n){var r=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.services=n,this.options=VR(VR(VR({},Uke()),this.options||{}),o),this.allOptions=i,this.services&&this.options.reloadInterval){var a=setInterval(function(){return r.reload()},this.options.reloadInterval);cy(a)==="object"&&typeof a.unref=="function"&&a.unref()}}},{key:"readMulti",value:function(n,r,o){this._readAny(n,n,r,r,o)}},{key:"read",value:function(n,r,o){this._readAny([n],n,[r],r,o)}},{key:"_readAny",value:function(n,r,o,i,a){var s=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(n,o)),l=kke(l),l.then(function(c){if(!c)return a(null,{});var u=s.services.interpolator.interpolate(c,{lng:n.join("+"),ns:o.join("+")});s.loadUrl(u,a,r,i)})}},{key:"loadUrl",value:function(n,r,o,i){var a=this,s=typeof o=="string"?[o]:o,l=typeof i=="string"?[i]:i,c=this.options.parseLoadPayload(s,l);this.options.request(this.options,n,c,function(u,f){if(f&&(f.status>=500&&f.status<600||!f.status))return r("failed loading "+n+"; status code: "+f.status,!0);if(f&&f.status>=400&&f.status<500)return r("failed loading "+n+"; status code: "+f.status,!1);if(!f&&u&&u.message){var h=u.message.toLowerCase(),m=["failed","fetch","network","load"].find(function(v){return h.indexOf(v)>-1});if(m)return r("failed loading "+n+": "+u.message,!0)}if(u)return r(u,!1);var g,y;try{typeof f.data=="string"?g=a.options.parse(f.data,o,i):g=f.data}catch{y="failed parsing "+n+" to json"}if(y)return r(y,!1);r(null,g)})}},{key:"create",value:function(n,r,o,i,a){var s=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var l=this.options.parsePayload(r,o,i),c=0,u=[],f=[];n.forEach(function(h){var m=s.options.addPath;typeof s.options.addPath=="function"&&(m=s.options.addPath(h,r));var g=s.services.interpolator.interpolate(m,{lng:h,ns:r});s.options.request(s.options,g,l,function(y,v){c+=1,u.push(y),f.push(v),c===n.length&&typeof a=="function"&&a(u,f)})})}}},{key:"reload",value:function(){var n=this,r=this.services,o=r.backendConnector,i=r.languageUtils,a=r.logger,s=o.language;if(!(s&&s.toLowerCase()==="cimode")){var l=[],c=function(f){var h=i.toResolveHierarchy(f);h.forEach(function(m){l.indexOf(m)<0&&l.push(m)})};c(s),this.allOptions.preload&&this.allOptions.preload.forEach(function(u){return c(u)}),l.forEach(function(u){n.allOptions.ns.forEach(function(f){o.read(u,f,"read",null,null,function(h,m){h&&a.warn("loading namespace ".concat(f," for language ").concat(u," failed"),h),!h&&m&&a.log("loaded namespace ".concat(f," for language ").concat(u),m),o.loaded("".concat(u,"|").concat(f),h,m)})})})}}}])}();Ire.type="backend";hr.use(Ire).use(Cre).use(eRe).init({load:"languageOnly",detection:{order:["path","navigator","htmlTag"]},fallbackLng:"en",interpolation:{escapeValue:!1},backend:{loadPath:"/static/react/locales/{{lng}}/{{ns}}.json"}});class Gke{constructor(t,n){this.id=t,this.name=n}get translatedName(){return hr.t(CB(this.name),{defaultValue:this.name})}}class Pre{fromJson(t){return new Gke(t.id,t.name)}toJson(t){return{id:t.id,name:t.name}}}const qke="equipment",Wke=async()=>{const e=ft(qke),{data:t}=await it.get(e,{headers:ht()}),n=new Pre;return t.results.map(r=>n.fromJson(r))};class Kke{constructor(t,n){this.id=t,this.name=n}get translatedName(){return hr.t(CB(this.name),{defaultValue:this.name})}}class Are{fromJson(t){return new Kke(t.id,t.name)}toJson(t){return{id:t.id,name:t.name}}}const Yke="exercisecategory",Qke=async()=>{const e=ft(Yke),{data:t}=await it.get(e,{headers:ht()}),n=new Are;return t.results.map(r=>n.fromJson(r))};var Cu=(e=>(e[e.LINE_ART=1]="LINE_ART",e[e.THREE_D=2]="THREE_D",e[e.LOW_POLY=3]="LOW_POLY",e[e.PHOTO=4]="PHOTO",e[e.OTHER=5]="OTHER",e))(Cu||{});class Xke{constructor(t,n,r,o){this.id=t,this.uuid=n,this.url=r,this.isMain=o}}class qN{fromJson(t){return new Xke(t.id,t.uuid,t.image,t.is_main)}toJson(t){return{id:t.id,image:t.url,is_front:t.isMain}}}class Jke{constructor(t,n,r){this.id=t,this.uuid=n,this.alias=r}}class Mre{fromJson(t){return new Jke(t.id,t.uuid,t.alias)}toJson(t){return{id:t.id,name:t.alias}}}class WN{constructor(t,n,r){this.id=t,this.exercise=n,this.note=r}}class Rre{fromJson(t){return new WN(t.id,t.exercise,t.comment)}toJson(t){return{id:t.id,comment:t.note,exercise:t.exercise}}}class Dre{constructor(t,n,r,o,i,a,s,l){Ce(this,"notes",[]);Ce(this,"aliases",[]);Ce(this,"authors",[]);this.id=t,this.uuid=n,this.name=r,this.description=o,this.language=i,a&&(this.notes=a),s&&(this.aliases=s),l&&(this.authors=l)}get nameLong(){return hke(this.name)}get nameSlug(){return yre(this.name)}}class EB{fromJson(t){var n,r;return new Dre(t.id,t.uuid,t.name,t.description,t.language,(n=t.notes)==null?void 0:n.map(o=>new Rre().fromJson(o)),(r=t.aliases)==null?void 0:r.map(o=>new Mre().fromJson(o)),t.author_history)}toJson(t){return{id:t.id,uuid:t.uuid,name:t.name,description:t.description,language:t.language}}}class Zke{constructor(t,n,r,o){this.id=t,this.uuid=n,this.url=r,this.isMain=o}}class kre{fromJson(t){return new Zke(t.id,t.uuid,t.video,t.is_main)}toJson(t){return{id:t.id,video:t.url}}}class TB{constructor(t,n,r){this.id=t,this.nameShort=n,this.nameLong=r}}class e2e{fromJson(t){return new TB(t.id,t.short_name,t.full_name)}toJson(t){return{}}}const bh=2,_re="en",t2e=new TB(bh,_re,"English"),n2e=21,r2e=1,o2e=1,i2e=2,a2e="variations",s2e="detail",l2e="permission",dv="measurements",fv="measurements-categories";var st=(e=>(e.ROUTINE_OVERVIEW="routine-overview",e.ROUTINE_DETAIL="routine-detail",e.SESSION_SEARCH="session-search",e.SESSIONS_FULL="sessions-full",e.ROUTINE_LOGS="routine-logs",e.ROUTINE_LOG_DATA="routine-log-data",e.ROUTINE_STATS="routine-stats",e.ROUTINES_ACTIVE="routines-active",e.ROUTINES_SHALLOW="routines-shallow",e.PRIVATE_TEMPLATES="private-templates",e.PUBLIC_TEMPLATES="public-templates",e.NUTRITIONAL_PLANS="nutritional-plans",e.NUTRITIONAL_PLAN="nutritional-plan",e.NUTRITIONAL_PLAN_DIARY="nutritional-plan-diary",e.NUTRITIONAL_PLAN_LAST="nutritional-plan-last",e.INGREDIENT="ingredient",e.BODY_WEIGHT="body-weight",e.ROUTINE_WEIGHT_UNITS="weight-units",e.ROUTINE_REP_UNITS="rep-units",e.QUERY_PROFILE="profile",e.EXERCISES="exercises",e.EXERCISE_VARIATIONS="variations",e.EXERCISE_DETAIL="detail",e.LANGUAGES="languages",e.CATEGORIES="categories",e.EQUIPMENT="equipment",e.MUSCLES="muscles",e.QUERY_NOTES="notes",e))(st||{}),St=(e=>(e.MEAL="meal",e.MEAL_ITEM="mealitem",e.NUTRITIONAL_DIARY="nutritiondiary",e.INGREDIENT_PATH="ingredientinfo",e.INGREDIENT_SEARCH_PATH="ingredient/search",e.INGREDIENT_WEIGHT_UNIT="ingredientweightunit",e.ROUTINE="routine",e.WEIGHT_CONFIG="weight-config",e.MAX_WEIGHT_CONFIG="max-weight-config",e.REPETITIONS_CONFIG="repetitions-config",e.MAX_REPS_CONFIG="max-repetitions-config",e.RIR_CONFIG="rir-config",e.MAX_RIR_CONFIG="max-rir-config",e.NR_OF_SETS_CONFIG="sets-config",e.MAX_NR_OF_SETS_CONFIG="max-sets-config",e.REST_CONFIG="rest-config",e.MAX_REST_CONFIG="max-rest-config",e.DAY="day",e.SLOT="slot",e.SLOT_ENTRY="slot-entry",e.SESSION="workoutsession",e.WORKOUT_LOG="workoutlog",e.PRIVATE_TEMPLATE="templates",e.PUBLIC_TEMPLATE="public-templates",e.API_PROFILE_PATH="userprofile",e))(St||{});const KN="999",c2e=["#2a4c7d","#5b5291","#8e5298","#bf5092","#e7537e","#ff6461","#ff813d","#ffa600"],u2e=["#2a4c7d","#825298","#d45089","#ff6a59","#ffa600"],d2e=["#2a4c7d","#d45089","#ffa600"],YN={pageSizeOptions:[5,10,25,50,100],pageSize:10},f2e="Europe/Berlin",uy="en",EI=3e3,$re=500;class p2e{constructor(t,n,r,o,i,a,s,l,c,u,f){Ce(this,"translations",[]);Ce(this,"videos",[]);Ce(this,"authors",[]);this.id=t,this.uuid=n,this.category=r,this.equipment=o,this.muscles=i,this.musclesSecondary=a,this.images=s,this.variationId=l,c&&(this.translations=c),u&&(this.videos=u),f&&(this.authors=f)}get availableLanguages(){return this.translations.map(t=>t.language)}get mainImage(){return this.images.find(t=>t.isMain)}get sideImages(){return this.images.filter(t=>!t.isMain)}getTranslation(t){const n=t!=null?t.id:bh;let r=this.translations.find(o=>o.language===n);return r||(r=this.translations.find(o=>o.language===bh)),r||this.translations[0]}}class Nre{fromJson(t){const n=new Are,r=new Pre,o=new xre,i=new qN,a=new EB,s=new kre,l=new p2e(t.id,t.uuid,n.fromJson(t.category),t.equipment.map(c=>r.fromJson(c)),t.muscles.map(c=>o.fromJson(c)),t.muscles_secondary.map(c=>o.fromJson(c)),t.images.map(c=>i.fromJson(c)),t.variations,t.translations.map(c=>a.fromJson(c)),t.videos.map(c=>s.fromJson(c)),t.author_history);if(l.translations.some(c=>c.language===bh)||console.info(`No english translation found for exercise base ${l.uuid}!`),l.translations.length===0)throw new Error(`No translations found for exercise base ${l.uuid}!`);return l}toJson(t){return{id:t.id,uuid:t.uuid,category:t.category.id,equipment:t.equipment.map(n=>n.id),muscles:t.muscles.map(n=>n.id),muscles_secondary:t.musclesSecondary.map(n=>n.id),images:t.images.map(n=>new qN().toJson(n))}}}const OB="exerciseinfo",IB="exercise";function Lre(e){const t=new Nre,n=[];for(const r of e.results)try{n.push(t.fromJson(r))}catch(o){console.error("An error happened, skipping base:",o)}return n}const h2e=async()=>{const e=ft(OB,{query:{limit:900}}),t=await it.get(e,{headers:ht()});return Lre(t.data)},pv=async e=>{const t=new Nre,n=ft(OB,{id:e}),r=await it.get(n,{headers:ht()});return t.fromJson(r.data)},m2e=async e=>{if(!e)return[];const t=ft(OB,{query:{variations:e}}),n=await it.get(t,{headers:ht()});return Lre(n.data)},g2e=async(e,t,n,r,o,i)=>{const a=ft(IB),s={category:e,equipment:t,muscles:n,muscles_secondary:r,variation_id:o,license_author:i};return(await it.post(a,s,{headers:ht()})).data.id},PB=async(e,t)=>{const n=ft(IB,{id:e});return(await it.patch(n,t,{headers:ht()})).status},pq=async(e,t)=>{const r=ft(IB,t===void 0?{id:e}:{id:e,query:{replaced_by:t}});return(await it.delete(r,{headers:ht()})).status},AB="exercise-translation",y2e="exercise/search",v2e=async(e,t=_re,n=!0)=>{const r=[t];t!==uy&&n&&r.push(uy);const o=ft(y2e,{query:{term:e,language:r.join(",")}}),{data:i}=await it.get(o);return i.suggestions},QN=async e=>{const{exerciseId:t,languageId:n,name:r,description:o,author:i}=e,a=ft(AB),s={exercise:t,language:n,name:r,description:o,license_author:i},l=await it.post(a,s,{headers:ht()});return new EB().fromJson(l.data)},b2e=async e=>{const{id:t,exerciseId:n,languageId:r,name:o,description:i}=e,a=ft(AB,{id:t}),s={exercise:n,language:r,name:o,description:i},l=await it.patch(a,s,{headers:ht()});return new EB().fromJson(l.data)},x2e=async e=>{const t=ft(AB,{id:e});return(await it.delete(t,{headers:ht()})).status},S2e="language",w2e=async()=>{const e=ft(S2e),{data:t}=await it.get(e,{headers:ht()}),n=new e2e;return t.results.map(r=>n.fromJson(r))},Gu=(e,t)=>{const n=e.split("-")[0],r=t.find(o=>o.nameShort===n);if(r)return r},Fre="exerciseimage",jre=async e=>{const t=ft(Fre),n=ht();n["Content-Type"]="multipart/form-data";const r=await it.post(t,{exercise:e.exerciseId,image:e.image,license_title:e.imageData.title,license_object_url:e.imageData.objectUrl,license_author:e.imageData.author,license_author_url:e.imageData.authorUrl,license_derivative_source_url:e.imageData.derivativeSourceUrl,style:e.imageData.style},{headers:n});return new qN().fromJson(r.data)},C2e=async e=>{const t=ft(Fre,{id:e}),n=ht();return(await it.delete(t,{headers:n})).status},Bre="exercisealias",XN=async(e,t)=>{const n=ft(Bre),r=await it.post(n,{translation:e,alias:t},{headers:ht()});return new Mre().fromJson(r.data)},E2e=async e=>(await it.delete(ft(Bre,{id:e}),{headers:ht()})).status,zre="video",T2e=async(e,t,n)=>{const r=ft(zre),o=ht();o["Content-Type"]="multipart/form-data";const i=await it.post(r,{exercise:e,license_author:t,video:n},{headers:o});return new kre().fromJson(i.data)},O2e=async e=>{const t=ft(zre,{id:e}),n=ht();return(await it.delete(t,{headers:n})).status},Qi="r",I2e="+",P2e="-",JN=["weight","reps","rir","rest"],A2e=[{value:"abs",label:"Absolute"},{value:"percent",label:"Percent"}],M2e=[{value:I2e,label:"Add"},{value:P2e,label:"Subtract"},{value:Qi,label:"Replace"}],Vre=[{value:"",label:"-/-"},...[0,.5,1,1.5,2,2.5,3,3.5,4].map(e=>({value:e,label:e.toString()})),{value:4.5,label:"4+"}],Hre=[...Vre];class R2e{constructor(t){Ce(this,"id");Ce(this,"slotEntryId");Ce(this,"iteration");Ce(this,"value");Ce(this,"operation");Ce(this,"step");Ce(this,"repeat");Ce(this,"requirements");this.id=t.id,this.slotEntryId=t.slotEntryId,this.iteration=t.iteration,this.value=t.value,this.operation=t.operation??"r",this.step=t.step??"abs",this.repeat=t.repeat??!1,this.requirements=t.requirements??null}get replace(){return this.operation==="r"}}class MB{constructor(){Ce(this,"fromJson",t=>new R2e({id:t.id,slotEntryId:t.slot_entry,iteration:t.iteration,value:parseFloat(t.value),operation:t.operation,step:t.step,repeat:t.repeat,requirements:t.requirements}));Ce(this,"toJson",t=>({slot_entry:t.slotEntryId,iteration:t.iteration,value:t.value,operation:t.operation,step:t.step,repeat:t.repeat,requirements:t.requirements}))}}class D2e{constructor(t){Ce(this,"id");Ce(this,"slotId");Ce(this,"exerciseId");Ce(this,"repetitionUnitId");Ce(this,"repetitionRounding");Ce(this,"weightUnitId");Ce(this,"weightRounding");Ce(this,"order");Ce(this,"comment");Ce(this,"type");Ce(this,"config");Ce(this,"weightConfigs",[]);Ce(this,"maxWeightConfigs",[]);Ce(this,"repetitionsConfigs",[]);Ce(this,"maxRepetitionsConfigs",[]);Ce(this,"restTimeConfigs",[]);Ce(this,"maxRestTimeConfigs",[]);Ce(this,"nrOfSetsConfigs",[]);Ce(this,"maxNrOfSetsConfigs",[]);Ce(this,"rirConfigs",[]);Ce(this,"maxRirConfigs",[]);Ce(this,"exercise");Ce(this,"repetitionUnit",null);Ce(this,"weightUnit",null);this.id=t.id,this.slotId=t.slotId,this.exerciseId=t.exerciseId,this.exercise=t.exercise,this.repetitionUnitId=t.repetitionUnitId,this.repetitionRounding=t.repetitionRounding,this.weightUnitId=t.weightUnitId,this.weightRounding=t.weightRounding,this.order=t.order,this.comment=t.comment,this.type=t.type,this.config=t.config,t.configs!==void 0&&(this.weightConfigs=t.configs.weightConfigs??[],this.maxWeightConfigs=t.configs.maxWeightConfigs??[],this.repetitionsConfigs=t.configs.repetitionsConfigs??[],this.maxRepetitionsConfigs=t.configs.maxRepetitionsConfigs??[],this.restTimeConfigs=t.configs.restTimeConfigs??[],this.maxRestTimeConfigs=t.configs.maxRestTimeConfigs??[],this.nrOfSetsConfigs=t.configs.nrOfSetsConfigs??[],this.maxNrOfSetsConfigs=t.configs.maxNrOfSetsConfigs??[],this.rirConfigs=t.configs.rirConfigs??[],this.maxRirConfigs=t.configs.maxRirConfigs??[])}get hasProgressionRules(){return this.weightConfigs.length>1||this.maxWeightConfigs.length>1||this.repetitionsConfigs.length>1||this.maxRepetitionsConfigs.length>1||this.restTimeConfigs.length>1||this.maxRestTimeConfigs.length>1||this.nrOfSetsConfigs.length>1||this.maxNrOfSetsConfigs.length>1||this.rirConfigs.length>1||this.maxRirConfigs.length>1}}class k2e{constructor(){Ce(this,"fromJson",t=>{const n=new MB,r={weightConfigs:[],maxWeightConfigs:[],repetitionsConfigs:[],maxRepetitionsConfigs:[],restTimeConfigs:[],maxRestTimeConfigs:[],nrOfSetsConfigs:[],maxNrOfSetsConfigs:[],rirConfigs:[],maxRirConfigs:[]};return Object.hasOwn(t,"weight_configs")&&(r.weightConfigs=t.weight_configs.map(o=>n.fromJson(o))),Object.hasOwn(t,"max_weight_configs")&&(r.maxWeightConfigs=t.max_weight_configs.map(o=>n.fromJson(o))),Object.hasOwn(t,"repetitions_configs")&&(r.repetitionsConfigs=t.repetitions_configs.map(o=>n.fromJson(o))),Object.hasOwn(t,"max_repetitions_configs")&&(r.maxRepetitionsConfigs=t.max_repetitions_configs.map(o=>n.fromJson(o))),Object.hasOwn(t,"set_nr_configs")&&(r.nrOfSetsConfigs=t.set_nr_configs.map(o=>n.fromJson(o))),Object.hasOwn(t,"max_set_nr_configs")&&(r.maxNrOfSetsConfigs=t.max_set_nr_configs.map(o=>n.fromJson(o))),Object.hasOwn(t,"rest_configs")&&(r.restTimeConfigs=t.rest_configs.map(o=>n.fromJson(o))),Object.hasOwn(t,"max_rest_configs")&&(r.maxRestTimeConfigs=t.max_rest_configs.map(o=>n.fromJson(o))),Object.hasOwn(t,"rir_configs")&&(r.rirConfigs=t.rir_configs.map(o=>n.fromJson(o))),Object.hasOwn(t,"max_rir_configs")&&(r.maxRirConfigs=t.max_rir_configs.map(o=>n.fromJson(o))),new D2e({id:t.id,slotId:t.slot,exerciseId:t.exercise,repetitionUnitId:t.repetition_unit,repetitionRounding:t.repetition_rounding,weightUnitId:t.weight_unit,weightRounding:t.weight_rounding,order:t.order,comment:t.comment,type:t.type,config:t.config,configs:r})});Ce(this,"toJson",t=>({slot:t.slotId,exercise:t.exerciseId,repetition_unit:t.repetitionUnitId,repetition_rounding:t.repetitionRounding,weight_unit:t.weightUnitId,weight_rounding:t.weightRounding,order:t.order,comment:t.comment,type:t.type,config:t.config}))}}const RB=new k2e;class _2e{constructor({id:t,dayId:n,order:r,comment:o,config:i,entries:a=[]}){Ce(this,"id");Ce(this,"dayId");Ce(this,"order");Ce(this,"comment");Ce(this,"config");Ce(this,"entries",[]);this.id=t,this.dayId=n,this.order=r,this.comment=o,this.config=i,this.entries=a}}class DB{constructor(){Ce(this,"fromJson",t=>new _2e({id:t.id,dayId:t.day,order:t.order,comment:t.comment,config:t.config,entries:Object.hasOwn(t,"entries")?t.entries.map(n=>RB.fromJson(n)):[]}))}toJson(t){return{id:t.id,day:t.dayId,order:t.order,comment:t.order,config:t.config}}}class Ure{constructor({id:t,order:n,name:r,description:o,isRest:i,needLogsToAdvance:a,type:s,config:l,slots:c=[]}){Ce(this,"id");Ce(this,"order");Ce(this,"name");Ce(this,"description");Ce(this,"isRest");Ce(this,"needLogsToAdvance");Ce(this,"type");Ce(this,"config");Ce(this,"slots",[]);this.id=t,this.order=n,this.name=r,this.description=o,this.isRest=i,this.needLogsToAdvance=a,this.type=s,this.config=l,this.slots=c}get isSpecialType(){return this.type!=="custom"}getDisplayName(){return this.isRest?hr.t("routines.restDay"):this.name}}const Gre=e=>e===null||e.isRest?hr.t("routines.restDay"):e.getDisplayName();class TI{constructor(){Ce(this,"fromJson",t=>new Ure({id:t.id,order:t.order,name:t.name,description:t.description,isRest:t.is_rest,needLogsToAdvance:t.need_logs_to_advance,type:t.type,config:t.config,slots:Object.hasOwn(t,"slots")?t.slots.map(n=>new DB().fromJson(n)):[]}));Ce(this,"toJson",t=>({order:t.order,description:t.description,is_rest:t.isRest,need_logs_to_advance:t.needLogsToAdvance,type:t.type,config:t.config}))}}class qre{constructor(t){Ce(this,"exercises",{});Ce(this,"muscle",{});Ce(this,"upper_body",0);Ce(this,"lower_body",0);Ce(this,"total",0);Object.assign(this,t)}}class SE{constructor(t){Ce(this,"mesocycle",new qre);Ce(this,"iteration",{});Ce(this,"weekly",{});Ce(this,"daily",{});Object.assign(this,t)}}class $2e{constructor(t){Ce(this,"volume",new SE);Ce(this,"intensity",new SE);Ce(this,"sets",new SE);Object.assign(this,t)}}class N2e{fromJson(t){const n=o=>{const i={};for(const s in o.exercises)i[parseInt(s)]=parseFloat(o.exercises[s]);const a={};for(const s in o.muscle)a[parseInt(s)]=parseFloat(o.muscle[s]);return new qre({exercises:i,muscle:a,upper_body:parseFloat(o.upper_body),lower_body:parseFloat(o.lower_body),total:parseFloat(o.total)})},r=o=>{const i={};for(const l in o.iteration)i[l]=n(o.iteration[l]);const a={};for(const l in o.weekly)a[l]=n(o.weekly[l]);const s={};for(const l in o.daily)s[l]=n(o.daily[l]);return new SE({mesocycle:n(o.mesocycle),iteration:i,weekly:a,daily:s})};return new $2e({volume:r(t.volume),intensity:r(t.intensity),sets:r(t.sets)})}}class zh extends Error{}class L2e extends zh{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class F2e extends zh{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class j2e extends zh{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class mg extends zh{}class Wre extends zh{constructor(t){super(`Invalid unit ${t}`)}}class ki extends zh{}class Nd extends zh{constructor(){super("Zone is an abstract class")}}const Rt="numeric",Yl="short",Xa="long",sT={year:Rt,month:Rt,day:Rt},Kre={year:Rt,month:Yl,day:Rt},B2e={year:Rt,month:Yl,day:Rt,weekday:Yl},Yre={year:Rt,month:Xa,day:Rt},Qre={year:Rt,month:Xa,day:Rt,weekday:Xa},Xre={hour:Rt,minute:Rt},Jre={hour:Rt,minute:Rt,second:Rt},Zre={hour:Rt,minute:Rt,second:Rt,timeZoneName:Yl},eoe={hour:Rt,minute:Rt,second:Rt,timeZoneName:Xa},toe={hour:Rt,minute:Rt,hourCycle:"h23"},noe={hour:Rt,minute:Rt,second:Rt,hourCycle:"h23"},roe={hour:Rt,minute:Rt,second:Rt,hourCycle:"h23",timeZoneName:Yl},ooe={hour:Rt,minute:Rt,second:Rt,hourCycle:"h23",timeZoneName:Xa},ioe={year:Rt,month:Rt,day:Rt,hour:Rt,minute:Rt},aoe={year:Rt,month:Rt,day:Rt,hour:Rt,minute:Rt,second:Rt},soe={year:Rt,month:Yl,day:Rt,hour:Rt,minute:Rt},loe={year:Rt,month:Yl,day:Rt,hour:Rt,minute:Rt,second:Rt},z2e={year:Rt,month:Yl,day:Rt,weekday:Yl,hour:Rt,minute:Rt},coe={year:Rt,month:Xa,day:Rt,hour:Rt,minute:Rt,timeZoneName:Yl},uoe={year:Rt,month:Xa,day:Rt,hour:Rt,minute:Rt,second:Rt,timeZoneName:Yl},doe={year:Rt,month:Xa,day:Rt,weekday:Xa,hour:Rt,minute:Rt,timeZoneName:Xa},foe={year:Rt,month:Xa,day:Rt,weekday:Xa,hour:Rt,minute:Rt,second:Rt,timeZoneName:Xa};class fw{get type(){throw new Nd}get name(){throw new Nd}get ianaName(){return this.name}get isUniversal(){throw new Nd}offsetName(t,n){throw new Nd}formatOffset(t,n){throw new Nd}offset(t){throw new Nd}equals(t){throw new Nd}get isValid(){throw new Nd}}let HR=null;class OI extends fw{static get instance(){return HR===null&&(HR=new OI),HR}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return Coe(t,n,r)}formatOffset(t,n){return ex(this.offset(t),n)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}const ZN=new Map;function V2e(e){let t=ZN.get(e);return t===void 0&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),ZN.set(e,t)),t}const H2e={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function U2e(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,o,i,a,s,l,c,u]=r;return[a,o,i,s,l,c,u]}function G2e(e,t){const n=e.formatToParts(t),r=[];for(let o=0;o<n.length;o++){const{type:i,value:a}=n[o],s=H2e[i];i==="era"?r[s]=a:mn(s)||(r[s]=parseInt(a,10))}return r}const UR=new Map;class qu extends fw{static create(t){let n=UR.get(t);return n===void 0&&UR.set(t,n=new qu(t)),n}static resetCache(){UR.clear(),ZN.clear()}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=qu.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return Coe(t,n,r,this.name)}formatOffset(t,n){return ex(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const r=V2e(this.name);let[o,i,a,s,l,c,u]=r.formatToParts?G2e(r,n):U2e(r,n);s==="BC"&&(o=-Math.abs(o)+1);const h=PI({year:o,month:i,day:a,hour:l===24?0:l,minute:c,second:u,millisecond:0});let m=+n;const g=m%1e3;return m-=g>=0?g:1e3+g,(h-m)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let hq={};function q2e(e,t={}){const n=JSON.stringify([e,t]);let r=hq[n];return r||(r=new Intl.ListFormat(e,t),hq[n]=r),r}const eL=new Map;function tL(e,t={}){const n=JSON.stringify([e,t]);let r=eL.get(n);return r===void 0&&(r=new Intl.DateTimeFormat(e,t),eL.set(n,r)),r}const nL=new Map;function W2e(e,t={}){const n=JSON.stringify([e,t]);let r=nL.get(n);return r===void 0&&(r=new Intl.NumberFormat(e,t),nL.set(n,r)),r}const rL=new Map;function K2e(e,t={}){const{base:n,...r}=t,o=JSON.stringify([e,r]);let i=rL.get(o);return i===void 0&&(i=new Intl.RelativeTimeFormat(e,t),rL.set(o,i)),i}let _0=null;function Y2e(){return _0||(_0=new Intl.DateTimeFormat().resolvedOptions().locale,_0)}const oL=new Map;function poe(e){let t=oL.get(e);return t===void 0&&(t=new Intl.DateTimeFormat(e).resolvedOptions(),oL.set(e,t)),t}const iL=new Map;function Q2e(e){let t=iL.get(e);if(!t){const n=new Intl.Locale(e);t="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,"minimalDays"in t||(t={...hoe,...t}),iL.set(e,t)}return t}function X2e(e){const t=e.indexOf("-x-");t!==-1&&(e=e.substring(0,t));const n=e.indexOf("-u-");if(n===-1)return[e];{let r,o;try{r=tL(e).resolvedOptions(),o=e}catch{const l=e.substring(0,n);r=tL(l).resolvedOptions(),o=l}const{numberingSystem:i,calendar:a}=r;return[o,i,a]}}function J2e(e,t,n){return(n||t)&&(e.includes("-u-")||(e+="-u"),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`)),e}function Z2e(e){const t=[];for(let n=1;n<=12;n++){const r=xt.utc(2009,n,1);t.push(e(r))}return t}function e_e(e){const t=[];for(let n=1;n<=7;n++){const r=xt.utc(2016,11,13+n);t.push(e(r))}return t}function P1(e,t,n,r){const o=e.listingMode();return o==="error"?null:o==="en"?n(t):r(t)}function t_e(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||poe(e.locale).numberingSystem==="latn"}class n_e{constructor(t,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:o,floor:i,...a}=r;if(!n||Object.keys(a).length>0){const s={useGrouping:!1,...r};r.padTo>0&&(s.minimumIntegerDigits=r.padTo),this.inf=W2e(t,s)}}format(t){if(this.inf){const n=this.floor?Math.floor(t):t;return this.inf.format(n)}else{const n=this.floor?Math.floor(t):LB(t,3);return Ao(n,this.padTo)}}}class r_e{constructor(t,n,r){this.opts=r,this.originalZone=void 0;let o;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){const a=-1*(t.offset/60),s=a>=0?`Etc/GMT+${a}`:`Etc/GMT${a}`;t.offset!==0&&qu.create(s).valid?(o=s,this.dt=t):(o="UTC",this.dt=t.offset===0?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else t.zone.type==="system"?this.dt=t:t.zone.type==="iana"?(this.dt=t,o=t.zone.name):(o="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);const i={...this.opts};i.timeZone=i.timeZone||o,this.dtf=tL(n,i)}format(){return this.originalZone?this.formatToParts().map(({value:t})=>t).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map(n=>{if(n.type==="timeZoneName"){const r=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...n,value:r}}else return n}):t}resolvedOptions(){return this.dtf.resolvedOptions()}}class o_e{constructor(t,n,r){this.opts={style:"long",...r},!n&&Soe()&&(this.rtf=K2e(t,r))}format(t,n){return this.rtf?this.rtf.format(t,n):O_e(n,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,n){return this.rtf?this.rtf.formatToParts(t,n):[]}}const hoe={firstDay:1,minimalDays:4,weekend:[6,7]};class ur{static fromOpts(t){return ur.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,n,r,o,i=!1){const a=t||to.defaultLocale,s=a||(i?"en-US":Y2e()),l=n||to.defaultNumberingSystem,c=r||to.defaultOutputCalendar,u=sL(o)||to.defaultWeekSettings;return new ur(s,l,c,u,a)}static resetCache(){_0=null,eL.clear(),nL.clear(),rL.clear(),oL.clear(),iL.clear()}static fromObject({locale:t,numberingSystem:n,outputCalendar:r,weekSettings:o}={}){return ur.create(t,n,r,o)}constructor(t,n,r,o,i){const[a,s,l]=X2e(t);this.locale=a,this.numberingSystem=n||s||null,this.outputCalendar=r||l||null,this.weekSettings=o,this.intl=J2e(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=t_e(this)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&n?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:ur.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,sL(t.weekSettings)||this.weekSettings,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,n=!1){return P1(this,t,Ooe,()=>{const r=n?{month:t,day:"numeric"}:{month:t},o=n?"format":"standalone";return this.monthsCache[o][t]||(this.monthsCache[o][t]=Z2e(i=>this.extract(i,r,"month"))),this.monthsCache[o][t]})}weekdays(t,n=!1){return P1(this,t,Aoe,()=>{const r=n?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},o=n?"format":"standalone";return this.weekdaysCache[o][t]||(this.weekdaysCache[o][t]=e_e(i=>this.extract(i,r,"weekday"))),this.weekdaysCache[o][t]})}meridiems(){return P1(this,void 0,()=>Moe,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[xt.utc(2016,11,13,9),xt.utc(2016,11,13,19)].map(n=>this.extract(n,t,"dayperiod"))}return this.meridiemCache})}eras(t){return P1(this,t,Roe,()=>{const n={era:t};return this.eraCache[t]||(this.eraCache[t]=[xt.utc(-40,1,1),xt.utc(2017,1,1)].map(r=>this.extract(r,n,"era"))),this.eraCache[t]})}extract(t,n,r){const o=this.dtFormatter(t,n),i=o.formatToParts(),a=i.find(s=>s.type.toLowerCase()===r);return a?a.value:null}numberFormatter(t={}){return new n_e(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,n={}){return new r_e(t,this.intl,n)}relFormatter(t={}){return new o_e(this.intl,this.isEnglish(),t)}listFormatter(t={}){return q2e(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||poe(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:woe()?Q2e(this.locale):hoe}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let GR=null;class ea extends fw{static get utcInstance(){return GR===null&&(GR=new ea(0)),GR}static instance(t){return t===0?ea.utcInstance:new ea(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new ea(AI(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${ex(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${ex(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return ex(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}class i_e extends fw{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Yd(e,t){if(mn(e)||e===null)return t;if(e instanceof fw)return e;if(d_e(e)){const n=e.toLowerCase();return n==="default"?t:n==="local"||n==="system"?OI.instance:n==="utc"||n==="gmt"?ea.utcInstance:ea.parseSpecifier(n)||qu.create(e)}else return gf(e)?ea.instance(e):typeof e=="object"&&"offset"in e&&typeof e.offset=="function"?e:new i_e(e)}const kB={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},mq={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},a_e=kB.hanidec.replace(/[\[|\]]/g,"").split("");function s_e(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(e[n].search(kB.hanidec)!==-1)t+=a_e.indexOf(e[n]);else for(const o in mq){const[i,a]=mq[o];r>=i&&r<=a&&(t+=r-i)}}return parseInt(t,10)}else return t}const aL=new Map;function l_e(){aL.clear()}function ml({numberingSystem:e},t=""){const n=e||"latn";let r=aL.get(n);r===void 0&&(r=new Map,aL.set(n,r));let o=r.get(t);return o===void 0&&(o=new RegExp(`${kB[n]}${t}`),r.set(t,o)),o}let gq=()=>Date.now(),yq="system",vq=null,bq=null,xq=null,Sq=60,wq,Cq=null;class to{static get now(){return gq}static set now(t){gq=t}static set defaultZone(t){yq=t}static get defaultZone(){return Yd(yq,OI.instance)}static get defaultLocale(){return vq}static set defaultLocale(t){vq=t}static get defaultNumberingSystem(){return bq}static set defaultNumberingSystem(t){bq=t}static get defaultOutputCalendar(){return xq}static set defaultOutputCalendar(t){xq=t}static get defaultWeekSettings(){return Cq}static set defaultWeekSettings(t){Cq=sL(t)}static get twoDigitCutoffYear(){return Sq}static set twoDigitCutoffYear(t){Sq=t%100}static get throwOnInvalid(){return wq}static set throwOnInvalid(t){wq=t}static resetCaches(){ur.resetCache(),qu.resetCache(),xt.resetCache(),l_e()}}class kl{constructor(t,n){this.reason=t,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const moe=[0,31,59,90,120,151,181,212,243,273,304,334],goe=[0,31,60,91,121,152,182,213,244,274,305,335];function zs(e,t){return new kl("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function _B(e,t,n){const r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const o=r.getUTCDay();return o===0?7:o}function yoe(e,t,n){return n+(pw(e)?goe:moe)[t-1]}function voe(e,t){const n=pw(e)?goe:moe,r=n.findIndex(i=>i<t),o=t-n[r];return{month:r+1,day:o}}function $B(e,t){return(e-t+7)%7+1}function lT(e,t=4,n=1){const{year:r,month:o,day:i}=e,a=yoe(r,o,i),s=$B(_B(r,o,i),n);let l=Math.floor((a-s+14-t)/7),c;return l<1?(c=r-1,l=Nx(c,t,n)):l>Nx(r,t,n)?(c=r+1,l=1):c=r,{weekYear:c,weekNumber:l,weekday:s,...MI(e)}}function Eq(e,t=4,n=1){const{weekYear:r,weekNumber:o,weekday:i}=e,a=$B(_B(r,1,t),n),s=$g(r);let l=o*7+i-a-7+t,c;l<1?(c=r-1,l+=$g(c)):l>s?(c=r+1,l-=$g(r)):c=r;const{month:u,day:f}=voe(c,l);return{year:c,month:u,day:f,...MI(e)}}function qR(e){const{year:t,month:n,day:r}=e,o=yoe(t,n,r);return{year:t,ordinal:o,...MI(e)}}function Tq(e){const{year:t,ordinal:n}=e,{month:r,day:o}=voe(t,n);return{year:t,month:r,day:o,...MI(e)}}function Oq(e,t){if(!mn(e.localWeekday)||!mn(e.localWeekNumber)||!mn(e.localWeekYear)){if(!mn(e.weekday)||!mn(e.weekNumber)||!mn(e.weekYear))throw new mg("Cannot mix locale-based week fields with ISO-based week fields");return mn(e.localWeekday)||(e.weekday=e.localWeekday),mn(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),mn(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function c_e(e,t=4,n=1){const r=II(e.weekYear),o=Vs(e.weekNumber,1,Nx(e.weekYear,t,n)),i=Vs(e.weekday,1,7);return r?o?i?!1:zs("weekday",e.weekday):zs("week",e.weekNumber):zs("weekYear",e.weekYear)}function u_e(e){const t=II(e.year),n=Vs(e.ordinal,1,$g(e.year));return t?n?!1:zs("ordinal",e.ordinal):zs("year",e.year)}function boe(e){const t=II(e.year),n=Vs(e.month,1,12),r=Vs(e.day,1,cT(e.year,e.month));return t?n?r?!1:zs("day",e.day):zs("month",e.month):zs("year",e.year)}function xoe(e){const{hour:t,minute:n,second:r,millisecond:o}=e,i=Vs(t,0,23)||t===24&&n===0&&r===0&&o===0,a=Vs(n,0,59),s=Vs(r,0,59),l=Vs(o,0,999);return i?a?s?l?!1:zs("millisecond",o):zs("second",r):zs("minute",n):zs("hour",t)}function mn(e){return typeof e>"u"}function gf(e){return typeof e=="number"}function II(e){return typeof e=="number"&&e%1===0}function d_e(e){return typeof e=="string"}function f_e(e){return Object.prototype.toString.call(e)==="[object Date]"}function Soe(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function woe(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function p_e(e){return Array.isArray(e)?e:[e]}function Iq(e,t,n){if(e.length!==0)return e.reduce((r,o)=>{const i=[t(o),o];return r&&n(r[0],i[0])===r[0]?r:i},null)[1]}function h_e(e,t){return t.reduce((n,r)=>(n[r]=e[r],n),{})}function dy(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function sL(e){if(e==null)return null;if(typeof e!="object")throw new ki("Week settings must be an object");if(!Vs(e.firstDay,1,7)||!Vs(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(t=>!Vs(t,1,7)))throw new ki("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function Vs(e,t,n){return II(e)&&e>=t&&e<=n}function m_e(e,t){return e-t*Math.floor(e/t)}function Ao(e,t=2){const n=e<0;let r;return n?r="-"+(""+-e).padStart(t,"0"):r=(""+e).padStart(t,"0"),r}function Hd(e){if(!(mn(e)||e===null||e===""))return parseInt(e,10)}function mp(e){if(!(mn(e)||e===null||e===""))return parseFloat(e)}function NB(e){if(!(mn(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function LB(e,t,n=!1){const r=10**t;return(n?Math.trunc:Math.round)(e*r)/r}function pw(e){return e%4===0&&(e%100!==0||e%400===0)}function $g(e){return pw(e)?366:365}function cT(e,t){const n=m_e(t-1,12)+1,r=e+(t-n)/12;return n===2?pw(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function PI(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function Pq(e,t,n){return-$B(_B(e,1,t),n)+t-1}function Nx(e,t=4,n=1){const r=Pq(e,t,n),o=Pq(e+1,t,n);return($g(e)-r+o)/7}function lL(e){return e>99?e:e>to.twoDigitCutoffYear?1900+e:2e3+e}function Coe(e,t,n,r=null){const o=new Date(e),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(i.timeZone=r);const a={timeZoneName:t,...i},s=new Intl.DateTimeFormat(n,a).formatToParts(o).find(l=>l.type.toLowerCase()==="timezonename");return s?s.value:null}function AI(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0,o=n<0||Object.is(n,-0)?-r:r;return n*60+o}function Eoe(e){const t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new ki(`Invalid unit value ${e}`);return t}function uT(e,t){const n={};for(const r in e)if(dy(e,r)){const o=e[r];if(o==null)continue;n[t(r)]=Eoe(o)}return n}function ex(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),o=e>=0?"+":"-";switch(t){case"short":return`${o}${Ao(n,2)}:${Ao(r,2)}`;case"narrow":return`${o}${n}${r>0?`:${r}`:""}`;case"techie":return`${o}${Ao(n,2)}${Ao(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function MI(e){return h_e(e,["hour","minute","second","millisecond"])}const g_e=["January","February","March","April","May","June","July","August","September","October","November","December"],Toe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],y_e=["J","F","M","A","M","J","J","A","S","O","N","D"];function Ooe(e){switch(e){case"narrow":return[...y_e];case"short":return[...Toe];case"long":return[...g_e];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const Ioe=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Poe=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],v_e=["M","T","W","T","F","S","S"];function Aoe(e){switch(e){case"narrow":return[...v_e];case"short":return[...Poe];case"long":return[...Ioe];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Moe=["AM","PM"],b_e=["Before Christ","Anno Domini"],x_e=["BC","AD"],S_e=["B","A"];function Roe(e){switch(e){case"narrow":return[...S_e];case"short":return[...x_e];case"long":return[...b_e];default:return null}}function w_e(e){return Moe[e.hour<12?0:1]}function C_e(e,t){return Aoe(t)[e.weekday-1]}function E_e(e,t){return Ooe(t)[e.month-1]}function T_e(e,t){return Roe(t)[e.year<0?0:1]}function O_e(e,t,n="always",r=!1){const o={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},i=["hours","minutes","seconds"].indexOf(e)===-1;if(n==="auto"&&i){const f=e==="days";switch(t){case 1:return f?"tomorrow":`next ${o[e][0]}`;case-1:return f?"yesterday":`last ${o[e][0]}`;case 0:return f?"today":`this ${o[e][0]}`}}const a=Object.is(t,-0)||t<0,s=Math.abs(t),l=s===1,c=o[e],u=r?l?c[1]:c[2]||c[1]:l?o[e][0]:e;return a?`${s} ${u} ago`:`in ${s} ${u}`}function Aq(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const I_e={D:sT,DD:Kre,DDD:Yre,DDDD:Qre,t:Xre,tt:Jre,ttt:Zre,tttt:eoe,T:toe,TT:noe,TTT:roe,TTTT:ooe,f:ioe,ff:soe,fff:coe,ffff:doe,F:aoe,FF:loe,FFF:uoe,FFFF:foe};class Li{static create(t,n={}){return new Li(t,n)}static parseFormat(t){let n=null,r="",o=!1;const i=[];for(let a=0;a<t.length;a++){const s=t.charAt(a);s==="'"?(r.length>0&&i.push({literal:o||/^\s+$/.test(r),val:r}),n=null,r="",o=!o):o||s===n?r+=s:(r.length>0&&i.push({literal:/^\s+$/.test(r),val:r}),r=s,n=s)}return r.length>0&&i.push({literal:o||/^\s+$/.test(r),val:r}),i}static macroTokenToFormatOpts(t){return I_e[t]}constructor(t,n){this.opts=n,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...n}).format()}dtFormatter(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n})}formatDateTime(t,n){return this.dtFormatter(t,n).format()}formatDateTimeParts(t,n){return this.dtFormatter(t,n).formatToParts()}formatInterval(t,n){return this.dtFormatter(t.start,n).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,n){return this.dtFormatter(t,n).resolvedOptions()}num(t,n=0){if(this.opts.forceSimple)return Ao(t,n);const r={...this.opts};return n>0&&(r.padTo=n),this.loc.numberFormatter(r).format(t)}formatDateTimeFromString(t,n){const r=this.loc.listingMode()==="en",o=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",i=(m,g)=>this.loc.extract(t,m,g),a=m=>t.isOffsetFixed&&t.offset===0&&m.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,m.format):"",s=()=>r?w_e(t):i({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(m,g)=>r?E_e(t,m):i(g?{month:m}:{month:m,day:"numeric"},"month"),c=(m,g)=>r?C_e(t,m):i(g?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),u=m=>{const g=Li.macroTokenToFormatOpts(m);return g?this.formatWithSystemDefault(t,g):m},f=m=>r?T_e(t,m):i({era:m},"era"),h=m=>{switch(m){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return a({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return a({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return a({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return s();case"d":return o?i({day:"numeric"},"day"):this.num(t.day);case"dd":return o?i({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return c("short",!0);case"cccc":return c("long",!0);case"ccccc":return c("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return c("short",!1);case"EEEE":return c("long",!1);case"EEEEE":return c("narrow",!1);case"L":return o?i({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return o?i({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return l("short",!0);case"LLLL":return l("long",!0);case"LLLLL":return l("narrow",!0);case"M":return o?i({month:"numeric"},"month"):this.num(t.month);case"MM":return o?i({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return l("short",!1);case"MMMM":return l("long",!1);case"MMMMM":return l("narrow",!1);case"y":return o?i({year:"numeric"},"year"):this.num(t.year);case"yy":return o?i({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return o?i({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return o?i({year:"numeric"},"year"):this.num(t.year,6);case"G":return f("short");case"GG":return f("long");case"GGGGG":return f("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"n":return this.num(t.localWeekNumber);case"nn":return this.num(t.localWeekNumber,2);case"ii":return this.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(t.localWeekYear,4);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return u(m)}};return Aq(Li.parseFormat(n),h)}formatDurationFromString(t,n){const r=l=>{switch(l[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},o=l=>c=>{const u=r(c);return u?this.num(l.get(u),c.length):c},i=Li.parseFormat(n),a=i.reduce((l,{literal:c,val:u})=>c?l:l.concat(u),[]),s=t.shiftTo(...a.map(r).filter(l=>l));return Aq(i,o(s))}}const Doe=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function hv(...e){const t=e.reduce((n,r)=>n+r.source,"");return RegExp(`^${t}$`)}function mv(...e){return t=>e.reduce(([n,r,o],i)=>{const[a,s,l]=i(t,o);return[{...n,...a},s||r,l]},[{},null,1]).slice(0,2)}function gv(e,...t){if(e==null)return[null,null];for(const[n,r]of t){const o=n.exec(e);if(o)return r(o)}return[null,null]}function koe(...e){return(t,n)=>{const r={};let o;for(o=0;o<e.length;o++)r[e[o]]=Hd(t[n+o]);return[r,null,n+o]}}const _oe=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,P_e=`(?:${_oe.source}?(?:\\[(${Doe.source})\\])?)?`,FB=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,$oe=RegExp(`${FB.source}${P_e}`),jB=RegExp(`(?:T${$oe.source})?`),A_e=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,M_e=/(\d{4})-?W(\d\d)(?:-?(\d))?/,R_e=/(\d{4})-?(\d{3})/,D_e=koe("weekYear","weekNumber","weekDay"),k_e=koe("year","ordinal"),__e=/(\d{4})-(\d\d)-(\d\d)/,Noe=RegExp(`${FB.source} ?(?:${_oe.source}|(${Doe.source}))?`),$_e=RegExp(`(?: ${Noe.source})?`);function Ng(e,t,n){const r=e[t];return mn(r)?n:Hd(r)}function N_e(e,t){return[{year:Ng(e,t),month:Ng(e,t+1,1),day:Ng(e,t+2,1)},null,t+3]}function yv(e,t){return[{hours:Ng(e,t,0),minutes:Ng(e,t+1,0),seconds:Ng(e,t+2,0),milliseconds:NB(e[t+3])},null,t+4]}function hw(e,t){const n=!e[t]&&!e[t+1],r=AI(e[t+1],e[t+2]),o=n?null:ea.instance(r);return[{},o,t+3]}function mw(e,t){const n=e[t]?qu.create(e[t]):null;return[{},n,t+1]}const L_e=RegExp(`^T?${FB.source}$`),F_e=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function j_e(e){const[t,n,r,o,i,a,s,l,c]=e,u=t[0]==="-",f=l&&l[0]==="-",h=(m,g=!1)=>m!==void 0&&(g||m&&u)?-m:m;return[{years:h(mp(n)),months:h(mp(r)),weeks:h(mp(o)),days:h(mp(i)),hours:h(mp(a)),minutes:h(mp(s)),seconds:h(mp(l),l==="-0"),milliseconds:h(NB(c),f)}]}const B_e={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function BB(e,t,n,r,o,i,a){const s={year:t.length===2?lL(Hd(t)):Hd(t),month:Toe.indexOf(n)+1,day:Hd(r),hour:Hd(o),minute:Hd(i)};return a&&(s.second=Hd(a)),e&&(s.weekday=e.length>3?Ioe.indexOf(e)+1:Poe.indexOf(e)+1),s}const z_e=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function V_e(e){const[,t,n,r,o,i,a,s,l,c,u,f]=e,h=BB(t,o,r,n,i,a,s);let m;return l?m=B_e[l]:c?m=0:m=AI(u,f),[h,new ea(m)]}function H_e(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const U_e=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,G_e=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,q_e=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Mq(e){const[,t,n,r,o,i,a,s]=e;return[BB(t,o,r,n,i,a,s),ea.utcInstance]}function W_e(e){const[,t,n,r,o,i,a,s]=e;return[BB(t,s,n,r,o,i,a),ea.utcInstance]}const K_e=hv(A_e,jB),Y_e=hv(M_e,jB),Q_e=hv(R_e,jB),X_e=hv($oe),Loe=mv(N_e,yv,hw,mw),J_e=mv(D_e,yv,hw,mw),Z_e=mv(k_e,yv,hw,mw),e$e=mv(yv,hw,mw);function t$e(e){return gv(e,[K_e,Loe],[Y_e,J_e],[Q_e,Z_e],[X_e,e$e])}function n$e(e){return gv(H_e(e),[z_e,V_e])}function r$e(e){return gv(e,[U_e,Mq],[G_e,Mq],[q_e,W_e])}function o$e(e){return gv(e,[F_e,j_e])}const i$e=mv(yv);function a$e(e){return gv(e,[L_e,i$e])}const s$e=hv(__e,$_e),l$e=hv(Noe),c$e=mv(yv,hw,mw);function u$e(e){return gv(e,[s$e,Loe],[l$e,c$e])}const Rq="Invalid Duration",Foe={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},d$e={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...Foe},Ts=146097/400,Wm=146097/4800,f$e={years:{quarters:4,months:12,weeks:Ts/7,days:Ts,hours:Ts*24,minutes:Ts*24*60,seconds:Ts*24*60*60,milliseconds:Ts*24*60*60*1e3},quarters:{months:3,weeks:Ts/28,days:Ts/4,hours:Ts*24/4,minutes:Ts*24*60/4,seconds:Ts*24*60*60/4,milliseconds:Ts*24*60*60*1e3/4},months:{weeks:Wm/7,days:Wm,hours:Wm*24,minutes:Wm*24*60,seconds:Wm*24*60*60,milliseconds:Wm*24*60*60*1e3},...Foe},jp=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],p$e=jp.slice(0).reverse();function Ld(e,t,n=!1){const r={values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new Xn(r)}function joe(e,t){let n=t.milliseconds??0;for(const r of p$e.slice(1))t[r]&&(n+=t[r]*e[r].milliseconds);return n}function Dq(e,t){const n=joe(e,t)<0?-1:1;jp.reduceRight((r,o)=>{if(mn(t[o]))return r;if(r){const i=t[r]*n,a=e[o][r],s=Math.floor(i/a);t[o]+=s*n,t[r]-=s*a*n}return o},null),jp.reduce((r,o)=>{if(mn(t[o]))return r;if(r){const i=t[r]%1;t[r]-=i,t[o]+=i*e[r][o]}return o},null)}function h$e(e){const t={};for(const[n,r]of Object.entries(e))r!==0&&(t[n]=r);return t}class Xn{constructor(t){const n=t.conversionAccuracy==="longterm"||!1;let r=n?f$e:d$e;t.matrix&&(r=t.matrix),this.values=t.values,this.loc=t.loc||ur.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(t,n){return Xn.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(t==null||typeof t!="object")throw new ki(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new Xn({values:uT(t,Xn.normalizeUnit),loc:ur.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(t){if(gf(t))return Xn.fromMillis(t);if(Xn.isDuration(t))return t;if(typeof t=="object")return Xn.fromObject(t);throw new ki(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){const[r]=o$e(t);return r?Xn.fromObject(r,n):Xn.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){const[r]=a$e(t);return r?Xn.fromObject(r,n):Xn.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new ki("need to specify a reason the Duration is invalid");const r=t instanceof kl?t:new kl(t,n);if(to.throwOnInvalid)throw new j2e(r);return new Xn({invalid:r})}static normalizeUnit(t){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!n)throw new Wre(t);return n}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,n={}){const r={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?Li.create(this.loc,r).formatDurationFromString(this,t):Rq}toHuman(t={}){if(!this.isValid)return Rq;const n=jp.map(r=>{const o=this.values[r];return mn(o)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:r.slice(0,-1)}).format(o)}).filter(r=>r);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=LB(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const n=this.toMillis();return n<0||n>=864e5?null:(t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t,includeOffset:!1},xt.fromMillis(n,{zone:"UTC"}).toISOTime(t))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?joe(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const n=Xn.fromDurationLike(t),r={};for(const o of jp)(dy(n.values,o)||dy(this.values,o))&&(r[o]=n.get(o)+this.get(o));return Ld(this,{values:r},!0)}minus(t){if(!this.isValid)return this;const n=Xn.fromDurationLike(t);return this.plus(n.negate())}mapUnits(t){if(!this.isValid)return this;const n={};for(const r of Object.keys(this.values))n[r]=Eoe(t(this.values[r],r));return Ld(this,{values:n},!0)}get(t){return this[Xn.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const n={...this.values,...uT(t,Xn.normalizeUnit)};return Ld(this,{values:n})}reconfigure({locale:t,numberingSystem:n,conversionAccuracy:r,matrix:o}={}){const a={loc:this.loc.clone({locale:t,numberingSystem:n}),matrix:o,conversionAccuracy:r};return Ld(this,a)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return Dq(this.matrix,t),Ld(this,{values:t},!0)}rescale(){if(!this.isValid)return this;const t=h$e(this.normalize().shiftToAll().toObject());return Ld(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(a=>Xn.normalizeUnit(a));const n={},r={},o=this.toObject();let i;for(const a of jp)if(t.indexOf(a)>=0){i=a;let s=0;for(const c in r)s+=this.matrix[c][a]*r[c],r[c]=0;gf(o[a])&&(s+=o[a]);const l=Math.trunc(s);n[a]=l,r[a]=(s*1e3-l*1e3)/1e3}else gf(o[a])&&(r[a]=o[a]);for(const a in r)r[a]!==0&&(n[i]+=a===i?r[a]:r[a]/this.matrix[i][a]);return Dq(this.matrix,n),Ld(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=this.values[n]===0?0:-this.values[n];return Ld(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function n(r,o){return r===void 0||r===0?o===void 0||o===0:r===o}for(const r of jp)if(!n(this.values[r],t.values[r]))return!1;return!0}}const Km="Invalid Interval";function m$e(e,t){return!e||!e.isValid?uo.invalid("missing or invalid start"):!t||!t.isValid?uo.invalid("missing or invalid end"):t<e?uo.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null}class uo{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,n=null){if(!t)throw new ki("need to specify a reason the Interval is invalid");const r=t instanceof kl?t:new kl(t,n);if(to.throwOnInvalid)throw new F2e(r);return new uo({invalid:r})}static fromDateTimes(t,n){const r=n0(t),o=n0(n),i=m$e(r,o);return i??new uo({start:r,end:o})}static after(t,n){const r=Xn.fromDurationLike(n),o=n0(t);return uo.fromDateTimes(o,o.plus(r))}static before(t,n){const r=Xn.fromDurationLike(n),o=n0(t);return uo.fromDateTimes(o.minus(r),o)}static fromISO(t,n){const[r,o]=(t||"").split("/",2);if(r&&o){let i,a;try{i=xt.fromISO(r,n),a=i.isValid}catch{a=!1}let s,l;try{s=xt.fromISO(o,n),l=s.isValid}catch{l=!1}if(a&&l)return uo.fromDateTimes(i,s);if(a){const c=Xn.fromISO(o,n);if(c.isValid)return uo.after(i,c)}else if(l){const c=Xn.fromISO(r,n);if(c.isValid)return uo.before(s,c)}}return uo.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds",n){if(!this.isValid)return NaN;const r=this.start.startOf(t,n);let o;return n!=null&&n.useLocaleWeeks?o=this.end.reconfigure({locale:r.locale}):o=this.end,o=o.startOf(t,n),Math.floor(o.diff(r,t).get(t))+(o.valueOf()!==this.end.valueOf())}hasSame(t){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,t):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return this.isValid?this.s>t:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:n}={}){return this.isValid?uo.fromDateTimes(t||this.s,n||this.e):this}splitAt(...t){if(!this.isValid)return[];const n=t.map(n0).filter(a=>this.contains(a)).sort((a,s)=>a.toMillis()-s.toMillis()),r=[];let{s:o}=this,i=0;for(;o<this.e;){const a=n[i]||this.e,s=+a>+this.e?this.e:a;r.push(uo.fromDateTimes(o,s)),o=s,i+=1}return r}splitBy(t){const n=Xn.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,o=1,i;const a=[];for(;r<this.e;){const s=this.start.plus(n.mapUnits(l=>l*o));i=+s>+this.e?this.e:s,a.push(uo.fromDateTimes(r,i)),r=i,o+=1}return a}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return this.isValid?+this.e==+t.s:!1}abutsEnd(t){return this.isValid?+t.e==+this.s:!1}engulfs(t){return this.isValid?this.s<=t.s&&this.e>=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const n=this.s>t.s?this.s:t.s,r=this.e<t.e?this.e:t.e;return n>=r?null:uo.fromDateTimes(n,r)}union(t){if(!this.isValid)return this;const n=this.s<t.s?this.s:t.s,r=this.e>t.e?this.e:t.e;return uo.fromDateTimes(n,r)}static merge(t){const[n,r]=t.sort((o,i)=>o.s-i.s).reduce(([o,i],a)=>i?i.overlaps(a)||i.abutsStart(a)?[o,i.union(a)]:[o.concat([i]),a]:[o,a],[[],null]);return r&&n.push(r),n}static xor(t){let n=null,r=0;const o=[],i=t.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),a=Array.prototype.concat(...i),s=a.sort((l,c)=>l.time-c.time);for(const l of s)r+=l.type==="s"?1:-1,r===1?n=l.time:(n&&+n!=+l.time&&o.push(uo.fromDateTimes(n,l.time)),n=null);return uo.merge(o)}difference(...t){return uo.xor([this].concat(t)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Km}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(t=sT,n={}){return this.isValid?Li.create(this.s.loc.clone(n),t).formatInterval(this):Km}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:Km}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Km}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:Km}toFormat(t,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${n}${this.e.toFormat(t)}`:Km}toDuration(t,n){return this.isValid?this.e.diff(this.s,t,n):Xn.invalid(this.invalidReason)}mapEndpoints(t){return uo.fromDateTimes(t(this.s),t(this.e))}}class $0{static hasDST(t=to.defaultZone){const n=xt.now().setZone(t).set({month:12});return!t.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(t){return qu.isValidZone(t)}static normalizeZone(t){return Yd(t,to.defaultZone)}static getStartOfWeek({locale:t=null,locObj:n=null}={}){return(n||ur.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:n=null}={}){return(n||ur.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:n=null}={}){return(n||ur.create(t)).getWeekendDays().slice()}static months(t="long",{locale:n=null,numberingSystem:r=null,locObj:o=null,outputCalendar:i="gregory"}={}){return(o||ur.create(n,r,i)).months(t)}static monthsFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:o=null,outputCalendar:i="gregory"}={}){return(o||ur.create(n,r,i)).months(t,!0)}static weekdays(t="long",{locale:n=null,numberingSystem:r=null,locObj:o=null}={}){return(o||ur.create(n,r,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:o=null}={}){return(o||ur.create(n,r,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return ur.create(t).meridiems()}static eras(t="short",{locale:n=null}={}){return ur.create(n,null,"gregory").eras(t)}static features(){return{relative:Soe(),localeWeek:woe()}}}function kq(e,t){const n=o=>o.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(Xn.fromMillis(r).as("days"))}function g$e(e,t,n){const r=[["years",(l,c)=>c.year-l.year],["quarters",(l,c)=>c.quarter-l.quarter+(c.year-l.year)*4],["months",(l,c)=>c.month-l.month+(c.year-l.year)*12],["weeks",(l,c)=>{const u=kq(l,c);return(u-u%7)/7}],["days",kq]],o={},i=e;let a,s;for(const[l,c]of r)n.indexOf(l)>=0&&(a=l,o[l]=c(e,t),s=i.plus(o),s>t?(o[l]--,e=i.plus(o),e>t&&(s=e,o[l]--,e=i.plus(o))):e=s);return[e,o,s,a]}function y$e(e,t,n,r){let[o,i,a,s]=g$e(e,t,n);const l=t-o,c=n.filter(f=>["hours","minutes","seconds","milliseconds"].indexOf(f)>=0);c.length===0&&(a<t&&(a=o.plus({[s]:1})),a!==o&&(i[s]=(i[s]||0)+l/(a-o)));const u=Xn.fromObject(i,r);return c.length>0?Xn.fromMillis(l,r).shiftTo(...c).plus(u):u}const v$e="missing Intl.DateTimeFormat.formatToParts support";function or(e,t=n=>n){return{regex:e,deser:([n])=>t(s_e(n))}}const b$e=" ",Boe=`[ ${b$e}]`,zoe=new RegExp(Boe,"g");function x$e(e){return e.replace(/\./g,"\\.?").replace(zoe,Boe)}function _q(e){return e.replace(/\./g,"").replace(zoe," ").toLowerCase()}function gl(e,t){return e===null?null:{regex:RegExp(e.map(x$e).join("|")),deser:([n])=>e.findIndex(r=>_q(n)===_q(r))+t}}function $q(e,t){return{regex:e,deser:([,n,r])=>AI(n,r),groups:t}}function A1(e){return{regex:e,deser:([t])=>t}}function S$e(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function w$e(e,t){const n=ml(t),r=ml(t,"{2}"),o=ml(t,"{3}"),i=ml(t,"{4}"),a=ml(t,"{6}"),s=ml(t,"{1,2}"),l=ml(t,"{1,3}"),c=ml(t,"{1,6}"),u=ml(t,"{1,9}"),f=ml(t,"{2,4}"),h=ml(t,"{4,6}"),m=v=>({regex:RegExp(S$e(v.val)),deser:([w])=>w,literal:!0}),y=(v=>{if(e.literal)return m(v);switch(v.val){case"G":return gl(t.eras("short"),0);case"GG":return gl(t.eras("long"),0);case"y":return or(c);case"yy":return or(f,lL);case"yyyy":return or(i);case"yyyyy":return or(h);case"yyyyyy":return or(a);case"M":return or(s);case"MM":return or(r);case"MMM":return gl(t.months("short",!0),1);case"MMMM":return gl(t.months("long",!0),1);case"L":return or(s);case"LL":return or(r);case"LLL":return gl(t.months("short",!1),1);case"LLLL":return gl(t.months("long",!1),1);case"d":return or(s);case"dd":return or(r);case"o":return or(l);case"ooo":return or(o);case"HH":return or(r);case"H":return or(s);case"hh":return or(r);case"h":return or(s);case"mm":return or(r);case"m":return or(s);case"q":return or(s);case"qq":return or(r);case"s":return or(s);case"ss":return or(r);case"S":return or(l);case"SSS":return or(o);case"u":return A1(u);case"uu":return A1(s);case"uuu":return or(n);case"a":return gl(t.meridiems(),0);case"kkkk":return or(i);case"kk":return or(f,lL);case"W":return or(s);case"WW":return or(r);case"E":case"c":return or(n);case"EEE":return gl(t.weekdays("short",!1),1);case"EEEE":return gl(t.weekdays("long",!1),1);case"ccc":return gl(t.weekdays("short",!0),1);case"cccc":return gl(t.weekdays("long",!0),1);case"Z":case"ZZ":return $q(new RegExp(`([+-]${s.source})(?::(${r.source}))?`),2);case"ZZZ":return $q(new RegExp(`([+-]${s.source})(${r.source})?`),2);case"z":return A1(/[a-z_+-/]{1,256}?/i);case" ":return A1(/[^\S\n\r]/);default:return m(v)}})(e)||{invalidReason:v$e};return y.token=e,y}const C$e={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function E$e(e,t,n){const{type:r,value:o}=e;if(r==="literal"){const l=/^\s+$/.test(o);return{literal:!l,val:l?" ":o}}const i=t[r];let a=r;r==="hour"&&(t.hour12!=null?a=t.hour12?"hour12":"hour24":t.hourCycle!=null?t.hourCycle==="h11"||t.hourCycle==="h12"?a="hour12":a="hour24":a=n.hour12?"hour12":"hour24");let s=C$e[a];if(typeof s=="object"&&(s=s[i]),s)return{literal:!1,val:s}}function T$e(e){return[`^${e.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,e]}function O$e(e,t,n){const r=e.match(t);if(r){const o={};let i=1;for(const a in n)if(dy(n,a)){const s=n[a],l=s.groups?s.groups+1:1;!s.literal&&s.token&&(o[s.token.val[0]]=s.deser(r.slice(i,i+l))),i+=l}return[r,o]}else return[r,{}]}function I$e(e){const t=i=>{switch(i){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,r;return mn(e.z)||(n=qu.create(e.z)),mn(e.Z)||(n||(n=new ea(e.Z)),r=e.Z),mn(e.q)||(e.M=(e.q-1)*3+1),mn(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),mn(e.u)||(e.S=NB(e.u)),[Object.keys(e).reduce((i,a)=>{const s=t(a);return s&&(i[s]=e[a]),i},{}),n,r]}let WR=null;function P$e(){return WR||(WR=xt.fromMillis(1555555555555)),WR}function A$e(e,t){if(e.literal)return e;const n=Li.macroTokenToFormatOpts(e.val),r=Goe(n,t);return r==null||r.includes(void 0)?e:r}function Voe(e,t){return Array.prototype.concat(...e.map(n=>A$e(n,t)))}class Hoe{constructor(t,n){if(this.locale=t,this.format=n,this.tokens=Voe(Li.parseFormat(n),t),this.units=this.tokens.map(r=>w$e(r,t)),this.disqualifyingUnit=this.units.find(r=>r.invalidReason),!this.disqualifyingUnit){const[r,o]=T$e(this.units);this.regex=RegExp(r,"i"),this.handlers=o}}explainFromTokens(t){if(this.isValid){const[n,r]=O$e(t,this.regex,this.handlers),[o,i,a]=r?I$e(r):[null,null,void 0];if(dy(r,"a")&&dy(r,"H"))throw new mg("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:this.tokens,regex:this.regex,rawMatches:n,matches:r,result:o,zone:i,specificOffset:a}}else return{input:t,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function Uoe(e,t,n){return new Hoe(e,n).explainFromTokens(t)}function M$e(e,t,n){const{result:r,zone:o,specificOffset:i,invalidReason:a}=Uoe(e,t,n);return[r,o,i,a]}function Goe(e,t){if(!e)return null;const r=Li.create(t,e).dtFormatter(P$e()),o=r.formatToParts(),i=r.resolvedOptions();return o.map(a=>E$e(a,e,i))}const KR="Invalid DateTime",R$e=864e13;function N0(e){return new kl("unsupported zone",`the zone "${e.name}" is not supported`)}function YR(e){return e.weekData===null&&(e.weekData=lT(e.c)),e.weekData}function QR(e){return e.localWeekData===null&&(e.localWeekData=lT(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function gp(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new xt({...n,...t,old:n})}function qoe(e,t,n){let r=e-t*60*1e3;const o=n.offset(r);if(t===o)return[r,t];r-=(o-t)*60*1e3;const i=n.offset(r);return o===i?[r,o]:[e-Math.min(o,i)*60*1e3,Math.max(o,i)]}function M1(e,t){e+=t*60*1e3;const n=new Date(e);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function wE(e,t,n){return qoe(PI(e),t,n)}function Nq(e,t){const n=e.o,r=e.c.year+Math.trunc(t.years),o=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,i={...e.c,year:r,month:o,day:Math.min(e.c.day,cT(r,o))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},a=Xn.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),s=PI(i);let[l,c]=qoe(s,n,e.zone);return a!==0&&(l+=a,c=e.zone.offset(l)),{ts:l,o:c}}function Ym(e,t,n,r,o,i){const{setZone:a,zone:s}=n;if(e&&Object.keys(e).length!==0||t){const l=t||s,c=xt.fromObject(e,{...n,zone:l,specificOffset:i});return a?c:c.setZone(s)}else return xt.invalid(new kl("unparsable",`the input "${o}" can't be parsed as ${r}`))}function R1(e,t,n=!0){return e.isValid?Li.create(ur.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function XR(e,t){const n=e.c.year>9999||e.c.year<0;let r="";return n&&e.c.year>=0&&(r+="+"),r+=Ao(e.c.year,n?6:4),t?(r+="-",r+=Ao(e.c.month),r+="-",r+=Ao(e.c.day)):(r+=Ao(e.c.month),r+=Ao(e.c.day)),r}function Lq(e,t,n,r,o,i){let a=Ao(e.c.hour);return t?(a+=":",a+=Ao(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!n)&&(a+=":")):a+=Ao(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!n)&&(a+=Ao(e.c.second),(e.c.millisecond!==0||!r)&&(a+=".",a+=Ao(e.c.millisecond,3))),o&&(e.isOffsetFixed&&e.offset===0&&!i?a+="Z":e.o<0?(a+="-",a+=Ao(Math.trunc(-e.o/60)),a+=":",a+=Ao(Math.trunc(-e.o%60))):(a+="+",a+=Ao(Math.trunc(e.o/60)),a+=":",a+=Ao(Math.trunc(e.o%60)))),i&&(a+="["+e.zone.ianaName+"]"),a}const Woe={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},D$e={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},k$e={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Koe=["year","month","day","hour","minute","second","millisecond"],_$e=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],$$e=["year","ordinal","hour","minute","second","millisecond"];function N$e(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new Wre(e);return t}function Fq(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return N$e(e)}}function L$e(e){if(L0===void 0&&(L0=to.now()),e.type!=="iana")return e.offset(L0);const t=e.name;let n=cL.get(t);return n===void 0&&(n=e.offset(L0),cL.set(t,n)),n}function jq(e,t){const n=Yd(t.zone,to.defaultZone);if(!n.isValid)return xt.invalid(N0(n));const r=ur.fromObject(t);let o,i;if(mn(e.year))o=to.now();else{for(const l of Koe)mn(e[l])&&(e[l]=Woe[l]);const a=boe(e)||xoe(e);if(a)return xt.invalid(a);const s=L$e(n);[o,i]=wE(e,s,n)}return new xt({ts:o,zone:n,loc:r,o:i})}function Bq(e,t,n){const r=mn(n.round)?!0:n.round,o=(a,s)=>(a=LB(a,r||n.calendary?0:2,!0),t.loc.clone(n).relFormatter(n).format(a,s)),i=a=>n.calendary?t.hasSame(e,a)?0:t.startOf(a).diff(e.startOf(a),a).get(a):t.diff(e,a).get(a);if(n.unit)return o(i(n.unit),n.unit);for(const a of n.units){const s=i(a);if(Math.abs(s)>=1)return o(s,a)}return o(e>t?-0:0,n.units[n.units.length-1])}function zq(e){let t={},n;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],n=Array.from(e).slice(0,e.length-1)):n=Array.from(e),[t,n]}let L0;const cL=new Map;class xt{constructor(t){const n=t.zone||to.defaultZone;let r=t.invalid||(Number.isNaN(t.ts)?new kl("invalid input"):null)||(n.isValid?null:N0(n));this.ts=mn(t.ts)?to.now():t.ts;let o=null,i=null;if(!r)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(n))[o,i]=[t.old.c,t.old.o];else{const s=gf(t.o)&&!t.old?t.o:n.offset(this.ts);o=M1(this.ts,s),r=Number.isNaN(o.year)?new kl("invalid input"):null,o=r?null:o,i=r?null:s}this._zone=n,this.loc=t.loc||ur.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=o,this.o=i,this.isLuxonDateTime=!0}static now(){return new xt({})}static local(){const[t,n]=zq(arguments),[r,o,i,a,s,l,c]=n;return jq({year:r,month:o,day:i,hour:a,minute:s,second:l,millisecond:c},t)}static utc(){const[t,n]=zq(arguments),[r,o,i,a,s,l,c]=n;return t.zone=ea.utcInstance,jq({year:r,month:o,day:i,hour:a,minute:s,second:l,millisecond:c},t)}static fromJSDate(t,n={}){const r=f_e(t)?t.valueOf():NaN;if(Number.isNaN(r))return xt.invalid("invalid input");const o=Yd(n.zone,to.defaultZone);return o.isValid?new xt({ts:r,zone:o,loc:ur.fromObject(n)}):xt.invalid(N0(o))}static fromMillis(t,n={}){if(gf(t))return t<-864e13||t>R$e?xt.invalid("Timestamp out of range"):new xt({ts:t,zone:Yd(n.zone,to.defaultZone),loc:ur.fromObject(n)});throw new ki(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,n={}){if(gf(t))return new xt({ts:t*1e3,zone:Yd(n.zone,to.defaultZone),loc:ur.fromObject(n)});throw new ki("fromSeconds requires a numerical input")}static fromObject(t,n={}){t=t||{};const r=Yd(n.zone,to.defaultZone);if(!r.isValid)return xt.invalid(N0(r));const o=ur.fromObject(n),i=uT(t,Fq),{minDaysInFirstWeek:a,startOfWeek:s}=Oq(i,o),l=to.now(),c=mn(n.specificOffset)?r.offset(l):n.specificOffset,u=!mn(i.ordinal),f=!mn(i.year),h=!mn(i.month)||!mn(i.day),m=f||h,g=i.weekYear||i.weekNumber;if((m||u)&&g)throw new mg("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&u)throw new mg("Can't mix ordinal dates with month/day");const y=g||i.weekday&&!m;let v,w,C=M1(l,c);y?(v=_$e,w=D$e,C=lT(C,a,s)):u?(v=$$e,w=k$e,C=qR(C)):(v=Koe,w=Woe);let E=!1;for(const A of v){const _=i[A];mn(_)?E?i[A]=w[A]:i[A]=C[A]:E=!0}const I=y?c_e(i,a,s):u?u_e(i):boe(i),O=I||xoe(i);if(O)return xt.invalid(O);const P=y?Eq(i,a,s):u?Tq(i):i,[R,D]=wE(P,c,r),M=new xt({ts:R,zone:r,o:D,loc:o});return i.weekday&&m&&t.weekday!==M.weekday?xt.invalid("mismatched weekday",`you can't specify both a weekday of ${i.weekday} and a date of ${M.toISO()}`):M.isValid?M:xt.invalid(M.invalid)}static fromISO(t,n={}){const[r,o]=t$e(t);return Ym(r,o,n,"ISO 8601",t)}static fromRFC2822(t,n={}){const[r,o]=n$e(t);return Ym(r,o,n,"RFC 2822",t)}static fromHTTP(t,n={}){const[r,o]=r$e(t);return Ym(r,o,n,"HTTP",n)}static fromFormat(t,n,r={}){if(mn(t)||mn(n))throw new ki("fromFormat requires an input string and a format");const{locale:o=null,numberingSystem:i=null}=r,a=ur.fromOpts({locale:o,numberingSystem:i,defaultToEN:!0}),[s,l,c,u]=M$e(a,t,n);return u?xt.invalid(u):Ym(s,l,r,`format ${n}`,t,c)}static fromString(t,n,r={}){return xt.fromFormat(t,n,r)}static fromSQL(t,n={}){const[r,o]=u$e(t);return Ym(r,o,n,"SQL",t)}static invalid(t,n=null){if(!t)throw new ki("need to specify a reason the DateTime is invalid");const r=t instanceof kl?t:new kl(t,n);if(to.throwOnInvalid)throw new L2e(r);return new xt({invalid:r})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,n={}){const r=Goe(t,ur.fromObject(n));return r?r.map(o=>o?o.val:null).join(""):null}static expandFormat(t,n={}){return Voe(Li.parseFormat(t),ur.fromObject(n)).map(o=>o.val).join("")}static resetCache(){L0=void 0,cL.clear()}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?YR(this).weekYear:NaN}get weekNumber(){return this.isValid?YR(this).weekNumber:NaN}get weekday(){return this.isValid?YR(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?QR(this).weekday:NaN}get localWeekNumber(){return this.isValid?QR(this).weekNumber:NaN}get localWeekYear(){return this.isValid?QR(this).weekYear:NaN}get ordinal(){return this.isValid?qR(this.c).ordinal:NaN}get monthShort(){return this.isValid?$0.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?$0.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?$0.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?$0.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const t=864e5,n=6e4,r=PI(this.c),o=this.zone.offset(r-t),i=this.zone.offset(r+t),a=this.zone.offset(r-o*n),s=this.zone.offset(r-i*n);if(a===s)return[this];const l=r-a*n,c=r-s*n,u=M1(l,a),f=M1(c,s);return u.hour===f.hour&&u.minute===f.minute&&u.second===f.second&&u.millisecond===f.millisecond?[gp(this,{ts:l}),gp(this,{ts:c})]:[this]}get isInLeapYear(){return pw(this.year)}get daysInMonth(){return cT(this.year,this.month)}get daysInYear(){return this.isValid?$g(this.year):NaN}get weeksInWeekYear(){return this.isValid?Nx(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Nx(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){const{locale:n,numberingSystem:r,calendar:o}=Li.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:o}}toUTC(t=0,n={}){return this.setZone(ea.instance(t),n)}toLocal(){return this.setZone(to.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(t=Yd(t,to.defaultZone),t.equals(this.zone))return this;if(t.isValid){let o=this.ts;if(n||r){const i=t.offset(this.ts),a=this.toObject();[o]=wE(a,i,t)}return gp(this,{ts:o,zone:t})}else return xt.invalid(N0(t))}reconfigure({locale:t,numberingSystem:n,outputCalendar:r}={}){const o=this.loc.clone({locale:t,numberingSystem:n,outputCalendar:r});return gp(this,{loc:o})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const n=uT(t,Fq),{minDaysInFirstWeek:r,startOfWeek:o}=Oq(n,this.loc),i=!mn(n.weekYear)||!mn(n.weekNumber)||!mn(n.weekday),a=!mn(n.ordinal),s=!mn(n.year),l=!mn(n.month)||!mn(n.day),c=s||l,u=n.weekYear||n.weekNumber;if((c||a)&&u)throw new mg("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&a)throw new mg("Can't mix ordinal dates with month/day");let f;i?f=Eq({...lT(this.c,r,o),...n},r,o):mn(n.ordinal)?(f={...this.toObject(),...n},mn(n.day)&&(f.day=Math.min(cT(f.year,f.month),f.day))):f=Tq({...qR(this.c),...n});const[h,m]=wE(f,this.o,this.zone);return gp(this,{ts:h,o:m})}plus(t){if(!this.isValid)return this;const n=Xn.fromDurationLike(t);return gp(this,Nq(this,n))}minus(t){if(!this.isValid)return this;const n=Xn.fromDurationLike(t).negate();return gp(this,Nq(this,n))}startOf(t,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;const r={},o=Xn.normalizeUnit(t);switch(o){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0;break}if(o==="weeks")if(n){const i=this.loc.getStartOfWeek(),{weekday:a}=this;a<i&&(r.weekNumber=this.weekNumber-1),r.weekday=i}else r.weekday=1;if(o==="quarters"){const i=Math.ceil(this.month/3);r.month=(i-1)*3+1}return this.set(r)}endOf(t,n){return this.isValid?this.plus({[t]:1}).startOf(t,n).minus(1):this}toFormat(t,n={}){return this.isValid?Li.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,t):KR}toLocaleString(t=sT,n={}){return this.isValid?Li.create(this.loc.clone(n),t).formatDateTime(this):KR}toLocaleParts(t={}){return this.isValid?Li.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:o=!0,extendedZone:i=!1}={}){if(!this.isValid)return null;const a=t==="extended";let s=XR(this,a);return s+="T",s+=Lq(this,a,n,r,o,i),s}toISODate({format:t="extended"}={}){return this.isValid?XR(this,t==="extended"):null}toISOWeekDate(){return R1(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:o=!1,extendedZone:i=!1,format:a="extended"}={}){return this.isValid?(o?"T":"")+Lq(this,a==="extended",n,t,r,i):null}toRFC2822(){return R1(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return R1(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?XR(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let o="HH:mm:ss.SSS";return(n||t)&&(r&&(o+=" "),n?o+="z":t&&(o+="ZZ")),R1(this,o,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():KR}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const n={...this.c};return t.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,n="milliseconds",r={}){if(!this.isValid||!t.isValid)return Xn.invalid("created by diffing an invalid DateTime");const o={locale:this.locale,numberingSystem:this.numberingSystem,...r},i=p_e(n).map(Xn.normalizeUnit),a=t.valueOf()>this.valueOf(),s=a?this:t,l=a?t:this,c=y$e(s,l,i,o);return a?c.negate():c}diffNow(t="milliseconds",n={}){return this.diff(xt.now(),t,n)}until(t){return this.isValid?uo.fromDateTimes(this,t):this}hasSame(t,n,r){if(!this.isValid)return!1;const o=t.valueOf(),i=this.setZone(t.zone,{keepLocalTime:!0});return i.startOf(n,r)<=o&&o<=i.endOf(n,r)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const n=t.base||xt.fromObject({},{zone:this.zone}),r=t.padding?this<n?-t.padding:t.padding:0;let o=["years","months","days","hours","minutes","seconds"],i=t.unit;return Array.isArray(t.unit)&&(o=t.unit,i=void 0),Bq(n,this.plus(r),{...t,numeric:"always",units:o,unit:i})}toRelativeCalendar(t={}){return this.isValid?Bq(t.base||xt.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(xt.isDateTime))throw new ki("min requires all arguments be DateTimes");return Iq(t,n=>n.valueOf(),Math.min)}static max(...t){if(!t.every(xt.isDateTime))throw new ki("max requires all arguments be DateTimes");return Iq(t,n=>n.valueOf(),Math.max)}static fromFormatExplain(t,n,r={}){const{locale:o=null,numberingSystem:i=null}=r,a=ur.fromOpts({locale:o,numberingSystem:i,defaultToEN:!0});return Uoe(a,t,n)}static fromStringExplain(t,n,r={}){return xt.fromFormatExplain(t,n,r)}static buildFormatParser(t,n={}){const{locale:r=null,numberingSystem:o=null}=n,i=ur.fromOpts({locale:r,numberingSystem:o,defaultToEN:!0});return new Hoe(i,t)}static fromFormatParser(t,n,r={}){if(mn(t)||mn(n))throw new ki("fromFormatParser requires an input string and a format parser");const{locale:o=null,numberingSystem:i=null}=r,a=ur.fromOpts({locale:o,numberingSystem:i,defaultToEN:!0});if(!a.equals(n.locale))throw new ki(`fromFormatParser called with a locale of ${a}, but the format parser was created for ${n.locale}`);const{result:s,zone:l,specificOffset:c,invalidReason:u}=n.explainFromTokens(t);return u?xt.invalid(u):Ym(s,l,r,`format ${n.format}`,t,c)}static get DATE_SHORT(){return sT}static get DATE_MED(){return Kre}static get DATE_MED_WITH_WEEKDAY(){return B2e}static get DATE_FULL(){return Yre}static get DATE_HUGE(){return Qre}static get TIME_SIMPLE(){return Xre}static get TIME_WITH_SECONDS(){return Jre}static get TIME_WITH_SHORT_OFFSET(){return Zre}static get TIME_WITH_LONG_OFFSET(){return eoe}static get TIME_24_SIMPLE(){return toe}static get TIME_24_WITH_SECONDS(){return noe}static get TIME_24_WITH_SHORT_OFFSET(){return roe}static get TIME_24_WITH_LONG_OFFSET(){return ooe}static get DATETIME_SHORT(){return ioe}static get DATETIME_SHORT_WITH_SECONDS(){return aoe}static get DATETIME_MED(){return soe}static get DATETIME_MED_WITH_SECONDS(){return loe}static get DATETIME_MED_WITH_WEEKDAY(){return z2e}static get DATETIME_FULL(){return coe}static get DATETIME_FULL_WITH_SECONDS(){return uoe}static get DATETIME_HUGE(){return doe}static get DATETIME_HUGE_WITH_SECONDS(){return foe}}function n0(e){if(xt.isDateTime(e))return e;if(e&&e.valueOf&&gf(e.valueOf()))return xt.fromJSDate(e);if(e&&typeof e=="object")return xt.fromObject(e);throw new ki(`Unknown datetime argument: ${e}, of type ${typeof e}`)}const Vq=3,Hq=25,Uq=1e3,Gq=1,qq=16,F$e=12;class j$e{constructor(t){Ce(this,"id");Ce(this,"name");Ce(this,"description");Ce(this,"created");Ce(this,"start");Ce(this,"end");Ce(this,"fitInWeek");Ce(this,"isTemplate");Ce(this,"isPublic");Ce(this,"days",[]);Ce(this,"dayData",[]);this.id=t.id,this.name=t.name,this.description=t.description,this.created=t.created,this.start=t.start,this.end=t.end,this.fitInWeek=t.fitInWeek,this.isTemplate=t.isTemplate??!1,this.isPublic=t.isPublic??!1,this.days=t.days??[],this.dayData=t.dayData??[]}get exercises(){return this.days.flatMap(t=>t.slots.flatMap(n=>n.entries.flatMap(r=>r.exercise)))}get dayDataCurrentIteration(){const t=this.getIteration()??1;return this.dayData.filter(n=>n.iteration===t)}get groupedDayDataByIteration(){const t={};for(const n of this.dayData)t[n.iteration]||(t[n.iteration]=[]),t[n.iteration].push(n);return t}get duration(){const t=xt.fromJSDate(this.end).diff(xt.fromJSDate(this.start),["weeks","days"]),n=Math.floor(t.weeks),r=Math.floor(t.days);return{weeks:n,days:r}}get durationText(){const t=this.duration.days,n=this.duration.weeks;return t===0?hr.t("durationWeeks",{number:n}):hr.t("durationWeeksDays",{nrWeeks:n,nrDays:t})}get mainMuscles(){return this.days.flatMap(n=>n.slots.flatMap(r=>r.entries.flatMap(o=>{var i;return((i=o.exercise)==null?void 0:i.muscles)||[]}))).filter((n,r,o)=>r===o.findIndex(i=>i.id===n.id))}get secondaryMuscles(){return this.days.flatMap(n=>n.slots.flatMap(r=>r.entries.flatMap(o=>{var i;return((i=o.exercise)==null?void 0:i.musclesSecondary)||[]}))).filter((n,r,o)=>r===o.findIndex(i=>i.id===n.id))}get cycleLength(){return this.dayDataCurrentIteration.length}getIteration(t){const n=t??new Date,r=this.dayData.find(o=>xa(o.date,n));return r?r.iteration:null}getSetConfigData(t,n,r){const o=this.dayData.find(a=>{var s;return((s=a.day)==null?void 0:s.id)===t&&a.iteration===n});if(!o)return null;const i=o.slots.find(a=>a.setConfigs.some(s=>s.slotEntryId===r));return(i==null?void 0:i.setConfigs.find(a=>a.slotEntryId===r))||null}getDayData(t,n){return this.dayData.filter(r=>{var o;return((o=r.day)==null?void 0:o.id)===t&&r.date.getDate()===n.getDate()&&r.date.getMonth()===n.getMonth()&&r.date.getFullYear()===n.getFullYear()})}}class B$e{fromJson(t){return new j$e({id:t.id,name:t.name,description:t.description,created:new Date(t.created),start:new Date(t.start),end:new Date(t.end),fitInWeek:t.fit_in_week,isTemplate:t.is_template,isPublic:t.is_public,days:t.days?t.days.map(n=>new Ure(n)):[]})}toJson(t){return{id:t.id,name:t.name,description:t.description,start:Jn(t.start),end:Jn(t.end),fit_in_week:t.fitInWeek}}}const vv=new B$e;class z$e{constructor(t){Ce(this,"exercise");Ce(this,"weightUnit",null);Ce(this,"repetitionsUnit",null);Ce(this,"exerciseId");Ce(this,"slotEntryId");Ce(this,"type");Ce(this,"nrOfSets");Ce(this,"maxNrOfSets");Ce(this,"weight");Ce(this,"maxWeight");Ce(this,"weightUnitId",null);Ce(this,"weightRounding",null);Ce(this,"repetitions");Ce(this,"maxRepetitions");Ce(this,"repetitionsUnitId",null);Ce(this,"repetitionsRounding",null);Ce(this,"rir");Ce(this,"maxRir");Ce(this,"rpe");Ce(this,"restTime");Ce(this,"maxRestTime");Ce(this,"textRepr");Ce(this,"comment");this.exerciseId=t.exerciseId,this.exercise=t.exercise,this.slotEntryId=t.slotEntryId,this.type=t.type,this.nrOfSets=t.nrOfSets,this.maxNrOfSets=t.maxNrOfSets??null,this.weight=t.weight??null,this.maxWeight=t.maxWeight??null,this.weightUnitId=t.weightUnitId,this.weightUnit=t.weightUnit??null,this.weightRounding=t.weightRounding,this.repetitions=t.repetitions??null,this.maxRepetitions=t.maxRepetitions??null,this.repetitionsUnitId=t.repetitionsUnitId,this.repetitionsUnit=t.repetitionsUnit??null,this.repetitionsRounding=t.repetitionsRounding,this.rir=t.rir??null,this.maxRir=t.maxRir??null,this.rpe=t.rpe??null,this.restTime=t.restTime??null,this.maxRestTime=t.maxRestTime??null,this.textRepr=t.textRepr,this.comment=t.comment}get isSpecialType(){return this.type!=="normal"}}class V$e{constructor(){Ce(this,"fromJson",t=>new z$e({exerciseId:t.exercise,slotEntryId:t.slot_entry_id,type:t.type,nrOfSets:t.sets,maxNrOfSets:t.max_sets!==null?parseInt(t.max_sets):null,weight:t.weight!==null?parseFloat(t.weight):null,maxWeight:t.max_weight!==null?parseFloat(t.max_weight):null,weightUnitId:t.weight_unit,weightRounding:t.weight_rounding!==null?parseFloat(t.weight_rounding):null,repetitions:t.repetitions!==null?parseFloat(t.repetitions):null,maxRepetitions:t.max_repetitions!==null?parseFloat(t.max_repetitions):null,repetitionsUnitId:t.repetitions_unit,repetitionsRounding:t.repetitions_rounding!==null?parseFloat(t.repetitions_rounding):null,rir:t.rir!==null?parseFloat(t.rir):null,maxRir:t.max_rir!==null?parseFloat(t.max_rir):null,rpe:t.rpe!==null?parseFloat(t.rpe):null,restTime:t.rest!==null?parseInt(t.rest):null,maxRestTime:t.max_rest!==null?parseInt(t.max_rest):null,textRepr:t.text_repr,comment:t.comment}))}}class H$e{constructor(t,n,r,o,i){Ce(this,"exercises",[]);this.comment=t,this.isSuperset=n,this.exerciseIds=r,this.setConfigs=o,this.exercises=i??[]}}class U$e{constructor(){Ce(this,"fromJson",t=>new H$e(t.comment,t.is_superset,t.exercises,t.sets.map(n=>new V$e().fromJson(n))))}}class G$e{constructor(t,n,r,o,i){Ce(this,"slots",[]);this.iteration=t,this.date=n,this.label=r,this.day=o,this.slots=i??[]}}class q$e{constructor(){Ce(this,"fromJson",t=>new G$e(t.iteration,new Date(t.date),t.label,t.day!=null?new TI().fromJson(t.day):null,t.slots.map(n=>new U$e().fromJson(n))))}}class W$e{constructor(t){Ce(this,"id");Ce(this,"date");Ce(this,"iteration");Ce(this,"exerciseId");Ce(this,"slotEntryId");Ce(this,"sessionId");Ce(this,"routineId");Ce(this,"repetitionUnitObj");Ce(this,"repetitionUnitId");Ce(this,"repetitions");Ce(this,"repetitionsTarget");Ce(this,"weightUnitObj");Ce(this,"weightUnitId");Ce(this,"weight");Ce(this,"weightTarget");Ce(this,"rir");Ce(this,"rirTarget");Ce(this,"restTime");Ce(this,"restTimeTarget");Ce(this,"exerciseObj");this.id=t.id,this.date=typeof t.date=="string"?new Date(t.date):t.date,this.iteration=t.iteration,this.slotEntryId=t.slotEntryId,this.sessionId=t.sessionId||null,this.routineId=t.routineId||null,this.exerciseObj=t.exercise,this.exerciseId=t.exerciseId,this.repetitionUnitObj=t.repetitionsUnit||null,this.repetitionUnitId=t.repetitionsUnitId||null,this.repetitions=t.repetitions,this.repetitionsTarget=t.repetitionsTarget||null,this.weightUnitObj=t.weightUnit||null,this.weightUnitId=t.weightUnitId||null,this.weight=t.weight,this.weightTarget=t.weightTarget||null,this.rir=t.rir,this.rirTarget=t.rirTarget||null,this.restTime=t.restTime||null,this.restTimeTarget=t.restTimeTarget||null}get rirString(){return this.rir===null?"-/-":this.rir.toString()}}class RI{constructor(){Ce(this,"fromJson",t=>new W$e({id:t.id,date:t.date,iteration:t.iteration,exerciseId:t.exercise,slotEntryId:t.slot_entry,sessionId:t.session,routineId:t.routine,repetitionsUnitId:t.repetitions_unit,repetitions:t.repetitions===null?null:Number.parseFloat(t.repetitions),repetitionsTarget:t.repetitions_target===null?null:Number.parseFloat(t.repetitions_target),weightUnitId:t.weight_unit,weight:t.weight===null?null:Number.parseFloat(t.weight),weightTarget:t.weight_target===null?null:Number.parseFloat(t.weight_target),rir:t.rir===null?null:Number.parseFloat(t.rir),rirTarget:t.rir_target===null?null:Number.parseFloat(t.rir_target),restTime:t.rest,restTimeTarget:t.rest_target}));Ce(this,"toJson",t=>({id:t.id,iteration:t.iteration,date:t.date.toISOString(),slot_entry:t.slotEntryId,exercise:t.exerciseId,routine:t.routineId,repetitions_unit:t.repetitionUnitId,repetitions:t.repetitions,repetitions_target:t.repetitionsTarget,weight_unit:t.weightUnitId,weight:t.weight,weight_target:t.weightTarget,rir:t.rir,rir_target:t.rirTarget,rest:t.restTime,rest_target:t.restTimeTarget}))}}const Wq=1e3,uL="1",cg="2",dL="3";class K$e{constructor(t){Ce(this,"id");Ce(this,"dayId");Ce(this,"routineId");Ce(this,"date");Ce(this,"notes");Ce(this,"impression");Ce(this,"timeStart");Ce(this,"timeEnd");Ce(this,"dayObj");Ce(this,"logs",[]);this.id=t.id,this.dayId=t.dayId,this.routineId=t.routineId,this.date=t.date,this.notes=t.notes,this.impression=t.impression,this.timeStart=t.timeStart,this.timeEnd=t.timeEnd,t.dayObj&&(this.dayObj=t.dayObj),this.logs=t.logs??[]}get impressionString(){switch(this.impression){case uL:return hr.t("routines.impressionBad");case cg:return hr.t("routines.impressionNeutral");case dL:return hr.t("routines.impressionGood");default:return""}}get textRepresentation(){const t=this.timeStart&&this.timeEnd?`${this.timeStart.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})} - ${this.timeEnd.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})} /`:"",n=this.notes??"";return`${this.impressionString} ${t} ${n}`}}class gw{constructor(){Ce(this,"fromJson",t=>new K$e({id:t.id,dayId:t.day,routineId:t.routine,date:new Date(t.date),notes:t.notes!==void 0?t.notes:null,impression:t.impression,timeStart:t.time_start!==void 0?VN(t.time_start):null,timeEnd:t.time_end!==void 0?VN(t.time_end):null,dayObj:t.dayObj,logs:t.logs}));Ce(this,"toJson",t=>({id:t.id,day:t.dayId,date:Jn(t.date),routine:t.routineId,notes:t.notes,impression:t.impression,time_start:Dx(t.timeStart),time_end:Dx(t.timeEnd)}))}}class Y$e{constructor(t,n){this.session=t,this.logs=n}}class Q$e{constructor(){Ce(this,"fromJson",t=>new Y$e(new gw().fromJson(t.session),t.logs.map(n=>new RI().fromJson(n))))}}class X$e{constructor(t,n){Ce(this,"id");Ce(this,"name");this.id=t,this.name=n}}class J$e{fromJson(t){return new X$e(t.id,t.name)}toJson(t){return{}}}class Z$e{constructor(t,n){Ce(this,"id");Ce(this,"name");this.id=t,this.name=n}}class eNe{fromJson(t){return new Z$e(t.id,t.name)}toJson(t){return{}}}const tNe="setting-repetitionunit",nNe="setting-weightunit",Yoe=async()=>{const e=ft(tNe),{data:t}=await it.get(e,{headers:ht()}),n=new J$e;return t.results.map(r=>n.fromJson(r))},Qoe=async()=>{const e=ft(nNe),{data:t}=await it.get(e,{headers:ht()}),n=new eNe;return t.results.map(r=>n.fromJson(r))},rNe="structure",oNe="logs",iNe="stats",aNe="date-sequence-display",D1={},Xoe=async e=>{var f;const t=await it.get(ft(St.ROUTINE,{id:e}),{headers:ht()}),n=vv.fromJson(t.data),r=await Promise.all([Yoe(),Qoe(),mNe(e),gNe(e)]),o=r[0],i=r[1],a=r[2],s=r[3],l=new Set;for(const h of a.filter(m=>m.day!==null&&m.iteration===1))for(const m of h.slots)for(const g of m.setConfigs)l.add(g.exerciseId);const c=Array.from(l).map(h=>pv(h));(await Promise.all(c)).forEach(h=>{D1[h.id]=h});for(const h of a)for(const m of h.slots){for(const g of m.setConfigs)g.exercise=D1[g.exerciseId],g.repetitionsUnitId!==null&&(g.repetitionsUnit=o.find(y=>y.id===g.repetitionsUnitId)??null),g.weightUnitId!==null&&(g.weightUnit=i.find(y=>y.id===g.weightUnitId)??null);for(const g of m.exerciseIds)(f=m.exercises)==null||f.push(D1[g])}for(const h of s)for(const m of h.slots)for(const g of m.entries)g.exercise=D1[g.exerciseId],g.repetitionUnitId!==null&&(g.repetitionUnit=o.find(y=>y.id===g.repetitionUnitId)??null),g.weightUnitId!==null&&(g.weightUnit=i.find(y=>y.id===g.weightUnitId)??null);return n.dayData=a,n.days=s,n},sNe=async()=>{const e=ft(St.ROUTINE,{query:{limit:"1",is_template:!1}}),t=await it.get(e,{headers:ht()});return t.data.count===0?null:await Xoe(t.data.results[0].id)},lNe=async e=>await Xoe(e),cNe=async()=>{const e=ft(St.ROUTINE,{query:{is_public:!1}});return(await it.get(e,{headers:ht()})).data.results.map(n=>vv.fromJson(n))},uNe=async()=>{const e=ft(St.PRIVATE_TEMPLATE);return(await it.get(e,{headers:ht()})).data.results.map(n=>vv.fromJson(n))},dNe=async()=>{const e=ft(St.PUBLIC_TEMPLATE);return(await it.get(e,{headers:ht()})).data.results.map(n=>vv.fromJson(n))},fNe=async e=>{const t=await it.post(ft(St.ROUTINE),e,{headers:ht()});return vv.fromJson(t.data)},pNe=async e=>{const t=await it.patch(ft(St.ROUTINE,{id:e.id}),e,{headers:ht()});return vv.fromJson(t.data)},hNe=async e=>(await it.delete(ft(St.ROUTINE,{id:e}),{headers:ht()})).status,mNe=async e=>{const t=await it.get(ft(St.ROUTINE,{id:e,objectMethod:aNe}),{headers:ht()}),n=new q$e;return t.data.map(r=>n.fromJson(r))},gNe=async e=>{const t=await it.get(ft(St.ROUTINE,{id:e,objectMethod:rNe}),{headers:ht()}),n=new TI;return t.data.days.map(r=>n.fromJson(r))},yNe=async e=>{const t=await it.get(ft(St.ROUTINE,{id:e,objectMethod:oNe}),{headers:ht()}),n=new Q$e;return t.data.map(r=>n.fromJson(r))},vNe=async e=>{const t=await it.get(ft(St.ROUTINE,{id:e,objectMethod:iNe}),{headers:ht()});return new N2e().fromJson(t.data)};class bNe{constructor(t,n,r,o){Ce(this,"entries",[]);this.id=t,this.name=n,this.unit=r,o&&(this.entries=o)}}class DI{fromJson(t){return new bNe(t.id,t.name,t.unit)}toJson(t){return{id:t.id,name:t.name,unit:t.unit}}}class xNe{constructor(t,n,r,o,i){this.id=t,this.category=n,this.date=r,this.value=o,this.notes=i}}class kI{fromJson(t){return new xNe(t.id,t.category,new Date(t.date),t.value,t.notes)}toJson(t){return{id:t.id,category:t.category,date:t.date,value:t.value,notes:t.notes}}}async function*xh(e,t){for(t==null&&(t=ht());;){const r=(await it.get(e,{headers:t})).data;if(yield r.results,e=r.next,!e)break}}const yw="measurement-category",vw="measurement",SNe=async e=>{const{filtersetQueryCategories:t={},filtersetQueryEntries:n={}}=e||{},r=new DI,o=new kI,i=[];for await(const c of xh(ft(yw,{query:{...t}}),ht()))for(const u of c)i.push(r.fromJson(u));const a=i.map(async c=>{const u=[],f=ft(vw,{query:{category:c.id,...n}});for await(const h of xh(f,ht()))for(const m of h)u.push(o.fromJson(m));return u}),s=await Promise.all(a);let l;return s.forEach(c=>{c.length>0&&(l=c[0].category,i.findLast(u=>u.id===l).entries=c)}),i},wNe=async e=>{const{data:t}=await it.get(ft(yw,{id:e}),{headers:ht()}),n=new DI().fromJson(t),r=new kI,o=[],i=ft(vw,{query:{category:n.id}});for await(const a of xh(i,ht()))for(const s of a)o.push(r.fromJson(s));return n.entries=o,n},CNe=async e=>{const t=await it.post(ft(yw),{name:e.name,unit:e.unit},{headers:ht()});return new DI().fromJson(t.data)},ENe=async e=>{const t=await it.patch(ft(yw,{id:e.id}),{name:e.name,unit:e.unit},{headers:ht()});return new DI().fromJson(t.data)},TNe=async e=>{await it.delete(ft(yw,{id:e}),{headers:ht()})},ONe=async e=>{await it.delete(ft(vw,{id:e}),{headers:ht()})},INe=async e=>{const t=await it.patch(ft(vw,{id:e.id}),{date:Jn(e.date),value:e.value,notes:e.notes},{headers:ht()});return new kI().fromJson(t.data)},PNe=async e=>{const t=await it.post(ft(vw),{category:e.categoryId,date:Jn(e.date),value:e.value,notes:e.notes},{headers:ht()});return new kI().fromJson(t.data)};class ANe{constructor(t,n,r,o,i,a,s,l){this.id=t,this.uuid=n,this.url=r,this.created=o,this.lastUpdate=i,this.size=a,this.width=s,this.height=l}}class MNe{fromJson(t){return new ANe(t.id,t.uuid,t.image,new Date(t.created),new Date(t.last_update),t.size,t.width,t.height)}}class RNe{constructor(t,n,r,o,i,a,s,l,c,u,f,h,m=null){this.id=t,this.uuid=n,this.code=r,this.name=o,this.energy=i,this.protein=a,this.carbohydrates=s,this.carbohydratesSugar=l,this.fat=c,this.fatSaturated=u,this.fiber=f,this.sodium=h,this.image=m}}class Joe{fromJson(t){return new RNe(t.id,t.uuid,t.code,t.name,t.energy,parseFloat(t.protein),parseFloat(t.carbohydrates),t.carbohydrates_sugar===null?null:parseFloat(t.carbohydrates_sugar),parseFloat(t.fat),t.fat_saturated===null?null:parseFloat(t.fat_saturated),t.fiber===null?null:parseFloat(t.fiber),t.sodium===null?null:parseFloat(t.sodium),t.image===null?null:new MNe().fromJson(t.image))}}const DNe=async e=>{const{data:t}=await it.get(ft(St.INGREDIENT_PATH,{id:e}),{headers:ht()});return new Joe().fromJson(t)},Zoe=async e=>{if(e.length===0)return[];const t=ft(St.INGREDIENT_PATH,{query:{id__in:e.join(",")}}),n=new Joe,r=[];for await(const o of xh(t,ht()))for(const i of o)r.push(n.fromJson(i));return r},kNe=async(e,t,n=!0)=>{const r=[t];t!==uy&&n&&r.push(uy);const o=ft(St.INGREDIENT_SEARCH_PATH,{query:{term:e,language:r.join(",")}}),{data:i}=await it.get(o);return i.suggestions};class _Ne{constructor(t,n,r,o,i,a,s){Ce(this,"ingredient",null);Ce(this,"weightUnit",null);this.id=t,this.ingredientId=n,this.weightUnitId=r,this.amount=o,this.order=i,a&&(this.ingredient=a),s&&(this.weightUnit=s)}get amountString(){var t;return this.amount.toFixed().toString()+(this.weightUnitId!==null?` ${(t=this.weightUnit)==null?void 0:t.name}`:"g")}get nutritionalValues(){return this.ingredient?qa.fromIngredient(this.ingredient,this.amount,this.weightUnit):new qa}}class zB{fromJson(t){return new _Ne(t.id,t.ingredient,t.weight_unit,parseFloat(t.amount),t.order)}toJson(t){return{ingredient:t.ingredientId,weight_unit:t.weightUnitId,amount:t.amount.toString(),order:t.order}}}const $Ne=async e=>{const t=await it.post(ft(St.MEAL_ITEM),e,{headers:ht()});return new zB().fromJson(t.data)},NNe=async e=>{const t=await it.patch(ft(St.MEAL_ITEM,{id:e.id}),e,{headers:ht()});return new zB().fromJson(t.data)},LNe=async e=>{await it.delete(ft(St.MEAL_ITEM,{id:e}),{headers:ht()})};class FNe{constructor(t,n,r,o=""){this.id=t,this.amount=n,this.grams=r,this.name=o}}class jNe{fromJson(t){return new FNe(t.id,parseFloat(t.amount),t.gram)}}const eie=async e=>{if(e===null)return null;const{data:t}=await it.get(ft(St.INGREDIENT_WEIGHT_UNIT,{id:e}),{headers:ht()});return new jNe().fromJson(t)},BNe=async e=>{const t=await it.post(ft(St.MEAL),e,{headers:ht()});return new xB().fromJson(t.data)},zNe=async e=>{const t=await it.patch(ft(St.MEAL,{id:e.id}),e,{headers:ht()});return new xB().fromJson(t.data)},VNe=async e=>{await it.delete(ft(St.MEAL,{id:e}),{headers:ht()})},HNe=async e=>{let t=[];const n=new xB,r=new zB,{data:o}=await it.get(ft(St.MEAL,{query:{plan:e}}),{headers:ht()}),i=o.results.map(a=>n.fromJson(a));for(const a of i){t=[];const{data:s}=await it.get(ft(St.MEAL_ITEM,{query:{meal:a.id}}),{headers:ht()}),l=s.results.map(u=>r.fromJson(u));for(const u of l)t.push(u.ingredientId);const c=await Zoe(t);for(const u of l)u.weightUnit=await eie(u.weightUnitId),u.ingredient=c.find(f=>f.id===u.ingredientId);a.items=l}return i},UNe=async e=>(await it.delete(ft(St.WORKOUT_LOG,{id:e}),{headers:ht()})).status,GNe=async e=>{const t=new RI,n=await it.patch(ft(St.WORKOUT_LOG,{id:e.id}),t.toJson(e),{headers:ht()});return t.fromJson(n.data)},qNe=async e=>{const t=new RI,n=[];for(const r of e){const o=await it.post(ft(St.WORKOUT_LOG),{...r},{headers:ht()});n.push(t.fromJson(o.data))}return n},WNe=async e=>{const t=await it.patch(ft(St.SLOT_ENTRY,{id:e.id}),e,{headers:ht()});return RB.fromJson(t.data)},KNe=async e=>{await it.delete(ft(St.SLOT_ENTRY,{id:e}),{headers:ht()})},YNe=async e=>{const t=await it.post(ft(St.SLOT_ENTRY),e,{headers:ht()});return RB.fromJson(t.data)},QNe=async e=>{const t=await it.patch(ft(St.DAY,{id:e.id}),e,{headers:ht()});return new TI().fromJson(t.data)},XNe=async e=>{for(const t of e)await it.patch(ft(St.DAY,{id:t.id}),{order:t.order},{headers:ht()})},JNe=async e=>{const t=await it.post(ft(St.DAY),e,{headers:ht()});return new TI().fromJson(t.data)},ZNe=async e=>{await it.delete(ft(St.DAY,{id:e}),{headers:ht()})},eLe=async e=>{const t=await it.post(ft(St.SLOT),e,{headers:ht()});return new DB().fromJson(t.data)},tLe=async e=>{const t=await it.patch(ft(St.SLOT,{id:e.id}),e,{headers:ht()});return new DB().fromJson(t.data)},nLe=async e=>{for(const t of e)await it.patch(ft(St.SLOT,{id:t.id}),{order:t.order},{headers:ht()})},rLe=async e=>{await it.delete(ft(St.SLOT,{id:e}),{headers:ht()})},oLe=async({values:e,maxValues:t})=>{const n=async r=>{const{toAdd:o,toEdit:i,toDelete:a,apiPath:s}=r;for(const l of o)await tc(l,s);for(const l of i)await ec(l,s);for(const l of a)await Vc(l,s)};e!==void 0&&await n(e),t!==void 0&&await n(t)},ec=async(e,t)=>{const n=await it.patch(ft(t,{id:e.id}),e,{headers:ht()});return new MB().fromJson(n.data)},tc=async(e,t)=>{const n=await it.post(ft(t),e,{headers:ht()});return new MB().fromJson(n.data)},Vc=async(e,t)=>await it.delete(ft(t,{id:e}),{headers:ht()}),iLe=async e=>await ec(e,St.WEIGHT_CONFIG),aLe=async e=>await tc(e,St.WEIGHT_CONFIG),sLe=async e=>await Vc(e,St.WEIGHT_CONFIG),lLe=async e=>await ec(e,St.MAX_WEIGHT_CONFIG),cLe=async e=>await tc(e,St.MAX_WEIGHT_CONFIG),uLe=async e=>await Vc(e,St.MAX_WEIGHT_CONFIG),dLe=async e=>await ec(e,St.REPETITIONS_CONFIG),fLe=async e=>await tc(e,St.REPETITIONS_CONFIG),pLe=async e=>await Vc(e,St.REPETITIONS_CONFIG),hLe=async e=>await ec(e,St.MAX_REPS_CONFIG),mLe=async e=>await tc(e,St.MAX_REPS_CONFIG),gLe=async e=>await Vc(e,St.MAX_REPS_CONFIG),yLe=async e=>await ec(e,St.NR_OF_SETS_CONFIG),vLe=async e=>await tc(e,St.NR_OF_SETS_CONFIG),bLe=async e=>await Vc(e,St.NR_OF_SETS_CONFIG),xLe=async e=>await ec(e,St.MAX_NR_OF_SETS_CONFIG),SLe=async e=>await tc(e,St.MAX_NR_OF_SETS_CONFIG),wLe=async e=>await ec(e,St.RIR_CONFIG),CLe=async e=>await tc(e,St.RIR_CONFIG),ELe=async e=>await Vc(e,St.RIR_CONFIG),TLe=async e=>await ec(e,St.MAX_RIR_CONFIG),OLe=async e=>await tc(e,St.MAX_RIR_CONFIG),ILe=async e=>await Vc(e,St.MAX_RIR_CONFIG),PLe=async e=>await ec(e,St.REST_CONFIG),ALe=async e=>await tc(e,St.REST_CONFIG),MLe=async e=>await Vc(e,St.REST_CONFIG),RLe=async e=>await ec(e,St.MAX_REST_CONFIG),DLe=async e=>await tc(e,St.MAX_REST_CONFIG),kLe=async e=>await Vc(e,St.MAX_REST_CONFIG),_Le=async e=>{const t=await it.get(ft(St.SESSION,{query:e}),{headers:ht()});return t.data.count===1?new gw().fromJson(t.data.results[0]):null},$Le=async e=>{const{filtersetQuerySessions:t={},filtersetQueryLogs:n={}}=e||{},r=new gw,o=new RI,i=[],a=[],s={};for await(const l of xh(ft(St.WORKOUT_LOG,{query:{limit:KN,...n}}),ht()))for(const c of l)a.push(o.fromJson(c));for(const l of a)s[l.exerciseId]||(s[l.exerciseId]=await pv(l.exerciseId)),l.exerciseObj=s[l.exerciseId];for await(const l of xh(ft(St.SESSION,{query:{limit:KN,...t}}),ht()))for(const c of l){const u=r.fromJson(c);u.logs=a.filter(f=>f.sessionId===u.id),i.push(u)}return i},NLe=async e=>{const t=await it.post(ft(St.SESSION),e,{headers:ht()});return new gw().fromJson(t.data)},LLe=async e=>{const t=await it.patch(ft(St.SESSION,{id:e.id}),e,{headers:ht()});return new gw().fromJson(t.data)};class FLe{constructor(t,n,r,o,i,a,s,l,c){Ce(this,"ingredient",null);Ce(this,"weightUnit",null);this.id=t,this.planId=n,this.mealId=r,this.ingredientId=o,this.weightUnitId=i,this.amount=a,this.datetime=s,l&&(this.ingredient=l),c&&(this.weightUnit=c)}get amountString(){var t;return this.amount.toFixed().toString()+(this.weightUnitId!==null?` ${(t=this.weightUnit)==null?void 0:t.name}`:"g")}get nutritionalValues(){return this.ingredient?qa.fromIngredient(this.ingredient,this.amount,this.weightUnit):(console.log("Diary entry has no ingredient, returning empty NutritionalValues object"),new qa)}}class VB{fromJson(t){return new FLe(t.id,t.plan,t.meal,t.ingredient,t.weight_unit,parseFloat(t.amount),new Date(t.datetime))}toJson(t){return{plan:t.planId,meal:t.mealId,ingredient:t.ingredientId,weight_unit:t.weightUnitId,amount:t.amount.toString(),datetime:t.datetime.toISOString()}}}const tie=async e=>{const t=new VB,{filtersetQuery:n={},loadUnit:r=!0,loadIngredient:o=!0}=e||{},i=ft(St.NUTRITIONAL_DIARY,{query:{limit:KN,...n}}),a=[];for await(const s of xh(i,ht()))for(const l of s){const c=t.fromJson(l);r&&(c.weightUnit=await eie(c.weightUnitId)),o&&(c.ingredient=await DNe(c.ingredientId)),a.push(c)}return a},nie=async e=>{const t=await it.post(ft(St.NUTRITIONAL_DIARY),e,{headers:ht()});return new VB().fromJson(t.data)},jLe=async e=>{const t=await it.patch(ft(St.NUTRITIONAL_DIARY,{id:e.id}),e,{headers:ht()});return new VB().fromJson(t.data)};class BLe{constructor(t){Ce(this,"username");Ce(this,"email");Ce(this,"emailVerified");Ce(this,"dateJoined");Ce(this,"isTrustworthy");Ce(this,"useMetric");Ce(this,"height");Ce(this,"weightRounding");Ce(this,"repetitionsRounding");this.username=t.username,this.email=t.email,this.emailVerified=t.emailVerified,this.dateJoined=t.dateJoined,this.isTrustworthy=t.isTrustworthy,this.useMetric=t.useMetric,this.height=t.height,this.weightRounding=t.weightRounding,this.repetitionsRounding=t.repetitionsRounding}}class rie{constructor(){Ce(this,"fromJson",t=>new BLe({username:t.username,email:t.email,emailVerified:t.email_verified,dateJoined:new Date(t.date_joined),isTrustworthy:t.is_trustworthy,useMetric:t.weight_unit==="kg",height:t.height,weightRounding:t.weight_rounding!==null?parseFloat(t.weight_rounding):null,repetitionsRounding:t.repetitions_rounding!==null?parseFloat(t.repetitions_rounding):null}));Ce(this,"toJson",t=>({email:t.email,height:t.height,weight_unit:t.useMetric?"kg":"lb",weight_rounding:t.weightRounding,repetitions_rounding:t.repetitionsRounding}))}}const zLe="userprofile",VLe=async()=>{const e=ft(zLe),t=new rie;try{const n=await it.get(e,{headers:ht()});return t.fromJson(n.data)}catch{return null}},HLe=async e=>{const t=await it.post(ft(St.API_PROFILE_PATH),e,{headers:ht()});return new rie().fromJson(t.data)},bv="nutritionplan",ULe=async()=>{const{data:e}=await it.get(ft(bv),{headers:ht()});return e.results.map(t=>ly.fromJson(t))},GLe=async()=>{const{data:e}=await it.get(ft(bv,{query:{limit:"1"}}),{headers:ht()});return e.count===0?null:await HB(e.results[0].id)},HB=async(e,t)=>{if(e===null)return null;const{filtersetQueryLogs:n={}}=t||{},{data:r}=await it.get(ft(bv,{id:e}),{headers:ht()}),o=[],i=ly.fromJson(r),a=await Promise.all([HNe(e),tie({filtersetQuery:{plan:e,...n}})]);i.meals=a[0],i.diaryEntries=a[1],i.diaryEntries.forEach(l=>{o.includes(l.ingredientId)||o.push(l.ingredientId)});const s=await Zoe(o);return i.diaryEntries.forEach(l=>{l.ingredient=s.find(c=>c.id===l.ingredientId)}),i.meals.forEach(l=>{l.diaryEntries=i.diaryEntries.filter(c=>c.mealId===l.id)}),i},qLe=async e=>{const t=await it.post(ft(bv),ly.toJson(e),{headers:ht()});return ly.fromJson(t.data)},WLe=async e=>{const t=await it.patch(ft(bv,{id:e.id}),ly.toJson(e),{headers:ht()});return ly.fromJson(t.data)},KLe=async e=>{await it.delete(ft(bv,{id:e}),{headers:ht()})};function YLe(){return yr({queryKey:[st.NUTRITIONAL_PLANS],queryFn:()=>ULe()})}function QLe(){return yr({queryKey:[st.NUTRITIONAL_PLAN,"last"],queryFn:()=>GLe()})}function XLe(e){return yr({queryKey:[st.NUTRITIONAL_PLAN,e],queryFn:()=>HB(e)})}function JLe(e,t,n=!0){return yr({queryKey:[st.NUTRITIONAL_PLAN,e,t],queryFn:()=>HB(e,{filtersetQueryLogs:{datetime__eq:Jn(new Date(t))}}),enabled:n})}const ZLe=()=>{const e=Mt();return Dt({mutationFn:t=>qLe(t),onSuccess:()=>{e.invalidateQueries({queryKey:[st.NUTRITIONAL_PLANS]}),e.invalidateQueries({queryKey:[st.NUTRITIONAL_PLAN]})}})},eFe=e=>{const t=Mt();return Dt({mutationFn:n=>KLe(n),onSuccess:()=>{t.invalidateQueries({queryKey:[st.NUTRITIONAL_PLANS]}),t.invalidateQueries({queryKey:[st.NUTRITIONAL_PLAN,e]})}})},tFe=e=>{const t=Mt();return Dt({mutationFn:n=>WLe(n),onSuccess:()=>{t.invalidateQueries({queryKey:[st.NUTRITIONAL_PLAN,e]}),t.invalidateQueries({queryKey:[st.NUTRITIONAL_PLANS]})}})},nFe=e=>yr({queryFn:()=>tie(e),queryKey:[st.NUTRITIONAL_PLAN_DIARY,JSON.stringify(e||{})]}),rFe=e=>{const t=Mt();return Dt({mutationFn:n=>nie(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.NUTRITIONAL_PLAN,e]})})},oie=e=>{const t=Mt();return Dt({mutationFn:n=>Promise.all(n.map(r=>nie(r))),onSuccess:()=>t.invalidateQueries({queryKey:[st.NUTRITIONAL_PLAN,e]})})},oFe=e=>{const t=Mt();return Dt({mutationFn:n=>jLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.NUTRITIONAL_PLAN,e]})})},iFe=e=>{const t=Mt();return Dt({mutationFn:n=>BNe(n),onSuccess:()=>{t.invalidateQueries({queryKey:[st.NUTRITIONAL_PLAN,e]})}})},aFe=e=>{const t=Mt();return Dt({mutationFn:n=>VNe(n),onSuccess:()=>{t.invalidateQueries({queryKey:[st.NUTRITIONAL_PLAN,e]})}})},sFe=e=>{const t=Mt();return Dt({mutationFn:n=>zNe(n),onSuccess:()=>{t.invalidateQueries({queryKey:[st.NUTRITIONAL_PLAN,e]})}})},lFe=e=>{const t=Mt();return Dt({mutationFn:n=>$Ne(n),onSuccess:()=>{t.invalidateQueries({queryKey:[st.NUTRITIONAL_PLAN,e]})}})},cFe=e=>{const t=Mt();return Dt({mutationFn:n=>NNe(n),onSuccess:()=>{t.invalidateQueries({queryKey:[st.NUTRITIONAL_PLAN,e]})}})},uFe=e=>{const t=Mt();return Dt({mutationFn:n=>LNe(n),onSuccess:()=>{t.invalidateQueries({queryKey:[st.NUTRITIONAL_PLAN,e]})}})};function _i(e,t){return e.toLocaleString(t,{maximumFractionDigits:0})}function iie(e,t,n){return e.toLocaleString(t,{maximumFractionDigits:0,unit:n.valueOf(),style:"unit"})}function $n(e,t){return iie(e,t,"gram")}function JR(e,t){return iie(e,t,"percent")}const Lg=e=>{const{i18n:t}=je(),n=e.planned>0;return Q(Tt,{children:[S(Cne,{variant:"determinate",value:e.percentage<100?e.percentage:100}),Q(at,{variant:"caption",children:[e.title," — ",$n(e.logged,t.language),n&&Q(Tt,{children:[" / ",$n(e.planned,t.language)]})]})]})};var ZR,Kq;function Aa(){if(Kq)return ZR;Kq=1;var e=Array.isArray;return ZR=e,ZR}var eD,Yq;function aie(){if(Yq)return eD;Yq=1;var e=typeof f1=="object"&&f1&&f1.Object===Object&&f1;return eD=e,eD}var tD,Qq;function Hc(){if(Qq)return tD;Qq=1;var e=aie(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return tD=n,tD}var nD,Xq;function bw(){if(Xq)return nD;Xq=1;var e=Hc(),t=e.Symbol;return nD=t,nD}var rD,Jq;function dFe(){if(Jq)return rD;Jq=1;var e=bw(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,o=e?e.toStringTag:void 0;function i(a){var s=n.call(a,o),l=a[o];try{a[o]=void 0;var c=!0}catch{}var u=r.call(a);return c&&(s?a[o]=l:delete a[o]),u}return rD=i,rD}var oD,Zq;function fFe(){if(Zq)return oD;Zq=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return oD=n,oD}var iD,eW;function Zu(){if(eW)return iD;eW=1;var e=bw(),t=dFe(),n=fFe(),r="[object Null]",o="[object Undefined]",i=e?e.toStringTag:void 0;function a(s){return s==null?s===void 0?o:r:i&&i in Object(s)?t(s):n(s)}return iD=a,iD}var aD,tW;function ed(){if(tW)return aD;tW=1;function e(t){return t!=null&&typeof t=="object"}return aD=e,aD}var sD,nW;function xv(){if(nW)return sD;nW=1;var e=Zu(),t=ed(),n="[object Symbol]";function r(o){return typeof o=="symbol"||t(o)&&e(o)==n}return sD=r,sD}var lD,rW;function UB(){if(rW)return lD;rW=1;var e=Aa(),t=xv(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function o(i,a){if(e(i))return!1;var s=typeof i;return s=="number"||s=="symbol"||s=="boolean"||i==null||t(i)?!0:r.test(i)||!n.test(i)||a!=null&&i in Object(a)}return lD=o,lD}var cD,oW;function jf(){if(oW)return cD;oW=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return cD=e,cD}var uD,iW;function GB(){if(iW)return uD;iW=1;var e=Zu(),t=jf(),n="[object AsyncFunction]",r="[object Function]",o="[object GeneratorFunction]",i="[object Proxy]";function a(s){if(!t(s))return!1;var l=e(s);return l==r||l==o||l==n||l==i}return uD=a,uD}var dD,aW;function pFe(){if(aW)return dD;aW=1;var e=Hc(),t=e["__core-js_shared__"];return dD=t,dD}var fD,sW;function hFe(){if(sW)return fD;sW=1;var e=pFe(),t=function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function n(r){return!!t&&t in r}return fD=n,fD}var pD,lW;function sie(){if(lW)return pD;lW=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return pD=n,pD}var hD,cW;function mFe(){if(cW)return hD;cW=1;var e=GB(),t=hFe(),n=jf(),r=sie(),o=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,a=Function.prototype,s=Object.prototype,l=a.toString,c=s.hasOwnProperty,u=RegExp("^"+l.call(c).replace(o,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function f(h){if(!n(h)||t(h))return!1;var m=e(h)?u:i;return m.test(r(h))}return hD=f,hD}var mD,uW;function gFe(){if(uW)return mD;uW=1;function e(t,n){return t==null?void 0:t[n]}return mD=e,mD}var gD,dW;function Vh(){if(dW)return gD;dW=1;var e=mFe(),t=gFe();function n(r,o){var i=t(r,o);return e(i)?i:void 0}return gD=n,gD}var yD,fW;function _I(){if(fW)return yD;fW=1;var e=Vh(),t=e(Object,"create");return yD=t,yD}var vD,pW;function yFe(){if(pW)return vD;pW=1;var e=_I();function t(){this.__data__=e?e(null):{},this.size=0}return vD=t,vD}var bD,hW;function vFe(){if(hW)return bD;hW=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return bD=e,bD}var xD,mW;function bFe(){if(mW)return xD;mW=1;var e=_I(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function o(i){var a=this.__data__;if(e){var s=a[i];return s===t?void 0:s}return r.call(a,i)?a[i]:void 0}return xD=o,xD}var SD,gW;function xFe(){if(gW)return SD;gW=1;var e=_I(),t=Object.prototype,n=t.hasOwnProperty;function r(o){var i=this.__data__;return e?i[o]!==void 0:n.call(i,o)}return SD=r,SD}var wD,yW;function SFe(){if(yW)return wD;yW=1;var e=_I(),t="__lodash_hash_undefined__";function n(r,o){var i=this.__data__;return this.size+=this.has(r)?0:1,i[r]=e&&o===void 0?t:o,this}return wD=n,wD}var CD,vW;function wFe(){if(vW)return CD;vW=1;var e=yFe(),t=vFe(),n=bFe(),r=xFe(),o=SFe();function i(a){var s=-1,l=a==null?0:a.length;for(this.clear();++s<l;){var c=a[s];this.set(c[0],c[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=o,CD=i,CD}var ED,bW;function CFe(){if(bW)return ED;bW=1;function e(){this.__data__=[],this.size=0}return ED=e,ED}var TD,xW;function qB(){if(xW)return TD;xW=1;function e(t,n){return t===n||t!==t&&n!==n}return TD=e,TD}var OD,SW;function $I(){if(SW)return OD;SW=1;var e=qB();function t(n,r){for(var o=n.length;o--;)if(e(n[o][0],r))return o;return-1}return OD=t,OD}var ID,wW;function EFe(){if(wW)return ID;wW=1;var e=$I(),t=Array.prototype,n=t.splice;function r(o){var i=this.__data__,a=e(i,o);if(a<0)return!1;var s=i.length-1;return a==s?i.pop():n.call(i,a,1),--this.size,!0}return ID=r,ID}var PD,CW;function TFe(){if(CW)return PD;CW=1;var e=$I();function t(n){var r=this.__data__,o=e(r,n);return o<0?void 0:r[o][1]}return PD=t,PD}var AD,EW;function OFe(){if(EW)return AD;EW=1;var e=$I();function t(n){return e(this.__data__,n)>-1}return AD=t,AD}var MD,TW;function IFe(){if(TW)return MD;TW=1;var e=$I();function t(n,r){var o=this.__data__,i=e(o,n);return i<0?(++this.size,o.push([n,r])):o[i][1]=r,this}return MD=t,MD}var RD,OW;function NI(){if(OW)return RD;OW=1;var e=CFe(),t=EFe(),n=TFe(),r=OFe(),o=IFe();function i(a){var s=-1,l=a==null?0:a.length;for(this.clear();++s<l;){var c=a[s];this.set(c[0],c[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=o,RD=i,RD}var DD,IW;function WB(){if(IW)return DD;IW=1;var e=Vh(),t=Hc(),n=e(t,"Map");return DD=n,DD}var kD,PW;function PFe(){if(PW)return kD;PW=1;var e=wFe(),t=NI(),n=WB();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return kD=r,kD}var _D,AW;function AFe(){if(AW)return _D;AW=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return _D=e,_D}var $D,MW;function LI(){if(MW)return $D;MW=1;var e=AFe();function t(n,r){var o=n.__data__;return e(r)?o[typeof r=="string"?"string":"hash"]:o.map}return $D=t,$D}var ND,RW;function MFe(){if(RW)return ND;RW=1;var e=LI();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return ND=t,ND}var LD,DW;function RFe(){if(DW)return LD;DW=1;var e=LI();function t(n){return e(this,n).get(n)}return LD=t,LD}var FD,kW;function DFe(){if(kW)return FD;kW=1;var e=LI();function t(n){return e(this,n).has(n)}return FD=t,FD}var jD,_W;function kFe(){if(_W)return jD;_W=1;var e=LI();function t(n,r){var o=e(this,n),i=o.size;return o.set(n,r),this.size+=o.size==i?0:1,this}return jD=t,jD}var BD,$W;function KB(){if($W)return BD;$W=1;var e=PFe(),t=MFe(),n=RFe(),r=DFe(),o=kFe();function i(a){var s=-1,l=a==null?0:a.length;for(this.clear();++s<l;){var c=a[s];this.set(c[0],c[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=o,BD=i,BD}var zD,NW;function lie(){if(NW)return zD;NW=1;var e=KB(),t="Expected a function";function n(r,o){if(typeof r!="function"||o!=null&&typeof o!="function")throw new TypeError(t);var i=function(){var a=arguments,s=o?o.apply(this,a):a[0],l=i.cache;if(l.has(s))return l.get(s);var c=r.apply(this,a);return i.cache=l.set(s,c)||l,c};return i.cache=new(n.Cache||e),i}return n.Cache=e,zD=n,zD}var VD,LW;function _Fe(){if(LW)return VD;LW=1;var e=lie(),t=500;function n(r){var o=e(r,function(a){return i.size===t&&i.clear(),a}),i=o.cache;return o}return VD=n,VD}var HD,FW;function $Fe(){if(FW)return HD;FW=1;var e=_Fe(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=e(function(o){var i=[];return o.charCodeAt(0)===46&&i.push(""),o.replace(t,function(a,s,l,c){i.push(l?c.replace(n,"$1"):s||a)}),i});return HD=r,HD}var UD,jW;function YB(){if(jW)return UD;jW=1;function e(t,n){for(var r=-1,o=t==null?0:t.length,i=Array(o);++r<o;)i[r]=n(t[r],r,t);return i}return UD=e,UD}var GD,BW;function NFe(){if(BW)return GD;BW=1;var e=bw(),t=YB(),n=Aa(),r=xv(),o=e?e.prototype:void 0,i=o?o.toString:void 0;function a(s){if(typeof s=="string")return s;if(n(s))return t(s,a)+"";if(r(s))return i?i.call(s):"";var l=s+"";return l=="0"&&1/s==-1/0?"-0":l}return GD=a,GD}var qD,zW;function cie(){if(zW)return qD;zW=1;var e=NFe();function t(n){return n==null?"":e(n)}return qD=t,qD}var WD,VW;function uie(){if(VW)return WD;VW=1;var e=Aa(),t=UB(),n=$Fe(),r=cie();function o(i,a){return e(i)?i:t(i,a)?[i]:n(r(i))}return WD=o,WD}var KD,HW;function FI(){if(HW)return KD;HW=1;var e=xv();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return KD=t,KD}var YD,UW;function QB(){if(UW)return YD;UW=1;var e=uie(),t=FI();function n(r,o){o=e(o,r);for(var i=0,a=o.length;r!=null&&i<a;)r=r[t(o[i++])];return i&&i==a?r:void 0}return YD=n,YD}var QD,GW;function die(){if(GW)return QD;GW=1;var e=QB();function t(n,r,o){var i=n==null?void 0:e(n,r);return i===void 0?o:i}return QD=t,QD}var LFe=die();const Ja=Gn(LFe);var XD,qW;function FFe(){if(qW)return XD;qW=1;function e(t){return t==null}return XD=e,XD}var jFe=FFe();const on=Gn(jFe);var JD,WW;function BFe(){if(WW)return JD;WW=1;var e=Zu(),t=Aa(),n=ed(),r="[object String]";function o(i){return typeof i=="string"||!t(i)&&n(i)&&e(i)==r}return JD=o,JD}var zFe=BFe();const Sh=Gn(zFe);var VFe=GB();const rn=Gn(VFe);var HFe=jf();const Sv=Gn(HFe);var ZD={exports:{}},cr={};/**
+`+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=yh(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&vE.assertOptions(r,{silentJSONParsing:uc.transitional(uc.boolean),forcedJSONParsing:uc.transitional(uc.boolean),clarifyTimeoutError:uc.transitional(uc.boolean)},!1),o!=null&&(Ue.isFunction(o)?n.paramsSerializer={serialize:o}:vE.assertOptions(o,{encode:uc.function,serialize:uc.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),vE.assertOptions(n,{baseUrl:uc.spelling("baseURL"),withXsrfToken:uc.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&Ue.merge(i.common,i[n.method]);i&&Ue.forEach(["delete","get","head","post","put","patch","common"],g=>{delete i[g]}),n.headers=Ia.concat(a,i);const s=[];let l=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(n)===!1||(l=l&&y.synchronous,s.unshift(y.fulfilled,y.rejected))});const c=[];this.interceptors.response.forEach(function(y){c.push(y.fulfilled,y.rejected)});let u,f=0,h;if(!l){const g=[z6.bind(this),void 0];for(g.unshift.apply(g,s),g.push.apply(g,c),h=g.length,u=Promise.resolve(n);f<h;)u=u.then(g[f++],g[f++]);return u}h=s.length;let m=n;for(f=0;f<h;){const g=s[f++],y=s[f++];try{m=g(m)}catch(v){y.call(this,v);break}}try{u=z6.call(this,m)}catch(g){return Promise.reject(g)}for(f=0,h=c.length;f<h;)u=u.then(c[f++],c[f++]);return u}getUri(t){t=yh(this.defaults,t);const n=sre(t.baseURL,t.url,t.allowAbsoluteUrls);return nre(n,t.params,t.paramsSerializer)}};Ue.forEach(["delete","get","head","options"],function(t){rh.prototype[t]=function(n,r){return this.request(yh(r||{},{method:t,url:n,data:(r||{}).data}))}});Ue.forEach(["post","put","patch"],function(t){function n(r){return function(i,a,s){return this.request(yh(s||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}rh.prototype[t]=n(),rh.prototype[t+"Form"]=n(!0)});let DDe=class pre{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(o=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const a=new Promise(s=>{r.subscribe(s),i=s}).then(o);return a.cancel=function(){r.unsubscribe(i)},a},t(function(i,a,s){r.reason||(r.reason=new uv(i,a,s),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new pre(function(o){t=o}),cancel:t}}};function kDe(e){return function(n){return e.apply(null,n)}}function _De(e){return Ue.isObject(e)&&e.isAxiosError===!0}const zN={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(zN).forEach(([e,t])=>{zN[t]=e});function hre(e){const t=new rh(e),n=Une(rh.prototype.request,t);return Ue.extend(n,rh.prototype,t,{allOwnKeys:!0}),Ue.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return hre(yh(e,o))},n}const it=hre(dw);it.Axios=rh;it.CanceledError=uv;it.CancelToken=DDe;it.isCancel=ire;it.VERSION=fre;it.toFormData=vI;it.AxiosError=Sn;it.Cancel=it.CanceledError;it.all=function(t){return Promise.all(t)};it.spread=kDe;it.isAxiosError=_De;it.mergeConfig=yh;it.AxiosHeaders=Ia;it.formToJSON=e=>ore(Ue.isHTMLForm(e)?new FormData(e):e);it.getAdapter=dre.getAdapter;it.HttpStatusCode=zN;it.default=it;const{Axios:dAt,AxiosError:fAt,CanceledError:pAt,isCancel:hAt,CancelToken:mAt,VERSION:gAt,all:yAt,Cancel:vAt,isAxiosError:bAt,spread:xAt,toFormData:SAt,AxiosHeaders:wAt,HttpStatusCode:CAt,formToJSON:EAt,getAdapter:TAt,mergeConfig:OAt}=it,_g={protein:4,carbohydrates:4,fat:9};class qa{constructor(t){Ce(this,"bodyWeight",0);Ce(this,"energy",0);Ce(this,"protein",0);Ce(this,"carbohydrates",0);Ce(this,"carbohydratesSugar",0);Ce(this,"fat",0);Ce(this,"fatSaturated",0);Ce(this,"fiber",0);Ce(this,"sodium",0);this.energy=(t==null?void 0:t.energy)??0,this.protein=(t==null?void 0:t.protein)??0,this.carbohydrates=(t==null?void 0:t.carbohydrates)??0,this.carbohydratesSugar=(t==null?void 0:t.carbohydratesSugar)??0,this.fat=(t==null?void 0:t.fat)??0,this.fatSaturated=(t==null?void 0:t.fatSaturated)??0,this.fiber=(t==null?void 0:t.fiber)??0,this.sodium=(t==null?void 0:t.sodium)??0,this.bodyWeight=(t==null?void 0:t.bodyWeight)??0}get energyKj(){return this.energy*4.184}get isEmpty(){return this.energy===0&&this.protein===0&&this.carbohydrates===0&&this.fat===0}get percent(){return{protein:this.protein>0?this.protein*_g.protein/this.energy*100:0,carbohydrates:this.carbohydrates>0?this.carbohydrates*_g.carbohydrates/this.energy*100:0,fat:this.fat>0?this.fat*_g.fat/this.energy*100:0}}get perBodyKg(){return{protein:this.bodyWeight>0?this.protein/this.bodyWeight:0,carbohydrates:this.bodyWeight>0?this.carbohydrates/this.bodyWeight:0,fat:this.bodyWeight>0?this.fat/this.bodyWeight:0}}static fromIngredient(t,n,r){const o=new qa,i=r===null?n:n*r.amount*r.grams;return o.energy=t.energy*i/100,o.protein=t.protein*i/100,o.carbohydrates=t.carbohydrates*i/100,o.carbohydratesSugar=t.carbohydratesSugar?t.carbohydratesSugar*i/100:0,o.fat=t.fat*i/100,o.fatSaturated=t.fatSaturated?t.fatSaturated*i/100:0,o.fiber=t.fiber?t.fiber*i/100:0,o.sodium=t.sodium?t.sodium*i/100:0,o}add(t){return this.energy+=t.energy,this.protein+=t.protein,this.carbohydrates+=t.carbohydrates,this.carbohydratesSugar+=t.carbohydratesSugar,this.fat+=t.fat,this.fatSaturated+=t.fatSaturated,this.fiber+=t.fiber,this.sodium+=t.sodium,this}toString(){return`e: ${this.energy}, p: ${this.protein}, c: ${this.carbohydrates}, cS: ${this.carbohydratesSugar}, f: ${this.fat}, fS: ${this.fatSaturated}, fi: ${this.fiber}, s: ${this.sodium}`}equals(t){return this.energy===t.energy&&this.protein===t.protein&&this.carbohydrates===t.carbohydrates&&this.carbohydratesSugar===t.carbohydratesSugar&&this.fat===t.fat&&this.fatSaturated===t.fatSaturated&&this.fiber===t.fiber&&this.sodium===t.sodium}}function Zn(e){return e.toISOString().split("T")[0]}function xa(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function nT(e,t){return e==null?null:e.toLocaleTimeString(t?[t]:[],{hour:"2-digit",minute:"2-digit"})}function Dx(e){if(e==null)return null;const[t,n]=e.toTimeString().split(":");return`${t}:${n}`}function VN(e){if(e==null)return null;const[t,n]=e.split(":",2),r=new Date;return r.setHours(parseInt(t)),r.setMinutes(parseInt(n)),r}function $De(e,t=new Date){const r={lastWeek:()=>t.setDate(t.getDate()-7),lastMonth:()=>t.setMonth(t.getMonth()-1),lastHalfYear:()=>t.setMonth(t.getMonth()-6),lastYear:()=>t.setFullYear(t.getFullYear()-1),"":void 0}[e];if(r)r();else return;return Zn(t)}class mre{constructor(t,n,r,o){Ce(this,"items",[]);Ce(this,"diaryEntries",[]);this.id=t,this.order=n,this.time=r,this.name=o}get timeHHMMLocale(){return nT(this.time)}get displayName(){return this.name?this.name:this.timeHHMMLocale}get diaryEntriesToday(){return this.diaryEntries.filter(t=>xa(t.datetime,new Date))}get plannedNutritionalValues(){const t=new qa;for(const n of this.items)t.add(n.nutritionalValues);return t}get loggedNutritionalValuesToday(){const t=new qa;for(const n of this.diaryEntriesToday)t.add(n.nutritionalValues);return t}}class xB{fromJson(t){return new mre(t.id,t.order,VN(t.time),t.name)}toJson(t){return{name:t.name,order:t.order,time:nT(t.time)}}}const bE=-1;class SI{constructor(t){Ce(this,"id");Ce(this,"creationDate");Ce(this,"start");Ce(this,"end");Ce(this,"description");Ce(this,"onlyLogging");Ce(this,"goalEnergy");Ce(this,"goalProtein");Ce(this,"goalCarbohydrates");Ce(this,"goalFiber");Ce(this,"goalSodium");Ce(this,"goalFat");Ce(this,"goalFatsSaturated");Ce(this,"meals",[]);Ce(this,"diaryEntries",[]);this.id=t.id??null,this.creationDate=t.creationDate??new Date,this.start=t.start??this.creationDate,this.end=t.end??null,this.description=t.description??"",this.onlyLogging=t.onlyLogging??!1,this.goalEnergy=t.goalEnergy??null,this.goalProtein=t.goalProtein??null,this.goalCarbohydrates=t.goalCarbohydrates??null,this.goalFiber=t.goalFiber??null,this.goalSodium=t.goalSodium??null,this.goalFat=t.goalFat??null,this.goalFatsSaturated=t.goalFatsSaturated??null}get hasAnyGoals(){return this.goalEnergy!==null||this.goalProtein!==null||this.goalCarbohydrates!==null||this.goalFat!==null}get hasAnyAdvancedGoals(){return this.goalFiber!==null||this.goalSodium!==null||this.goalFatsSaturated!==null}get hasAnyPlanned(){return this.hasAnyGoals||this.plannedNutritionalValues.energy>0}get plannedNutritionalValues(){if(this.hasAnyGoals)return new qa({energy:this.goalEnergy,carbohydrates:this.goalCarbohydrates,protein:this.goalProtein,fat:this.goalFat});const t=new qa;for(const n of this.meals)t.add(n.plannedNutritionalValues);return t}get loggedNutritionalValues7DayAvg(){const t=new Date,n=new Date(t.getTime()-7*24*60*60*1e3),r=this.diaryEntries.filter(o=>o.datetime>=n);return this.getAverageNutritionalValuesFromDiaryEntries(r)}get loggedNutritionalValuesToday(){const t=this.diaryEntries.filter(n=>xa(n.datetime,new Date));return this.getNutritionalValuesFromDiaryEntries(t)}get groupDiaryEntries(){return this.diaryEntries.reduce((t,n)=>{const r=n.datetime.toISOString().split("T")[0],o=t.get(r)||{entries:[],nutritionalValues:new qa};return o.entries.push(n),o.nutritionalValues.add(n.nutritionalValues),t.set(r,o),t},new Map)}get percentageValuesLoggedToday(){return new qa({protein:this.loggedNutritionalValuesToday.protein/this.plannedNutritionalValues.protein*100,carbohydrates:this.loggedNutritionalValuesToday.carbohydrates/this.plannedNutritionalValues.carbohydrates*100,fat:this.loggedNutritionalValuesToday.fat/this.plannedNutritionalValues.fat*100})}copyWith(t){return new SI({id:t.id!==void 0?t.id:this.id,creationDate:t.creationDate!==void 0?t.creationDate:this.creationDate,start:t.start!==void 0?t.start:this.start,end:t.end!==void 0?t.end:this.end,description:t.description!==void 0?t.description:this.description,onlyLogging:t.onlyLogging!==void 0?t.onlyLogging:this.onlyLogging,goalEnergy:t.goalEnergy!==void 0?t.goalEnergy:this.goalEnergy,goalProtein:t.goalProtein!==void 0?t.goalProtein:this.goalProtein,goalCarbohydrates:t.goalCarbohydrates!==void 0?t.goalCarbohydrates:this.goalCarbohydrates,goalFiber:t.goalFiber!==void 0?t.goalFiber:this.goalFiber,goalSodium:t.goalSodium!==void 0?t.goalSodium:this.goalSodium,goalFat:t.goalFat!==void 0?t.goalFat:this.goalFat,goalFatsSaturated:t.goalFatsSaturated!==void 0?t.goalFatsSaturated:this.goalFatsSaturated})}pseudoMealOthers(t){const n=new mre(bE,-1,null,t);return n.diaryEntries=this.diaryEntries.filter(r=>r.mealId===null),n}loggedNutritionalValuesDate(t){return this.getNutritionalValuesFromDiaryEntries(this.loggedEntriesDate(t))}loggedEntriesDate(t){return this.diaryEntries.filter(n=>xa(n.datetime,t))}getAverageNutritionalValuesFromDiaryEntries(t){const n=t.length,r=this.getNutritionalValuesFromDiaryEntries(t);return n===0||(r.energy=r.energy/n,r.protein=r.protein/n,r.carbohydrates=r.carbohydrates/n,r.carbohydratesSugar=r.carbohydratesSugar/n,r.fat=r.fat/n,r.fatSaturated=r.fatSaturated/n,r.fiber=r.fiber/n,r.sodium=r.sodium/n),r}getNutritionalValuesFromDiaryEntries(t){return t.reduce((n,r)=>n.add(r.nutritionalValues),new qa)}}class NDe{fromJson(t){return new SI({id:t.id,creationDate:new Date(t.creation_date),start:new Date(t.start),end:t.end!==null?new Date(t.end):null,description:t.description,onlyLogging:t.only_logging,goalEnergy:t.goal_energy,goalProtein:t.goal_protein,goalCarbohydrates:t.goal_carbohydrates,goalFiber:t.goal_fiber,goalSodium:null,goalFat:t.goal_fat,goalFatsSaturated:null})}toJson(t){return{...t.id!=null?{id:t.id}:{},start:Zn(t.start),end:t.end?Zn(t.end):null,description:t.description,only_logging:t.onlyLogging,goal_energy:t.goalEnergy,goal_protein:t.goalProtein,goal_carbohydrates:t.goalCarbohydrates,goal_fiber:t.goalFiber,goal_sodium:t.goalSodium,goal_fat:t.goalFat,goal_fats_saturated:t.goalFatsSaturated}}}const ly=new NDe;class gre{constructor(t,n,r){this.date=t,this.weight=n,this.id=r}}class SB{fromJson(t){return new gre(new Date(t.date),parseFloat(t.weight),t.id)}toJson(t){return{id:t.id,date:Zn(t.date),weight:t.weight}}}const LDe="/static/react",wB="",FDe="",jDe=void 0;var xE={exports:{}},BDe=xE.exports,H6;function zDe(){return H6||(H6=1,function(e){(function(t){let n;function r(u,f){const h=u.charCodeAt(f);if(isNaN(h))throw new RangeError("Index "+f+' out of range for string "'+u+'"; please open an issue at https://github.com/Trott/slug/issues/new');if(h<55296||h>57343)return[u.charAt(f),f];if(h>=55296&&h<=56319){if(u.length<=f+1)return[" ",f];const g=u.charCodeAt(f+1);return g<56320||g>57343?[" ",f]:[u.charAt(f)+u.charAt(f+1),f+1]}if(f===0)return[" ",f];const m=u.charCodeAt(f-1);if(m<55296||m>56319)return[" ",f];throw new Error('String "'+u+'" reaches code believed to be unreachable; please open an issue at https://github.com/Trott/slug/issues/new')}typeof window<"u"?window.btoa?n=function(u){return btoa(unescape(encodeURIComponent(u)))}:n=function(u){const f=unescape(encodeURIComponent(u+""));let h="";for(let m,g,y=0,v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";f.charAt(y|0)||(v="=",y%1);h+=v.charAt(63&m>>8-y%1*8)){if(g=f.charCodeAt(y+=3/4),g>255)throw new Error("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");m=m<<8|g}return h}:n=function(u){return Buffer.from(u).toString("base64")};function o(u,f){let h=s(u,f);if((f&&f.fallback!==void 0?f.fallback:o.defaults.fallback)===!0&&h===""){let g="";for(let y=0;y<u.length;y++){const v=r(u,y);y=v[1],g+=v[0]}h=s(n(g),f)}return h}const i={bg:{Й:"Y",й:"y",X:"H",x:"h",Ц:"Ts",ц:"ts",Щ:"Sht",щ:"sht",Ъ:"A",ъ:"a",Ь:"Y",ь:"y"},de:{Ä:"AE",ä:"ae",Ö:"OE",ö:"oe",Ü:"UE",ü:"ue"},sr:{đ:"dj",Đ:"DJ"},uk:{И:"Y",и:"y",Й:"Y",й:"y",Ц:"Ts",ц:"ts",Х:"Kh",х:"kh",Щ:"Shch",щ:"shch",Г:"H",г:"h"}};let a={};function s(u,f){if(typeof u!="string")throw new Error("slug() requires a string argument, received "+typeof u);typeof f=="string"&&(f={replacement:f}),f=f?Object.assign({},f):{},f.mode=f.mode||o.defaults.mode;const h=o.defaults.modes[f.mode],m=["replacement","multicharmap","charmap","remove","lower","trim"];for(let C,E=0,I=m.length;E<I;E++)C=m[E],f[C]=C in f?f[C]:h[C];const g=i[f.locale]||a;let y=[];for(const C in f.multicharmap){if(!Object.prototype.hasOwnProperty.call(f.multicharmap,C))continue;const E=C.length;y.indexOf(E)===-1&&y.push(E)}y=y.sort(function(C,E){return E-C});const v=f.mode==="rfc3986"?/[^\w\s\-.~]/:/[^A-Za-z0-9\s]/;let w="";for(let C,E=0,I=u.length;E<I;E++){C=u[E];let O=!1;for(let P=0;P<y.length;P++){const R=y[P],D=u.substr(E,R);if(f.multicharmap[D]){E+=R-1,C=f.multicharmap[D],O=!0;break}}O||(g[C]?C=g[C]:f.charmap[C]?C=f.charmap[C].replace(f.replacement," "):C.includes(f.replacement)?C=C.replace(f.replacement," "):C=C.replace(v,"")),w+=C}return f.remove&&(w=w.replace(f.remove,"")),f.trim&&(w=w.trim()),w=w.replace(/\s+/g,f.replacement),f.lower&&(w=w.toLowerCase()),w}const l={फ़:"Fi",ग़:"Ghi",ख़:"Khi",क़:"Qi",ड़:"ugDha",ढ़:"ugDhha",य़:"Yi",ज़:"Za",בִי:"i",בֵ:"e",בֵי:"e",בֶ:"e",בַ:"a",בָ:"a",בֹ:"o",וֹ:"o",בֻ:"u",וּ:"u",בּ:"b",כּ:"k",ךּ:"k",פּ:"p",שׁ:"sh",שׂ:"s",בְ:"e",חֱ:"e",חֲ:"a",חֳ:"o",בִ:"i"},c={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Æ:"AE",Ç:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ő:"O",Ø:"O",Ō:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ű:"U",Ý:"Y",Þ:"TH",ß:"ss",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",æ:"ae",ç:"c",è:"e",é:"e",ê:"e",ë:"e",ì:"i",í:"i",î:"i",ï:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ő:"o",ø:"o",ō:"o",Œ:"OE",œ:"oe",ù:"u",ú:"u",û:"u",ü:"u",ű:"u",ý:"y",þ:"th",ÿ:"y","ẞ":"SS",α:"a",β:"b",γ:"g",δ:"d",ε:"e",ζ:"z",η:"h",θ:"th",ι:"i",κ:"k",λ:"l",μ:"m",ν:"n",ξ:"3",ο:"o",π:"p",ρ:"r",σ:"s",τ:"t",υ:"y",φ:"f",χ:"x",ψ:"ps",ω:"w",ά:"a",έ:"e",ί:"i",ό:"o",ύ:"y",ή:"h",ώ:"w",ς:"s",ϊ:"i",ΰ:"y",ϋ:"y",ΐ:"i",Α:"A",Β:"B",Γ:"G",Δ:"D",Ε:"E",Ζ:"Z",Η:"H",Θ:"Th",Ι:"I",Κ:"K",Λ:"L",Μ:"M",Ν:"N",Ξ:"3",Ο:"O",Π:"P",Ρ:"R",Σ:"S",Τ:"T",Υ:"Y",Φ:"F",Χ:"X",Ψ:"PS",Ω:"W",Ά:"A",Έ:"E",Ί:"I",Ό:"O",Ύ:"Y",Ή:"H",Ώ:"W",Ϊ:"I",Ϋ:"Y",ş:"s",Ş:"S",ı:"i",İ:"I",ğ:"g",Ğ:"G",а:"a",б:"b",в:"v",г:"g",д:"d",е:"e",ё:"yo",ж:"zh",з:"z",и:"i",й:"j",к:"k",л:"l",м:"m",н:"n",о:"o",п:"p",р:"r",с:"s",т:"t",у:"u",ф:"f",х:"h",ц:"c",ч:"ch",ш:"sh",щ:"sh",ъ:"u",ы:"y",ь:"",э:"e",ю:"yu",я:"ya",А:"A",Б:"B",В:"V",Г:"G",Д:"D",Е:"E",Ё:"Yo",Ж:"Zh",З:"Z",И:"I",Й:"J",К:"K",Л:"L",М:"M",Н:"N",О:"O",П:"P",Р:"R",С:"S",Т:"T",У:"U",Ф:"F",Х:"H",Ц:"C",Ч:"Ch",Ш:"Sh",Щ:"Sh",Ъ:"U",Ы:"Y",Ь:"",Э:"E",Ю:"Yu",Я:"Ya",Є:"Ye",І:"I",Ї:"Yi",Ґ:"G",є:"ye",і:"i",ї:"yi",ґ:"g",č:"c",ď:"d",ě:"e",ň:"n",ř:"r",š:"s",ť:"t",ů:"u",ž:"z",Č:"C",Ď:"D",Ě:"E",Ň:"N",Ř:"R",Š:"S",Ť:"T",Ů:"U",Ž:"Z",ľ:"l",ĺ:"l",ŕ:"r",Ľ:"L",Ĺ:"L",Ŕ:"R",ą:"a",ć:"c",ę:"e",ł:"l",ń:"n",ś:"s",ź:"z",ż:"z",Ą:"A",Ć:"C",Ę:"E",Ł:"L",Ń:"N",Ś:"S",Ź:"Z",Ż:"Z",ā:"a",ē:"e",ģ:"g",ī:"i",ķ:"k",ļ:"l",ņ:"n",ū:"u",Ā:"A",Ē:"E",Ģ:"G",Ī:"I",Ķ:"K",Ļ:"L",Ņ:"N",Ū:"U",أ:"a",إ:"i",ب:"b",ت:"t",ث:"th",ج:"g",ح:"h",خ:"kh",د:"d",ذ:"th",ر:"r",ز:"z",س:"s",ش:"sh",ص:"s",ض:"d",ط:"t",ظ:"th",ع:"aa",غ:"gh",ف:"f",ق:"k",ك:"k",ل:"l",م:"m",ن:"n",ه:"h",و:"o",ي:"y",ء:"aa",ة:"a",آ:"a",ا:"a",پ:"p",ژ:"zh",گ:"g",چ:"ch",ک:"k",ی:"i",ė:"e",į:"i",ų:"u",Ė:"E",Į:"I",Ų:"U",ț:"t",Ț:"T",ţ:"t",Ţ:"T",ș:"s",Ș:"S",ă:"a",Ă:"A",Ạ:"A",Ả:"A",Ầ:"A",Ấ:"A",Ậ:"A",Ẩ:"A",Ẫ:"A",Ằ:"A",Ắ:"A",Ặ:"A",Ẳ:"A",Ẵ:"A",Ẹ:"E",Ẻ:"E",Ẽ:"E",Ề:"E",Ế:"E",Ệ:"E",Ể:"E",Ễ:"E",Ị:"I",Ỉ:"I",Ĩ:"I",Ọ:"O",Ỏ:"O",Ồ:"O",Ố:"O",Ộ:"O",Ổ:"O",Ỗ:"O",Ơ:"O",Ờ:"O",Ớ:"O",Ợ:"O",Ở:"O",Ỡ:"O",Ụ:"U",Ủ:"U",Ũ:"U",Ư:"U",Ừ:"U",Ứ:"U",Ự:"U",Ử:"U",Ữ:"U",Ỳ:"Y",Ỵ:"Y",Ỷ:"Y",Ỹ:"Y",Đ:"D",ạ:"a",ả:"a",ầ:"a",ấ:"a",ậ:"a",ẩ:"a",ẫ:"a",ằ:"a",ắ:"a",ặ:"a",ẳ:"a",ẵ:"a",ẹ:"e",ẻ:"e",ẽ:"e",ề:"e",ế:"e",ệ:"e",ể:"e",ễ:"e",ị:"i",ỉ:"i",ĩ:"i",ọ:"o",ỏ:"o",ồ:"o",ố:"o",ộ:"o",ổ:"o",ỗ:"o",ơ:"o",ờ:"o",ớ:"o",ợ:"o",ở:"o",ỡ:"o",ụ:"u",ủ:"u",ũ:"u",ư:"u",ừ:"u",ứ:"u",ự:"u",ử:"u",ữ:"u",ỳ:"y",ỵ:"y",ỷ:"y",ỹ:"y",đ:"d",Ә:"AE",ә:"ae",Ғ:"GH",ғ:"gh",Қ:"KH",қ:"kh",Ң:"NG",ң:"ng",Ү:"UE",ү:"ue",Ұ:"U",ұ:"u",Һ:"H",һ:"h",Ө:"OE",ө:"oe",ђ:"dj",ј:"j",љ:"lj",њ:"nj",ћ:"c",џ:"dz",Ђ:"Dj",Ј:"j",Љ:"Lj",Њ:"Nj",Ћ:"C",Џ:"Dz",nj:"nj",lj:"lj",Nj:"NJ",Lj:"LJ",अ:"a",आ:"aa",ए:"e",ई:"ii",ऍ:"ei",ऎ:"ae",ऐ:"ai",इ:"i",ओ:"o",ऑ:"oi",ऒ:"oii",ऊ:"uu",औ:"ou",उ:"u",ब:"B",भ:"Bha",च:"Ca",छ:"Chha",ड:"Da",ढ:"Dha",फ:"Fa",ग:"Ga",घ:"Gha",ग़:"Ghi",ह:"Ha",ज:"Ja",झ:"Jha",क:"Ka",ख:"Kha",ख़:"Khi",ल:"L",ळ:"Li",ऌ:"Li",ऴ:"Lii",ॡ:"Lii",म:"Ma",न:"Na",ङ:"Na",ञ:"Nia",ण:"Nae",ऩ:"Ni",ॐ:"oms",प:"Pa",क़:"Qi",र:"Ra",ऋ:"Ri",ॠ:"Ri",ऱ:"Ri",स:"Sa",श:"Sha",ष:"Shha",ट:"Ta",त:"Ta",ठ:"Tha",द:"Tha",थ:"Tha",ध:"Thha",ड़:"ugDha",ढ़:"ugDhha",व:"Va",य:"Ya",य़:"Yi",ज़:"Za",ə:"e",Ə:"E",ა:"a",ბ:"b",გ:"g",დ:"d",ე:"e",ვ:"v",ზ:"z",თ:"t",ი:"i",კ:"k",ლ:"l",მ:"m",ნ:"n",ო:"o",პ:"p",ჟ:"zh",რ:"r",ს:"s",ტ:"t",უ:"u",ფ:"p",ქ:"k",ღ:"gh",ყ:"q",შ:"sh",ჩ:"ch",ც:"ts",ძ:"dz",წ:"ts",ჭ:"ch",ხ:"kh",ჯ:"j",ჰ:"h",ב:"v",גּ:"g",ג:"g",ד:"d",דּ:"d",ה:"h",ו:"v",ז:"z",ח:"h",ט:"t",י:"y",כ:"kh",ך:"kh",ל:"l",מ:"m",ם:"m",נ:"n",ן:"n",ס:"s",פ:"f",ף:"f",ץ:"ts",צ:"ts",ק:"k",ר:"r",תּ:"t",ת:"t"};o.charmap=Object.assign({},c),o.multicharmap=Object.assign({},l),o.defaults={charmap:o.charmap,mode:"pretty",modes:{rfc3986:{replacement:"-",remove:null,lower:!0,charmap:o.charmap,multicharmap:o.multicharmap,trim:!0},pretty:{replacement:"-",remove:null,lower:!0,charmap:o.charmap,multicharmap:o.multicharmap,trim:!0}},multicharmap:o.multicharmap,fallback:!0},o.reset=function(){o.defaults.modes.rfc3986.charmap=o.defaults.modes.pretty.charmap=o.charmap=o.defaults.charmap=Object.assign({},c),o.defaults.modes.rfc3986.multicharmap=o.defaults.modes.pretty.multicharmap=o.multicharmap=o.defaults.multicharmap=Object.assign({},l),a=""},o.extend=function(u){const f=Object.keys(u),h={},m={};for(let g=0;g<f.length;g++)f[g].length>1?h[f[g]]=u[f[g]]:m[f[g]]=u[f[g]];Object.assign(o.charmap,m),Object.assign(o.multicharmap,h)},o.setLocale=function(u){a=i[u]||{}},e.exports?e.exports=o:t.slug=o})(BDe)}(xE)),xE.exports}var VDe=zDe();const yre=Gn(VDe);function ft(e,t){t=t||{};const r=[t.server||FDe,"api","v2",e];if(t.id&&r.push(t.id.toString()),t.objectMethod&&r.push(t.objectMethod),r.push(""),t.query){const o=[];for(const i in t.query)Object.hasOwn(t.query,i)&&o.push(`${encodeURIComponent(i)}=${encodeURIComponent(t.query[i])}`);r.pop(),r.push(`?${o.join("&")}`)}return r.join("/")}var Qt=(e=>(e[e.DASHBOARD=0]="DASHBOARD",e[e.ROUTINE_OVERVIEW=1]="ROUTINE_OVERVIEW",e[e.ROUTINE_DETAIL=2]="ROUTINE_DETAIL",e[e.ROUTINE_EDIT=3]="ROUTINE_EDIT",e[e.ROUTINE_DETAIL_TABLE=4]="ROUTINE_DETAIL_TABLE",e[e.ROUTINE_EDIT_PROGRESSION=5]="ROUTINE_EDIT_PROGRESSION",e[e.ROUTINE_ADD=6]="ROUTINE_ADD",e[e.ROUTINE_LOGS_OVERVIEW=7]="ROUTINE_LOGS_OVERVIEW",e[e.ROUTINE_STATS_OVERVIEW=8]="ROUTINE_STATS_OVERVIEW",e[e.ROUTINE_PDF_TABLE=9]="ROUTINE_PDF_TABLE",e[e.ROUTINE_PDF_LOGS=10]="ROUTINE_PDF_LOGS",e[e.ROUTINE_ICAL=11]="ROUTINE_ICAL",e[e.ROUTINE_COPY=12]="ROUTINE_COPY",e[e.ROUTINE_ADD_LOG=13]="ROUTINE_ADD_LOG",e[e.TEMPLATE_DETAIL=14]="TEMPLATE_DETAIL",e[e.PRIVATE_TEMPLATE_OVERVIEW=15]="PRIVATE_TEMPLATE_OVERVIEW",e[e.PUBLIC_TEMPLATE_OVERVIEW=16]="PUBLIC_TEMPLATE_OVERVIEW",e[e.EXERCISE_DETAIL=17]="EXERCISE_DETAIL",e[e.EXERCISE_OVERVIEW=18]="EXERCISE_OVERVIEW",e[e.EXERCISE_CONTRIBUTE=19]="EXERCISE_CONTRIBUTE",e[e.WEIGHT_OVERVIEW=20]="WEIGHT_OVERVIEW",e[e.WEIGHT_ADD=21]="WEIGHT_ADD",e[e.MEASUREMENT_OVERVIEW=22]="MEASUREMENT_OVERVIEW",e[e.MEASUREMENT_DETAIL=23]="MEASUREMENT_DETAIL",e[e.NUTRITION_OVERVIEW=24]="NUTRITION_OVERVIEW",e[e.NUTRITION_DETAIL=25]="NUTRITION_DETAIL",e[e.NUTRITION_PLAN_PDF=26]="NUTRITION_PLAN_PDF",e[e.NUTRITION_PLAN_COPY=27]="NUTRITION_PLAN_COPY",e[e.NUTRITION_DIARY=28]="NUTRITION_DIARY",e[e.INGREDIENT_DETAIL=29]="INGREDIENT_DETAIL",e[e.CALENDAR=30]="CALENDAR",e))(Qt||{});function cn(e,t,n){t=t||"en-us";const r=t.split("-")[0];switch(e){case 1:return`/${r}/routine/overview`;case 2:return`/${r}/routine/${n.id}/view`;case 4:return`/${r}/routine/${n.id}/table`;case 3:return`/${r}/routine/${n.id}/edit`;case 5:return`/${r}/routine/${n.id}/edit/progression/${n.id2}`;case 6:return`/${r}/routine/add`;case 12:return`/${r}/routine/${n.id}/copy`;case 9:return`/${r}/routine/${n.id}/pdf/table`;case 10:return`/${r}/routine/${n.id}/pdf/log`;case 11:return`/${r}/routine/${n.id}/ical`;case 7:return`/${r}/routine/${n.id}/logs`;case 8:return`/${r}/routine/${n.id}/statistics`;case 13:return`/${r}/routine/${n.id}/day/${n.id2}/add-logs`;case 30:return`/${r}/routine/calendar`;case 14:return`/${r}/routine/templates/${n.id}/view`;case 15:return`/${r}/routine/templates/overview/private`;case 16:return`/${r}/routine/templates/overview/public`;case 19:return`/${r}/exercise/contribute`;case 17:return n.slug?`/${r}/exercise/${n.id}/view/${yre(n.slug)}`:`/${r}/exercise/${n.id}/view`;case 18:return`/${r}/exercise/overview`;case 20:return`/${r}/weight/overview`;case 21:return`/${r}/weight/add`;case 22:return`/${r}/measurement/overview`;case 23:return`/${r}/measurement/category/${n.id}`;case 24:return`/${r}/nutrition/overview`;case 25:return`/${r}/nutrition/${n.id}/view`;case 28:return`/${r}/nutrition/${n.id}/${n.date}`;case 26:return`/${r}/nutrition/${n.id}/pdf`;case 27:return`/${r}/nutrition/${n.id}/copy`;case 29:return`/${r}/nutrition/ingredient/${n.id}/view`;case 0:default:return"/"}}function HDe(e){let t=null;if(document.cookie&&document.cookie!==""){const n=document.cookie.split(";");for(let r=0;r<n.length;r++){const o=n[r].trim();if(o.substring(0,e.length+1)===e+"="){t=decodeURIComponent(o.substring(e.length+1));break}}}return t}function ht(e){e=e||jDe;const t="csrftoken",n={};n["Content-Type"]="application/json",e&&(n.Authorization=`Token ${e}`);const r=HDe(t);return r!=null&&(n["X-CSRFToken"]=r),n}const wI="weightentry",UDe=async(e="")=>{const t=$De(e),n=ft(wI,{query:{ordering:"-date",limit:900,...t&&{date__gte:t}}}),{data:r}=await it.get(n,{headers:ht()});return r.results.map(o=>new SB().fromJson(o))},GDe=async e=>(await it.delete(ft(wI,{id:e}),{headers:ht()})).status,qDe=async e=>{const t=new SB,n=await it.patch(ft(wI,{id:e.id}),t.toJson(e),{headers:ht()});return t.fromJson(n)},WDe=async e=>{const t=new SB,n=await it.post(ft(wI),t.toJson(e),{headers:ht()});return t.fromJson(n.data)},gn=e=>typeof e=="string",t0=()=>{let e,t;const n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n},U6=e=>e==null?"":""+e,KDe=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},YDe=/###/g,G6=e=>e&&e.indexOf("###")>-1?e.replace(YDe,"."):e,q6=e=>!e||gn(e),Z0=(e,t,n)=>{const r=gn(t)?t.split("."):t;let o=0;for(;o<r.length-1;){if(q6(e))return{};const i=G6(r[o]);!e[i]&&n&&(e[i]=new n),Object.prototype.hasOwnProperty.call(e,i)?e=e[i]:e={},++o}return q6(e)?{}:{obj:e,k:G6(r[o])}},W6=(e,t,n)=>{const{obj:r,k:o}=Z0(e,t,Object);if(r!==void 0||t.length===1){r[o]=n;return}let i=t[t.length-1],a=t.slice(0,t.length-1),s=Z0(e,a,Object);for(;s.obj===void 0&&a.length;)i=`${a[a.length-1]}.${i}`,a=a.slice(0,a.length-1),s=Z0(e,a,Object),s!=null&&s.obj&&typeof s.obj[`${s.k}.${i}`]<"u"&&(s.obj=void 0);s.obj[`${s.k}.${i}`]=n},QDe=(e,t,n,r)=>{const{obj:o,k:i}=Z0(e,t,Object);o[i]=o[i]||[],o[i].push(n)},rT=(e,t)=>{const{obj:n,k:r}=Z0(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},XDe=(e,t,n)=>{const r=rT(e,n);return r!==void 0?r:rT(t,n)},vre=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?gn(e[r])||e[r]instanceof String||gn(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):vre(e[r],t[r],n):e[r]=t[r]);return e},Um=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var JDe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const ZDe=e=>gn(e)?e.replace(/[&<>"'\/]/g,t=>JDe[t]):e;class eke{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const tke=[" ",",","?","!",";"],nke=new eke(20),rke=(e,t,n)=>{t=t||"",n=n||"";const r=tke.filter(a=>t.indexOf(a)<0&&n.indexOf(a)<0);if(r.length===0)return!0;const o=nke.getRegExp(`(${r.map(a=>a==="?"?"\\?":a).join("|")})`);let i=!o.test(e);if(!i){const a=e.indexOf(n);a>0&&!o.test(e.substring(0,a))&&(i=!0)}return i},HN=(e,t,n=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(n);let o=e;for(let i=0;i<r.length;){if(!o||typeof o!="object")return;let a,s="";for(let l=i;l<r.length;++l)if(l!==i&&(s+=n),s+=r[l],a=o[s],a!==void 0){if(["string","number","boolean"].indexOf(typeof a)>-1&&l<r.length-1)continue;i+=l-i+1;break}o=a}return o},kx=e=>e==null?void 0:e.replace("_","-"),oke={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var n,r;(r=(n=console==null?void 0:console[e])==null?void 0:n.apply)==null||r.call(n,console,t)}};class oT{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||oke,this.options=n,this.debug=n.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,o){return o&&!this.debug?null:(gn(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new oT(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new oT(this.logger,t)}}var xc=new oT;let CI=class{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const o=this.observers[r].get(n)||0;this.observers[r].set(n,o+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t,...n){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([o,i])=>{for(let a=0;a<i;a++)o(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([o,i])=>{for(let a=0;a<i;a++)o.apply(o,[t,...n])})}};class K6 extends CI{constructor(t,n={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r,o={}){var c,u;const i=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,a=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let s;t.indexOf(".")>-1?s=t.split("."):(s=[t,n],r&&(Array.isArray(r)?s.push(...r):gn(r)&&i?s.push(...r.split(i)):s.push(r)));const l=rT(this.data,s);return!l&&!n&&!r&&t.indexOf(".")>-1&&(t=s[0],n=s[1],r=s.slice(2).join(".")),l||!a||!gn(r)?l:HN((u=(c=this.data)==null?void 0:c[t])==null?void 0:u[n],r,i)}addResource(t,n,r,o,i={silent:!1}){const a=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let s=[t,n];r&&(s=s.concat(a?r.split(a):r)),t.indexOf(".")>-1&&(s=t.split("."),o=n,n=s[1]),this.addNamespaces(n),W6(this.data,s,o),i.silent||this.emit("added",t,n,r,o)}addResources(t,n,r,o={silent:!1}){for(const i in r)(gn(r[i])||Array.isArray(r[i]))&&this.addResource(t,n,i,r[i],{silent:!0});o.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,o,i,a={silent:!1,skipCopy:!1}){let s=[t,n];t.indexOf(".")>-1&&(s=t.split("."),o=r,r=n,n=s[1]),this.addNamespaces(n);let l=rT(this.data,s)||{};a.skipCopy||(r=JSON.parse(JSON.stringify(r))),o?vre(l,r,i):l={...l,...r},W6(this.data,s,l),a.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(o=>n[o]&&Object.keys(n[o]).length>0)}toJSON(){return this.data}}var bre={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach(i=>{var a;t=((a=this.processors[i])==null?void 0:a.process(t,n,r,o))??t}),t}};const Y6={},Q6=e=>!gn(e)&&typeof e!="boolean"&&typeof e!="number";class iT extends CI{constructor(t,n={}){super(),KDe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=xc.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const r={...n};if(t==null)return!1;const o=this.resolve(t,r);return(o==null?void 0:o.res)!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let i=n.ns||this.options.defaultNS||[];const a=r&&t.indexOf(r)>-1,s=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!rke(t,r,o);if(a&&!s){const l=t.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:t,namespaces:gn(i)?[i]:i};const c=t.split(r);(r!==o||r===o&&this.options.ns.indexOf(c[0])>-1)&&(i=c.shift()),t=c.join(o)}return{key:t,namespaces:gn(i)?[i]:i}}translate(t,n,r){let o=typeof n=="object"?{...n}:n;if(typeof o!="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),typeof options=="object"&&(o={...o}),o||(o={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const i=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,{key:s,namespaces:l}=this.extractFromKey(t[t.length-1],o),c=l[l.length-1];let u=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;u===void 0&&(u=":");const f=o.lng||this.language,h=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((f==null?void 0:f.toLowerCase())==="cimode")return h?i?{res:`${c}${u}${s}`,usedKey:s,exactUsedKey:s,usedLng:f,usedNS:c,usedParams:this.getUsedParamsDetails(o)}:`${c}${u}${s}`:i?{res:s,usedKey:s,exactUsedKey:s,usedLng:f,usedNS:c,usedParams:this.getUsedParamsDetails(o)}:s;const m=this.resolve(t,o);let g=m==null?void 0:m.res;const y=(m==null?void 0:m.usedKey)||s,v=(m==null?void 0:m.exactUsedKey)||s,w=["[object Number]","[object Function]","[object RegExp]"],C=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,E=!this.i18nFormat||this.i18nFormat.handleAsObject,I=o.count!==void 0&&!gn(o.count),O=iT.hasDefaultValue(o),P=I?this.pluralResolver.getSuffix(f,o.count,o):"",R=o.ordinal&&I?this.pluralResolver.getSuffix(f,o.count,{ordinal:!1}):"",D=I&&!o.ordinal&&o.count===0,M=D&&o[`defaultValue${this.options.pluralSeparator}zero`]||o[`defaultValue${P}`]||o[`defaultValue${R}`]||o.defaultValue;let A=g;E&&!g&&O&&(A=M);const _=Q6(A),N=Object.prototype.toString.apply(A);if(E&&A&&_&&w.indexOf(N)<0&&!(gn(C)&&Array.isArray(A))){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const B=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,A,{...o,ns:l}):`key '${s} (${this.language})' returned an object instead of string.`;return i?(m.res=B,m.usedParams=this.getUsedParamsDetails(o),m):B}if(a){const B=Array.isArray(A),H=B?[]:{},j=B?v:y;for(const L in A)if(Object.prototype.hasOwnProperty.call(A,L)){const V=`${j}${a}${L}`;O&&!g?H[L]=this.translate(V,{...o,defaultValue:Q6(M)?M[L]:void 0,joinArrays:!1,ns:l}):H[L]=this.translate(V,{...o,joinArrays:!1,ns:l}),H[L]===V&&(H[L]=A[L])}g=H}}else if(E&&gn(C)&&Array.isArray(g))g=g.join(C),g&&(g=this.extendTranslation(g,t,o,r));else{let B=!1,H=!1;!this.isValidLookup(g)&&O&&(B=!0,g=M),this.isValidLookup(g)||(H=!0,g=s);const L=(o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&H?void 0:g,V=O&&M!==g&&this.options.updateMissing;if(H||B||V){if(this.logger.log(V?"updateKey":"missingKey",f,c,s,V?M:g),a){const q=this.resolve(s,{...o,keySeparator:!1});q&&q.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let W=[];const K=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&K&&K[0])for(let q=0;q<K.length;q++)W.push(K[q]);else this.options.saveMissingTo==="all"?W=this.languageUtils.toResolveHierarchy(o.lng||this.language):W.push(o.lng||this.language);const G=(q,Y,Z)=>{var se;const ie=O&&Z!==g?Z:L;this.options.missingKeyHandler?this.options.missingKeyHandler(q,c,Y,ie,V,o):(se=this.backendConnector)!=null&&se.saveMissing&&this.backendConnector.saveMissing(q,c,Y,ie,V,o),this.emit("missingKey",q,c,Y,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&I?W.forEach(q=>{const Y=this.pluralResolver.getSuffixes(q,o);D&&o[`defaultValue${this.options.pluralSeparator}zero`]&&Y.indexOf(`${this.options.pluralSeparator}zero`)<0&&Y.push(`${this.options.pluralSeparator}zero`),Y.forEach(Z=>{G([q],s+Z,o[`defaultValue${Z}`]||M)})}):G(W,s,M))}g=this.extendTranslation(g,t,o,m,r),H&&g===s&&this.options.appendNamespaceToMissingKey&&(g=`${c}${u}${s}`),(H||B)&&this.options.parseMissingKeyHandler&&(g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}${u}${s}`:s,B?g:void 0,o))}return i?(m.res=g,m.usedParams=this.getUsedParamsDetails(o),m):g}extendTranslation(t,n,r,o,i){var l,c;if((l=this.i18nFormat)!=null&&l.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const u=gn(t)&&(((c=r==null?void 0:r.interpolation)==null?void 0:c.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(u){const m=t.match(this.interpolator.nestingRegexp);f=m&&m.length}let h=r.replace&&!gn(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(h={...this.options.interpolation.defaultVariables,...h}),t=this.interpolator.interpolate(t,h,r.lng||this.language||o.usedLng,r),u){const m=t.match(this.interpolator.nestingRegexp),g=m&&m.length;f<g&&(r.nest=!1)}!r.lng&&o&&o.res&&(r.lng=this.language||o.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,(...m)=>(i==null?void 0:i[0])===m[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${m[0]} in key: ${n[0]}`),null):this.translate(...m,n),r)),r.interpolation&&this.interpolator.reset()}const a=r.postProcess||this.options.postProcess,s=gn(a)?[a]:a;return t!=null&&(s!=null&&s.length)&&r.applyPostProcessor!==!1&&(t=bre.handle(s,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t,n={}){let r,o,i,a,s;return gn(t)&&(t=[t]),t.forEach(l=>{if(this.isValidLookup(r))return;const c=this.extractFromKey(l,n),u=c.key;o=u;let f=c.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const h=n.count!==void 0&&!gn(n.count),m=h&&!n.ordinal&&n.count===0,g=n.context!==void 0&&(gn(n.context)||typeof n.context=="number")&&n.context!=="",y=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(v=>{var w,C;this.isValidLookup(r)||(s=v,!Y6[`${y[0]}-${v}`]&&((w=this.utils)!=null&&w.hasLoadedNamespace)&&!((C=this.utils)!=null&&C.hasLoadedNamespace(s))&&(Y6[`${y[0]}-${v}`]=!0,this.logger.warn(`key "${o}" for languages "${y.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),y.forEach(E=>{var P;if(this.isValidLookup(r))return;a=E;const I=[u];if((P=this.i18nFormat)!=null&&P.addLookupKeys)this.i18nFormat.addLookupKeys(I,u,E,v,n);else{let R;h&&(R=this.pluralResolver.getSuffix(E,n.count,n));const D=`${this.options.pluralSeparator}zero`,M=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(I.push(u+R),n.ordinal&&R.indexOf(M)===0&&I.push(u+R.replace(M,this.options.pluralSeparator)),m&&I.push(u+D)),g){const A=`${u}${this.options.contextSeparator}${n.context}`;I.push(A),h&&(I.push(A+R),n.ordinal&&R.indexOf(M)===0&&I.push(A+R.replace(M,this.options.pluralSeparator)),m&&I.push(A+D))}}let O;for(;O=I.pop();)this.isValidLookup(r)||(i=O,r=this.getResource(E,v,O,n))}))})}),{res:r,usedKey:o,exactUsedKey:i,usedLng:a,usedNS:s}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r,o={}){var i;return(i=this.i18nFormat)!=null&&i.getResource?this.i18nFormat.getResource(t,n,r,o):this.resourceStore.getResource(t,n,r,o)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!gn(t.replace);let o=r?t.replace:t;if(r&&typeof t.count<"u"&&(o.count=t.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!r){o={...o};for(const i of n)delete o[i]}return o}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}class X6{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=xc.create("languageUtils")}getScriptPartFromCode(t){if(t=kx(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=kx(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(gn(t)&&t.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const o=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(o))&&(n=o)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const o=this.getScriptPartFromCode(r);if(this.isSupportedCode(o))return n=o;const i=this.getLanguagePartFromCode(r);if(this.isSupportedCode(i))return n=i;n=this.options.supportedLngs.find(a=>{if(a===i)return a;if(!(a.indexOf("-")<0&&i.indexOf("-")<0)&&(a.indexOf("-")>0&&i.indexOf("-")<0&&a.substring(0,a.indexOf("-"))===i||a.indexOf(i)===0&&i.length>1))return a})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),gn(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),o=[],i=a=>{a&&(this.isSupportedCode(a)?o.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return gn(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(t))):gn(t)&&i(this.formatLanguageCode(t)),r.forEach(a=>{o.indexOf(a)<0&&i(this.formatLanguageCode(a))}),o}}const J6={zero:0,one:1,two:2,few:3,many:4,other:5},Z6={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class ike{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=xc.create("pluralResolver"),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const r=kx(t==="dev"?"en":t),o=n.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:r,type:o});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(r,{type:o})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Z6;if(!t.match(/-|_/))return Z6;const l=this.languageUtils.getLanguagePartFromCode(t);a=this.getRule(l,n)}return this.pluralRulesCache[i]=a,a}needsPlural(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),(r==null?void 0:r.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,n,r={}){return this.getSuffixes(t,r).map(o=>`${n}${o}`)}getSuffixes(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((o,i)=>J6[o]-J6[i]).map(o=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${o}`):[]}getSuffix(t,n,r={}){const o=this.getRule(t,r);return o?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${o.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}}const eq=(e,t,n,r=".",o=!0)=>{let i=XDe(e,t,n);return!i&&o&&gn(n)&&(i=HN(e,n,r),i===void 0&&(i=HN(t,n,r))),i},zR=e=>e.replace(/\$/g,"$$$$");class ake{constructor(t={}){var n;this.logger=xc.create("interpolator"),this.options=t,this.format=((n=t==null?void 0:t.interpolation)==null?void 0:n.format)||(r=>r),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:o,prefix:i,prefixEscaped:a,suffix:s,suffixEscaped:l,formatSeparator:c,unescapeSuffix:u,unescapePrefix:f,nestingPrefix:h,nestingPrefixEscaped:m,nestingSuffix:g,nestingSuffixEscaped:y,nestingOptionsSeparator:v,maxReplaces:w,alwaysFormat:C}=t.interpolation;this.escape=n!==void 0?n:ZDe,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=i?Um(i):a||"{{",this.suffix=s?Um(s):l||"}}",this.formatSeparator=c||",",this.unescapePrefix=u?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=h?Um(h):m||Um("$t("),this.nestingSuffix=g?Um(g):y||Um(")"),this.nestingOptionsSeparator=v||",",this.maxReplaces=w||1e3,this.alwaysFormat=C!==void 0?C:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>(n==null?void 0:n.source)===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,n,r,o){var m;let i,a,s;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=g=>{if(g.indexOf(this.formatSeparator)<0){const C=eq(n,l,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(C,void 0,r,{...o,...n,interpolationkey:g}):C}const y=g.split(this.formatSeparator),v=y.shift().trim(),w=y.join(this.formatSeparator).trim();return this.format(eq(n,l,v,this.options.keySeparator,this.options.ignoreJSONStructure),w,r,{...o,...n,interpolationkey:v})};this.resetRegExp();const u=(o==null?void 0:o.missingInterpolationHandler)||this.options.missingInterpolationHandler,f=((m=o==null?void 0:o.interpolation)==null?void 0:m.skipOnVariables)!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>zR(g)},{regex:this.regexp,safeValue:g=>this.escapeValue?zR(this.escape(g)):zR(g)}].forEach(g=>{for(s=0;i=g.regex.exec(t);){const y=i[1].trim();if(a=c(y),a===void 0)if(typeof u=="function"){const w=u(t,i,o);a=gn(w)?w:""}else if(o&&Object.prototype.hasOwnProperty.call(o,y))a="";else if(f){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${y} for interpolating ${t}`),a="";else!gn(a)&&!this.useRawValueToEscape&&(a=U6(a));const v=g.safeValue(a);if(t=t.replace(i[0],v),f?(g.regex.lastIndex+=a.length,g.regex.lastIndex-=i[0].length):g.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),t}nest(t,n,r={}){let o,i,a;const s=(l,c)=>{const u=this.nestingOptionsSeparator;if(l.indexOf(u)<0)return l;const f=l.split(new RegExp(`${u}[ ]*{`));let h=`{${f[1]}`;l=f[0],h=this.interpolate(h,a);const m=h.match(/'/g),g=h.match(/"/g);(((m==null?void 0:m.length)??0)%2===0&&!g||g.length%2!==0)&&(h=h.replace(/'/g,'"'));try{a=JSON.parse(h),c&&(a={...c,...a})}catch(y){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,y),`${l}${u}${h}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,l};for(;o=this.nestingRegexp.exec(t);){let l=[];a={...r},a=a.replace&&!gn(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=!1;if(o[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(o[1])){const u=o[1].split(this.formatSeparator).map(f=>f.trim());o[1]=u.shift(),l=u,c=!0}if(i=n(s.call(this,o[1].trim(),a),a),i&&o[0]===t&&!gn(i))return i;gn(i)||(i=U6(i)),i||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${t}`),i=""),c&&(i=l.reduce((u,f)=>this.format(u,f,r.lng,{...r,interpolationkey:o[1].trim()}),i.trim())),t=t.replace(o[0],i),this.regexp.lastIndex=0}return t}}const ske=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const o=r[1].substring(0,r[1].length-1);t==="currency"&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):t==="relativetime"&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach(a=>{if(a){const[s,...l]=a.split(":"),c=l.join(":").trim().replace(/^'+|'+$/g,""),u=s.trim();n[u]||(n[u]=c),c==="false"&&(n[u]=!1),c==="true"&&(n[u]=!0),isNaN(c)||(n[u]=parseInt(c,10))}})}return{formatName:t,formatOptions:n}},tq=e=>{const t={};return(n,r,o)=>{let i=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(i={...i,[o.interpolationkey]:void 0});const a=r+JSON.stringify(i);let s=t[a];return s||(s=e(kx(r),o),t[a]=s),s(n)}},lke=e=>(t,n,r)=>e(kx(n),r)(t);let cke=class{constructor(t={}){this.logger=xc.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const r=n.cacheInBuiltFormats?tq:lke;this.formats={number:r((o,i)=>{const a=new Intl.NumberFormat(o,{...i});return s=>a.format(s)}),currency:r((o,i)=>{const a=new Intl.NumberFormat(o,{...i,style:"currency"});return s=>a.format(s)}),datetime:r((o,i)=>{const a=new Intl.DateTimeFormat(o,{...i});return s=>a.format(s)}),relativetime:r((o,i)=>{const a=new Intl.RelativeTimeFormat(o,{...i});return s=>a.format(s,i.range||"day")}),list:r((o,i)=>{const a=new Intl.ListFormat(o,{...i});return s=>a.format(s)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=tq(n)}format(t,n,r,o={}){const i=n.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find(s=>s.indexOf(")")>-1)){const s=i.findIndex(l=>l.indexOf(")")>-1);i[0]=[i[0],...i.splice(1,s)].join(this.formatSeparator)}return i.reduce((s,l)=>{var f;const{formatName:c,formatOptions:u}=ske(l);if(this.formats[c]){let h=s;try{const m=((f=o==null?void 0:o.formatParams)==null?void 0:f[o.interpolationkey])||{},g=m.locale||m.lng||o.locale||o.lng||r;h=this.formats[c](s,g,{...u,...o,...m})}catch(m){this.logger.warn(m)}return h}else this.logger.warn(`there was no format function for ${c}`);return s},t)}};const uke=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class dke extends CI{constructor(t,n,r,o={}){var i,a;super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=o,this.logger=xc.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],(a=(i=this.backend)==null?void 0:i.init)==null||a.call(i,r,o.backend,o)}queueLoad(t,n,r,o){const i={},a={},s={},l={};return t.forEach(c=>{let u=!0;n.forEach(f=>{const h=`${c}|${f}`;!r.reload&&this.store.hasResourceBundle(c,f)?this.state[h]=2:this.state[h]<0||(this.state[h]===1?a[h]===void 0&&(a[h]=!0):(this.state[h]=1,u=!1,a[h]===void 0&&(a[h]=!0),i[h]===void 0&&(i[h]=!0),l[f]===void 0&&(l[f]=!0)))}),u||(s[c]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}loaded(t,n,r){const o=t.split("|"),i=o[0],a=o[1];n&&this.emit("failedLoading",i,a,n),!n&&r&&this.store.addResourceBundle(i,a,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const s={};this.queue.forEach(l=>{QDe(l.loaded,[i],a),uke(l,t),n&&l.errors.push(n),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(c=>{s[c]||(s[c]={});const u=l.loaded[c];u.length&&u.forEach(f=>{s[c][f]===void 0&&(s[c][f]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(l=>!l.done)}read(t,n,r,o=0,i=this.retryTimeout,a){if(!t.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:o,wait:i,callback:a});return}this.readingCalls++;const s=(c,u)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(c&&u&&o<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,o+1,i*2,a)},i);return}a(c,u)},l=this.backend[r].bind(this.backend);if(l.length===2){try{const c=l(t,n);c&&typeof c.then=="function"?c.then(u=>s(null,u)).catch(s):s(null,c)}catch(c){s(c)}return}return l(t,n,s)}prepareLoading(t,n,r={},o){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();gn(t)&&(t=this.languageUtils.toResolveHierarchy(t)),gn(n)&&(n=[n]);const i=this.queueLoad(t,n,r,o);if(!i.toLoad.length)return i.pending.length||o(),null;i.toLoad.forEach(a=>{this.loadOne(a)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t,n=""){const r=t.split("|"),o=r[0],i=r[1];this.read(o,i,"read",void 0,void 0,(a,s)=>{a&&this.logger.warn(`${n}loading namespace ${i} for language ${o} failed`,a),!a&&s&&this.logger.log(`${n}loaded namespace ${i} for language ${o}`,s),this.loaded(t,a,s)})}saveMissing(t,n,r,o,i,a={},s=()=>{}){var l,c,u,f,h;if((c=(l=this.services)==null?void 0:l.utils)!=null&&c.hasLoadedNamespace&&!((f=(u=this.services)==null?void 0:u.utils)!=null&&f.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if((h=this.backend)!=null&&h.create){const m={...a,isUpdate:i},g=this.backend.create.bind(this.backend);if(g.length<6)try{let y;g.length===5?y=g(t,n,r,o,m):y=g(t,n,r,o),y&&typeof y.then=="function"?y.then(v=>s(null,v)).catch(s):s(null,y)}catch(y){s(y)}else g(t,n,r,o,s,m)}!t||!t[0]||this.store.addResource(t[0],n,r,o)}}}const nq=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),gn(e[1])&&(t.defaultValue=e[1]),gn(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),rq=e=>{var t,n;return gn(e.ns)&&(e.ns=[e.ns]),gn(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),gn(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),((n=(t=e.supportedLngs)==null?void 0:t.indexOf)==null?void 0:n.call(t,"cimode"))<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e},I1=()=>{},fke=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class _x extends CI{constructor(t={},n){if(super(),this.options=rq(t),this.services={},this.logger=xc,this.modules={external:[]},fke(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(t={},n){this.isInitializing=!0,typeof t=="function"&&(n=t,t={}),t.defaultNS==null&&t.ns&&(gn(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=nq();this.options={...r,...this.options,...rq(t)},this.options.interpolation={...r.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator);const o=c=>c?typeof c=="function"?new c:c:null;if(!this.options.isClone){this.modules.logger?xc.init(o(this.modules.logger),this.options):xc.init(null,this.options);let c;this.modules.formatter?c=this.modules.formatter:c=cke;const u=new X6(this.options);this.store=new K6(this.options.resources,this.options);const f=this.services;f.logger=xc,f.resourceStore=this.store,f.languageUtils=u,f.pluralResolver=new ike(u,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),c&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(f.formatter=o(c),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new ake(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new dke(o(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",(h,...m)=>{this.emit(h,...m)}),this.modules.languageDetector&&(f.languageDetector=o(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=o(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new iT(this.services,this.options),this.translator.on("*",(h,...m)=>{this.emit(h,...m)}),this.modules.external.forEach(h=>{h.init&&h.init(this)})}if(this.format=this.options.interpolation.format,n||(n=I1),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&c[0]!=="dev"&&(this.options.lng=c[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(c=>{this[c]=(...u)=>this.store[c](...u)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(c=>{this[c]=(...u)=>(this.store[c](...u),this)});const s=t0(),l=()=>{const c=(u,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),s.resolve(f),n(u,f)};if(this.languages&&!this.isInitialized)return c(null,this.t.bind(this));this.changeLanguage(this.options.lng,c)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,0),s}loadResources(t,n=I1){var i,a;let r=n;const o=gn(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if((o==null?void 0:o.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const s=[],l=c=>{if(!c||c==="cimode")return;this.services.languageUtils.toResolveHierarchy(c).forEach(f=>{f!=="cimode"&&s.indexOf(f)<0&&s.push(f)})};o?l(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(u=>l(u)),(a=(i=this.options.preload)==null?void 0:i.forEach)==null||a.call(i,c=>l(c)),this.services.backendConnector.load(s,this.options.ns,c=>{!c&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(c)})}else r(null)}reloadResources(t,n,r){const o=t0();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=I1),this.services.backendConnector.reload(t,n,i=>{o.resolve(),r(i)}),o}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&bre.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1)){for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,n){this.isLanguageChangingTo=t;const r=t0();this.emit("languageChanging",t);const o=s=>{this.language=s,this.languages=this.services.languageUtils.toResolveHierarchy(s),this.resolvedLanguage=void 0,this.setResolvedLanguage(s)},i=(s,l)=>{l?this.isLanguageChangingTo===t&&(o(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,r.resolve((...c)=>this.t(...c)),n&&n(s,(...c)=>this.t(...c))},a=s=>{var u,f;!t&&!s&&this.services.languageDetector&&(s=[]);const l=gn(s)?s:s&&s[0],c=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(gn(s)?[s]:s);c&&(this.language||o(c),this.translator.language||this.translator.changeLanguage(c),(f=(u=this.services.languageDetector)==null?void 0:u.cacheUserLanguage)==null||f.call(u,c)),this.loadResources(c,h=>{i(h,c)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(t),r}getFixedT(t,n,r){const o=(i,a,...s)=>{let l;typeof a!="object"?l=this.options.overloadTranslationOptionHandler([i,a].concat(s)):l={...a},l.lng=l.lng||o.lng,l.lngs=l.lngs||o.lngs,l.ns=l.ns||o.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||r||o.keyPrefix);const c=this.options.keySeparator||".";let u;return l.keyPrefix&&Array.isArray(i)?u=i.map(f=>`${l.keyPrefix}${c}${f}`):u=l.keyPrefix?`${l.keyPrefix}${c}${i}`:i,this.t(u,l)};return gn(t)?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=r,o}t(...t){var n;return(n=this.translator)==null?void 0:n.translate(...t)}exists(...t){var n;return(n=this.translator)==null?void 0:n.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const a=(s,l)=>{const c=this.services.backendConnector.state[`${s}|${l}`];return c===-1||c===0||c===2};if(n.precheck){const s=n.precheck(this,a);if(s!==void 0)return s}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(r,t)&&(!o||a(i,t)))}loadNamespaces(t,n){const r=t0();return this.options.ns?(gn(t)&&(t=[t]),t.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=t0();gn(t)&&(t=[t]);const o=this.options.preload||[],i=t.filter(a=>o.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return i.length?(this.options.preload=o.concat(i),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}dir(t){var o,i;if(t||(t=this.resolvedLanguage||(((o=this.languages)==null?void 0:o.length)>0?this.languages[0]:this.language)),!t)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=((i=this.services)==null?void 0:i.languageUtils)||new X6(nq());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){return new _x(t,n)}cloneInstance(t={},n=I1){const r=t.forkResourceStore;r&&delete t.forkResourceStore;const o={...this.options,...t,isClone:!0},i=new _x(o);if((t.debug!==void 0||t.prefix!==void 0)&&(i.logger=i.logger.clone(t)),["store","services","language"].forEach(s=>{i[s]=this[s]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},r){const s=Object.keys(this.store.data).reduce((l,c)=>(l[c]={...this.store.data[c]},l[c]=Object.keys(l[c]).reduce((u,f)=>(u[f]={...l[c][f]},u),l[c]),l),{});i.store=new K6(s,o),i.services.resourceStore=i.store}return i.translator=new iT(i.services,o),i.translator.on("*",(s,...l)=>{i.emit(s,...l)}),i.init(o,n),i.translator.options=o,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const hr=_x.createInstance();hr.createInstance=_x.createInstance;hr.createInstance;hr.dir;hr.init;hr.loadResources;hr.reloadResources;hr.use;hr.changeLanguage;hr.getFixedT;hr.t;hr.exists;hr.setDefaultNamespace;hr.hasLoadedNamespace;hr.loadNamespaces;hr.loadLanguages;const pke=22;function hke(e,t=pke){return e.length>t?e.slice(0,t)+"…":e}function mke(e){return e.toLowerCase().replace(/\s/g,"_").replace("(","_").replace(")","_").replace("-","_")}function CB(e){return e===void 0?(console.warn("called getTranslationKey with undefined name"),""):`server.${mke(e)}`}class gke{constructor(t,n,r,o){this.id=t,this.name=n,this.nameEn=r,this.isFront=o}get translatedName(){return hr.t(CB(this.nameEn),{defaultValue:this.nameEn})}getName(){return this.nameEn?`${this.name} (${this.translatedName})`:this.name}}class xre{fromJson(t){return new gke(t.id,t.name,t.name_en,t.is_front)}toJson(t){return{}}}const yke="muscle",vke=async()=>{const e=ft(yke),{data:t}=await it.get(e,{headers:ht()}),n=new xre;return t.results.map(r=>n.fromJson(r))},{slice:bke,forEach:xke}=[];function Ske(e){return xke.call(bke.call(arguments,1),t=>{if(t)for(const n in t)e[n]===void 0&&(e[n]=t[n])}),e}const oq=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,wke=function(e,t){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},o=encodeURIComponent(t);let i=`${e}=${o}`;if(r.maxAge>0){const a=r.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");i+=`; Max-Age=${Math.floor(a)}`}if(r.domain){if(!oq.test(r.domain))throw new TypeError("option domain is invalid");i+=`; Domain=${r.domain}`}if(r.path){if(!oq.test(r.path))throw new TypeError("option path is invalid");i+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");i+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(i+="; HttpOnly"),r.secure&&(i+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i},iq={create(e,t,n,r){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+n*60*1e3)),r&&(o.domain=r),document.cookie=wke(e,encodeURIComponent(t),o)},read(e){const t=`${e}=`,n=document.cookie.split(";");for(let r=0;r<n.length;r++){let o=n[r];for(;o.charAt(0)===" ";)o=o.substring(1,o.length);if(o.indexOf(t)===0)return o.substring(t.length,o.length)}return null},remove(e){this.create(e,"",-1)}};var Cke={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&typeof document<"u")return iq.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:n,cookieMinutes:r,cookieDomain:o,cookieOptions:i}=t;n&&typeof document<"u"&&iq.create(n,e,r,o,i)}},Eke={name:"querystring",lookup(e){var r;let{lookupQuerystring:t}=e,n;if(typeof window<"u"){let{search:o}=window.location;!window.location.search&&((r=window.location.hash)==null?void 0:r.indexOf("?"))>-1&&(o=window.location.hash.substring(window.location.hash.indexOf("?")));const a=o.substring(1).split("&");for(let s=0;s<a.length;s++){const l=a[s].indexOf("=");l>0&&a[s].substring(0,l)===t&&(n=a[s].substring(l+1))}}return n}};let Gm=null;const aq=()=>{if(Gm!==null)return Gm;try{if(Gm=typeof window<"u"&&window.localStorage!==null,!Gm)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{Gm=!1}return Gm};var Tke={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&aq())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&aq()&&window.localStorage.setItem(n,e)}};let qm=null;const sq=()=>{if(qm!==null)return qm;try{if(qm=typeof window<"u"&&window.sessionStorage!==null,!qm)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{qm=!1}return qm};var Oke={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&sq())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&sq()&&window.sessionStorage.setItem(n,e)}},Ike={name:"navigator",lookup(e){const t=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:o}=navigator;if(n)for(let i=0;i<n.length;i++)t.push(n[i]);r&&t.push(r),o&&t.push(o)}return t.length>0?t:void 0}},Pke={name:"htmlTag",lookup(e){let{htmlTag:t}=e,n;const r=t||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},Ake={name:"path",lookup(e){var o;let{lookupFromPathIndex:t}=e;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?(o=n[typeof t=="number"?t:0])==null?void 0:o.replace("/",""):void 0}},Mke={name:"subdomain",lookup(e){var o,i;let{lookupFromSubdomainIndex:t}=e;const n=typeof t=="number"?t+1:1,r=typeof window<"u"&&((i=(o=window.location)==null?void 0:o.hostname)==null?void 0:i.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(r)return r[n]}};let Sre=!1;try{document.cookie,Sre=!0}catch{}const wre=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Sre||wre.splice(1,1);const Rke=()=>({order:wre,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class Cre{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,n)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=Ske(n,this.options||{},Rke()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=o=>o.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(Cke),this.addDetector(Eke),this.addDetector(Tke),this.addDetector(Oke),this.addDetector(Ike),this.addDetector(Pke),this.addDetector(Ake),this.addDetector(Mke)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,n=[];return t.forEach(r=>{if(this.detectors[r]){let o=this.detectors[r].lookup(this.options);o&&typeof o=="string"&&(o=[o]),o&&(n=n.concat(o))}}),n=n.map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(t,this.options)}))}}Cre.type="languageDetector";function UN(e){"@babel/helpers - typeof";return UN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},UN(e)}function Ere(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":UN(XMLHttpRequest))==="object"}function Dke(e){return!!e&&typeof e.then=="function"}function kke(e){return Dke(e)?e:Promise.resolve(e)}function lq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function cq(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lq(Object(n),!0).forEach(function(r){_ke(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lq(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _ke(e,t,n){return(t=$ke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $ke(e){var t=Nke(e,"string");return vh(t)=="symbol"?t:t+""}function Nke(e,t){if(vh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(vh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vh(e){"@babel/helpers - typeof";return vh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vh(e)}var Of=typeof fetch=="function"?fetch:void 0;typeof global<"u"&&global.fetch?Of=global.fetch:typeof window<"u"&&window.fetch&&(Of=window.fetch);var $x;Ere()&&(typeof global<"u"&&global.XMLHttpRequest?$x=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&($x=window.XMLHttpRequest));var aT;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?aT=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(aT=window.ActiveXObject));typeof Of!="function"&&(Of=void 0);if(!Of&&!$x&&!aT)try{iSe(()=>import("./browser-ponyfill-DBa4LM7e.js").then(e=>e.b),[]).then(function(e){Of=e.default}).catch(function(){})}catch{}var GN=function(t,n){if(n&&vh(n)==="object"){var r="";for(var o in n)r+="&"+encodeURIComponent(o)+"="+encodeURIComponent(n[o]);if(!r)return t;t=t+(t.indexOf("?")!==-1?"&":"?")+r.slice(1)}return t},uq=function(t,n,r,o){var i=function(l){if(!l.ok)return r(l.statusText||"Error",{status:l.status});l.text().then(function(c){r(null,{status:l.status,data:c})}).catch(r)};if(o){var a=o(t,n);if(a instanceof Promise){a.then(i).catch(r);return}}typeof fetch=="function"?fetch(t,n).then(i).catch(r):Of(t,n).then(i).catch(r)},dq=!1,Lke=function(t,n,r,o){t.queryStringParams&&(n=GN(n,t.queryStringParams));var i=cq({},typeof t.customHeaders=="function"?t.customHeaders():t.customHeaders);typeof window>"u"&&typeof global<"u"&&typeof global.process<"u"&&global.process.versions&&global.process.versions.node&&(i["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),r&&(i["Content-Type"]="application/json");var a=typeof t.requestOptions=="function"?t.requestOptions(r):t.requestOptions,s=cq({method:r?"POST":"GET",body:r?t.stringify(r):void 0,headers:i},dq?{}:a),l=typeof t.alternateFetch=="function"&&t.alternateFetch.length>=1?t.alternateFetch:void 0;try{uq(n,s,o,l)}catch(c){if(!a||Object.keys(a).length===0||!c.message||c.message.indexOf("not implemented")<0)return o(c);try{Object.keys(a).forEach(function(u){delete s[u]}),uq(n,s,o,l),dq=!0}catch(u){o(u)}}},Fke=function(t,n,r,o){r&&vh(r)==="object"&&(r=GN("",r).slice(1)),t.queryStringParams&&(n=GN(n,t.queryStringParams));try{var i=$x?new $x:new aT("MSXML2.XMLHTTP.3.0");i.open(r?"POST":"GET",n,1),t.crossDomain||i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.withCredentials=!!t.withCredentials,r&&i.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),i.overrideMimeType&&i.overrideMimeType("application/json");var a=t.customHeaders;if(a=typeof a=="function"?a():a,a)for(var s in a)i.setRequestHeader(s,a[s]);i.onreadystatechange=function(){i.readyState>3&&o(i.status>=400?i.statusText:null,{status:i.status,data:i.responseText})},i.send(r)}catch(l){console&&console.log(l)}},jke=function(t,n,r,o){if(typeof r=="function"&&(o=r,r=void 0),o=o||function(){},Of&&n.indexOf("file:")!==0)return Lke(t,n,r,o);if(Ere()||typeof ActiveXObject=="function")return Fke(t,n,r,o);o(new Error("No fetch and no xhr implementation found!"))};function cy(e){"@babel/helpers - typeof";return cy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cy(e)}function fq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function VR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fq(Object(n),!0).forEach(function(r){Tre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fq(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Bke(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zke(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,Ore(r.key),r)}}function Vke(e,t,n){return t&&zke(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Tre(e,t,n){return(t=Ore(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ore(e){var t=Hke(e,"string");return cy(t)=="symbol"?t:t+""}function Hke(e,t){if(cy(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(cy(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Uke=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:function(n){return JSON.parse(n)},stringify:JSON.stringify,parsePayload:function(n,r,o){return Tre({},r,o||"")},parseLoadPayload:function(n,r){},request:jke,reloadInterval:typeof window<"u"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},Ire=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Bke(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}return Vke(e,[{key:"init",value:function(n){var r=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.services=n,this.options=VR(VR(VR({},Uke()),this.options||{}),o),this.allOptions=i,this.services&&this.options.reloadInterval){var a=setInterval(function(){return r.reload()},this.options.reloadInterval);cy(a)==="object"&&typeof a.unref=="function"&&a.unref()}}},{key:"readMulti",value:function(n,r,o){this._readAny(n,n,r,r,o)}},{key:"read",value:function(n,r,o){this._readAny([n],n,[r],r,o)}},{key:"_readAny",value:function(n,r,o,i,a){var s=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(n,o)),l=kke(l),l.then(function(c){if(!c)return a(null,{});var u=s.services.interpolator.interpolate(c,{lng:n.join("+"),ns:o.join("+")});s.loadUrl(u,a,r,i)})}},{key:"loadUrl",value:function(n,r,o,i){var a=this,s=typeof o=="string"?[o]:o,l=typeof i=="string"?[i]:i,c=this.options.parseLoadPayload(s,l);this.options.request(this.options,n,c,function(u,f){if(f&&(f.status>=500&&f.status<600||!f.status))return r("failed loading "+n+"; status code: "+f.status,!0);if(f&&f.status>=400&&f.status<500)return r("failed loading "+n+"; status code: "+f.status,!1);if(!f&&u&&u.message){var h=u.message.toLowerCase(),m=["failed","fetch","network","load"].find(function(v){return h.indexOf(v)>-1});if(m)return r("failed loading "+n+": "+u.message,!0)}if(u)return r(u,!1);var g,y;try{typeof f.data=="string"?g=a.options.parse(f.data,o,i):g=f.data}catch{y="failed parsing "+n+" to json"}if(y)return r(y,!1);r(null,g)})}},{key:"create",value:function(n,r,o,i,a){var s=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var l=this.options.parsePayload(r,o,i),c=0,u=[],f=[];n.forEach(function(h){var m=s.options.addPath;typeof s.options.addPath=="function"&&(m=s.options.addPath(h,r));var g=s.services.interpolator.interpolate(m,{lng:h,ns:r});s.options.request(s.options,g,l,function(y,v){c+=1,u.push(y),f.push(v),c===n.length&&typeof a=="function"&&a(u,f)})})}}},{key:"reload",value:function(){var n=this,r=this.services,o=r.backendConnector,i=r.languageUtils,a=r.logger,s=o.language;if(!(s&&s.toLowerCase()==="cimode")){var l=[],c=function(f){var h=i.toResolveHierarchy(f);h.forEach(function(m){l.indexOf(m)<0&&l.push(m)})};c(s),this.allOptions.preload&&this.allOptions.preload.forEach(function(u){return c(u)}),l.forEach(function(u){n.allOptions.ns.forEach(function(f){o.read(u,f,"read",null,null,function(h,m){h&&a.warn("loading namespace ".concat(f," for language ").concat(u," failed"),h),!h&&m&&a.log("loaded namespace ".concat(f," for language ").concat(u),m),o.loaded("".concat(u,"|").concat(f),h,m)})})})}}}])}();Ire.type="backend";hr.use(Ire).use(Cre).use(eRe).init({load:"languageOnly",detection:{order:["path","navigator","htmlTag"]},fallbackLng:"en",interpolation:{escapeValue:!1},backend:{loadPath:"/static/react/locales/{{lng}}/{{ns}}.json"}});class Gke{constructor(t,n){this.id=t,this.name=n}get translatedName(){return hr.t(CB(this.name),{defaultValue:this.name})}}class Pre{fromJson(t){return new Gke(t.id,t.name)}toJson(t){return{id:t.id,name:t.name}}}const qke="equipment",Wke=async()=>{const e=ft(qke),{data:t}=await it.get(e,{headers:ht()}),n=new Pre;return t.results.map(r=>n.fromJson(r))};class Kke{constructor(t,n){this.id=t,this.name=n}get translatedName(){return hr.t(CB(this.name),{defaultValue:this.name})}}class Are{fromJson(t){return new Kke(t.id,t.name)}toJson(t){return{id:t.id,name:t.name}}}const Yke="exercisecategory",Qke=async()=>{const e=ft(Yke),{data:t}=await it.get(e,{headers:ht()}),n=new Are;return t.results.map(r=>n.fromJson(r))};var Cu=(e=>(e[e.LINE_ART=1]="LINE_ART",e[e.THREE_D=2]="THREE_D",e[e.LOW_POLY=3]="LOW_POLY",e[e.PHOTO=4]="PHOTO",e[e.OTHER=5]="OTHER",e))(Cu||{});class Xke{constructor(t,n,r,o){this.id=t,this.uuid=n,this.url=r,this.isMain=o}}class qN{fromJson(t){return new Xke(t.id,t.uuid,t.image,t.is_main)}toJson(t){return{id:t.id,image:t.url,is_front:t.isMain}}}class Jke{constructor(t,n,r){this.id=t,this.uuid=n,this.alias=r}}class Mre{fromJson(t){return new Jke(t.id,t.uuid,t.alias)}toJson(t){return{id:t.id,name:t.alias}}}class WN{constructor(t,n,r){this.id=t,this.exercise=n,this.note=r}}class Rre{fromJson(t){return new WN(t.id,t.exercise,t.comment)}toJson(t){return{id:t.id,comment:t.note,exercise:t.exercise}}}class Dre{constructor(t,n,r,o,i,a,s,l){Ce(this,"notes",[]);Ce(this,"aliases",[]);Ce(this,"authors",[]);this.id=t,this.uuid=n,this.name=r,this.description=o,this.language=i,a&&(this.notes=a),s&&(this.aliases=s),l&&(this.authors=l)}get nameLong(){return hke(this.name)}get nameSlug(){return yre(this.name)}}class EB{fromJson(t){var n,r;return new Dre(t.id,t.uuid,t.name,t.description,t.language,(n=t.notes)==null?void 0:n.map(o=>new Rre().fromJson(o)),(r=t.aliases)==null?void 0:r.map(o=>new Mre().fromJson(o)),t.author_history)}toJson(t){return{id:t.id,uuid:t.uuid,name:t.name,description:t.description,language:t.language}}}class Zke{constructor(t,n,r,o){this.id=t,this.uuid=n,this.url=r,this.isMain=o}}class kre{fromJson(t){return new Zke(t.id,t.uuid,t.video,t.is_main)}toJson(t){return{id:t.id,video:t.url}}}class TB{constructor(t,n,r){this.id=t,this.nameShort=n,this.nameLong=r}}class e2e{fromJson(t){return new TB(t.id,t.short_name,t.full_name)}toJson(t){return{}}}const bh=2,_re="en",t2e=new TB(bh,_re,"English"),n2e=21,r2e=1,o2e=1,i2e=2,a2e="variations",s2e="detail",l2e="permission",dv="measurements",fv="measurements-categories";var st=(e=>(e.ROUTINE_OVERVIEW="routine-overview",e.ROUTINE_DETAIL="routine-detail",e.SESSION_SEARCH="session-search",e.SESSIONS_FULL="sessions-full",e.ROUTINE_LOGS="routine-logs",e.ROUTINE_LOG_DATA="routine-log-data",e.ROUTINE_STATS="routine-stats",e.ROUTINES_ACTIVE="routines-active",e.ROUTINES_SHALLOW="routines-shallow",e.PRIVATE_TEMPLATES="private-templates",e.PUBLIC_TEMPLATES="public-templates",e.NUTRITIONAL_PLANS="nutritional-plans",e.NUTRITIONAL_PLAN="nutritional-plan",e.NUTRITIONAL_PLAN_DIARY="nutritional-plan-diary",e.NUTRITIONAL_PLAN_LAST="nutritional-plan-last",e.INGREDIENT="ingredient",e.BODY_WEIGHT="body-weight",e.ROUTINE_WEIGHT_UNITS="weight-units",e.ROUTINE_REP_UNITS="rep-units",e.QUERY_PROFILE="profile",e.EXERCISES="exercises",e.EXERCISE_VARIATIONS="variations",e.EXERCISE_DETAIL="detail",e.LANGUAGES="languages",e.CATEGORIES="categories",e.EQUIPMENT="equipment",e.MUSCLES="muscles",e.QUERY_NOTES="notes",e))(st||{}),St=(e=>(e.MEAL="meal",e.MEAL_ITEM="mealitem",e.NUTRITIONAL_DIARY="nutritiondiary",e.INGREDIENT_PATH="ingredientinfo",e.INGREDIENT_SEARCH_PATH="ingredient/search",e.INGREDIENT_WEIGHT_UNIT="ingredientweightunit",e.ROUTINE="routine",e.WEIGHT_CONFIG="weight-config",e.MAX_WEIGHT_CONFIG="max-weight-config",e.REPETITIONS_CONFIG="repetitions-config",e.MAX_REPS_CONFIG="max-repetitions-config",e.RIR_CONFIG="rir-config",e.MAX_RIR_CONFIG="max-rir-config",e.NR_OF_SETS_CONFIG="sets-config",e.MAX_NR_OF_SETS_CONFIG="max-sets-config",e.REST_CONFIG="rest-config",e.MAX_REST_CONFIG="max-rest-config",e.DAY="day",e.SLOT="slot",e.SLOT_ENTRY="slot-entry",e.SESSION="workoutsession",e.WORKOUT_LOG="workoutlog",e.PRIVATE_TEMPLATE="templates",e.PUBLIC_TEMPLATE="public-templates",e.API_PROFILE_PATH="userprofile",e))(St||{});const KN="999",c2e=["#2a4c7d","#5b5291","#8e5298","#bf5092","#e7537e","#ff6461","#ff813d","#ffa600"],u2e=["#2a4c7d","#825298","#d45089","#ff6a59","#ffa600"],d2e=["#2a4c7d","#d45089","#ffa600"],YN={pageSizeOptions:[5,10,25,50,100],pageSize:10},f2e="Europe/Berlin",uy="en",EI=3e3,$re=500;class p2e{constructor(t,n,r,o,i,a,s,l,c,u,f){Ce(this,"translations",[]);Ce(this,"videos",[]);Ce(this,"authors",[]);this.id=t,this.uuid=n,this.category=r,this.equipment=o,this.muscles=i,this.musclesSecondary=a,this.images=s,this.variationId=l,c&&(this.translations=c),u&&(this.videos=u),f&&(this.authors=f)}get availableLanguages(){return this.translations.map(t=>t.language)}get mainImage(){return this.images.find(t=>t.isMain)}get sideImages(){return this.images.filter(t=>!t.isMain)}getTranslation(t){const n=t!=null?t.id:bh;let r=this.translations.find(o=>o.language===n);return r||(r=this.translations.find(o=>o.language===bh)),r||this.translations[0]}}class Nre{fromJson(t){const n=new Are,r=new Pre,o=new xre,i=new qN,a=new EB,s=new kre,l=new p2e(t.id,t.uuid,n.fromJson(t.category),t.equipment.map(c=>r.fromJson(c)),t.muscles.map(c=>o.fromJson(c)),t.muscles_secondary.map(c=>o.fromJson(c)),t.images.map(c=>i.fromJson(c)),t.variations,t.translations.map(c=>a.fromJson(c)),t.videos.map(c=>s.fromJson(c)),t.author_history);if(l.translations.some(c=>c.language===bh)||console.info(`No english translation found for exercise base ${l.uuid}!`),l.translations.length===0)throw new Error(`No translations found for exercise base ${l.uuid}!`);return l}toJson(t){return{id:t.id,uuid:t.uuid,category:t.category.id,equipment:t.equipment.map(n=>n.id),muscles:t.muscles.map(n=>n.id),muscles_secondary:t.musclesSecondary.map(n=>n.id),images:t.images.map(n=>new qN().toJson(n))}}}const OB="exerciseinfo",IB="exercise";function Lre(e){const t=new Nre,n=[];for(const r of e.results)try{n.push(t.fromJson(r))}catch(o){console.error("An error happened, skipping base:",o)}return n}const h2e=async()=>{const e=ft(OB,{query:{limit:900}}),t=await it.get(e,{headers:ht()});return Lre(t.data)},pv=async e=>{const t=new Nre,n=ft(OB,{id:e}),r=await it.get(n,{headers:ht()});return t.fromJson(r.data)},m2e=async e=>{if(!e)return[];const t=ft(OB,{query:{variations:e}}),n=await it.get(t,{headers:ht()});return Lre(n.data)},g2e=async(e,t,n,r,o,i)=>{const a=ft(IB),s={category:e,equipment:t,muscles:n,muscles_secondary:r,variation_id:o,license_author:i};return(await it.post(a,s,{headers:ht()})).data.id},PB=async(e,t)=>{const n=ft(IB,{id:e});return(await it.patch(n,t,{headers:ht()})).status},pq=async(e,t)=>{const r=ft(IB,t===void 0?{id:e}:{id:e,query:{replaced_by:t}});return(await it.delete(r,{headers:ht()})).status},AB="exercise-translation",y2e="exercise/search",v2e=async(e,t=_re,n=!0)=>{const r=[t];t!==uy&&n&&r.push(uy);const o=ft(y2e,{query:{term:e,language:r.join(",")}}),{data:i}=await it.get(o);return i.suggestions},QN=async e=>{const{exerciseId:t,languageId:n,name:r,description:o,author:i}=e,a=ft(AB),s={exercise:t,language:n,name:r,description:o,license_author:i},l=await it.post(a,s,{headers:ht()});return new EB().fromJson(l.data)},b2e=async e=>{const{id:t,exerciseId:n,languageId:r,name:o,description:i}=e,a=ft(AB,{id:t}),s={exercise:n,language:r,name:o,description:i},l=await it.patch(a,s,{headers:ht()});return new EB().fromJson(l.data)},x2e=async e=>{const t=ft(AB,{id:e});return(await it.delete(t,{headers:ht()})).status},S2e="language",w2e=async()=>{const e=ft(S2e),{data:t}=await it.get(e,{headers:ht()}),n=new e2e;return t.results.map(r=>n.fromJson(r))},Gu=(e,t)=>{const n=e.split("-")[0],r=t.find(o=>o.nameShort===n);if(r)return r},Fre="exerciseimage",jre=async e=>{const t=ft(Fre),n=ht();n["Content-Type"]="multipart/form-data";const r=await it.post(t,{exercise:e.exerciseId,image:e.image,license_title:e.imageData.title,license_object_url:e.imageData.objectUrl,license_author:e.imageData.author,license_author_url:e.imageData.authorUrl,license_derivative_source_url:e.imageData.derivativeSourceUrl,style:e.imageData.style},{headers:n});return new qN().fromJson(r.data)},C2e=async e=>{const t=ft(Fre,{id:e}),n=ht();return(await it.delete(t,{headers:n})).status},Bre="exercisealias",XN=async(e,t)=>{const n=ft(Bre),r=await it.post(n,{translation:e,alias:t},{headers:ht()});return new Mre().fromJson(r.data)},E2e=async e=>(await it.delete(ft(Bre,{id:e}),{headers:ht()})).status,zre="video",T2e=async(e,t,n)=>{const r=ft(zre),o=ht();o["Content-Type"]="multipart/form-data";const i=await it.post(r,{exercise:e,license_author:t,video:n},{headers:o});return new kre().fromJson(i.data)},O2e=async e=>{const t=ft(zre,{id:e}),n=ht();return(await it.delete(t,{headers:n})).status},Qi="r",I2e="+",P2e="-",JN=["weight","repetitions","rir","rest"],A2e=[{value:"abs",label:"Absolute"},{value:"percent",label:"Percent"}],M2e=[{value:I2e,label:"Add"},{value:P2e,label:"Subtract"},{value:Qi,label:"Replace"}],Vre=[{value:"",label:"-/-"},...[0,.5,1,1.5,2,2.5,3,3.5,4].map(e=>({value:e,label:e.toString()})),{value:4.5,label:"4+"}],Hre=[...Vre];class R2e{constructor(t){Ce(this,"id");Ce(this,"slotEntryId");Ce(this,"iteration");Ce(this,"value");Ce(this,"operation");Ce(this,"step");Ce(this,"repeat");Ce(this,"requirements");this.id=t.id,this.slotEntryId=t.slotEntryId,this.iteration=t.iteration,this.value=t.value,this.operation=t.operation??"r",this.step=t.step??"abs",this.repeat=t.repeat??!1,this.requirements=t.requirements??null}get replace(){return this.operation==="r"}}class MB{constructor(){Ce(this,"fromJson",t=>new R2e({id:t.id,slotEntryId:t.slot_entry,iteration:t.iteration,value:parseFloat(t.value),operation:t.operation,step:t.step,repeat:t.repeat,requirements:t.requirements}));Ce(this,"toJson",t=>({slot_entry:t.slotEntryId,iteration:t.iteration,value:t.value,operation:t.operation,step:t.step,repeat:t.repeat,requirements:t.requirements}))}}class D2e{constructor(t){Ce(this,"id");Ce(this,"slotId");Ce(this,"exerciseId");Ce(this,"repetitionUnitId");Ce(this,"repetitionRounding");Ce(this,"weightUnitId");Ce(this,"weightRounding");Ce(this,"order");Ce(this,"comment");Ce(this,"type");Ce(this,"config");Ce(this,"weightConfigs",[]);Ce(this,"maxWeightConfigs",[]);Ce(this,"repetitionsConfigs",[]);Ce(this,"maxRepetitionsConfigs",[]);Ce(this,"restTimeConfigs",[]);Ce(this,"maxRestTimeConfigs",[]);Ce(this,"nrOfSetsConfigs",[]);Ce(this,"maxNrOfSetsConfigs",[]);Ce(this,"rirConfigs",[]);Ce(this,"maxRirConfigs",[]);Ce(this,"exercise");Ce(this,"repetitionUnit",null);Ce(this,"weightUnit",null);this.id=t.id,this.slotId=t.slotId,this.exerciseId=t.exerciseId,this.exercise=t.exercise,this.repetitionUnitId=t.repetitionUnitId,this.repetitionRounding=t.repetitionRounding,this.weightUnitId=t.weightUnitId,this.weightRounding=t.weightRounding,this.order=t.order,this.comment=t.comment,this.type=t.type,this.config=t.config,t.configs!==void 0&&(this.weightConfigs=t.configs.weightConfigs??[],this.maxWeightConfigs=t.configs.maxWeightConfigs??[],this.repetitionsConfigs=t.configs.repetitionsConfigs??[],this.maxRepetitionsConfigs=t.configs.maxRepetitionsConfigs??[],this.restTimeConfigs=t.configs.restTimeConfigs??[],this.maxRestTimeConfigs=t.configs.maxRestTimeConfigs??[],this.nrOfSetsConfigs=t.configs.nrOfSetsConfigs??[],this.maxNrOfSetsConfigs=t.configs.maxNrOfSetsConfigs??[],this.rirConfigs=t.configs.rirConfigs??[],this.maxRirConfigs=t.configs.maxRirConfigs??[])}get hasProgressionRules(){return this.weightConfigs.length>1||this.maxWeightConfigs.length>1||this.repetitionsConfigs.length>1||this.maxRepetitionsConfigs.length>1||this.restTimeConfigs.length>1||this.maxRestTimeConfigs.length>1||this.nrOfSetsConfigs.length>1||this.maxNrOfSetsConfigs.length>1||this.rirConfigs.length>1||this.maxRirConfigs.length>1}}class k2e{constructor(){Ce(this,"fromJson",t=>{const n=new MB,r={weightConfigs:[],maxWeightConfigs:[],repetitionsConfigs:[],maxRepetitionsConfigs:[],restTimeConfigs:[],maxRestTimeConfigs:[],nrOfSetsConfigs:[],maxNrOfSetsConfigs:[],rirConfigs:[],maxRirConfigs:[]};return Object.hasOwn(t,"weight_configs")&&(r.weightConfigs=t.weight_configs.map(o=>n.fromJson(o))),Object.hasOwn(t,"max_weight_configs")&&(r.maxWeightConfigs=t.max_weight_configs.map(o=>n.fromJson(o))),Object.hasOwn(t,"repetitions_configs")&&(r.repetitionsConfigs=t.repetitions_configs.map(o=>n.fromJson(o))),Object.hasOwn(t,"max_repetitions_configs")&&(r.maxRepetitionsConfigs=t.max_repetitions_configs.map(o=>n.fromJson(o))),Object.hasOwn(t,"set_nr_configs")&&(r.nrOfSetsConfigs=t.set_nr_configs.map(o=>n.fromJson(o))),Object.hasOwn(t,"max_set_nr_configs")&&(r.maxNrOfSetsConfigs=t.max_set_nr_configs.map(o=>n.fromJson(o))),Object.hasOwn(t,"rest_configs")&&(r.restTimeConfigs=t.rest_configs.map(o=>n.fromJson(o))),Object.hasOwn(t,"max_rest_configs")&&(r.maxRestTimeConfigs=t.max_rest_configs.map(o=>n.fromJson(o))),Object.hasOwn(t,"rir_configs")&&(r.rirConfigs=t.rir_configs.map(o=>n.fromJson(o))),Object.hasOwn(t,"max_rir_configs")&&(r.maxRirConfigs=t.max_rir_configs.map(o=>n.fromJson(o))),new D2e({id:t.id,slotId:t.slot,exerciseId:t.exercise,repetitionUnitId:t.repetition_unit,repetitionRounding:t.repetition_rounding,weightUnitId:t.weight_unit,weightRounding:t.weight_rounding,order:t.order,comment:t.comment,type:t.type,config:t.config,configs:r})});Ce(this,"toJson",t=>({slot:t.slotId,exercise:t.exerciseId,repetition_unit:t.repetitionUnitId,repetition_rounding:t.repetitionRounding,weight_unit:t.weightUnitId,weight_rounding:t.weightRounding,order:t.order,comment:t.comment,type:t.type,config:t.config}))}}const RB=new k2e;class _2e{constructor({id:t,dayId:n,order:r,comment:o,config:i,entries:a=[]}){Ce(this,"id");Ce(this,"dayId");Ce(this,"order");Ce(this,"comment");Ce(this,"config");Ce(this,"entries",[]);this.id=t,this.dayId=n,this.order=r,this.comment=o,this.config=i,this.entries=a}}class DB{constructor(){Ce(this,"fromJson",t=>new _2e({id:t.id,dayId:t.day,order:t.order,comment:t.comment,config:t.config,entries:Object.hasOwn(t,"entries")?t.entries.map(n=>RB.fromJson(n)):[]}))}toJson(t){return{id:t.id,day:t.dayId,order:t.order,comment:t.order,config:t.config}}}class Ure{constructor({id:t,order:n,name:r,description:o,isRest:i,needLogsToAdvance:a,type:s,config:l,slots:c=[]}){Ce(this,"id");Ce(this,"order");Ce(this,"name");Ce(this,"description");Ce(this,"isRest");Ce(this,"needLogsToAdvance");Ce(this,"type");Ce(this,"config");Ce(this,"slots",[]);this.id=t,this.order=n,this.name=r,this.description=o,this.isRest=i,this.needLogsToAdvance=a,this.type=s,this.config=l,this.slots=c}get isSpecialType(){return this.type!=="custom"}getDisplayName(){return this.isRest?hr.t("routines.restDay"):this.name}}const Gre=e=>e===null||e.isRest?hr.t("routines.restDay"):e.getDisplayName();class TI{constructor(){Ce(this,"fromJson",t=>new Ure({id:t.id,order:t.order,name:t.name,description:t.description,isRest:t.is_rest,needLogsToAdvance:t.need_logs_to_advance,type:t.type,config:t.config,slots:Object.hasOwn(t,"slots")?t.slots.map(n=>new DB().fromJson(n)):[]}));Ce(this,"toJson",t=>({order:t.order,description:t.description,is_rest:t.isRest,need_logs_to_advance:t.needLogsToAdvance,type:t.type,config:t.config}))}}class qre{constructor(t){Ce(this,"exercises",{});Ce(this,"muscle",{});Ce(this,"upper_body",0);Ce(this,"lower_body",0);Ce(this,"total",0);Object.assign(this,t)}}class SE{constructor(t){Ce(this,"mesocycle",new qre);Ce(this,"iteration",{});Ce(this,"weekly",{});Ce(this,"daily",{});Object.assign(this,t)}}class $2e{constructor(t){Ce(this,"volume",new SE);Ce(this,"intensity",new SE);Ce(this,"sets",new SE);Object.assign(this,t)}}class N2e{fromJson(t){const n=o=>{const i={};for(const s in o.exercises)i[parseInt(s)]=parseFloat(o.exercises[s]);const a={};for(const s in o.muscle)a[parseInt(s)]=parseFloat(o.muscle[s]);return new qre({exercises:i,muscle:a,upper_body:parseFloat(o.upper_body),lower_body:parseFloat(o.lower_body),total:parseFloat(o.total)})},r=o=>{const i={};for(const l in o.iteration)i[l]=n(o.iteration[l]);const a={};for(const l in o.weekly)a[l]=n(o.weekly[l]);const s={};for(const l in o.daily)s[l]=n(o.daily[l]);return new SE({mesocycle:n(o.mesocycle),iteration:i,weekly:a,daily:s})};return new $2e({volume:r(t.volume),intensity:r(t.intensity),sets:r(t.sets)})}}class zh extends Error{}class L2e extends zh{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class F2e extends zh{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class j2e extends zh{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class mg extends zh{}class Wre extends zh{constructor(t){super(`Invalid unit ${t}`)}}class ki extends zh{}class Nd extends zh{constructor(){super("Zone is an abstract class")}}const Rt="numeric",Yl="short",Xa="long",sT={year:Rt,month:Rt,day:Rt},Kre={year:Rt,month:Yl,day:Rt},B2e={year:Rt,month:Yl,day:Rt,weekday:Yl},Yre={year:Rt,month:Xa,day:Rt},Qre={year:Rt,month:Xa,day:Rt,weekday:Xa},Xre={hour:Rt,minute:Rt},Jre={hour:Rt,minute:Rt,second:Rt},Zre={hour:Rt,minute:Rt,second:Rt,timeZoneName:Yl},eoe={hour:Rt,minute:Rt,second:Rt,timeZoneName:Xa},toe={hour:Rt,minute:Rt,hourCycle:"h23"},noe={hour:Rt,minute:Rt,second:Rt,hourCycle:"h23"},roe={hour:Rt,minute:Rt,second:Rt,hourCycle:"h23",timeZoneName:Yl},ooe={hour:Rt,minute:Rt,second:Rt,hourCycle:"h23",timeZoneName:Xa},ioe={year:Rt,month:Rt,day:Rt,hour:Rt,minute:Rt},aoe={year:Rt,month:Rt,day:Rt,hour:Rt,minute:Rt,second:Rt},soe={year:Rt,month:Yl,day:Rt,hour:Rt,minute:Rt},loe={year:Rt,month:Yl,day:Rt,hour:Rt,minute:Rt,second:Rt},z2e={year:Rt,month:Yl,day:Rt,weekday:Yl,hour:Rt,minute:Rt},coe={year:Rt,month:Xa,day:Rt,hour:Rt,minute:Rt,timeZoneName:Yl},uoe={year:Rt,month:Xa,day:Rt,hour:Rt,minute:Rt,second:Rt,timeZoneName:Yl},doe={year:Rt,month:Xa,day:Rt,weekday:Xa,hour:Rt,minute:Rt,timeZoneName:Xa},foe={year:Rt,month:Xa,day:Rt,weekday:Xa,hour:Rt,minute:Rt,second:Rt,timeZoneName:Xa};class fw{get type(){throw new Nd}get name(){throw new Nd}get ianaName(){return this.name}get isUniversal(){throw new Nd}offsetName(t,n){throw new Nd}formatOffset(t,n){throw new Nd}offset(t){throw new Nd}equals(t){throw new Nd}get isValid(){throw new Nd}}let HR=null;class OI extends fw{static get instance(){return HR===null&&(HR=new OI),HR}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return Coe(t,n,r)}formatOffset(t,n){return ex(this.offset(t),n)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}const ZN=new Map;function V2e(e){let t=ZN.get(e);return t===void 0&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),ZN.set(e,t)),t}const H2e={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function U2e(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,o,i,a,s,l,c,u]=r;return[a,o,i,s,l,c,u]}function G2e(e,t){const n=e.formatToParts(t),r=[];for(let o=0;o<n.length;o++){const{type:i,value:a}=n[o],s=H2e[i];i==="era"?r[s]=a:mn(s)||(r[s]=parseInt(a,10))}return r}const UR=new Map;class qu extends fw{static create(t){let n=UR.get(t);return n===void 0&&UR.set(t,n=new qu(t)),n}static resetCache(){UR.clear(),ZN.clear()}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=qu.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return Coe(t,n,r,this.name)}formatOffset(t,n){return ex(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const r=V2e(this.name);let[o,i,a,s,l,c,u]=r.formatToParts?G2e(r,n):U2e(r,n);s==="BC"&&(o=-Math.abs(o)+1);const h=PI({year:o,month:i,day:a,hour:l===24?0:l,minute:c,second:u,millisecond:0});let m=+n;const g=m%1e3;return m-=g>=0?g:1e3+g,(h-m)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let hq={};function q2e(e,t={}){const n=JSON.stringify([e,t]);let r=hq[n];return r||(r=new Intl.ListFormat(e,t),hq[n]=r),r}const eL=new Map;function tL(e,t={}){const n=JSON.stringify([e,t]);let r=eL.get(n);return r===void 0&&(r=new Intl.DateTimeFormat(e,t),eL.set(n,r)),r}const nL=new Map;function W2e(e,t={}){const n=JSON.stringify([e,t]);let r=nL.get(n);return r===void 0&&(r=new Intl.NumberFormat(e,t),nL.set(n,r)),r}const rL=new Map;function K2e(e,t={}){const{base:n,...r}=t,o=JSON.stringify([e,r]);let i=rL.get(o);return i===void 0&&(i=new Intl.RelativeTimeFormat(e,t),rL.set(o,i)),i}let _0=null;function Y2e(){return _0||(_0=new Intl.DateTimeFormat().resolvedOptions().locale,_0)}const oL=new Map;function poe(e){let t=oL.get(e);return t===void 0&&(t=new Intl.DateTimeFormat(e).resolvedOptions(),oL.set(e,t)),t}const iL=new Map;function Q2e(e){let t=iL.get(e);if(!t){const n=new Intl.Locale(e);t="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,"minimalDays"in t||(t={...hoe,...t}),iL.set(e,t)}return t}function X2e(e){const t=e.indexOf("-x-");t!==-1&&(e=e.substring(0,t));const n=e.indexOf("-u-");if(n===-1)return[e];{let r,o;try{r=tL(e).resolvedOptions(),o=e}catch{const l=e.substring(0,n);r=tL(l).resolvedOptions(),o=l}const{numberingSystem:i,calendar:a}=r;return[o,i,a]}}function J2e(e,t,n){return(n||t)&&(e.includes("-u-")||(e+="-u"),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`)),e}function Z2e(e){const t=[];for(let n=1;n<=12;n++){const r=xt.utc(2009,n,1);t.push(e(r))}return t}function e_e(e){const t=[];for(let n=1;n<=7;n++){const r=xt.utc(2016,11,13+n);t.push(e(r))}return t}function P1(e,t,n,r){const o=e.listingMode();return o==="error"?null:o==="en"?n(t):r(t)}function t_e(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||poe(e.locale).numberingSystem==="latn"}class n_e{constructor(t,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:o,floor:i,...a}=r;if(!n||Object.keys(a).length>0){const s={useGrouping:!1,...r};r.padTo>0&&(s.minimumIntegerDigits=r.padTo),this.inf=W2e(t,s)}}format(t){if(this.inf){const n=this.floor?Math.floor(t):t;return this.inf.format(n)}else{const n=this.floor?Math.floor(t):LB(t,3);return Ao(n,this.padTo)}}}class r_e{constructor(t,n,r){this.opts=r,this.originalZone=void 0;let o;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){const a=-1*(t.offset/60),s=a>=0?`Etc/GMT+${a}`:`Etc/GMT${a}`;t.offset!==0&&qu.create(s).valid?(o=s,this.dt=t):(o="UTC",this.dt=t.offset===0?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else t.zone.type==="system"?this.dt=t:t.zone.type==="iana"?(this.dt=t,o=t.zone.name):(o="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);const i={...this.opts};i.timeZone=i.timeZone||o,this.dtf=tL(n,i)}format(){return this.originalZone?this.formatToParts().map(({value:t})=>t).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map(n=>{if(n.type==="timeZoneName"){const r=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...n,value:r}}else return n}):t}resolvedOptions(){return this.dtf.resolvedOptions()}}class o_e{constructor(t,n,r){this.opts={style:"long",...r},!n&&Soe()&&(this.rtf=K2e(t,r))}format(t,n){return this.rtf?this.rtf.format(t,n):O_e(n,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,n){return this.rtf?this.rtf.formatToParts(t,n):[]}}const hoe={firstDay:1,minimalDays:4,weekend:[6,7]};class ur{static fromOpts(t){return ur.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,n,r,o,i=!1){const a=t||to.defaultLocale,s=a||(i?"en-US":Y2e()),l=n||to.defaultNumberingSystem,c=r||to.defaultOutputCalendar,u=sL(o)||to.defaultWeekSettings;return new ur(s,l,c,u,a)}static resetCache(){_0=null,eL.clear(),nL.clear(),rL.clear(),oL.clear(),iL.clear()}static fromObject({locale:t,numberingSystem:n,outputCalendar:r,weekSettings:o}={}){return ur.create(t,n,r,o)}constructor(t,n,r,o,i){const[a,s,l]=X2e(t);this.locale=a,this.numberingSystem=n||s||null,this.outputCalendar=r||l||null,this.weekSettings=o,this.intl=J2e(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=t_e(this)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&n?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:ur.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,sL(t.weekSettings)||this.weekSettings,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,n=!1){return P1(this,t,Ooe,()=>{const r=n?{month:t,day:"numeric"}:{month:t},o=n?"format":"standalone";return this.monthsCache[o][t]||(this.monthsCache[o][t]=Z2e(i=>this.extract(i,r,"month"))),this.monthsCache[o][t]})}weekdays(t,n=!1){return P1(this,t,Aoe,()=>{const r=n?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},o=n?"format":"standalone";return this.weekdaysCache[o][t]||(this.weekdaysCache[o][t]=e_e(i=>this.extract(i,r,"weekday"))),this.weekdaysCache[o][t]})}meridiems(){return P1(this,void 0,()=>Moe,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[xt.utc(2016,11,13,9),xt.utc(2016,11,13,19)].map(n=>this.extract(n,t,"dayperiod"))}return this.meridiemCache})}eras(t){return P1(this,t,Roe,()=>{const n={era:t};return this.eraCache[t]||(this.eraCache[t]=[xt.utc(-40,1,1),xt.utc(2017,1,1)].map(r=>this.extract(r,n,"era"))),this.eraCache[t]})}extract(t,n,r){const o=this.dtFormatter(t,n),i=o.formatToParts(),a=i.find(s=>s.type.toLowerCase()===r);return a?a.value:null}numberFormatter(t={}){return new n_e(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,n={}){return new r_e(t,this.intl,n)}relFormatter(t={}){return new o_e(this.intl,this.isEnglish(),t)}listFormatter(t={}){return q2e(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||poe(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:woe()?Q2e(this.locale):hoe}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let GR=null;class ea extends fw{static get utcInstance(){return GR===null&&(GR=new ea(0)),GR}static instance(t){return t===0?ea.utcInstance:new ea(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new ea(AI(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${ex(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${ex(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return ex(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}class i_e extends fw{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Yd(e,t){if(mn(e)||e===null)return t;if(e instanceof fw)return e;if(d_e(e)){const n=e.toLowerCase();return n==="default"?t:n==="local"||n==="system"?OI.instance:n==="utc"||n==="gmt"?ea.utcInstance:ea.parseSpecifier(n)||qu.create(e)}else return gf(e)?ea.instance(e):typeof e=="object"&&"offset"in e&&typeof e.offset=="function"?e:new i_e(e)}const kB={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},mq={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},a_e=kB.hanidec.replace(/[\[|\]]/g,"").split("");function s_e(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(e[n].search(kB.hanidec)!==-1)t+=a_e.indexOf(e[n]);else for(const o in mq){const[i,a]=mq[o];r>=i&&r<=a&&(t+=r-i)}}return parseInt(t,10)}else return t}const aL=new Map;function l_e(){aL.clear()}function ml({numberingSystem:e},t=""){const n=e||"latn";let r=aL.get(n);r===void 0&&(r=new Map,aL.set(n,r));let o=r.get(t);return o===void 0&&(o=new RegExp(`${kB[n]}${t}`),r.set(t,o)),o}let gq=()=>Date.now(),yq="system",vq=null,bq=null,xq=null,Sq=60,wq,Cq=null;class to{static get now(){return gq}static set now(t){gq=t}static set defaultZone(t){yq=t}static get defaultZone(){return Yd(yq,OI.instance)}static get defaultLocale(){return vq}static set defaultLocale(t){vq=t}static get defaultNumberingSystem(){return bq}static set defaultNumberingSystem(t){bq=t}static get defaultOutputCalendar(){return xq}static set defaultOutputCalendar(t){xq=t}static get defaultWeekSettings(){return Cq}static set defaultWeekSettings(t){Cq=sL(t)}static get twoDigitCutoffYear(){return Sq}static set twoDigitCutoffYear(t){Sq=t%100}static get throwOnInvalid(){return wq}static set throwOnInvalid(t){wq=t}static resetCaches(){ur.resetCache(),qu.resetCache(),xt.resetCache(),l_e()}}class kl{constructor(t,n){this.reason=t,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const moe=[0,31,59,90,120,151,181,212,243,273,304,334],goe=[0,31,60,91,121,152,182,213,244,274,305,335];function zs(e,t){return new kl("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function _B(e,t,n){const r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const o=r.getUTCDay();return o===0?7:o}function yoe(e,t,n){return n+(pw(e)?goe:moe)[t-1]}function voe(e,t){const n=pw(e)?goe:moe,r=n.findIndex(i=>i<t),o=t-n[r];return{month:r+1,day:o}}function $B(e,t){return(e-t+7)%7+1}function lT(e,t=4,n=1){const{year:r,month:o,day:i}=e,a=yoe(r,o,i),s=$B(_B(r,o,i),n);let l=Math.floor((a-s+14-t)/7),c;return l<1?(c=r-1,l=Nx(c,t,n)):l>Nx(r,t,n)?(c=r+1,l=1):c=r,{weekYear:c,weekNumber:l,weekday:s,...MI(e)}}function Eq(e,t=4,n=1){const{weekYear:r,weekNumber:o,weekday:i}=e,a=$B(_B(r,1,t),n),s=$g(r);let l=o*7+i-a-7+t,c;l<1?(c=r-1,l+=$g(c)):l>s?(c=r+1,l-=$g(r)):c=r;const{month:u,day:f}=voe(c,l);return{year:c,month:u,day:f,...MI(e)}}function qR(e){const{year:t,month:n,day:r}=e,o=yoe(t,n,r);return{year:t,ordinal:o,...MI(e)}}function Tq(e){const{year:t,ordinal:n}=e,{month:r,day:o}=voe(t,n);return{year:t,month:r,day:o,...MI(e)}}function Oq(e,t){if(!mn(e.localWeekday)||!mn(e.localWeekNumber)||!mn(e.localWeekYear)){if(!mn(e.weekday)||!mn(e.weekNumber)||!mn(e.weekYear))throw new mg("Cannot mix locale-based week fields with ISO-based week fields");return mn(e.localWeekday)||(e.weekday=e.localWeekday),mn(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),mn(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function c_e(e,t=4,n=1){const r=II(e.weekYear),o=Vs(e.weekNumber,1,Nx(e.weekYear,t,n)),i=Vs(e.weekday,1,7);return r?o?i?!1:zs("weekday",e.weekday):zs("week",e.weekNumber):zs("weekYear",e.weekYear)}function u_e(e){const t=II(e.year),n=Vs(e.ordinal,1,$g(e.year));return t?n?!1:zs("ordinal",e.ordinal):zs("year",e.year)}function boe(e){const t=II(e.year),n=Vs(e.month,1,12),r=Vs(e.day,1,cT(e.year,e.month));return t?n?r?!1:zs("day",e.day):zs("month",e.month):zs("year",e.year)}function xoe(e){const{hour:t,minute:n,second:r,millisecond:o}=e,i=Vs(t,0,23)||t===24&&n===0&&r===0&&o===0,a=Vs(n,0,59),s=Vs(r,0,59),l=Vs(o,0,999);return i?a?s?l?!1:zs("millisecond",o):zs("second",r):zs("minute",n):zs("hour",t)}function mn(e){return typeof e>"u"}function gf(e){return typeof e=="number"}function II(e){return typeof e=="number"&&e%1===0}function d_e(e){return typeof e=="string"}function f_e(e){return Object.prototype.toString.call(e)==="[object Date]"}function Soe(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function woe(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function p_e(e){return Array.isArray(e)?e:[e]}function Iq(e,t,n){if(e.length!==0)return e.reduce((r,o)=>{const i=[t(o),o];return r&&n(r[0],i[0])===r[0]?r:i},null)[1]}function h_e(e,t){return t.reduce((n,r)=>(n[r]=e[r],n),{})}function dy(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function sL(e){if(e==null)return null;if(typeof e!="object")throw new ki("Week settings must be an object");if(!Vs(e.firstDay,1,7)||!Vs(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(t=>!Vs(t,1,7)))throw new ki("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function Vs(e,t,n){return II(e)&&e>=t&&e<=n}function m_e(e,t){return e-t*Math.floor(e/t)}function Ao(e,t=2){const n=e<0;let r;return n?r="-"+(""+-e).padStart(t,"0"):r=(""+e).padStart(t,"0"),r}function Hd(e){if(!(mn(e)||e===null||e===""))return parseInt(e,10)}function mp(e){if(!(mn(e)||e===null||e===""))return parseFloat(e)}function NB(e){if(!(mn(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function LB(e,t,n=!1){const r=10**t;return(n?Math.trunc:Math.round)(e*r)/r}function pw(e){return e%4===0&&(e%100!==0||e%400===0)}function $g(e){return pw(e)?366:365}function cT(e,t){const n=m_e(t-1,12)+1,r=e+(t-n)/12;return n===2?pw(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function PI(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function Pq(e,t,n){return-$B(_B(e,1,t),n)+t-1}function Nx(e,t=4,n=1){const r=Pq(e,t,n),o=Pq(e+1,t,n);return($g(e)-r+o)/7}function lL(e){return e>99?e:e>to.twoDigitCutoffYear?1900+e:2e3+e}function Coe(e,t,n,r=null){const o=new Date(e),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(i.timeZone=r);const a={timeZoneName:t,...i},s=new Intl.DateTimeFormat(n,a).formatToParts(o).find(l=>l.type.toLowerCase()==="timezonename");return s?s.value:null}function AI(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0,o=n<0||Object.is(n,-0)?-r:r;return n*60+o}function Eoe(e){const t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new ki(`Invalid unit value ${e}`);return t}function uT(e,t){const n={};for(const r in e)if(dy(e,r)){const o=e[r];if(o==null)continue;n[t(r)]=Eoe(o)}return n}function ex(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),o=e>=0?"+":"-";switch(t){case"short":return`${o}${Ao(n,2)}:${Ao(r,2)}`;case"narrow":return`${o}${n}${r>0?`:${r}`:""}`;case"techie":return`${o}${Ao(n,2)}${Ao(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function MI(e){return h_e(e,["hour","minute","second","millisecond"])}const g_e=["January","February","March","April","May","June","July","August","September","October","November","December"],Toe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],y_e=["J","F","M","A","M","J","J","A","S","O","N","D"];function Ooe(e){switch(e){case"narrow":return[...y_e];case"short":return[...Toe];case"long":return[...g_e];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const Ioe=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Poe=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],v_e=["M","T","W","T","F","S","S"];function Aoe(e){switch(e){case"narrow":return[...v_e];case"short":return[...Poe];case"long":return[...Ioe];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Moe=["AM","PM"],b_e=["Before Christ","Anno Domini"],x_e=["BC","AD"],S_e=["B","A"];function Roe(e){switch(e){case"narrow":return[...S_e];case"short":return[...x_e];case"long":return[...b_e];default:return null}}function w_e(e){return Moe[e.hour<12?0:1]}function C_e(e,t){return Aoe(t)[e.weekday-1]}function E_e(e,t){return Ooe(t)[e.month-1]}function T_e(e,t){return Roe(t)[e.year<0?0:1]}function O_e(e,t,n="always",r=!1){const o={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},i=["hours","minutes","seconds"].indexOf(e)===-1;if(n==="auto"&&i){const f=e==="days";switch(t){case 1:return f?"tomorrow":`next ${o[e][0]}`;case-1:return f?"yesterday":`last ${o[e][0]}`;case 0:return f?"today":`this ${o[e][0]}`}}const a=Object.is(t,-0)||t<0,s=Math.abs(t),l=s===1,c=o[e],u=r?l?c[1]:c[2]||c[1]:l?o[e][0]:e;return a?`${s} ${u} ago`:`in ${s} ${u}`}function Aq(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const I_e={D:sT,DD:Kre,DDD:Yre,DDDD:Qre,t:Xre,tt:Jre,ttt:Zre,tttt:eoe,T:toe,TT:noe,TTT:roe,TTTT:ooe,f:ioe,ff:soe,fff:coe,ffff:doe,F:aoe,FF:loe,FFF:uoe,FFFF:foe};class Li{static create(t,n={}){return new Li(t,n)}static parseFormat(t){let n=null,r="",o=!1;const i=[];for(let a=0;a<t.length;a++){const s=t.charAt(a);s==="'"?(r.length>0&&i.push({literal:o||/^\s+$/.test(r),val:r}),n=null,r="",o=!o):o||s===n?r+=s:(r.length>0&&i.push({literal:/^\s+$/.test(r),val:r}),r=s,n=s)}return r.length>0&&i.push({literal:o||/^\s+$/.test(r),val:r}),i}static macroTokenToFormatOpts(t){return I_e[t]}constructor(t,n){this.opts=n,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...n}).format()}dtFormatter(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n})}formatDateTime(t,n){return this.dtFormatter(t,n).format()}formatDateTimeParts(t,n){return this.dtFormatter(t,n).formatToParts()}formatInterval(t,n){return this.dtFormatter(t.start,n).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,n){return this.dtFormatter(t,n).resolvedOptions()}num(t,n=0){if(this.opts.forceSimple)return Ao(t,n);const r={...this.opts};return n>0&&(r.padTo=n),this.loc.numberFormatter(r).format(t)}formatDateTimeFromString(t,n){const r=this.loc.listingMode()==="en",o=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",i=(m,g)=>this.loc.extract(t,m,g),a=m=>t.isOffsetFixed&&t.offset===0&&m.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,m.format):"",s=()=>r?w_e(t):i({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(m,g)=>r?E_e(t,m):i(g?{month:m}:{month:m,day:"numeric"},"month"),c=(m,g)=>r?C_e(t,m):i(g?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),u=m=>{const g=Li.macroTokenToFormatOpts(m);return g?this.formatWithSystemDefault(t,g):m},f=m=>r?T_e(t,m):i({era:m},"era"),h=m=>{switch(m){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return a({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return a({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return a({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return s();case"d":return o?i({day:"numeric"},"day"):this.num(t.day);case"dd":return o?i({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return c("short",!0);case"cccc":return c("long",!0);case"ccccc":return c("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return c("short",!1);case"EEEE":return c("long",!1);case"EEEEE":return c("narrow",!1);case"L":return o?i({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return o?i({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return l("short",!0);case"LLLL":return l("long",!0);case"LLLLL":return l("narrow",!0);case"M":return o?i({month:"numeric"},"month"):this.num(t.month);case"MM":return o?i({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return l("short",!1);case"MMMM":return l("long",!1);case"MMMMM":return l("narrow",!1);case"y":return o?i({year:"numeric"},"year"):this.num(t.year);case"yy":return o?i({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return o?i({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return o?i({year:"numeric"},"year"):this.num(t.year,6);case"G":return f("short");case"GG":return f("long");case"GGGGG":return f("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"n":return this.num(t.localWeekNumber);case"nn":return this.num(t.localWeekNumber,2);case"ii":return this.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(t.localWeekYear,4);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return u(m)}};return Aq(Li.parseFormat(n),h)}formatDurationFromString(t,n){const r=l=>{switch(l[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},o=l=>c=>{const u=r(c);return u?this.num(l.get(u),c.length):c},i=Li.parseFormat(n),a=i.reduce((l,{literal:c,val:u})=>c?l:l.concat(u),[]),s=t.shiftTo(...a.map(r).filter(l=>l));return Aq(i,o(s))}}const Doe=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function hv(...e){const t=e.reduce((n,r)=>n+r.source,"");return RegExp(`^${t}$`)}function mv(...e){return t=>e.reduce(([n,r,o],i)=>{const[a,s,l]=i(t,o);return[{...n,...a},s||r,l]},[{},null,1]).slice(0,2)}function gv(e,...t){if(e==null)return[null,null];for(const[n,r]of t){const o=n.exec(e);if(o)return r(o)}return[null,null]}function koe(...e){return(t,n)=>{const r={};let o;for(o=0;o<e.length;o++)r[e[o]]=Hd(t[n+o]);return[r,null,n+o]}}const _oe=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,P_e=`(?:${_oe.source}?(?:\\[(${Doe.source})\\])?)?`,FB=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,$oe=RegExp(`${FB.source}${P_e}`),jB=RegExp(`(?:T${$oe.source})?`),A_e=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,M_e=/(\d{4})-?W(\d\d)(?:-?(\d))?/,R_e=/(\d{4})-?(\d{3})/,D_e=koe("weekYear","weekNumber","weekDay"),k_e=koe("year","ordinal"),__e=/(\d{4})-(\d\d)-(\d\d)/,Noe=RegExp(`${FB.source} ?(?:${_oe.source}|(${Doe.source}))?`),$_e=RegExp(`(?: ${Noe.source})?`);function Ng(e,t,n){const r=e[t];return mn(r)?n:Hd(r)}function N_e(e,t){return[{year:Ng(e,t),month:Ng(e,t+1,1),day:Ng(e,t+2,1)},null,t+3]}function yv(e,t){return[{hours:Ng(e,t,0),minutes:Ng(e,t+1,0),seconds:Ng(e,t+2,0),milliseconds:NB(e[t+3])},null,t+4]}function hw(e,t){const n=!e[t]&&!e[t+1],r=AI(e[t+1],e[t+2]),o=n?null:ea.instance(r);return[{},o,t+3]}function mw(e,t){const n=e[t]?qu.create(e[t]):null;return[{},n,t+1]}const L_e=RegExp(`^T?${FB.source}$`),F_e=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function j_e(e){const[t,n,r,o,i,a,s,l,c]=e,u=t[0]==="-",f=l&&l[0]==="-",h=(m,g=!1)=>m!==void 0&&(g||m&&u)?-m:m;return[{years:h(mp(n)),months:h(mp(r)),weeks:h(mp(o)),days:h(mp(i)),hours:h(mp(a)),minutes:h(mp(s)),seconds:h(mp(l),l==="-0"),milliseconds:h(NB(c),f)}]}const B_e={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function BB(e,t,n,r,o,i,a){const s={year:t.length===2?lL(Hd(t)):Hd(t),month:Toe.indexOf(n)+1,day:Hd(r),hour:Hd(o),minute:Hd(i)};return a&&(s.second=Hd(a)),e&&(s.weekday=e.length>3?Ioe.indexOf(e)+1:Poe.indexOf(e)+1),s}const z_e=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function V_e(e){const[,t,n,r,o,i,a,s,l,c,u,f]=e,h=BB(t,o,r,n,i,a,s);let m;return l?m=B_e[l]:c?m=0:m=AI(u,f),[h,new ea(m)]}function H_e(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const U_e=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,G_e=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,q_e=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Mq(e){const[,t,n,r,o,i,a,s]=e;return[BB(t,o,r,n,i,a,s),ea.utcInstance]}function W_e(e){const[,t,n,r,o,i,a,s]=e;return[BB(t,s,n,r,o,i,a),ea.utcInstance]}const K_e=hv(A_e,jB),Y_e=hv(M_e,jB),Q_e=hv(R_e,jB),X_e=hv($oe),Loe=mv(N_e,yv,hw,mw),J_e=mv(D_e,yv,hw,mw),Z_e=mv(k_e,yv,hw,mw),e$e=mv(yv,hw,mw);function t$e(e){return gv(e,[K_e,Loe],[Y_e,J_e],[Q_e,Z_e],[X_e,e$e])}function n$e(e){return gv(H_e(e),[z_e,V_e])}function r$e(e){return gv(e,[U_e,Mq],[G_e,Mq],[q_e,W_e])}function o$e(e){return gv(e,[F_e,j_e])}const i$e=mv(yv);function a$e(e){return gv(e,[L_e,i$e])}const s$e=hv(__e,$_e),l$e=hv(Noe),c$e=mv(yv,hw,mw);function u$e(e){return gv(e,[s$e,Loe],[l$e,c$e])}const Rq="Invalid Duration",Foe={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},d$e={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...Foe},Ts=146097/400,Wm=146097/4800,f$e={years:{quarters:4,months:12,weeks:Ts/7,days:Ts,hours:Ts*24,minutes:Ts*24*60,seconds:Ts*24*60*60,milliseconds:Ts*24*60*60*1e3},quarters:{months:3,weeks:Ts/28,days:Ts/4,hours:Ts*24/4,minutes:Ts*24*60/4,seconds:Ts*24*60*60/4,milliseconds:Ts*24*60*60*1e3/4},months:{weeks:Wm/7,days:Wm,hours:Wm*24,minutes:Wm*24*60,seconds:Wm*24*60*60,milliseconds:Wm*24*60*60*1e3},...Foe},jp=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],p$e=jp.slice(0).reverse();function Ld(e,t,n=!1){const r={values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new Xn(r)}function joe(e,t){let n=t.milliseconds??0;for(const r of p$e.slice(1))t[r]&&(n+=t[r]*e[r].milliseconds);return n}function Dq(e,t){const n=joe(e,t)<0?-1:1;jp.reduceRight((r,o)=>{if(mn(t[o]))return r;if(r){const i=t[r]*n,a=e[o][r],s=Math.floor(i/a);t[o]+=s*n,t[r]-=s*a*n}return o},null),jp.reduce((r,o)=>{if(mn(t[o]))return r;if(r){const i=t[r]%1;t[r]-=i,t[o]+=i*e[r][o]}return o},null)}function h$e(e){const t={};for(const[n,r]of Object.entries(e))r!==0&&(t[n]=r);return t}class Xn{constructor(t){const n=t.conversionAccuracy==="longterm"||!1;let r=n?f$e:d$e;t.matrix&&(r=t.matrix),this.values=t.values,this.loc=t.loc||ur.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(t,n){return Xn.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(t==null||typeof t!="object")throw new ki(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new Xn({values:uT(t,Xn.normalizeUnit),loc:ur.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(t){if(gf(t))return Xn.fromMillis(t);if(Xn.isDuration(t))return t;if(typeof t=="object")return Xn.fromObject(t);throw new ki(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){const[r]=o$e(t);return r?Xn.fromObject(r,n):Xn.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){const[r]=a$e(t);return r?Xn.fromObject(r,n):Xn.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new ki("need to specify a reason the Duration is invalid");const r=t instanceof kl?t:new kl(t,n);if(to.throwOnInvalid)throw new j2e(r);return new Xn({invalid:r})}static normalizeUnit(t){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!n)throw new Wre(t);return n}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,n={}){const r={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?Li.create(this.loc,r).formatDurationFromString(this,t):Rq}toHuman(t={}){if(!this.isValid)return Rq;const n=jp.map(r=>{const o=this.values[r];return mn(o)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:r.slice(0,-1)}).format(o)}).filter(r=>r);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=LB(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const n=this.toMillis();return n<0||n>=864e5?null:(t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t,includeOffset:!1},xt.fromMillis(n,{zone:"UTC"}).toISOTime(t))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?joe(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const n=Xn.fromDurationLike(t),r={};for(const o of jp)(dy(n.values,o)||dy(this.values,o))&&(r[o]=n.get(o)+this.get(o));return Ld(this,{values:r},!0)}minus(t){if(!this.isValid)return this;const n=Xn.fromDurationLike(t);return this.plus(n.negate())}mapUnits(t){if(!this.isValid)return this;const n={};for(const r of Object.keys(this.values))n[r]=Eoe(t(this.values[r],r));return Ld(this,{values:n},!0)}get(t){return this[Xn.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const n={...this.values,...uT(t,Xn.normalizeUnit)};return Ld(this,{values:n})}reconfigure({locale:t,numberingSystem:n,conversionAccuracy:r,matrix:o}={}){const a={loc:this.loc.clone({locale:t,numberingSystem:n}),matrix:o,conversionAccuracy:r};return Ld(this,a)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return Dq(this.matrix,t),Ld(this,{values:t},!0)}rescale(){if(!this.isValid)return this;const t=h$e(this.normalize().shiftToAll().toObject());return Ld(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(a=>Xn.normalizeUnit(a));const n={},r={},o=this.toObject();let i;for(const a of jp)if(t.indexOf(a)>=0){i=a;let s=0;for(const c in r)s+=this.matrix[c][a]*r[c],r[c]=0;gf(o[a])&&(s+=o[a]);const l=Math.trunc(s);n[a]=l,r[a]=(s*1e3-l*1e3)/1e3}else gf(o[a])&&(r[a]=o[a]);for(const a in r)r[a]!==0&&(n[i]+=a===i?r[a]:r[a]/this.matrix[i][a]);return Dq(this.matrix,n),Ld(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=this.values[n]===0?0:-this.values[n];return Ld(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function n(r,o){return r===void 0||r===0?o===void 0||o===0:r===o}for(const r of jp)if(!n(this.values[r],t.values[r]))return!1;return!0}}const Km="Invalid Interval";function m$e(e,t){return!e||!e.isValid?uo.invalid("missing or invalid start"):!t||!t.isValid?uo.invalid("missing or invalid end"):t<e?uo.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null}class uo{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,n=null){if(!t)throw new ki("need to specify a reason the Interval is invalid");const r=t instanceof kl?t:new kl(t,n);if(to.throwOnInvalid)throw new F2e(r);return new uo({invalid:r})}static fromDateTimes(t,n){const r=n0(t),o=n0(n),i=m$e(r,o);return i??new uo({start:r,end:o})}static after(t,n){const r=Xn.fromDurationLike(n),o=n0(t);return uo.fromDateTimes(o,o.plus(r))}static before(t,n){const r=Xn.fromDurationLike(n),o=n0(t);return uo.fromDateTimes(o.minus(r),o)}static fromISO(t,n){const[r,o]=(t||"").split("/",2);if(r&&o){let i,a;try{i=xt.fromISO(r,n),a=i.isValid}catch{a=!1}let s,l;try{s=xt.fromISO(o,n),l=s.isValid}catch{l=!1}if(a&&l)return uo.fromDateTimes(i,s);if(a){const c=Xn.fromISO(o,n);if(c.isValid)return uo.after(i,c)}else if(l){const c=Xn.fromISO(r,n);if(c.isValid)return uo.before(s,c)}}return uo.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds",n){if(!this.isValid)return NaN;const r=this.start.startOf(t,n);let o;return n!=null&&n.useLocaleWeeks?o=this.end.reconfigure({locale:r.locale}):o=this.end,o=o.startOf(t,n),Math.floor(o.diff(r,t).get(t))+(o.valueOf()!==this.end.valueOf())}hasSame(t){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,t):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return this.isValid?this.s>t:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:n}={}){return this.isValid?uo.fromDateTimes(t||this.s,n||this.e):this}splitAt(...t){if(!this.isValid)return[];const n=t.map(n0).filter(a=>this.contains(a)).sort((a,s)=>a.toMillis()-s.toMillis()),r=[];let{s:o}=this,i=0;for(;o<this.e;){const a=n[i]||this.e,s=+a>+this.e?this.e:a;r.push(uo.fromDateTimes(o,s)),o=s,i+=1}return r}splitBy(t){const n=Xn.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,o=1,i;const a=[];for(;r<this.e;){const s=this.start.plus(n.mapUnits(l=>l*o));i=+s>+this.e?this.e:s,a.push(uo.fromDateTimes(r,i)),r=i,o+=1}return a}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return this.isValid?+this.e==+t.s:!1}abutsEnd(t){return this.isValid?+t.e==+this.s:!1}engulfs(t){return this.isValid?this.s<=t.s&&this.e>=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const n=this.s>t.s?this.s:t.s,r=this.e<t.e?this.e:t.e;return n>=r?null:uo.fromDateTimes(n,r)}union(t){if(!this.isValid)return this;const n=this.s<t.s?this.s:t.s,r=this.e>t.e?this.e:t.e;return uo.fromDateTimes(n,r)}static merge(t){const[n,r]=t.sort((o,i)=>o.s-i.s).reduce(([o,i],a)=>i?i.overlaps(a)||i.abutsStart(a)?[o,i.union(a)]:[o.concat([i]),a]:[o,a],[[],null]);return r&&n.push(r),n}static xor(t){let n=null,r=0;const o=[],i=t.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),a=Array.prototype.concat(...i),s=a.sort((l,c)=>l.time-c.time);for(const l of s)r+=l.type==="s"?1:-1,r===1?n=l.time:(n&&+n!=+l.time&&o.push(uo.fromDateTimes(n,l.time)),n=null);return uo.merge(o)}difference(...t){return uo.xor([this].concat(t)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Km}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(t=sT,n={}){return this.isValid?Li.create(this.s.loc.clone(n),t).formatInterval(this):Km}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:Km}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Km}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:Km}toFormat(t,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${n}${this.e.toFormat(t)}`:Km}toDuration(t,n){return this.isValid?this.e.diff(this.s,t,n):Xn.invalid(this.invalidReason)}mapEndpoints(t){return uo.fromDateTimes(t(this.s),t(this.e))}}class $0{static hasDST(t=to.defaultZone){const n=xt.now().setZone(t).set({month:12});return!t.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(t){return qu.isValidZone(t)}static normalizeZone(t){return Yd(t,to.defaultZone)}static getStartOfWeek({locale:t=null,locObj:n=null}={}){return(n||ur.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:n=null}={}){return(n||ur.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:n=null}={}){return(n||ur.create(t)).getWeekendDays().slice()}static months(t="long",{locale:n=null,numberingSystem:r=null,locObj:o=null,outputCalendar:i="gregory"}={}){return(o||ur.create(n,r,i)).months(t)}static monthsFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:o=null,outputCalendar:i="gregory"}={}){return(o||ur.create(n,r,i)).months(t,!0)}static weekdays(t="long",{locale:n=null,numberingSystem:r=null,locObj:o=null}={}){return(o||ur.create(n,r,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:o=null}={}){return(o||ur.create(n,r,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return ur.create(t).meridiems()}static eras(t="short",{locale:n=null}={}){return ur.create(n,null,"gregory").eras(t)}static features(){return{relative:Soe(),localeWeek:woe()}}}function kq(e,t){const n=o=>o.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(Xn.fromMillis(r).as("days"))}function g$e(e,t,n){const r=[["years",(l,c)=>c.year-l.year],["quarters",(l,c)=>c.quarter-l.quarter+(c.year-l.year)*4],["months",(l,c)=>c.month-l.month+(c.year-l.year)*12],["weeks",(l,c)=>{const u=kq(l,c);return(u-u%7)/7}],["days",kq]],o={},i=e;let a,s;for(const[l,c]of r)n.indexOf(l)>=0&&(a=l,o[l]=c(e,t),s=i.plus(o),s>t?(o[l]--,e=i.plus(o),e>t&&(s=e,o[l]--,e=i.plus(o))):e=s);return[e,o,s,a]}function y$e(e,t,n,r){let[o,i,a,s]=g$e(e,t,n);const l=t-o,c=n.filter(f=>["hours","minutes","seconds","milliseconds"].indexOf(f)>=0);c.length===0&&(a<t&&(a=o.plus({[s]:1})),a!==o&&(i[s]=(i[s]||0)+l/(a-o)));const u=Xn.fromObject(i,r);return c.length>0?Xn.fromMillis(l,r).shiftTo(...c).plus(u):u}const v$e="missing Intl.DateTimeFormat.formatToParts support";function or(e,t=n=>n){return{regex:e,deser:([n])=>t(s_e(n))}}const b$e=" ",Boe=`[ ${b$e}]`,zoe=new RegExp(Boe,"g");function x$e(e){return e.replace(/\./g,"\\.?").replace(zoe,Boe)}function _q(e){return e.replace(/\./g,"").replace(zoe," ").toLowerCase()}function gl(e,t){return e===null?null:{regex:RegExp(e.map(x$e).join("|")),deser:([n])=>e.findIndex(r=>_q(n)===_q(r))+t}}function $q(e,t){return{regex:e,deser:([,n,r])=>AI(n,r),groups:t}}function A1(e){return{regex:e,deser:([t])=>t}}function S$e(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function w$e(e,t){const n=ml(t),r=ml(t,"{2}"),o=ml(t,"{3}"),i=ml(t,"{4}"),a=ml(t,"{6}"),s=ml(t,"{1,2}"),l=ml(t,"{1,3}"),c=ml(t,"{1,6}"),u=ml(t,"{1,9}"),f=ml(t,"{2,4}"),h=ml(t,"{4,6}"),m=v=>({regex:RegExp(S$e(v.val)),deser:([w])=>w,literal:!0}),y=(v=>{if(e.literal)return m(v);switch(v.val){case"G":return gl(t.eras("short"),0);case"GG":return gl(t.eras("long"),0);case"y":return or(c);case"yy":return or(f,lL);case"yyyy":return or(i);case"yyyyy":return or(h);case"yyyyyy":return or(a);case"M":return or(s);case"MM":return or(r);case"MMM":return gl(t.months("short",!0),1);case"MMMM":return gl(t.months("long",!0),1);case"L":return or(s);case"LL":return or(r);case"LLL":return gl(t.months("short",!1),1);case"LLLL":return gl(t.months("long",!1),1);case"d":return or(s);case"dd":return or(r);case"o":return or(l);case"ooo":return or(o);case"HH":return or(r);case"H":return or(s);case"hh":return or(r);case"h":return or(s);case"mm":return or(r);case"m":return or(s);case"q":return or(s);case"qq":return or(r);case"s":return or(s);case"ss":return or(r);case"S":return or(l);case"SSS":return or(o);case"u":return A1(u);case"uu":return A1(s);case"uuu":return or(n);case"a":return gl(t.meridiems(),0);case"kkkk":return or(i);case"kk":return or(f,lL);case"W":return or(s);case"WW":return or(r);case"E":case"c":return or(n);case"EEE":return gl(t.weekdays("short",!1),1);case"EEEE":return gl(t.weekdays("long",!1),1);case"ccc":return gl(t.weekdays("short",!0),1);case"cccc":return gl(t.weekdays("long",!0),1);case"Z":case"ZZ":return $q(new RegExp(`([+-]${s.source})(?::(${r.source}))?`),2);case"ZZZ":return $q(new RegExp(`([+-]${s.source})(${r.source})?`),2);case"z":return A1(/[a-z_+-/]{1,256}?/i);case" ":return A1(/[^\S\n\r]/);default:return m(v)}})(e)||{invalidReason:v$e};return y.token=e,y}const C$e={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function E$e(e,t,n){const{type:r,value:o}=e;if(r==="literal"){const l=/^\s+$/.test(o);return{literal:!l,val:l?" ":o}}const i=t[r];let a=r;r==="hour"&&(t.hour12!=null?a=t.hour12?"hour12":"hour24":t.hourCycle!=null?t.hourCycle==="h11"||t.hourCycle==="h12"?a="hour12":a="hour24":a=n.hour12?"hour12":"hour24");let s=C$e[a];if(typeof s=="object"&&(s=s[i]),s)return{literal:!1,val:s}}function T$e(e){return[`^${e.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,e]}function O$e(e,t,n){const r=e.match(t);if(r){const o={};let i=1;for(const a in n)if(dy(n,a)){const s=n[a],l=s.groups?s.groups+1:1;!s.literal&&s.token&&(o[s.token.val[0]]=s.deser(r.slice(i,i+l))),i+=l}return[r,o]}else return[r,{}]}function I$e(e){const t=i=>{switch(i){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,r;return mn(e.z)||(n=qu.create(e.z)),mn(e.Z)||(n||(n=new ea(e.Z)),r=e.Z),mn(e.q)||(e.M=(e.q-1)*3+1),mn(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),mn(e.u)||(e.S=NB(e.u)),[Object.keys(e).reduce((i,a)=>{const s=t(a);return s&&(i[s]=e[a]),i},{}),n,r]}let WR=null;function P$e(){return WR||(WR=xt.fromMillis(1555555555555)),WR}function A$e(e,t){if(e.literal)return e;const n=Li.macroTokenToFormatOpts(e.val),r=Goe(n,t);return r==null||r.includes(void 0)?e:r}function Voe(e,t){return Array.prototype.concat(...e.map(n=>A$e(n,t)))}class Hoe{constructor(t,n){if(this.locale=t,this.format=n,this.tokens=Voe(Li.parseFormat(n),t),this.units=this.tokens.map(r=>w$e(r,t)),this.disqualifyingUnit=this.units.find(r=>r.invalidReason),!this.disqualifyingUnit){const[r,o]=T$e(this.units);this.regex=RegExp(r,"i"),this.handlers=o}}explainFromTokens(t){if(this.isValid){const[n,r]=O$e(t,this.regex,this.handlers),[o,i,a]=r?I$e(r):[null,null,void 0];if(dy(r,"a")&&dy(r,"H"))throw new mg("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:this.tokens,regex:this.regex,rawMatches:n,matches:r,result:o,zone:i,specificOffset:a}}else return{input:t,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function Uoe(e,t,n){return new Hoe(e,n).explainFromTokens(t)}function M$e(e,t,n){const{result:r,zone:o,specificOffset:i,invalidReason:a}=Uoe(e,t,n);return[r,o,i,a]}function Goe(e,t){if(!e)return null;const r=Li.create(t,e).dtFormatter(P$e()),o=r.formatToParts(),i=r.resolvedOptions();return o.map(a=>E$e(a,e,i))}const KR="Invalid DateTime",R$e=864e13;function N0(e){return new kl("unsupported zone",`the zone "${e.name}" is not supported`)}function YR(e){return e.weekData===null&&(e.weekData=lT(e.c)),e.weekData}function QR(e){return e.localWeekData===null&&(e.localWeekData=lT(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function gp(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new xt({...n,...t,old:n})}function qoe(e,t,n){let r=e-t*60*1e3;const o=n.offset(r);if(t===o)return[r,t];r-=(o-t)*60*1e3;const i=n.offset(r);return o===i?[r,o]:[e-Math.min(o,i)*60*1e3,Math.max(o,i)]}function M1(e,t){e+=t*60*1e3;const n=new Date(e);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function wE(e,t,n){return qoe(PI(e),t,n)}function Nq(e,t){const n=e.o,r=e.c.year+Math.trunc(t.years),o=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,i={...e.c,year:r,month:o,day:Math.min(e.c.day,cT(r,o))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},a=Xn.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),s=PI(i);let[l,c]=qoe(s,n,e.zone);return a!==0&&(l+=a,c=e.zone.offset(l)),{ts:l,o:c}}function Ym(e,t,n,r,o,i){const{setZone:a,zone:s}=n;if(e&&Object.keys(e).length!==0||t){const l=t||s,c=xt.fromObject(e,{...n,zone:l,specificOffset:i});return a?c:c.setZone(s)}else return xt.invalid(new kl("unparsable",`the input "${o}" can't be parsed as ${r}`))}function R1(e,t,n=!0){return e.isValid?Li.create(ur.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function XR(e,t){const n=e.c.year>9999||e.c.year<0;let r="";return n&&e.c.year>=0&&(r+="+"),r+=Ao(e.c.year,n?6:4),t?(r+="-",r+=Ao(e.c.month),r+="-",r+=Ao(e.c.day)):(r+=Ao(e.c.month),r+=Ao(e.c.day)),r}function Lq(e,t,n,r,o,i){let a=Ao(e.c.hour);return t?(a+=":",a+=Ao(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!n)&&(a+=":")):a+=Ao(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!n)&&(a+=Ao(e.c.second),(e.c.millisecond!==0||!r)&&(a+=".",a+=Ao(e.c.millisecond,3))),o&&(e.isOffsetFixed&&e.offset===0&&!i?a+="Z":e.o<0?(a+="-",a+=Ao(Math.trunc(-e.o/60)),a+=":",a+=Ao(Math.trunc(-e.o%60))):(a+="+",a+=Ao(Math.trunc(e.o/60)),a+=":",a+=Ao(Math.trunc(e.o%60)))),i&&(a+="["+e.zone.ianaName+"]"),a}const Woe={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},D$e={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},k$e={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Koe=["year","month","day","hour","minute","second","millisecond"],_$e=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],$$e=["year","ordinal","hour","minute","second","millisecond"];function N$e(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new Wre(e);return t}function Fq(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return N$e(e)}}function L$e(e){if(L0===void 0&&(L0=to.now()),e.type!=="iana")return e.offset(L0);const t=e.name;let n=cL.get(t);return n===void 0&&(n=e.offset(L0),cL.set(t,n)),n}function jq(e,t){const n=Yd(t.zone,to.defaultZone);if(!n.isValid)return xt.invalid(N0(n));const r=ur.fromObject(t);let o,i;if(mn(e.year))o=to.now();else{for(const l of Koe)mn(e[l])&&(e[l]=Woe[l]);const a=boe(e)||xoe(e);if(a)return xt.invalid(a);const s=L$e(n);[o,i]=wE(e,s,n)}return new xt({ts:o,zone:n,loc:r,o:i})}function Bq(e,t,n){const r=mn(n.round)?!0:n.round,o=(a,s)=>(a=LB(a,r||n.calendary?0:2,!0),t.loc.clone(n).relFormatter(n).format(a,s)),i=a=>n.calendary?t.hasSame(e,a)?0:t.startOf(a).diff(e.startOf(a),a).get(a):t.diff(e,a).get(a);if(n.unit)return o(i(n.unit),n.unit);for(const a of n.units){const s=i(a);if(Math.abs(s)>=1)return o(s,a)}return o(e>t?-0:0,n.units[n.units.length-1])}function zq(e){let t={},n;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],n=Array.from(e).slice(0,e.length-1)):n=Array.from(e),[t,n]}let L0;const cL=new Map;class xt{constructor(t){const n=t.zone||to.defaultZone;let r=t.invalid||(Number.isNaN(t.ts)?new kl("invalid input"):null)||(n.isValid?null:N0(n));this.ts=mn(t.ts)?to.now():t.ts;let o=null,i=null;if(!r)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(n))[o,i]=[t.old.c,t.old.o];else{const s=gf(t.o)&&!t.old?t.o:n.offset(this.ts);o=M1(this.ts,s),r=Number.isNaN(o.year)?new kl("invalid input"):null,o=r?null:o,i=r?null:s}this._zone=n,this.loc=t.loc||ur.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=o,this.o=i,this.isLuxonDateTime=!0}static now(){return new xt({})}static local(){const[t,n]=zq(arguments),[r,o,i,a,s,l,c]=n;return jq({year:r,month:o,day:i,hour:a,minute:s,second:l,millisecond:c},t)}static utc(){const[t,n]=zq(arguments),[r,o,i,a,s,l,c]=n;return t.zone=ea.utcInstance,jq({year:r,month:o,day:i,hour:a,minute:s,second:l,millisecond:c},t)}static fromJSDate(t,n={}){const r=f_e(t)?t.valueOf():NaN;if(Number.isNaN(r))return xt.invalid("invalid input");const o=Yd(n.zone,to.defaultZone);return o.isValid?new xt({ts:r,zone:o,loc:ur.fromObject(n)}):xt.invalid(N0(o))}static fromMillis(t,n={}){if(gf(t))return t<-864e13||t>R$e?xt.invalid("Timestamp out of range"):new xt({ts:t,zone:Yd(n.zone,to.defaultZone),loc:ur.fromObject(n)});throw new ki(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,n={}){if(gf(t))return new xt({ts:t*1e3,zone:Yd(n.zone,to.defaultZone),loc:ur.fromObject(n)});throw new ki("fromSeconds requires a numerical input")}static fromObject(t,n={}){t=t||{};const r=Yd(n.zone,to.defaultZone);if(!r.isValid)return xt.invalid(N0(r));const o=ur.fromObject(n),i=uT(t,Fq),{minDaysInFirstWeek:a,startOfWeek:s}=Oq(i,o),l=to.now(),c=mn(n.specificOffset)?r.offset(l):n.specificOffset,u=!mn(i.ordinal),f=!mn(i.year),h=!mn(i.month)||!mn(i.day),m=f||h,g=i.weekYear||i.weekNumber;if((m||u)&&g)throw new mg("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&u)throw new mg("Can't mix ordinal dates with month/day");const y=g||i.weekday&&!m;let v,w,C=M1(l,c);y?(v=_$e,w=D$e,C=lT(C,a,s)):u?(v=$$e,w=k$e,C=qR(C)):(v=Koe,w=Woe);let E=!1;for(const A of v){const _=i[A];mn(_)?E?i[A]=w[A]:i[A]=C[A]:E=!0}const I=y?c_e(i,a,s):u?u_e(i):boe(i),O=I||xoe(i);if(O)return xt.invalid(O);const P=y?Eq(i,a,s):u?Tq(i):i,[R,D]=wE(P,c,r),M=new xt({ts:R,zone:r,o:D,loc:o});return i.weekday&&m&&t.weekday!==M.weekday?xt.invalid("mismatched weekday",`you can't specify both a weekday of ${i.weekday} and a date of ${M.toISO()}`):M.isValid?M:xt.invalid(M.invalid)}static fromISO(t,n={}){const[r,o]=t$e(t);return Ym(r,o,n,"ISO 8601",t)}static fromRFC2822(t,n={}){const[r,o]=n$e(t);return Ym(r,o,n,"RFC 2822",t)}static fromHTTP(t,n={}){const[r,o]=r$e(t);return Ym(r,o,n,"HTTP",n)}static fromFormat(t,n,r={}){if(mn(t)||mn(n))throw new ki("fromFormat requires an input string and a format");const{locale:o=null,numberingSystem:i=null}=r,a=ur.fromOpts({locale:o,numberingSystem:i,defaultToEN:!0}),[s,l,c,u]=M$e(a,t,n);return u?xt.invalid(u):Ym(s,l,r,`format ${n}`,t,c)}static fromString(t,n,r={}){return xt.fromFormat(t,n,r)}static fromSQL(t,n={}){const[r,o]=u$e(t);return Ym(r,o,n,"SQL",t)}static invalid(t,n=null){if(!t)throw new ki("need to specify a reason the DateTime is invalid");const r=t instanceof kl?t:new kl(t,n);if(to.throwOnInvalid)throw new L2e(r);return new xt({invalid:r})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,n={}){const r=Goe(t,ur.fromObject(n));return r?r.map(o=>o?o.val:null).join(""):null}static expandFormat(t,n={}){return Voe(Li.parseFormat(t),ur.fromObject(n)).map(o=>o.val).join("")}static resetCache(){L0=void 0,cL.clear()}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?YR(this).weekYear:NaN}get weekNumber(){return this.isValid?YR(this).weekNumber:NaN}get weekday(){return this.isValid?YR(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?QR(this).weekday:NaN}get localWeekNumber(){return this.isValid?QR(this).weekNumber:NaN}get localWeekYear(){return this.isValid?QR(this).weekYear:NaN}get ordinal(){return this.isValid?qR(this.c).ordinal:NaN}get monthShort(){return this.isValid?$0.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?$0.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?$0.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?$0.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const t=864e5,n=6e4,r=PI(this.c),o=this.zone.offset(r-t),i=this.zone.offset(r+t),a=this.zone.offset(r-o*n),s=this.zone.offset(r-i*n);if(a===s)return[this];const l=r-a*n,c=r-s*n,u=M1(l,a),f=M1(c,s);return u.hour===f.hour&&u.minute===f.minute&&u.second===f.second&&u.millisecond===f.millisecond?[gp(this,{ts:l}),gp(this,{ts:c})]:[this]}get isInLeapYear(){return pw(this.year)}get daysInMonth(){return cT(this.year,this.month)}get daysInYear(){return this.isValid?$g(this.year):NaN}get weeksInWeekYear(){return this.isValid?Nx(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Nx(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){const{locale:n,numberingSystem:r,calendar:o}=Li.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:o}}toUTC(t=0,n={}){return this.setZone(ea.instance(t),n)}toLocal(){return this.setZone(to.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(t=Yd(t,to.defaultZone),t.equals(this.zone))return this;if(t.isValid){let o=this.ts;if(n||r){const i=t.offset(this.ts),a=this.toObject();[o]=wE(a,i,t)}return gp(this,{ts:o,zone:t})}else return xt.invalid(N0(t))}reconfigure({locale:t,numberingSystem:n,outputCalendar:r}={}){const o=this.loc.clone({locale:t,numberingSystem:n,outputCalendar:r});return gp(this,{loc:o})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const n=uT(t,Fq),{minDaysInFirstWeek:r,startOfWeek:o}=Oq(n,this.loc),i=!mn(n.weekYear)||!mn(n.weekNumber)||!mn(n.weekday),a=!mn(n.ordinal),s=!mn(n.year),l=!mn(n.month)||!mn(n.day),c=s||l,u=n.weekYear||n.weekNumber;if((c||a)&&u)throw new mg("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&a)throw new mg("Can't mix ordinal dates with month/day");let f;i?f=Eq({...lT(this.c,r,o),...n},r,o):mn(n.ordinal)?(f={...this.toObject(),...n},mn(n.day)&&(f.day=Math.min(cT(f.year,f.month),f.day))):f=Tq({...qR(this.c),...n});const[h,m]=wE(f,this.o,this.zone);return gp(this,{ts:h,o:m})}plus(t){if(!this.isValid)return this;const n=Xn.fromDurationLike(t);return gp(this,Nq(this,n))}minus(t){if(!this.isValid)return this;const n=Xn.fromDurationLike(t).negate();return gp(this,Nq(this,n))}startOf(t,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;const r={},o=Xn.normalizeUnit(t);switch(o){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0;break}if(o==="weeks")if(n){const i=this.loc.getStartOfWeek(),{weekday:a}=this;a<i&&(r.weekNumber=this.weekNumber-1),r.weekday=i}else r.weekday=1;if(o==="quarters"){const i=Math.ceil(this.month/3);r.month=(i-1)*3+1}return this.set(r)}endOf(t,n){return this.isValid?this.plus({[t]:1}).startOf(t,n).minus(1):this}toFormat(t,n={}){return this.isValid?Li.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,t):KR}toLocaleString(t=sT,n={}){return this.isValid?Li.create(this.loc.clone(n),t).formatDateTime(this):KR}toLocaleParts(t={}){return this.isValid?Li.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:o=!0,extendedZone:i=!1}={}){if(!this.isValid)return null;const a=t==="extended";let s=XR(this,a);return s+="T",s+=Lq(this,a,n,r,o,i),s}toISODate({format:t="extended"}={}){return this.isValid?XR(this,t==="extended"):null}toISOWeekDate(){return R1(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:o=!1,extendedZone:i=!1,format:a="extended"}={}){return this.isValid?(o?"T":"")+Lq(this,a==="extended",n,t,r,i):null}toRFC2822(){return R1(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return R1(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?XR(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let o="HH:mm:ss.SSS";return(n||t)&&(r&&(o+=" "),n?o+="z":t&&(o+="ZZ")),R1(this,o,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():KR}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const n={...this.c};return t.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,n="milliseconds",r={}){if(!this.isValid||!t.isValid)return Xn.invalid("created by diffing an invalid DateTime");const o={locale:this.locale,numberingSystem:this.numberingSystem,...r},i=p_e(n).map(Xn.normalizeUnit),a=t.valueOf()>this.valueOf(),s=a?this:t,l=a?t:this,c=y$e(s,l,i,o);return a?c.negate():c}diffNow(t="milliseconds",n={}){return this.diff(xt.now(),t,n)}until(t){return this.isValid?uo.fromDateTimes(this,t):this}hasSame(t,n,r){if(!this.isValid)return!1;const o=t.valueOf(),i=this.setZone(t.zone,{keepLocalTime:!0});return i.startOf(n,r)<=o&&o<=i.endOf(n,r)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const n=t.base||xt.fromObject({},{zone:this.zone}),r=t.padding?this<n?-t.padding:t.padding:0;let o=["years","months","days","hours","minutes","seconds"],i=t.unit;return Array.isArray(t.unit)&&(o=t.unit,i=void 0),Bq(n,this.plus(r),{...t,numeric:"always",units:o,unit:i})}toRelativeCalendar(t={}){return this.isValid?Bq(t.base||xt.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(xt.isDateTime))throw new ki("min requires all arguments be DateTimes");return Iq(t,n=>n.valueOf(),Math.min)}static max(...t){if(!t.every(xt.isDateTime))throw new ki("max requires all arguments be DateTimes");return Iq(t,n=>n.valueOf(),Math.max)}static fromFormatExplain(t,n,r={}){const{locale:o=null,numberingSystem:i=null}=r,a=ur.fromOpts({locale:o,numberingSystem:i,defaultToEN:!0});return Uoe(a,t,n)}static fromStringExplain(t,n,r={}){return xt.fromFormatExplain(t,n,r)}static buildFormatParser(t,n={}){const{locale:r=null,numberingSystem:o=null}=n,i=ur.fromOpts({locale:r,numberingSystem:o,defaultToEN:!0});return new Hoe(i,t)}static fromFormatParser(t,n,r={}){if(mn(t)||mn(n))throw new ki("fromFormatParser requires an input string and a format parser");const{locale:o=null,numberingSystem:i=null}=r,a=ur.fromOpts({locale:o,numberingSystem:i,defaultToEN:!0});if(!a.equals(n.locale))throw new ki(`fromFormatParser called with a locale of ${a}, but the format parser was created for ${n.locale}`);const{result:s,zone:l,specificOffset:c,invalidReason:u}=n.explainFromTokens(t);return u?xt.invalid(u):Ym(s,l,r,`format ${n.format}`,t,c)}static get DATE_SHORT(){return sT}static get DATE_MED(){return Kre}static get DATE_MED_WITH_WEEKDAY(){return B2e}static get DATE_FULL(){return Yre}static get DATE_HUGE(){return Qre}static get TIME_SIMPLE(){return Xre}static get TIME_WITH_SECONDS(){return Jre}static get TIME_WITH_SHORT_OFFSET(){return Zre}static get TIME_WITH_LONG_OFFSET(){return eoe}static get TIME_24_SIMPLE(){return toe}static get TIME_24_WITH_SECONDS(){return noe}static get TIME_24_WITH_SHORT_OFFSET(){return roe}static get TIME_24_WITH_LONG_OFFSET(){return ooe}static get DATETIME_SHORT(){return ioe}static get DATETIME_SHORT_WITH_SECONDS(){return aoe}static get DATETIME_MED(){return soe}static get DATETIME_MED_WITH_SECONDS(){return loe}static get DATETIME_MED_WITH_WEEKDAY(){return z2e}static get DATETIME_FULL(){return coe}static get DATETIME_FULL_WITH_SECONDS(){return uoe}static get DATETIME_HUGE(){return doe}static get DATETIME_HUGE_WITH_SECONDS(){return foe}}function n0(e){if(xt.isDateTime(e))return e;if(e&&e.valueOf&&gf(e.valueOf()))return xt.fromJSDate(e);if(e&&typeof e=="object")return xt.fromObject(e);throw new ki(`Unknown datetime argument: ${e}, of type ${typeof e}`)}const Vq=3,Hq=25,Uq=1e3,Gq=1,qq=16,F$e=12;class j$e{constructor(t){Ce(this,"id");Ce(this,"name");Ce(this,"description");Ce(this,"created");Ce(this,"start");Ce(this,"end");Ce(this,"fitInWeek");Ce(this,"isTemplate");Ce(this,"isPublic");Ce(this,"days",[]);Ce(this,"dayData",[]);this.id=t.id,this.name=t.name,this.description=t.description,this.created=t.created,this.start=t.start,this.end=t.end,this.fitInWeek=t.fitInWeek,this.isTemplate=t.isTemplate??!1,this.isPublic=t.isPublic??!1,this.days=t.days??[],this.dayData=t.dayData??[]}get exercises(){return this.days.flatMap(t=>t.slots.flatMap(n=>n.entries.flatMap(r=>r.exercise)))}get dayDataCurrentIteration(){const t=this.getIteration()??1;return this.dayData.filter(n=>n.iteration===t)}get groupedDayDataByIteration(){const t={};for(const n of this.dayData)t[n.iteration]||(t[n.iteration]=[]),t[n.iteration].push(n);return t}get duration(){const t=xt.fromJSDate(this.end).diff(xt.fromJSDate(this.start),["weeks","days"]),n=Math.floor(t.weeks),r=Math.floor(t.days);return{weeks:n,days:r}}get durationText(){const t=this.duration.days,n=this.duration.weeks;return t===0?hr.t("durationWeeks",{number:n}):hr.t("durationWeeksDays",{nrWeeks:n,nrDays:t})}get mainMuscles(){return this.days.flatMap(n=>n.slots.flatMap(r=>r.entries.flatMap(o=>{var i;return((i=o.exercise)==null?void 0:i.muscles)||[]}))).filter((n,r,o)=>r===o.findIndex(i=>i.id===n.id))}get secondaryMuscles(){return this.days.flatMap(n=>n.slots.flatMap(r=>r.entries.flatMap(o=>{var i;return((i=o.exercise)==null?void 0:i.musclesSecondary)||[]}))).filter((n,r,o)=>r===o.findIndex(i=>i.id===n.id))}get cycleLength(){return this.dayDataCurrentIteration.length}getIteration(t){const n=t??new Date,r=this.dayData.find(o=>xa(o.date,n));return r?r.iteration:null}getSetConfigData(t,n,r){const o=this.dayData.find(a=>{var s;return((s=a.day)==null?void 0:s.id)===t&&a.iteration===n});if(!o)return null;const i=o.slots.find(a=>a.setConfigs.some(s=>s.slotEntryId===r));return(i==null?void 0:i.setConfigs.find(a=>a.slotEntryId===r))||null}getDayData(t,n){return this.dayData.filter(r=>{var o;return((o=r.day)==null?void 0:o.id)===t&&r.date.getDate()===n.getDate()&&r.date.getMonth()===n.getMonth()&&r.date.getFullYear()===n.getFullYear()})}}class B$e{fromJson(t){return new j$e({id:t.id,name:t.name,description:t.description,created:new Date(t.created),start:new Date(t.start),end:new Date(t.end),fitInWeek:t.fit_in_week,isTemplate:t.is_template,isPublic:t.is_public,days:t.days?t.days.map(n=>new Ure(n)):[]})}toJson(t){return{id:t.id,name:t.name,description:t.description,start:Zn(t.start),end:Zn(t.end),fit_in_week:t.fitInWeek}}}const vv=new B$e;class z$e{constructor(t){Ce(this,"exercise");Ce(this,"weightUnit",null);Ce(this,"repetitionsUnit",null);Ce(this,"exerciseId");Ce(this,"slotEntryId");Ce(this,"type");Ce(this,"nrOfSets");Ce(this,"maxNrOfSets");Ce(this,"weight");Ce(this,"maxWeight");Ce(this,"weightUnitId",null);Ce(this,"weightRounding",null);Ce(this,"repetitions");Ce(this,"maxRepetitions");Ce(this,"repetitionsUnitId",null);Ce(this,"repetitionsRounding",null);Ce(this,"rir");Ce(this,"maxRir");Ce(this,"rpe");Ce(this,"restTime");Ce(this,"maxRestTime");Ce(this,"textRepr");Ce(this,"comment");this.exerciseId=t.exerciseId,this.exercise=t.exercise,this.slotEntryId=t.slotEntryId,this.type=t.type,this.nrOfSets=t.nrOfSets,this.maxNrOfSets=t.maxNrOfSets??null,this.weight=t.weight??null,this.maxWeight=t.maxWeight??null,this.weightUnitId=t.weightUnitId,this.weightUnit=t.weightUnit??null,this.weightRounding=t.weightRounding,this.repetitions=t.repetitions??null,this.maxRepetitions=t.maxRepetitions??null,this.repetitionsUnitId=t.repetitionsUnitId,this.repetitionsUnit=t.repetitionsUnit??null,this.repetitionsRounding=t.repetitionsRounding,this.rir=t.rir??null,this.maxRir=t.maxRir??null,this.rpe=t.rpe??null,this.restTime=t.restTime??null,this.maxRestTime=t.maxRestTime??null,this.textRepr=t.textRepr,this.comment=t.comment}get isSpecialType(){return this.type!=="normal"}}class V$e{constructor(){Ce(this,"fromJson",t=>new z$e({exerciseId:t.exercise,slotEntryId:t.slot_entry_id,type:t.type,nrOfSets:t.sets,maxNrOfSets:t.max_sets!==null?parseInt(t.max_sets):null,weight:t.weight!==null?parseFloat(t.weight):null,maxWeight:t.max_weight!==null?parseFloat(t.max_weight):null,weightUnitId:t.weight_unit,weightRounding:t.weight_rounding!==null?parseFloat(t.weight_rounding):null,repetitions:t.repetitions!==null?parseFloat(t.repetitions):null,maxRepetitions:t.max_repetitions!==null?parseFloat(t.max_repetitions):null,repetitionsUnitId:t.repetitions_unit,repetitionsRounding:t.repetitions_rounding!==null?parseFloat(t.repetitions_rounding):null,rir:t.rir!==null?parseFloat(t.rir):null,maxRir:t.max_rir!==null?parseFloat(t.max_rir):null,rpe:t.rpe!==null?parseFloat(t.rpe):null,restTime:t.rest!==null?parseInt(t.rest):null,maxRestTime:t.max_rest!==null?parseInt(t.max_rest):null,textRepr:t.text_repr,comment:t.comment}))}}class H$e{constructor(t,n,r,o,i){Ce(this,"exercises",[]);this.comment=t,this.isSuperset=n,this.exerciseIds=r,this.setConfigs=o,this.exercises=i??[]}}class U$e{constructor(){Ce(this,"fromJson",t=>new H$e(t.comment,t.is_superset,t.exercises,t.sets.map(n=>new V$e().fromJson(n))))}}class G$e{constructor(t,n,r,o,i){Ce(this,"slots",[]);this.iteration=t,this.date=n,this.label=r,this.day=o,this.slots=i??[]}}class q$e{constructor(){Ce(this,"fromJson",t=>new G$e(t.iteration,new Date(t.date),t.label,t.day!=null?new TI().fromJson(t.day):null,t.slots.map(n=>new U$e().fromJson(n))))}}class W$e{constructor(t){Ce(this,"id");Ce(this,"date");Ce(this,"iteration");Ce(this,"exerciseId");Ce(this,"slotEntryId");Ce(this,"sessionId");Ce(this,"routineId");Ce(this,"repetitionUnitObj");Ce(this,"repetitionUnitId");Ce(this,"repetitions");Ce(this,"repetitionsTarget");Ce(this,"weightUnitObj");Ce(this,"weightUnitId");Ce(this,"weight");Ce(this,"weightTarget");Ce(this,"rir");Ce(this,"rirTarget");Ce(this,"restTime");Ce(this,"restTimeTarget");Ce(this,"exerciseObj");this.id=t.id,this.date=typeof t.date=="string"?new Date(t.date):t.date,this.iteration=t.iteration,this.slotEntryId=t.slotEntryId,this.sessionId=t.sessionId||null,this.routineId=t.routineId||null,this.exerciseObj=t.exercise,this.exerciseId=t.exerciseId,this.repetitionUnitObj=t.repetitionsUnit||null,this.repetitionUnitId=t.repetitionsUnitId||null,this.repetitions=t.repetitions,this.repetitionsTarget=t.repetitionsTarget||null,this.weightUnitObj=t.weightUnit||null,this.weightUnitId=t.weightUnitId||null,this.weight=t.weight,this.weightTarget=t.weightTarget||null,this.rir=t.rir,this.rirTarget=t.rirTarget||null,this.restTime=t.restTime||null,this.restTimeTarget=t.restTimeTarget||null}get rirString(){return this.rir===null?"-/-":this.rir.toString()}}class RI{constructor(){Ce(this,"fromJson",t=>new W$e({id:t.id,date:t.date,iteration:t.iteration,exerciseId:t.exercise,slotEntryId:t.slot_entry,sessionId:t.session,routineId:t.routine,repetitionsUnitId:t.repetitions_unit,repetitions:t.repetitions===null?null:Number.parseFloat(t.repetitions),repetitionsTarget:t.repetitions_target===null?null:Number.parseFloat(t.repetitions_target),weightUnitId:t.weight_unit,weight:t.weight===null?null:Number.parseFloat(t.weight),weightTarget:t.weight_target===null?null:Number.parseFloat(t.weight_target),rir:t.rir===null?null:Number.parseFloat(t.rir),rirTarget:t.rir_target===null?null:Number.parseFloat(t.rir_target),restTime:t.rest,restTimeTarget:t.rest_target}));Ce(this,"toJson",t=>({id:t.id,iteration:t.iteration,date:t.date.toISOString(),slot_entry:t.slotEntryId,exercise:t.exerciseId,routine:t.routineId,repetitions_unit:t.repetitionUnitId,repetitions:t.repetitions,repetitions_target:t.repetitionsTarget,weight_unit:t.weightUnitId,weight:t.weight,weight_target:t.weightTarget,rir:t.rir,rir_target:t.rirTarget,rest:t.restTime,rest_target:t.restTimeTarget}))}}const Wq=1e3,uL="1",cg="2",dL="3";class K$e{constructor(t){Ce(this,"id");Ce(this,"dayId");Ce(this,"routineId");Ce(this,"date");Ce(this,"notes");Ce(this,"impression");Ce(this,"timeStart");Ce(this,"timeEnd");Ce(this,"dayObj");Ce(this,"logs",[]);this.id=t.id,this.dayId=t.dayId,this.routineId=t.routineId,this.date=t.date,this.notes=t.notes,this.impression=t.impression,this.timeStart=t.timeStart,this.timeEnd=t.timeEnd,t.dayObj&&(this.dayObj=t.dayObj),this.logs=t.logs??[]}get impressionString(){switch(this.impression){case uL:return hr.t("routines.impressionBad");case cg:return hr.t("routines.impressionNeutral");case dL:return hr.t("routines.impressionGood");default:return""}}get textRepresentation(){const t=this.timeStart&&this.timeEnd?`${this.timeStart.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})} - ${this.timeEnd.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})} /`:"",n=this.notes??"";return`${this.impressionString} ${t} ${n}`}}class gw{constructor(){Ce(this,"fromJson",t=>new K$e({id:t.id,dayId:t.day,routineId:t.routine,date:new Date(t.date),notes:t.notes!==void 0?t.notes:null,impression:t.impression,timeStart:t.time_start!==void 0?VN(t.time_start):null,timeEnd:t.time_end!==void 0?VN(t.time_end):null,dayObj:t.dayObj,logs:t.logs}));Ce(this,"toJson",t=>({id:t.id,day:t.dayId,date:Zn(t.date),routine:t.routineId,notes:t.notes,impression:t.impression,time_start:Dx(t.timeStart),time_end:Dx(t.timeEnd)}))}}class Y$e{constructor(t,n){this.session=t,this.logs=n}}class Q$e{constructor(){Ce(this,"fromJson",t=>new Y$e(new gw().fromJson(t.session),t.logs.map(n=>new RI().fromJson(n))))}}class X$e{constructor(t,n){Ce(this,"id");Ce(this,"name");this.id=t,this.name=n}}class J$e{fromJson(t){return new X$e(t.id,t.name)}toJson(t){return{}}}class Z$e{constructor(t,n){Ce(this,"id");Ce(this,"name");this.id=t,this.name=n}}class eNe{fromJson(t){return new Z$e(t.id,t.name)}toJson(t){return{}}}const tNe="setting-repetitionunit",nNe="setting-weightunit",Yoe=async()=>{const e=ft(tNe),{data:t}=await it.get(e,{headers:ht()}),n=new J$e;return t.results.map(r=>n.fromJson(r))},Qoe=async()=>{const e=ft(nNe),{data:t}=await it.get(e,{headers:ht()}),n=new eNe;return t.results.map(r=>n.fromJson(r))},rNe="structure",oNe="logs",iNe="stats",aNe="date-sequence-display",D1={},Xoe=async e=>{var f;const t=await it.get(ft(St.ROUTINE,{id:e}),{headers:ht()}),n=vv.fromJson(t.data),r=await Promise.all([Yoe(),Qoe(),mNe(e),gNe(e)]),o=r[0],i=r[1],a=r[2],s=r[3],l=new Set;for(const h of a.filter(m=>m.day!==null&&m.iteration===1))for(const m of h.slots)for(const g of m.setConfigs)l.add(g.exerciseId);const c=Array.from(l).map(h=>pv(h));(await Promise.all(c)).forEach(h=>{D1[h.id]=h});for(const h of a)for(const m of h.slots){for(const g of m.setConfigs)g.exercise=D1[g.exerciseId],g.repetitionsUnitId!==null&&(g.repetitionsUnit=o.find(y=>y.id===g.repetitionsUnitId)??null),g.weightUnitId!==null&&(g.weightUnit=i.find(y=>y.id===g.weightUnitId)??null);for(const g of m.exerciseIds)(f=m.exercises)==null||f.push(D1[g])}for(const h of s)for(const m of h.slots)for(const g of m.entries)g.exercise=D1[g.exerciseId],g.repetitionUnitId!==null&&(g.repetitionUnit=o.find(y=>y.id===g.repetitionUnitId)??null),g.weightUnitId!==null&&(g.weightUnit=i.find(y=>y.id===g.weightUnitId)??null);return n.dayData=a,n.days=s,n},sNe=async()=>{const e=ft(St.ROUTINE,{query:{limit:"1",is_template:!1}}),t=await it.get(e,{headers:ht()});return t.data.count===0?null:await Xoe(t.data.results[0].id)},lNe=async e=>await Xoe(e),cNe=async()=>{const e=ft(St.ROUTINE,{query:{is_public:!1}});return(await it.get(e,{headers:ht()})).data.results.map(n=>vv.fromJson(n))},uNe=async()=>{const e=ft(St.PRIVATE_TEMPLATE);return(await it.get(e,{headers:ht()})).data.results.map(n=>vv.fromJson(n))},dNe=async()=>{const e=ft(St.PUBLIC_TEMPLATE);return(await it.get(e,{headers:ht()})).data.results.map(n=>vv.fromJson(n))},fNe=async e=>{const t=await it.post(ft(St.ROUTINE),e,{headers:ht()});return vv.fromJson(t.data)},pNe=async e=>{const t=await it.patch(ft(St.ROUTINE,{id:e.id}),e,{headers:ht()});return vv.fromJson(t.data)},hNe=async e=>(await it.delete(ft(St.ROUTINE,{id:e}),{headers:ht()})).status,mNe=async e=>{const t=await it.get(ft(St.ROUTINE,{id:e,objectMethod:aNe}),{headers:ht()}),n=new q$e;return t.data.map(r=>n.fromJson(r))},gNe=async e=>{const t=await it.get(ft(St.ROUTINE,{id:e,objectMethod:rNe}),{headers:ht()}),n=new TI;return t.data.days.map(r=>n.fromJson(r))},yNe=async e=>{const t=await it.get(ft(St.ROUTINE,{id:e,objectMethod:oNe}),{headers:ht()}),n=new Q$e;return t.data.map(r=>n.fromJson(r))},vNe=async e=>{const t=await it.get(ft(St.ROUTINE,{id:e,objectMethod:iNe}),{headers:ht()});return new N2e().fromJson(t.data)};class bNe{constructor(t,n,r,o){Ce(this,"entries",[]);this.id=t,this.name=n,this.unit=r,o&&(this.entries=o)}}class DI{fromJson(t){return new bNe(t.id,t.name,t.unit)}toJson(t){return{id:t.id,name:t.name,unit:t.unit}}}class xNe{constructor(t,n,r,o,i){this.id=t,this.category=n,this.date=r,this.value=o,this.notes=i}}class kI{fromJson(t){return new xNe(t.id,t.category,new Date(t.date),t.value,t.notes)}toJson(t){return{id:t.id,category:t.category,date:t.date,value:t.value,notes:t.notes}}}async function*xh(e,t){for(t==null&&(t=ht());;){const r=(await it.get(e,{headers:t})).data;if(yield r.results,e=r.next,!e)break}}const yw="measurement-category",vw="measurement",SNe=async e=>{const{filtersetQueryCategories:t={},filtersetQueryEntries:n={}}=e||{},r=new DI,o=new kI,i=[];for await(const c of xh(ft(yw,{query:{...t}}),ht()))for(const u of c)i.push(r.fromJson(u));const a=i.map(async c=>{const u=[],f=ft(vw,{query:{category:c.id,...n}});for await(const h of xh(f,ht()))for(const m of h)u.push(o.fromJson(m));return u}),s=await Promise.all(a);let l;return s.forEach(c=>{c.length>0&&(l=c[0].category,i.findLast(u=>u.id===l).entries=c)}),i},wNe=async e=>{const{data:t}=await it.get(ft(yw,{id:e}),{headers:ht()}),n=new DI().fromJson(t),r=new kI,o=[],i=ft(vw,{query:{category:n.id}});for await(const a of xh(i,ht()))for(const s of a)o.push(r.fromJson(s));return n.entries=o,n},CNe=async e=>{const t=await it.post(ft(yw),{name:e.name,unit:e.unit},{headers:ht()});return new DI().fromJson(t.data)},ENe=async e=>{const t=await it.patch(ft(yw,{id:e.id}),{name:e.name,unit:e.unit},{headers:ht()});return new DI().fromJson(t.data)},TNe=async e=>{await it.delete(ft(yw,{id:e}),{headers:ht()})},ONe=async e=>{await it.delete(ft(vw,{id:e}),{headers:ht()})},INe=async e=>{const t=await it.patch(ft(vw,{id:e.id}),{date:Zn(e.date),value:e.value,notes:e.notes},{headers:ht()});return new kI().fromJson(t.data)},PNe=async e=>{const t=await it.post(ft(vw),{category:e.categoryId,date:Zn(e.date),value:e.value,notes:e.notes},{headers:ht()});return new kI().fromJson(t.data)};class ANe{constructor(t,n,r,o,i,a,s,l){this.id=t,this.uuid=n,this.url=r,this.created=o,this.lastUpdate=i,this.size=a,this.width=s,this.height=l}}class MNe{fromJson(t){return new ANe(t.id,t.uuid,t.image,new Date(t.created),new Date(t.last_update),t.size,t.width,t.height)}}class RNe{constructor(t,n,r,o,i,a,s,l,c,u,f,h,m=null){this.id=t,this.uuid=n,this.code=r,this.name=o,this.energy=i,this.protein=a,this.carbohydrates=s,this.carbohydratesSugar=l,this.fat=c,this.fatSaturated=u,this.fiber=f,this.sodium=h,this.image=m}}class Joe{fromJson(t){return new RNe(t.id,t.uuid,t.code,t.name,t.energy,parseFloat(t.protein),parseFloat(t.carbohydrates),t.carbohydrates_sugar===null?null:parseFloat(t.carbohydrates_sugar),parseFloat(t.fat),t.fat_saturated===null?null:parseFloat(t.fat_saturated),t.fiber===null?null:parseFloat(t.fiber),t.sodium===null?null:parseFloat(t.sodium),t.image===null?null:new MNe().fromJson(t.image))}}const DNe=async e=>{const{data:t}=await it.get(ft(St.INGREDIENT_PATH,{id:e}),{headers:ht()});return new Joe().fromJson(t)},Zoe=async e=>{if(e.length===0)return[];const t=ft(St.INGREDIENT_PATH,{query:{id__in:e.join(",")}}),n=new Joe,r=[];for await(const o of xh(t,ht()))for(const i of o)r.push(n.fromJson(i));return r},kNe=async(e,t,n=!0)=>{const r=[t];t!==uy&&n&&r.push(uy);const o=ft(St.INGREDIENT_SEARCH_PATH,{query:{term:e,language:r.join(",")}}),{data:i}=await it.get(o);return i.suggestions};class _Ne{constructor(t,n,r,o,i,a,s){Ce(this,"ingredient",null);Ce(this,"weightUnit",null);this.id=t,this.ingredientId=n,this.weightUnitId=r,this.amount=o,this.order=i,a&&(this.ingredient=a),s&&(this.weightUnit=s)}get amountString(){var t;return this.amount.toFixed().toString()+(this.weightUnitId!==null?` ${(t=this.weightUnit)==null?void 0:t.name}`:"g")}get nutritionalValues(){return this.ingredient?qa.fromIngredient(this.ingredient,this.amount,this.weightUnit):new qa}}class zB{fromJson(t){return new _Ne(t.id,t.ingredient,t.weight_unit,parseFloat(t.amount),t.order)}toJson(t){return{ingredient:t.ingredientId,weight_unit:t.weightUnitId,amount:t.amount.toString(),order:t.order}}}const $Ne=async e=>{const t=await it.post(ft(St.MEAL_ITEM),e,{headers:ht()});return new zB().fromJson(t.data)},NNe=async e=>{const t=await it.patch(ft(St.MEAL_ITEM,{id:e.id}),e,{headers:ht()});return new zB().fromJson(t.data)},LNe=async e=>{await it.delete(ft(St.MEAL_ITEM,{id:e}),{headers:ht()})};class FNe{constructor(t,n,r,o=""){this.id=t,this.amount=n,this.grams=r,this.name=o}}class jNe{fromJson(t){return new FNe(t.id,parseFloat(t.amount),t.gram)}}const eie=async e=>{if(e===null)return null;const{data:t}=await it.get(ft(St.INGREDIENT_WEIGHT_UNIT,{id:e}),{headers:ht()});return new jNe().fromJson(t)},BNe=async e=>{const t=await it.post(ft(St.MEAL),e,{headers:ht()});return new xB().fromJson(t.data)},zNe=async e=>{const t=await it.patch(ft(St.MEAL,{id:e.id}),e,{headers:ht()});return new xB().fromJson(t.data)},VNe=async e=>{await it.delete(ft(St.MEAL,{id:e}),{headers:ht()})},HNe=async e=>{let t=[];const n=new xB,r=new zB,{data:o}=await it.get(ft(St.MEAL,{query:{plan:e}}),{headers:ht()}),i=o.results.map(a=>n.fromJson(a));for(const a of i){t=[];const{data:s}=await it.get(ft(St.MEAL_ITEM,{query:{meal:a.id}}),{headers:ht()}),l=s.results.map(u=>r.fromJson(u));for(const u of l)t.push(u.ingredientId);const c=await Zoe(t);for(const u of l)u.weightUnit=await eie(u.weightUnitId),u.ingredient=c.find(f=>f.id===u.ingredientId);a.items=l}return i},UNe=async e=>(await it.delete(ft(St.WORKOUT_LOG,{id:e}),{headers:ht()})).status,GNe=async e=>{const t=new RI,n=await it.patch(ft(St.WORKOUT_LOG,{id:e.id}),t.toJson(e),{headers:ht()});return t.fromJson(n.data)},qNe=async e=>{const t=new RI,n=[];for(const r of e){const o=await it.post(ft(St.WORKOUT_LOG),{...r},{headers:ht()});n.push(t.fromJson(o.data))}return n},WNe=async e=>{const t=await it.patch(ft(St.SLOT_ENTRY,{id:e.id}),e,{headers:ht()});return RB.fromJson(t.data)},KNe=async e=>{await it.delete(ft(St.SLOT_ENTRY,{id:e}),{headers:ht()})},YNe=async e=>{const t=await it.post(ft(St.SLOT_ENTRY),e,{headers:ht()});return RB.fromJson(t.data)},QNe=async e=>{const t=await it.patch(ft(St.DAY,{id:e.id}),e,{headers:ht()});return new TI().fromJson(t.data)},XNe=async e=>{for(const t of e)await it.patch(ft(St.DAY,{id:t.id}),{order:t.order},{headers:ht()})},JNe=async e=>{const t=await it.post(ft(St.DAY),e,{headers:ht()});return new TI().fromJson(t.data)},ZNe=async e=>{await it.delete(ft(St.DAY,{id:e}),{headers:ht()})},eLe=async e=>{const t=await it.post(ft(St.SLOT),e,{headers:ht()});return new DB().fromJson(t.data)},tLe=async e=>{const t=await it.patch(ft(St.SLOT,{id:e.id}),e,{headers:ht()});return new DB().fromJson(t.data)},nLe=async e=>{for(const t of e)await it.patch(ft(St.SLOT,{id:t.id}),{order:t.order},{headers:ht()})},rLe=async e=>{await it.delete(ft(St.SLOT,{id:e}),{headers:ht()})},oLe=async({values:e,maxValues:t})=>{const n=async r=>{const{toAdd:o,toEdit:i,toDelete:a,apiPath:s}=r;for(const l of o)await tc(l,s);for(const l of i)await ec(l,s);for(const l of a)await Vc(l,s)};e!==void 0&&await n(e),t!==void 0&&await n(t)},ec=async(e,t)=>{const n=await it.patch(ft(t,{id:e.id}),e,{headers:ht()});return new MB().fromJson(n.data)},tc=async(e,t)=>{const n=await it.post(ft(t),e,{headers:ht()});return new MB().fromJson(n.data)},Vc=async(e,t)=>await it.delete(ft(t,{id:e}),{headers:ht()}),iLe=async e=>await ec(e,St.WEIGHT_CONFIG),aLe=async e=>await tc(e,St.WEIGHT_CONFIG),sLe=async e=>await Vc(e,St.WEIGHT_CONFIG),lLe=async e=>await ec(e,St.MAX_WEIGHT_CONFIG),cLe=async e=>await tc(e,St.MAX_WEIGHT_CONFIG),uLe=async e=>await Vc(e,St.MAX_WEIGHT_CONFIG),dLe=async e=>await ec(e,St.REPETITIONS_CONFIG),fLe=async e=>await tc(e,St.REPETITIONS_CONFIG),pLe=async e=>await Vc(e,St.REPETITIONS_CONFIG),hLe=async e=>await ec(e,St.MAX_REPS_CONFIG),mLe=async e=>await tc(e,St.MAX_REPS_CONFIG),gLe=async e=>await Vc(e,St.MAX_REPS_CONFIG),yLe=async e=>await ec(e,St.NR_OF_SETS_CONFIG),vLe=async e=>await tc(e,St.NR_OF_SETS_CONFIG),bLe=async e=>await Vc(e,St.NR_OF_SETS_CONFIG),xLe=async e=>await ec(e,St.MAX_NR_OF_SETS_CONFIG),SLe=async e=>await tc(e,St.MAX_NR_OF_SETS_CONFIG),wLe=async e=>await ec(e,St.RIR_CONFIG),CLe=async e=>await tc(e,St.RIR_CONFIG),ELe=async e=>await Vc(e,St.RIR_CONFIG),TLe=async e=>await ec(e,St.MAX_RIR_CONFIG),OLe=async e=>await tc(e,St.MAX_RIR_CONFIG),ILe=async e=>await Vc(e,St.MAX_RIR_CONFIG),PLe=async e=>await ec(e,St.REST_CONFIG),ALe=async e=>await tc(e,St.REST_CONFIG),MLe=async e=>await Vc(e,St.REST_CONFIG),RLe=async e=>await ec(e,St.MAX_REST_CONFIG),DLe=async e=>await tc(e,St.MAX_REST_CONFIG),kLe=async e=>await Vc(e,St.MAX_REST_CONFIG),_Le=async e=>{const t=await it.get(ft(St.SESSION,{query:e}),{headers:ht()});return t.data.count===1?new gw().fromJson(t.data.results[0]):null},$Le=async e=>{const{filtersetQuerySessions:t={},filtersetQueryLogs:n={}}=e||{},r=new gw,o=new RI,i=[],a=[],s={};for await(const l of xh(ft(St.WORKOUT_LOG,{query:{limit:KN,...n}}),ht()))for(const c of l)a.push(o.fromJson(c));for(const l of a)s[l.exerciseId]||(s[l.exerciseId]=await pv(l.exerciseId)),l.exerciseObj=s[l.exerciseId];for await(const l of xh(ft(St.SESSION,{query:{limit:KN,...t}}),ht()))for(const c of l){const u=r.fromJson(c);u.logs=a.filter(f=>f.sessionId===u.id),i.push(u)}return i},NLe=async e=>{const t=await it.post(ft(St.SESSION),e,{headers:ht()});return new gw().fromJson(t.data)},LLe=async e=>{const t=await it.patch(ft(St.SESSION,{id:e.id}),e,{headers:ht()});return new gw().fromJson(t.data)};class FLe{constructor(t,n,r,o,i,a,s,l,c){Ce(this,"ingredient",null);Ce(this,"weightUnit",null);this.id=t,this.planId=n,this.mealId=r,this.ingredientId=o,this.weightUnitId=i,this.amount=a,this.datetime=s,l&&(this.ingredient=l),c&&(this.weightUnit=c)}get amountString(){var t;return this.amount.toFixed().toString()+(this.weightUnitId!==null?` ${(t=this.weightUnit)==null?void 0:t.name}`:"g")}get nutritionalValues(){return this.ingredient?qa.fromIngredient(this.ingredient,this.amount,this.weightUnit):(console.log("Diary entry has no ingredient, returning empty NutritionalValues object"),new qa)}}class VB{fromJson(t){return new FLe(t.id,t.plan,t.meal,t.ingredient,t.weight_unit,parseFloat(t.amount),new Date(t.datetime))}toJson(t){return{plan:t.planId,meal:t.mealId,ingredient:t.ingredientId,weight_unit:t.weightUnitId,amount:t.amount.toString(),datetime:t.datetime.toISOString()}}}const tie=async e=>{const t=new VB,{filtersetQuery:n={},loadUnit:r=!0,loadIngredient:o=!0}=e||{},i=ft(St.NUTRITIONAL_DIARY,{query:{limit:KN,...n}}),a=[];for await(const s of xh(i,ht()))for(const l of s){const c=t.fromJson(l);r&&(c.weightUnit=await eie(c.weightUnitId)),o&&(c.ingredient=await DNe(c.ingredientId)),a.push(c)}return a},nie=async e=>{const t=await it.post(ft(St.NUTRITIONAL_DIARY),e,{headers:ht()});return new VB().fromJson(t.data)},jLe=async e=>{const t=await it.patch(ft(St.NUTRITIONAL_DIARY,{id:e.id}),e,{headers:ht()});return new VB().fromJson(t.data)};class BLe{constructor(t){Ce(this,"username");Ce(this,"email");Ce(this,"emailVerified");Ce(this,"dateJoined");Ce(this,"isTrustworthy");Ce(this,"useMetric");Ce(this,"height");Ce(this,"weightRounding");Ce(this,"repetitionsRounding");this.username=t.username,this.email=t.email,this.emailVerified=t.emailVerified,this.dateJoined=t.dateJoined,this.isTrustworthy=t.isTrustworthy,this.useMetric=t.useMetric,this.height=t.height,this.weightRounding=t.weightRounding,this.repetitionsRounding=t.repetitionsRounding}}class rie{constructor(){Ce(this,"fromJson",t=>new BLe({username:t.username,email:t.email,emailVerified:t.email_verified,dateJoined:new Date(t.date_joined),isTrustworthy:t.is_trustworthy,useMetric:t.weight_unit==="kg",height:t.height,weightRounding:t.weight_rounding!==null?parseFloat(t.weight_rounding):null,repetitionsRounding:t.repetitions_rounding!==null?parseFloat(t.repetitions_rounding):null}));Ce(this,"toJson",t=>({email:t.email,height:t.height,weight_unit:t.useMetric?"kg":"lb",weight_rounding:t.weightRounding,repetitions_rounding:t.repetitionsRounding}))}}const zLe="userprofile",VLe=async()=>{const e=ft(zLe),t=new rie;try{const n=await it.get(e,{headers:ht()});return t.fromJson(n.data)}catch{return null}},HLe=async e=>{const t=await it.post(ft(St.API_PROFILE_PATH),e,{headers:ht()});return new rie().fromJson(t.data)},bv="nutritionplan",ULe=async()=>{const{data:e}=await it.get(ft(bv),{headers:ht()});return e.results.map(t=>ly.fromJson(t))},GLe=async()=>{const{data:e}=await it.get(ft(bv,{query:{limit:"1"}}),{headers:ht()});return e.count===0?null:await HB(e.results[0].id)},HB=async(e,t)=>{if(e===null)return null;const{filtersetQueryLogs:n={}}=t||{},{data:r}=await it.get(ft(bv,{id:e}),{headers:ht()}),o=[],i=ly.fromJson(r),a=await Promise.all([HNe(e),tie({filtersetQuery:{plan:e,...n}})]);i.meals=a[0],i.diaryEntries=a[1],i.diaryEntries.forEach(l=>{o.includes(l.ingredientId)||o.push(l.ingredientId)});const s=await Zoe(o);return i.diaryEntries.forEach(l=>{l.ingredient=s.find(c=>c.id===l.ingredientId)}),i.meals.forEach(l=>{l.diaryEntries=i.diaryEntries.filter(c=>c.mealId===l.id)}),i},qLe=async e=>{const t=await it.post(ft(bv),ly.toJson(e),{headers:ht()});return ly.fromJson(t.data)},WLe=async e=>{const t=await it.patch(ft(bv,{id:e.id}),ly.toJson(e),{headers:ht()});return ly.fromJson(t.data)},KLe=async e=>{await it.delete(ft(bv,{id:e}),{headers:ht()})};function YLe(){return yr({queryKey:[st.NUTRITIONAL_PLANS],queryFn:()=>ULe()})}function QLe(){return yr({queryKey:[st.NUTRITIONAL_PLAN,"last"],queryFn:()=>GLe()})}function XLe(e){return yr({queryKey:[st.NUTRITIONAL_PLAN,e],queryFn:()=>HB(e)})}function JLe(e,t,n=!0){return yr({queryKey:[st.NUTRITIONAL_PLAN,e,t],queryFn:()=>HB(e,{filtersetQueryLogs:{datetime__eq:Zn(new Date(t))}}),enabled:n})}const ZLe=()=>{const e=Mt();return Dt({mutationFn:t=>qLe(t),onSuccess:()=>{e.invalidateQueries({queryKey:[st.NUTRITIONAL_PLANS]}),e.invalidateQueries({queryKey:[st.NUTRITIONAL_PLAN]})}})},eFe=e=>{const t=Mt();return Dt({mutationFn:n=>KLe(n),onSuccess:()=>{t.invalidateQueries({queryKey:[st.NUTRITIONAL_PLANS]}),t.invalidateQueries({queryKey:[st.NUTRITIONAL_PLAN,e]})}})},tFe=e=>{const t=Mt();return Dt({mutationFn:n=>WLe(n),onSuccess:()=>{t.invalidateQueries({queryKey:[st.NUTRITIONAL_PLAN,e]}),t.invalidateQueries({queryKey:[st.NUTRITIONAL_PLANS]})}})},nFe=e=>yr({queryFn:()=>tie(e),queryKey:[st.NUTRITIONAL_PLAN_DIARY,JSON.stringify(e||{})]}),rFe=e=>{const t=Mt();return Dt({mutationFn:n=>nie(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.NUTRITIONAL_PLAN,e]})})},oie=e=>{const t=Mt();return Dt({mutationFn:n=>Promise.all(n.map(r=>nie(r))),onSuccess:()=>t.invalidateQueries({queryKey:[st.NUTRITIONAL_PLAN,e]})})},oFe=e=>{const t=Mt();return Dt({mutationFn:n=>jLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.NUTRITIONAL_PLAN,e]})})},iFe=e=>{const t=Mt();return Dt({mutationFn:n=>BNe(n),onSuccess:()=>{t.invalidateQueries({queryKey:[st.NUTRITIONAL_PLAN,e]})}})},aFe=e=>{const t=Mt();return Dt({mutationFn:n=>VNe(n),onSuccess:()=>{t.invalidateQueries({queryKey:[st.NUTRITIONAL_PLAN,e]})}})},sFe=e=>{const t=Mt();return Dt({mutationFn:n=>zNe(n),onSuccess:()=>{t.invalidateQueries({queryKey:[st.NUTRITIONAL_PLAN,e]})}})},lFe=e=>{const t=Mt();return Dt({mutationFn:n=>$Ne(n),onSuccess:()=>{t.invalidateQueries({queryKey:[st.NUTRITIONAL_PLAN,e]})}})},cFe=e=>{const t=Mt();return Dt({mutationFn:n=>NNe(n),onSuccess:()=>{t.invalidateQueries({queryKey:[st.NUTRITIONAL_PLAN,e]})}})},uFe=e=>{const t=Mt();return Dt({mutationFn:n=>LNe(n),onSuccess:()=>{t.invalidateQueries({queryKey:[st.NUTRITIONAL_PLAN,e]})}})};function _i(e,t){return e.toLocaleString(t,{maximumFractionDigits:0})}function iie(e,t,n){return e.toLocaleString(t,{maximumFractionDigits:0,unit:n.valueOf(),style:"unit"})}function $n(e,t){return iie(e,t,"gram")}function JR(e,t){return iie(e,t,"percent")}const Lg=e=>{const{i18n:t}=je(),n=e.planned>0;return Q(Tt,{children:[S(Cne,{variant:"determinate",value:e.percentage<100?e.percentage:100}),Q(at,{variant:"caption",children:[e.title," — ",$n(e.logged,t.language),n&&Q(Tt,{children:[" / ",$n(e.planned,t.language)]})]})]})};var ZR,Kq;function Aa(){if(Kq)return ZR;Kq=1;var e=Array.isArray;return ZR=e,ZR}var eD,Yq;function aie(){if(Yq)return eD;Yq=1;var e=typeof f1=="object"&&f1&&f1.Object===Object&&f1;return eD=e,eD}var tD,Qq;function Hc(){if(Qq)return tD;Qq=1;var e=aie(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return tD=n,tD}var nD,Xq;function bw(){if(Xq)return nD;Xq=1;var e=Hc(),t=e.Symbol;return nD=t,nD}var rD,Jq;function dFe(){if(Jq)return rD;Jq=1;var e=bw(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,o=e?e.toStringTag:void 0;function i(a){var s=n.call(a,o),l=a[o];try{a[o]=void 0;var c=!0}catch{}var u=r.call(a);return c&&(s?a[o]=l:delete a[o]),u}return rD=i,rD}var oD,Zq;function fFe(){if(Zq)return oD;Zq=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return oD=n,oD}var iD,eW;function Zu(){if(eW)return iD;eW=1;var e=bw(),t=dFe(),n=fFe(),r="[object Null]",o="[object Undefined]",i=e?e.toStringTag:void 0;function a(s){return s==null?s===void 0?o:r:i&&i in Object(s)?t(s):n(s)}return iD=a,iD}var aD,tW;function ed(){if(tW)return aD;tW=1;function e(t){return t!=null&&typeof t=="object"}return aD=e,aD}var sD,nW;function xv(){if(nW)return sD;nW=1;var e=Zu(),t=ed(),n="[object Symbol]";function r(o){return typeof o=="symbol"||t(o)&&e(o)==n}return sD=r,sD}var lD,rW;function UB(){if(rW)return lD;rW=1;var e=Aa(),t=xv(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function o(i,a){if(e(i))return!1;var s=typeof i;return s=="number"||s=="symbol"||s=="boolean"||i==null||t(i)?!0:r.test(i)||!n.test(i)||a!=null&&i in Object(a)}return lD=o,lD}var cD,oW;function jf(){if(oW)return cD;oW=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return cD=e,cD}var uD,iW;function GB(){if(iW)return uD;iW=1;var e=Zu(),t=jf(),n="[object AsyncFunction]",r="[object Function]",o="[object GeneratorFunction]",i="[object Proxy]";function a(s){if(!t(s))return!1;var l=e(s);return l==r||l==o||l==n||l==i}return uD=a,uD}var dD,aW;function pFe(){if(aW)return dD;aW=1;var e=Hc(),t=e["__core-js_shared__"];return dD=t,dD}var fD,sW;function hFe(){if(sW)return fD;sW=1;var e=pFe(),t=function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function n(r){return!!t&&t in r}return fD=n,fD}var pD,lW;function sie(){if(lW)return pD;lW=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return pD=n,pD}var hD,cW;function mFe(){if(cW)return hD;cW=1;var e=GB(),t=hFe(),n=jf(),r=sie(),o=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,a=Function.prototype,s=Object.prototype,l=a.toString,c=s.hasOwnProperty,u=RegExp("^"+l.call(c).replace(o,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function f(h){if(!n(h)||t(h))return!1;var m=e(h)?u:i;return m.test(r(h))}return hD=f,hD}var mD,uW;function gFe(){if(uW)return mD;uW=1;function e(t,n){return t==null?void 0:t[n]}return mD=e,mD}var gD,dW;function Vh(){if(dW)return gD;dW=1;var e=mFe(),t=gFe();function n(r,o){var i=t(r,o);return e(i)?i:void 0}return gD=n,gD}var yD,fW;function _I(){if(fW)return yD;fW=1;var e=Vh(),t=e(Object,"create");return yD=t,yD}var vD,pW;function yFe(){if(pW)return vD;pW=1;var e=_I();function t(){this.__data__=e?e(null):{},this.size=0}return vD=t,vD}var bD,hW;function vFe(){if(hW)return bD;hW=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return bD=e,bD}var xD,mW;function bFe(){if(mW)return xD;mW=1;var e=_I(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function o(i){var a=this.__data__;if(e){var s=a[i];return s===t?void 0:s}return r.call(a,i)?a[i]:void 0}return xD=o,xD}var SD,gW;function xFe(){if(gW)return SD;gW=1;var e=_I(),t=Object.prototype,n=t.hasOwnProperty;function r(o){var i=this.__data__;return e?i[o]!==void 0:n.call(i,o)}return SD=r,SD}var wD,yW;function SFe(){if(yW)return wD;yW=1;var e=_I(),t="__lodash_hash_undefined__";function n(r,o){var i=this.__data__;return this.size+=this.has(r)?0:1,i[r]=e&&o===void 0?t:o,this}return wD=n,wD}var CD,vW;function wFe(){if(vW)return CD;vW=1;var e=yFe(),t=vFe(),n=bFe(),r=xFe(),o=SFe();function i(a){var s=-1,l=a==null?0:a.length;for(this.clear();++s<l;){var c=a[s];this.set(c[0],c[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=o,CD=i,CD}var ED,bW;function CFe(){if(bW)return ED;bW=1;function e(){this.__data__=[],this.size=0}return ED=e,ED}var TD,xW;function qB(){if(xW)return TD;xW=1;function e(t,n){return t===n||t!==t&&n!==n}return TD=e,TD}var OD,SW;function $I(){if(SW)return OD;SW=1;var e=qB();function t(n,r){for(var o=n.length;o--;)if(e(n[o][0],r))return o;return-1}return OD=t,OD}var ID,wW;function EFe(){if(wW)return ID;wW=1;var e=$I(),t=Array.prototype,n=t.splice;function r(o){var i=this.__data__,a=e(i,o);if(a<0)return!1;var s=i.length-1;return a==s?i.pop():n.call(i,a,1),--this.size,!0}return ID=r,ID}var PD,CW;function TFe(){if(CW)return PD;CW=1;var e=$I();function t(n){var r=this.__data__,o=e(r,n);return o<0?void 0:r[o][1]}return PD=t,PD}var AD,EW;function OFe(){if(EW)return AD;EW=1;var e=$I();function t(n){return e(this.__data__,n)>-1}return AD=t,AD}var MD,TW;function IFe(){if(TW)return MD;TW=1;var e=$I();function t(n,r){var o=this.__data__,i=e(o,n);return i<0?(++this.size,o.push([n,r])):o[i][1]=r,this}return MD=t,MD}var RD,OW;function NI(){if(OW)return RD;OW=1;var e=CFe(),t=EFe(),n=TFe(),r=OFe(),o=IFe();function i(a){var s=-1,l=a==null?0:a.length;for(this.clear();++s<l;){var c=a[s];this.set(c[0],c[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=o,RD=i,RD}var DD,IW;function WB(){if(IW)return DD;IW=1;var e=Vh(),t=Hc(),n=e(t,"Map");return DD=n,DD}var kD,PW;function PFe(){if(PW)return kD;PW=1;var e=wFe(),t=NI(),n=WB();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return kD=r,kD}var _D,AW;function AFe(){if(AW)return _D;AW=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return _D=e,_D}var $D,MW;function LI(){if(MW)return $D;MW=1;var e=AFe();function t(n,r){var o=n.__data__;return e(r)?o[typeof r=="string"?"string":"hash"]:o.map}return $D=t,$D}var ND,RW;function MFe(){if(RW)return ND;RW=1;var e=LI();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return ND=t,ND}var LD,DW;function RFe(){if(DW)return LD;DW=1;var e=LI();function t(n){return e(this,n).get(n)}return LD=t,LD}var FD,kW;function DFe(){if(kW)return FD;kW=1;var e=LI();function t(n){return e(this,n).has(n)}return FD=t,FD}var jD,_W;function kFe(){if(_W)return jD;_W=1;var e=LI();function t(n,r){var o=e(this,n),i=o.size;return o.set(n,r),this.size+=o.size==i?0:1,this}return jD=t,jD}var BD,$W;function KB(){if($W)return BD;$W=1;var e=PFe(),t=MFe(),n=RFe(),r=DFe(),o=kFe();function i(a){var s=-1,l=a==null?0:a.length;for(this.clear();++s<l;){var c=a[s];this.set(c[0],c[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=o,BD=i,BD}var zD,NW;function lie(){if(NW)return zD;NW=1;var e=KB(),t="Expected a function";function n(r,o){if(typeof r!="function"||o!=null&&typeof o!="function")throw new TypeError(t);var i=function(){var a=arguments,s=o?o.apply(this,a):a[0],l=i.cache;if(l.has(s))return l.get(s);var c=r.apply(this,a);return i.cache=l.set(s,c)||l,c};return i.cache=new(n.Cache||e),i}return n.Cache=e,zD=n,zD}var VD,LW;function _Fe(){if(LW)return VD;LW=1;var e=lie(),t=500;function n(r){var o=e(r,function(a){return i.size===t&&i.clear(),a}),i=o.cache;return o}return VD=n,VD}var HD,FW;function $Fe(){if(FW)return HD;FW=1;var e=_Fe(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=e(function(o){var i=[];return o.charCodeAt(0)===46&&i.push(""),o.replace(t,function(a,s,l,c){i.push(l?c.replace(n,"$1"):s||a)}),i});return HD=r,HD}var UD,jW;function YB(){if(jW)return UD;jW=1;function e(t,n){for(var r=-1,o=t==null?0:t.length,i=Array(o);++r<o;)i[r]=n(t[r],r,t);return i}return UD=e,UD}var GD,BW;function NFe(){if(BW)return GD;BW=1;var e=bw(),t=YB(),n=Aa(),r=xv(),o=e?e.prototype:void 0,i=o?o.toString:void 0;function a(s){if(typeof s=="string")return s;if(n(s))return t(s,a)+"";if(r(s))return i?i.call(s):"";var l=s+"";return l=="0"&&1/s==-1/0?"-0":l}return GD=a,GD}var qD,zW;function cie(){if(zW)return qD;zW=1;var e=NFe();function t(n){return n==null?"":e(n)}return qD=t,qD}var WD,VW;function uie(){if(VW)return WD;VW=1;var e=Aa(),t=UB(),n=$Fe(),r=cie();function o(i,a){return e(i)?i:t(i,a)?[i]:n(r(i))}return WD=o,WD}var KD,HW;function FI(){if(HW)return KD;HW=1;var e=xv();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return KD=t,KD}var YD,UW;function QB(){if(UW)return YD;UW=1;var e=uie(),t=FI();function n(r,o){o=e(o,r);for(var i=0,a=o.length;r!=null&&i<a;)r=r[t(o[i++])];return i&&i==a?r:void 0}return YD=n,YD}var QD,GW;function die(){if(GW)return QD;GW=1;var e=QB();function t(n,r,o){var i=n==null?void 0:e(n,r);return i===void 0?o:i}return QD=t,QD}var LFe=die();const Ja=Gn(LFe);var XD,qW;function FFe(){if(qW)return XD;qW=1;function e(t){return t==null}return XD=e,XD}var jFe=FFe();const on=Gn(jFe);var JD,WW;function BFe(){if(WW)return JD;WW=1;var e=Zu(),t=Aa(),n=ed(),r="[object String]";function o(i){return typeof i=="string"||!t(i)&&n(i)&&e(i)==r}return JD=o,JD}var zFe=BFe();const Sh=Gn(zFe);var VFe=GB();const rn=Gn(VFe);var HFe=jf();const Sv=Gn(HFe);var ZD={exports:{}},cr={};/**
* @license React
* react-is.production.min.js
*
@@ -347,9 +347,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
`));return e},WXe=["elements","areAllSectionsEmpty","defaultValue","label","value","onChange","id","autoFocus","endAdornment","startAdornment","renderSuffix","slots","slotProps","contentEditable","tabIndex","onInput","onPaste","onKeyDown","fullWidth","name","readOnly","inputProps","inputRef","sectionListRef","onFocus","onBlur","classes","ownerState"],KXe=e=>Math.round(e*1e5)/1e5,wP=ae("div",{name:"MuiPickersInputBase",slot:"Root"})(({theme:e})=>z({},e.typography.body1,{color:(e.vars||e).palette.text.primary,cursor:"text",padding:0,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",boxSizing:"border-box",letterSpacing:`${KXe(.15/16)}em`,variants:[{props:{isInputInFullWidth:!0},style:{width:"100%"}}]})),sV=ae(yce,{name:"MuiPickersInputBase",slot:"SectionsContainer"})(({theme:e})=>({padding:"4px 0 5px",fontFamily:e.typography.fontFamily,fontSize:"inherit",lineHeight:"1.4375em",flexGrow:1,outline:"none",display:"flex",flexWrap:"nowrap",overflow:"hidden",letterSpacing:"inherit",width:"182px",variants:[{props:{fieldDirection:"rtl"},style:{textAlign:"right /*! @noflip */"}},{props:{inputSize:"small"},style:{paddingTop:1}},{props:{hasStartAdornment:!1,isFieldFocused:!1,isFieldValueEmpty:!0},style:{color:"currentColor",opacity:0}},{props:{hasStartAdornment:!1,isFieldFocused:!1,isFieldValueEmpty:!0,inputHasLabel:!1},style:e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:e.palette.mode==="light"?.42:.5}}]})),YXe=ae(vce,{name:"MuiPickersInputBase",slot:"Section"})(({theme:e})=>({fontFamily:e.typography.fontFamily,fontSize:"inherit",letterSpacing:"inherit",lineHeight:"1.4375em",display:"inline-block",whiteSpace:"nowrap"})),QXe=ae(xce,{name:"MuiPickersInputBase",slot:"SectionContent",overridesResolver:(e,t)=>t.content})(({theme:e})=>({fontFamily:e.typography.fontFamily,lineHeight:"1.4375em",letterSpacing:"inherit",width:"fit-content",outline:"none"})),XXe=ae(bce,{name:"MuiPickersInputBase",slot:"Separator"})(()=>({whiteSpace:"pre",letterSpacing:"inherit"})),JXe=ae("input",{name:"MuiPickersInputBase",slot:"Input",overridesResolver:(e,t)=>t.hiddenInput})(z({},Ybe)),ZXe=ae("div",{name:"MuiPickersInputBase",slot:"ActiveBar"})(({theme:e,ownerState:t})=>({display:"none",position:"absolute",height:2,bottom:2,borderTopLeftRadius:2,borderTopRightRadius:2,transition:e.transitions.create(["width","left"],{duration:e.transitions.duration.shortest}),backgroundColor:(e.vars||e).palette.primary.main,'[data-active-range-position="start"] &, [data-active-range-position="end"] &':{display:"block"},'[data-active-range-position="start"] &':{left:t.sectionOffsets[0]},'[data-active-range-position="end"] &':{left:t.sectionOffsets[1]}})),eJe=(e,t)=>{const{isFieldFocused:n,isFieldDisabled:r,isFieldReadOnly:o,hasFieldError:i,inputSize:a,isInputInFullWidth:s,inputColor:l,hasStartAdornment:c,hasEndAdornment:u}=t,f={root:["root",n&&!r&&"focused",r&&"disabled",o&&"readOnly",i&&"error",s&&"fullWidth",`color${Oe(l)}`,a==="small"&&"inputSizeSmall",c&&"adornedStart",u&&"adornedEnd"],notchedOutline:["notchedOutline"],input:["input"],sectionsContainer:["sectionsContainer"],sectionContent:["sectionContent"],sectionBefore:["sectionBefore"],sectionAfter:["sectionAfter"],activeBar:["activeBar"]};return Me(f,zXe,e)};function iX(e,t,n,r){var o;if(e.content.id){const i=(o=t.current)==null?void 0:o.querySelectorAll(`[data-sectionindex="${n}"] [data-range-position="${r}"]`);if(i)return Array.from(i).reduce((a,s)=>a+s.offsetWidth,0)}return 0}function tJe(e,t){var o,i,a,s,l;let n=0;if(((o=t.current)==null?void 0:o.getAttribute("data-active-range-position"))==="end")for(let c=e.length-1;c>=e.length/2;c-=1)n+=iX(e[c],t,c,"end");else for(let c=0;c<e.length/2;c+=1)n+=iX(e[c],t,c,"start");return{activeBarWidth:n,sectionOffsets:[((a=(i=t.current)==null?void 0:i.querySelector('[data-sectionindex="0"]'))==null?void 0:a.offsetLeft)||0,((l=(s=t.current)==null?void 0:s.querySelector(`[data-sectionindex="${e.length/2}"]`))==null?void 0:l.offsetLeft)||0]}}const lV=x.forwardRef(function(t,n){const r=Pn({props:t,name:"MuiPickersInputBase"}),{elements:o,areAllSectionsEmpty:i,value:a,onChange:s,id:l,endAdornment:c,startAdornment:u,renderSuffix:f,slots:h,slotProps:m,contentEditable:g,tabIndex:y,onInput:v,onPaste:w,onKeyDown:C,name:E,readOnly:I,inputProps:O,inputRef:P,sectionListRef:R,onFocus:D,onBlur:M,classes:A,ownerState:_}=r,N=$e(r,WXe),B=SP(),H=x.useRef(null),j=x.useRef(null),L=x.useRef([]),V=en(n,H),W=en(O==null?void 0:O.ref,P),K=sl();if(!K)throw new Error("MUI X: PickersInputBase should always be used inside a PickersTextField component");const G=_??B,q=le=>{var de;(de=K.onFocus)==null||de.call(K,le),D==null||D(le)},Y=le=>{q(le)},Z=le=>{var de,oe;if(C==null||C(le),le.key==="Enter"&&!le.defaultMuiPrevented){if((de=H.current)!=null&&de.dataset.multiInput)return;const ue=(oe=H.current)==null?void 0:oe.closest("form"),pe=ue==null?void 0:ue.querySelector('[type="submit"]');if(!ue||!pe)return;le.preventDefault(),ue.requestSubmit(pe)}},ie=le=>{var de;(de=K.onBlur)==null||de.call(K,le),M==null||M(le)};x.useEffect(()=>{K&&K.setAdornedStart(!!u)},[K,u]),x.useEffect(()=>{K&&(i?K.onEmpty():K.onFilled())},[K,i]);const se=eJe(A,G),ce=(h==null?void 0:h.root)||wP,ye=Dn({elementType:ce,externalSlotProps:m==null?void 0:m.root,externalForwardedProps:N,additionalProps:{"aria-invalid":K.error,ref:V},className:se.root,ownerState:G}),Se=(h==null?void 0:h.input)||sV,ne=o.some(le=>le.content["data-range-position"]!==void 0);return x.useEffect(()=>{if(!ne||!G.isPickerOpen)return;const{activeBarWidth:le,sectionOffsets:de}=tJe(o,H);L.current=[de[0],de[1]],j.current&&(j.current.style.width=`${le}px`)},[o,ne,G.isPickerOpen]),k.jsxs(ce,z({},ye,{children:[u,k.jsx(qXe,{sectionListRef:R,elements:o,contentEditable:g,tabIndex:y,className:se.sectionsContainer,onFocus:q,onBlur:ie,onInput:v,onPaste:w,onKeyDown:Z,slots:{root:Se,section:YXe,sectionContent:QXe,sectionSeparator:XXe},slotProps:{root:z({},m==null?void 0:m.input,{ownerState:G}),sectionContent:{className:zg.sectionContent},sectionSeparator:({separatorPosition:le})=>({className:le==="before"?zg.sectionBefore:zg.sectionAfter})}}),c,f?f(z({},K)):null,k.jsx(JXe,z({name:E,className:se.input,value:a,onChange:s,id:l,"aria-hidden":"true",tabIndex:-1,readOnly:I,required:K.required,disabled:K.disabled,onFocus:Y},O,{ref:W})),ne&&k.jsx(ZXe,{className:se.activeBar,ref:j,ownerState:{sectionOffsets:L.current}})]}))});function nJe(e){return qe("MuiPickersOutlinedInput",e)}const bl=z({},zg,Ke("MuiPickersOutlinedInput",["root","notchedOutline","input"])),rJe=["children","className","label","notched","shrink"],oJe=ae("fieldset",{name:"MuiPickersOutlinedInput",slot:"NotchedOutline"})(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%",borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}}),aX=ae("span")(({theme:e})=>({fontFamily:e.typography.fontFamily,fontSize:"inherit"})),iJe=ae("legend",{shouldForwardProp:e=>Ca(e)&&e!=="notched"})(({theme:e})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:{inputHasLabel:!1},style:{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})}},{props:{inputHasLabel:!0},style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:{inputHasLabel:!0,notched:!0},style:{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}]}));function aJe(e){const{className:t,label:n,notched:r}=e,o=$e(e,rJe),i=SP();return k.jsx(oJe,z({"aria-hidden":!0,className:t},o,{ownerState:i,children:k.jsx(iJe,{ownerState:i,notched:r,children:n?k.jsx(aX,{children:n}):k.jsx(aX,{className:"notranslate",children:"​"})})}))}const sJe=["label","autoFocus","ownerState","classes","notched"],lJe=ae(wP,{name:"MuiPickersOutlinedInput",slot:"Root"})(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{padding:"0 14px",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${bl.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${bl.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}},[`&.${bl.focused} .${bl.notchedOutline}`]:{borderStyle:"solid",borderWidth:2},[`&.${bl.disabled}`]:{[`& .${bl.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled},"*":{color:(e.vars||e).palette.action.disabled}},[`&.${bl.error} .${bl.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},variants:Object.keys((e.vars??e).palette).filter(n=>{var r;return((r=(e.vars??e).palette[n])==null?void 0:r.main)??!1}).map(n=>({props:{inputColor:n},style:{[`&.${bl.focused}:not(.${bl.error}) .${bl.notchedOutline}`]:{borderColor:(e.vars||e).palette[n].main}}}))}}),cJe=ae(sV,{name:"MuiPickersOutlinedInput",slot:"SectionsContainer"})({padding:"16.5px 0",variants:[{props:{inputSize:"small"},style:{padding:"8.5px 0"}}]}),uJe=e=>{const n=Me({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},nJe,e);return z({},e,n)},wce=x.forwardRef(function(t,n){const r=Pn({props:t,name:"MuiPickersOutlinedInput"}),{label:o,classes:i,notched:a}=r,s=$e(r,sJe),l=sl(),c=uJe(i);return k.jsx(lV,z({slots:{root:lJe,input:cJe},renderSuffix:u=>k.jsx(aJe,{shrink:!!(a||u.adornedStart||u.focused||u.filled),notched:!!(a||u.adornedStart||u.focused||u.filled),className:c.notchedOutline,label:o!=null&&o!==""&&(l!=null&&l.required)?k.jsxs(x.Fragment,{children:[o," ","*"]}):o})},s,{label:o,classes:c,ref:n}))});wce.muiName="Input";function dJe(e){return qe("MuiPickersFilledInput",e)}const Sp=z({},zg,Ke("MuiPickersFilledInput",["root","underline","input"])),fJe=["label","autoFocus","disableUnderline","hiddenLabel","classes"],pJe=ae(wP,{name:"MuiPickersFilledInput",slot:"Root",shouldForwardProp:e=>Ca(e)&&e!=="disableUnderline"})(({theme:e})=>{const t=e.palette.mode==="light",n=t?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",r=t?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",o=t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",i=t?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:o,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r}},[`&.${Sp.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r},[`&.${Sp.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:i},variants:[...Object.keys((e.vars??e).palette).filter(a=>(e.vars??e).palette[a].main).map(a=>{var s;return{props:{inputColor:a,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(s=(e.vars||e).palette[a])==null?void 0:s.main}`}}}}),{props:{disableUnderline:!1},style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Sp.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Sp.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`:n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Sp.disabled}, .${Sp.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${Sp.disabled}:before`]:{borderBottomStyle:"dotted"}}},{props:{hasStartAdornment:!0},style:{paddingLeft:12}},{props:{hasEndAdornment:!0},style:{paddingRight:12}}]}}),hJe=ae(sV,{name:"MuiPickersFilledInput",slot:"sectionsContainer",shouldForwardProp:e=>Ca(e)&&e!=="hiddenLabel"})({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,variants:[{props:{inputSize:"small"},style:{paddingTop:21,paddingBottom:4}},{props:{hasStartAdornment:!0},style:{paddingLeft:0}},{props:{hasEndAdornment:!0},style:{paddingRight:0}},{props:{hiddenLabel:!0},style:{paddingTop:16,paddingBottom:17}},{props:{hiddenLabel:!0,inputSize:"small"},style:{paddingTop:8,paddingBottom:9}}]}),mJe=(e,t)=>{const{inputHasUnderline:n}=t,o=Me({root:["root",n&&"underline"],input:["input"]},dJe,e);return z({},e,o)},Cce=x.forwardRef(function(t,n){const r=Pn({props:t,name:"MuiPickersFilledInput"}),{label:o,disableUnderline:i=!1,hiddenLabel:a=!1,classes:s}=r,l=$e(r,fJe),c=SP(),u=z({},c,{inputHasUnderline:!i}),f=mJe(s,u);return k.jsx(lV,z({slots:{root:pJe,input:hJe},slotProps:{root:{disableUnderline:i},input:{hiddenLabel:a}}},l,{label:o,classes:f,ref:n,ownerState:u}))});Cce.muiName="Input";function gJe(e){return qe("MuiPickersFilledInput",e)}const m0=z({},zg,Ke("MuiPickersInput",["root","underline","input"])),yJe=["label","autoFocus","disableUnderline","ownerState","classes"],vJe=ae(wP,{name:"MuiPickersInput",slot:"Root",shouldForwardProp:e=>Ca(e)&&e!=="disableUnderline"})(({theme:e})=>{let n=e.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(n=`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`),{"label + &":{marginTop:16},variants:[...Object.keys((e.vars??e).palette).filter(r=>(e.vars??e).palette[r].main).map(r=>({props:{inputColor:r},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[r].main}`}}})),{props:{disableUnderline:!1},style:{"&::after":{background:"red",left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${m0.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${m0.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${m0.disabled}, .${m0.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${n}`}},[`&.${m0.disabled}:before`]:{borderBottomStyle:"dotted"}}}]}}),bJe=(e,t)=>{const{inputHasUnderline:n}=t,o=Me({root:["root",!n&&"underline"],input:["input"]},gJe,e);return z({},e,o)},Ece=x.forwardRef(function(t,n){const r=Pn({props:t,name:"MuiPickersInput"}),{label:o,disableUnderline:i=!1,classes:a}=r,s=$e(r,yJe),l=SP(),c=z({},l,{inputHasUnderline:!i}),u=bJe(a,c);return k.jsx(lV,z({slots:{root:vJe},slotProps:{root:{disableUnderline:i}}},s,{label:o,classes:u,ref:n}))});Ece.muiName="Input";const xJe=["onFocus","onBlur","className","classes","color","disabled","error","variant","required","InputProps","inputProps","inputRef","sectionListRef","elements","areAllSectionsEmpty","onClick","onKeyDown","onKeyUp","onPaste","onInput","endAdornment","startAdornment","tabIndex","contentEditable","focused","value","onChange","fullWidth","id","name","helperText","FormHelperTextProps","label","InputLabelProps","data-active-range-position"],SJe={standard:Ece,filled:Cce,outlined:wce},wJe=ae(Fh,{name:"MuiPickersTextField",slot:"Root"})({}),CJe=(e,t)=>{const{isFieldFocused:n,isFieldDisabled:r,isFieldRequired:o}=t;return Me({root:["root",n&&!r&&"focused",r&&"disabled",o&&"required"]},BXe,e)},Tce=x.forwardRef(function(t,n){const r=Pn({props:t,name:"MuiPickersTextField"}),{onFocus:o,onBlur:i,className:a,classes:s,color:l="primary",disabled:c=!1,error:u=!1,variant:f="outlined",required:h=!1,InputProps:m,inputProps:g,inputRef:y,sectionListRef:v,elements:w,areAllSectionsEmpty:C,onClick:E,onKeyDown:I,onKeyUp:O,onPaste:P,onInput:R,endAdornment:D,startAdornment:M,tabIndex:A,contentEditable:_,focused:N,value:B,onChange:H,fullWidth:j,id:L,name:V,helperText:W,FormHelperTextProps:K,label:G,InputLabelProps:q,"data-active-range-position":Y}=r,Z=$e(r,xJe),ie=x.useRef(null),se=en(n,ie),ce=bn(L),ye=W&&ce?`${ce}-helper-text`:void 0,Se=G&&ce?`${ce}-label`:void 0,ne=aV({disabled:r.disabled,required:r.required,readOnly:m==null?void 0:m.readOnly}),le=x.useMemo(()=>z({},ne,{isFieldValueEmpty:C,isFieldFocused:N??!1,hasFieldError:u??!1,inputSize:r.size??"medium",inputColor:l??"primary",isInputInFullWidth:j??!1,hasStartAdornment:!!(M??(m==null?void 0:m.startAdornment)),hasEndAdornment:!!(D??(m==null?void 0:m.endAdornment)),inputHasLabel:!!G}),[ne,C,N,u,r.size,l,j,M,D,m==null?void 0:m.startAdornment,m==null?void 0:m.endAdornment,G]),de=CJe(s,le),oe=SJe[f];return k.jsx(Sce.Provider,{value:le,children:k.jsxs(wJe,z({className:fe(de.root,a),ref:se,focused:N,disabled:c,variant:f,error:u,color:l,fullWidth:j,required:h,ownerState:le},Z,{children:[G!=null&&G!==""&&k.jsx(jh,z({htmlFor:ce,id:Se},q,{children:G})),k.jsx(oe,z({elements:w,areAllSectionsEmpty:C,onClick:E,onKeyDown:I,onKeyUp:O,onInput:R,onPaste:P,onFocus:o,onBlur:i,endAdornment:D,startAdornment:M,tabIndex:A,contentEditable:_,value:B,onChange:H,id:ce,fullWidth:j,inputProps:g,inputRef:y,sectionListRef:v,label:G,name:V,role:"group","aria-labelledby":Se,"aria-describedby":ye,"aria-live":ye?"polite":void 0,"data-active-range-position":Y},m)),W&&k.jsx(aw,z({id:ye},K,{children:W}))]}))})}),EJe=["enableAccessibleFieldDOMStructure"],TJe=["InputProps","readOnly","onClear","clearable","clearButtonPosition","openPickerButtonPosition","openPickerAriaLabel"],OJe=["onPaste","onKeyDown","inputMode","readOnly","InputProps","inputProps","inputRef","onClear","clearable","clearButtonPosition","openPickerButtonPosition","openPickerAriaLabel"],IJe=["ownerState"],PJe=["ownerState"],AJe=["ownerState"],MJe=["ownerState"],RJe=["InputProps","inputProps"],DJe=e=>{let{enableAccessibleFieldDOMStructure:t}=e,n=$e(e,EJe);if(t){const{InputProps:v,readOnly:w,onClear:C,clearable:E,clearButtonPosition:I,openPickerButtonPosition:O,openPickerAriaLabel:P}=n,R=$e(n,TJe);return{clearable:E,onClear:C,clearButtonPosition:I,openPickerButtonPosition:O,openPickerAriaLabel:P,textFieldProps:z({},R,{InputProps:z({},v??{},{readOnly:w})})}}const{onPaste:r,onKeyDown:o,inputMode:i,readOnly:a,InputProps:s,inputProps:l,inputRef:c,onClear:u,clearable:f,clearButtonPosition:h,openPickerButtonPosition:m,openPickerAriaLabel:g}=n,y=$e(n,OJe);return{clearable:f,onClear:u,clearButtonPosition:h,openPickerButtonPosition:m,openPickerAriaLabel:g,textFieldProps:z({},y,{InputProps:z({},s??{},{readOnly:a}),inputProps:z({},l??{},{inputMode:i,onPaste:r,onKeyDown:o,ref:c})})}},cV=x.createContext({slots:{},slotProps:{},inputRef:void 0});function uV(e){var K,G;const{slots:t,slotProps:n,fieldResponse:r,defaultOpenPickerIcon:o}=e,i=Ei(),a=rV(),s=x.useContext(cV),{textFieldProps:l,onClear:c,clearable:u,openPickerAriaLabel:f,clearButtonPosition:h="end",openPickerButtonPosition:m="end"}=DJe(r),g=aV(l),y=Je(q=>{q.preventDefault(),a==null||a.setOpen(Y=>!Y)}),v=a?a.triggerStatus:"hidden",w=u?h:null,C=v!=="hidden"?m:null,E=(t==null?void 0:t.textField)??s.slots.textField??(r.enableAccessibleFieldDOMStructure===!1?dn:Tce),I=(t==null?void 0:t.inputAdornment)??s.slots.inputAdornment??So,O=Dn({elementType:I,externalSlotProps:EE(s.slotProps.inputAdornment,n==null?void 0:n.inputAdornment),additionalProps:{position:"start"},ownerState:z({},g,{position:"start"})}),P=$e(O,IJe),R=Dn({elementType:I,externalSlotProps:n==null?void 0:n.inputAdornment,additionalProps:{position:"end"},ownerState:z({},g,{position:"end"})}),D=$e(R,PJe),M=s.slots.openPickerButton??pn,A=Dn({elementType:M,externalSlotProps:s.slotProps.openPickerButton,additionalProps:{disabled:v==="disabled",onClick:y,"aria-label":f,edge:l.variant!=="standard"?C:!1},ownerState:g}),_=$e(A,AJe),N=s.slots.openPickerIcon??o,B=Dn({elementType:N,externalSlotProps:s.slotProps.openPickerIcon,ownerState:g}),H=(t==null?void 0:t.clearButton)??s.slots.clearButton??pn,j=Dn({elementType:H,externalSlotProps:EE(s.slotProps.clearButton,n==null?void 0:n.clearButton),className:"clearButton",additionalProps:{title:i.fieldClearLabel,tabIndex:-1,onClick:c,disabled:r.disabled||r.readOnly,edge:l.variant!=="standard"&&w!==C?w:!1},ownerState:g}),L=$e(j,MJe),V=(t==null?void 0:t.clearIcon)??s.slots.clearIcon??EYe,W=Dn({elementType:V,externalSlotProps:EE(s.slotProps.clearIcon,n==null?void 0:n.clearIcon),additionalProps:{fontSize:"small"},ownerState:g});return l.ref=en(l.ref,a==null?void 0:a.rootRef),l.InputProps||(l.InputProps={}),a&&(l.InputProps.ref=a.triggerRef),!((K=l.InputProps)!=null&&K.startAdornment)&&(w==="start"||C==="start")&&(l.InputProps.startAdornment=k.jsxs(I,z({},P,{children:[C==="start"&&k.jsx(M,z({},_,{children:k.jsx(N,z({},B))})),w==="start"&&k.jsx(H,z({},L,{children:k.jsx(V,z({},W))}))]}))),!((G=l.InputProps)!=null&&G.endAdornment)&&(w==="end"||C==="end")&&(l.InputProps.endAdornment=k.jsxs(I,z({},D,{children:[w==="end"&&k.jsx(H,z({},L,{children:k.jsx(V,z({},W))})),C==="end"&&k.jsx(M,z({},_,{children:k.jsx(N,z({},B))}))]}))),w!=null&&(l.sx=[{"& .clearButton":{opacity:1},"@media (pointer: fine)":{"& .clearButton":{opacity:0},"&:hover, &:focus-within":{".clearButton":{opacity:1}}}},...Array.isArray(l.sx)?l.sx:[l.sx]]),k.jsx(E,z({},l))}function EE(e,t){return e?t?n=>z({},Dc(t,n),Dc(e,n)):e:t}function dV(e){const{ref:t,externalForwardedProps:n,slotProps:r}=e,o=x.useContext(cV),i=rV(),a=aV(n),{InputProps:s,inputProps:l}=n,c=$e(n,RJe),u=Dn({elementType:Tce,externalSlotProps:EE(o.slotProps.textField,r==null?void 0:r.textField),externalForwardedProps:c,additionalProps:{ref:t,sx:i==null?void 0:i.rootSx,label:i==null?void 0:i.label,name:i==null?void 0:i.name,className:i==null?void 0:i.rootClassName,inputRef:o.inputRef},ownerState:a});return u.inputProps=z({},l,u.inputProps),u.InputProps=z({},s,u.InputProps),u}function Oce(e){const{slots:t={},slotProps:n={},inputRef:r,children:o}=e,i=x.useMemo(()=>({inputRef:r,slots:{openPickerButton:t.openPickerButton,openPickerIcon:t.openPickerIcon,textField:t.textField,inputAdornment:t.inputAdornment,clearIcon:t.clearIcon,clearButton:t.clearButton},slotProps:{openPickerButton:n.openPickerButton,openPickerIcon:n.openPickerIcon,textField:n.textField,inputAdornment:n.inputAdornment,clearIcon:n.clearIcon,clearButton:n.clearButton}}),[r,t.openPickerButton,t.openPickerIcon,t.textField,t.inputAdornment,t.clearIcon,t.clearButton,n.openPickerButton,n.openPickerIcon,n.textField,n.inputAdornment,n.clearIcon,n.clearButton]);return k.jsx(cV.Provider,{value:i,children:o})}const kJe=["slots","slotProps"],Ice=x.forwardRef(function(t,n){const r=Pn({props:t,name:"MuiDateField"}),{slots:o,slotProps:i}=r,a=$e(r,kJe),s=dV({slotProps:i,ref:n,externalForwardedProps:a}),l=jXe(s);return k.jsx(uV,{slots:o,slotProps:i,fieldResponse:l,defaultOpenPickerIcon:jle})}),_Je=e=>{const t=kXe(e);return iV({manager:t,props:e})},$Je=["slots","slotProps","InputProps","inputProps"],Pce=x.forwardRef(function(t,n){const r=Pn({props:t,name:"MuiTimeField"}),{slots:o,slotProps:i}=r,a=$e(r,$Je),s=dV({slotProps:i,ref:n,externalForwardedProps:a}),l=_Je(s);return k.jsx(uV,{slots:o,slotProps:i,fieldResponse:l,defaultOpenPickerIcon:SYe})}),NJe=e=>{const t=NXe(e);return iV({manager:t,props:e})},LJe=["slots","slotProps"],Ace=x.forwardRef(function(t,n){const r=Pn({props:t,name:"MuiDateTimeField"}),{slots:o,slotProps:i}=r,a=$e(r,LJe),s=dV({slotProps:i,ref:n,externalForwardedProps:a}),l=NJe(s);return k.jsx(uV,{slots:o,slotProps:i,fieldResponse:l,defaultOpenPickerIcon:jle})}),Mce=({shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:r,maxDate:o,disableFuture:i,disablePast:a,timezone:s})=>{const l=Wh();return x.useCallback(c=>Rv({adapter:l,value:c,timezone:s,props:{shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:r,maxDate:o,disableFuture:i,disablePast:a}})!==null,[l,e,t,n,r,o,i,a,s])},FJe=(e,t)=>(n,r)=>{switch(r.type){case"setVisibleDate":return z({},n,{slideDirection:r.direction,currentMonth:r.month,isMonthSwitchingAnimating:!t.isSameMonth(r.month,n.currentMonth)&&!e&&!r.skipAnimation,focusedDay:r.focusedDay});case"changeMonthTimezone":{const o=r.newTimezone;if(t.getTimezone(n.currentMonth)===o)return n;let i=t.setTimezone(n.currentMonth,o);return t.getMonth(i)!==t.getMonth(n.currentMonth)&&(i=t.setMonth(i,t.getMonth(n.currentMonth))),z({},n,{currentMonth:i})}case"finishMonthSwitchingAnimation":return z({},n,{isMonthSwitchingAnimating:!1});default:throw new Error("missing support")}},jJe=e=>{const{value:t,referenceDate:n,disableFuture:r,disablePast:o,maxDate:i,minDate:a,onMonthChange:s,onYearChange:l,reduceAnimations:c,shouldDisableDate:u,timezone:f,getCurrentMonthFromVisibleDate:h}=e,m=xn(),g=x.useRef(FJe(!!c,m)).current,y=x.useMemo(()=>mo.getInitialReferenceValue({value:t,utils:m,timezone:f,props:e,referenceDate:n,granularity:Rl.day}),[n,f]),[v,w]=x.useReducer(g,{isMonthSwitchingAnimating:!1,focusedDay:y,currentMonth:m.startOfMonth(y),slideDirection:"left"}),C=Mce({shouldDisableDate:u,minDate:a,maxDate:i,disableFuture:r,disablePast:o,timezone:f});x.useEffect(()=>{w({type:"changeMonthTimezone",newTimezone:m.getTimezone(y)})},[y,m]);const E=Je(({target:O,reason:P})=>{if(P==="cell-interaction"&&v.focusedDay!=null&&m.isSameDay(O,v.focusedDay))return;const R=P==="cell-interaction";let D,M;if(P==="cell-interaction")D=h(O,v.currentMonth),M=O;else if(D=m.isSameMonth(O,v.currentMonth)?v.currentMonth:m.startOfMonth(O),M=O,C(M)){const N=m.startOfMonth(O),B=m.endOfMonth(O);M=SS({utils:m,date:M,minDate:m.isBefore(a,N)?N:a,maxDate:m.isAfter(i,B)?B:i,disablePast:o,disableFuture:r,isDateDisabled:C,timezone:f})}const A=!m.isSameMonth(v.currentMonth,D),_=!m.isSameYear(v.currentMonth,D);A&&(s==null||s(D)),_&&(l==null||l(m.startOfYear(D))),w({type:"setVisibleDate",month:D,direction:m.isAfterDay(D,v.currentMonth)?"left":"right",focusedDay:v.focusedDay!=null&&M!=null&&m.isSameDay(M,v.focusedDay)?v.focusedDay:M,skipAnimation:R})}),I=x.useCallback(()=>{w({type:"finishMonthSwitchingAnimation"})},[]);return{referenceDate:y,calendarState:v,setVisibleDate:E,isDateDisabled:C,onMonthSwitchingAnimationEnd:I}},BJe=e=>qe("MuiPickersFadeTransitionGroup",e);Ke("MuiPickersFadeTransitionGroup",["root"]);const zJe=["children"],VJe=e=>Me({root:["root"]},BJe,e),HJe=ae(tw,{name:"MuiPickersFadeTransitionGroup",slot:"Root"})({display:"block",position:"relative"});function Rce(e){const t=Pn({props:e,name:"MuiPickersFadeTransitionGroup"}),{className:n,reduceAnimations:r,transKey:o,classes:i}=t,{children:a}=t,s=$e(t,zJe),l=VJe(i),c=Lr();if(r)return a;const u=z({},s);return k.jsx(HJe,{className:fe(l.root,n),ownerState:u,children:k.jsx(hh,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:c.transitions.duration.enteringScreen,enter:c.transitions.duration.enteringScreen,exit:0},children:a},o)})}const UJe=e=>qe("MuiPickersSlideTransition",e),Ps=Ke("MuiPickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),GJe=["children","className","reduceAnimations","slideDirection","transKey","classes"],qJe=(e,t)=>{const{slideDirection:n}=t,r={root:["root"],exit:["slideExit"],enterActive:["slideEnterActive"],enter:[`slideEnter-${n}`],exitActive:[`slideExitActiveLeft-${n}`]};return Me(r,UJe,e)},WJe=ae(tw,{name:"MuiPickersSlideTransition",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`.${Ps["slideEnter-left"]}`]:t["slideEnter-left"]},{[`.${Ps["slideEnter-right"]}`]:t["slideEnter-right"]},{[`.${Ps.slideEnterActive}`]:t.slideEnterActive},{[`.${Ps.slideExit}`]:t.slideExit},{[`.${Ps["slideExitActiveLeft-left"]}`]:t["slideExitActiveLeft-left"]},{[`.${Ps["slideExitActiveLeft-right"]}`]:t["slideExitActiveLeft-right"]}]})(({theme:e})=>{const t=e.transitions.create("transform",{duration:e.transitions.duration.complex,easing:"cubic-bezier(0.35, 0.8, 0.4, 1)"});return{display:"block",position:"relative",overflowX:"hidden","& > *":{position:"absolute",top:0,right:0,left:0},[`& .${Ps["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${Ps["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${Ps.slideEnterActive}`]:{transform:"translate(0%)",transition:t},[`& .${Ps.slideExit}`]:{transform:"translate(0%)"},[`& .${Ps["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:t,zIndex:0},[`& .${Ps["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:t,zIndex:0}}});function KJe(e){const t=Pn({props:e,name:"MuiPickersSlideTransition"}),{children:n,className:r,reduceAnimations:o,slideDirection:i,transKey:a,classes:s}=t,l=$e(t,GJe),{ownerState:c}=Ur(),u=z({},c,{slideDirection:i}),f=qJe(s,u),h=Lr();if(o)return k.jsx("div",{className:fe(f.root,r),children:n});const m={exit:f.exit,enterActive:f.enterActive,enter:f.enter,exitActive:f.exitActive};return k.jsx(WJe,{className:fe(f.root,r),childFactory:g=>x.cloneElement(g,{classNames:m}),role:"presentation",ownerState:u,children:k.jsx(Kj,z({mountOnEnter:!0,unmountOnExit:!0,timeout:h.transitions.duration.complex,classNames:m},l,{children:n}),a)})}const YJe=e=>qe("MuiDayCalendar",e);Ke("MuiDayCalendar",["root","header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer","weekNumberLabel","weekNumber"]);const QJe=["parentProps","day","focusedDay","selectedDays","isDateDisabled","currentMonthNumber","isViewFocused"],XJe=["ownerState"],JJe=e=>Me({root:["root"],header:["header"],weekDayLabel:["weekDayLabel"],loadingContainer:["loadingContainer"],slideTransition:["slideTransition"],monthContainer:["monthContainer"],weekContainer:["weekContainer"],weekNumberLabel:["weekNumberLabel"],weekNumber:["weekNumber"]},YJe,e),Dce=(bS+yP*2)*6,ZJe=ae("div",{name:"MuiDayCalendar",slot:"Root"})({}),eZe=ae("div",{name:"MuiDayCalendar",slot:"Header"})({display:"flex",justifyContent:"center",alignItems:"center"}),tZe=ae(at,{name:"MuiDayCalendar",slot:"WeekDayLabel"})(({theme:e})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:(e.vars||e).palette.text.secondary})),nZe=ae(at,{name:"MuiDayCalendar",slot:"WeekNumberLabel"})(({theme:e})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:(e.vars||e).palette.text.disabled})),rZe=ae(at,{name:"MuiDayCalendar",slot:"WeekNumber"})(({theme:e})=>z({},e.typography.caption,{width:bS,height:bS,padding:0,margin:`0 ${yP}px`,color:(e.vars||e).palette.text.disabled,fontSize:"0.75rem",alignItems:"center",justifyContent:"center",display:"inline-flex"})),oZe=ae("div",{name:"MuiDayCalendar",slot:"LoadingContainer"})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:Dce}),iZe=ae(KJe,{name:"MuiDayCalendar",slot:"SlideTransition"})({minHeight:Dce}),aZe=ae("div",{name:"MuiDayCalendar",slot:"MonthContainer"})({overflow:"hidden"}),sZe=ae("div",{name:"MuiDayCalendar",slot:"WeekContainer"})({margin:`${yP}px 0`,display:"flex",justifyContent:"center"});function lZe(e){let{parentProps:t,day:n,focusedDay:r,selectedDays:o,isDateDisabled:i,currentMonthNumber:a,isViewFocused:s}=e,l=$e(e,QJe);const{disabled:c,disableHighlightToday:u,isMonthSwitchingAnimating:f,showDaysOutsideCurrentMonth:h,slots:m,slotProps:g,timezone:y}=t,v=xn(),w=Kh(y),C=r!=null&&v.isSameDay(n,r),E=s&&C,I=o.some(H=>v.isSameDay(H,n)),O=v.isSameDay(n,w),P=x.useMemo(()=>c||i(n),[c,i,n]),R=x.useMemo(()=>v.getMonth(n)!==a,[v,n,a]),D=ice({day:n,selected:I,disabled:P,today:O,outsideCurrentMonth:R,disableMargin:void 0,disableHighlightToday:u,showDaysOutsideCurrentMonth:h}),M=(m==null?void 0:m.day)??lXe,A=Dn({elementType:M,externalSlotProps:g==null?void 0:g.day,additionalProps:z({disableHighlightToday:u,showDaysOutsideCurrentMonth:h,role:"gridcell",isAnimating:f,"data-timestamp":v.toJsDate(n).valueOf()},l),ownerState:z({},D,{day:n,isDayDisabled:P,isDaySelected:I})}),_=$e(A,XJe),N=x.useMemo(()=>{const H=v.startOfMonth(v.setMonth(n,a));return h?v.isSameDay(n,v.startOfWeek(H)):v.isSameDay(n,H)},[a,n,h,v]),B=x.useMemo(()=>{const H=v.endOfMonth(v.setMonth(n,a));return h?v.isSameDay(n,v.endOfWeek(H)):v.isSameDay(n,H)},[a,n,h,v]);return k.jsx(M,z({},_,{day:n,disabled:P,autoFocus:!R&&E,today:O,outsideCurrentMonth:R,isFirstVisibleCell:N,isLastVisibleCell:B,selected:I,tabIndex:C?0:-1,"aria-selected":I,"aria-current":O?"date":void 0}))}function cZe(e){const t=Pn({props:e,name:"MuiDayCalendar"}),n=xn(),{onFocusedDayChange:r,className:o,classes:i,currentMonth:a,selectedDays:s,focusedDay:l,loading:c,onSelectedDaysChange:u,onMonthSwitchingAnimationEnd:f,readOnly:h,reduceAnimations:m,renderLoading:g=()=>k.jsx("span",{children:"..."}),slideDirection:y,TransitionProps:v,disablePast:w,disableFuture:C,minDate:E,maxDate:I,shouldDisableDate:O,shouldDisableMonth:P,shouldDisableYear:R,dayOfWeekFormatter:D=de=>n.format(de,"weekdayShort").charAt(0).toUpperCase(),hasFocus:M,onFocusedViewChange:A,gridLabelId:_,displayWeekNumber:N,fixedWeekNumber:B,timezone:H}=t,j=Kh(H),L=JJe(i),V=vr(),W=Mce({shouldDisableDate:O,shouldDisableMonth:P,shouldDisableYear:R,minDate:E,maxDate:I,disablePast:w,disableFuture:C,timezone:H}),K=Ei(),G=Je(de=>{h||u(de)}),q=de=>{W(de)||(r(de),A==null||A(!0))},Y=Je((de,oe)=>{switch(de.key){case"ArrowUp":q(n.addDays(oe,-7)),de.preventDefault();break;case"ArrowDown":q(n.addDays(oe,7)),de.preventDefault();break;case"ArrowLeft":{const ue=n.addDays(oe,V?1:-1),pe=n.addMonths(oe,V?1:-1),Ee=SS({utils:n,date:ue,minDate:V?ue:n.startOfMonth(pe),maxDate:V?n.endOfMonth(pe):ue,isDateDisabled:W,timezone:H});q(Ee||ue),de.preventDefault();break}case"ArrowRight":{const ue=n.addDays(oe,V?-1:1),pe=n.addMonths(oe,V?-1:1),Ee=SS({utils:n,date:ue,minDate:V?n.startOfMonth(pe):ue,maxDate:V?ue:n.endOfMonth(pe),isDateDisabled:W,timezone:H});q(Ee||ue),de.preventDefault();break}case"Home":q(n.startOfWeek(oe)),de.preventDefault();break;case"End":q(n.endOfWeek(oe)),de.preventDefault();break;case"PageUp":q(n.addMonths(oe,1)),de.preventDefault();break;case"PageDown":q(n.addMonths(oe,-1)),de.preventDefault();break}}),Z=Je((de,oe)=>q(oe)),ie=Je((de,oe)=>{l!=null&&n.isSameDay(l,oe)&&(A==null||A(!1))}),se=n.getMonth(a),ce=n.getYear(a),ye=x.useMemo(()=>s.filter(de=>!!de).map(de=>n.startOfDay(de)),[n,s]),Se=`${ce}-${se}`,ne=x.useMemo(()=>x.createRef(),[Se]),le=x.useMemo(()=>{const de=n.getWeekArray(a);let oe=n.addMonths(a,1);for(;B&&de.length<B;){const ue=n.getWeekArray(oe),pe=n.isSameDay(de[de.length-1][0],ue[0][0]);ue.slice(pe?1:0).forEach(Ee=>{de.length<B&&de.push(Ee)}),oe=n.addMonths(oe,1)}return de},[a,B,n]);return k.jsxs(ZJe,{role:"grid","aria-labelledby":_,className:L.root,children:[k.jsxs(eZe,{role:"row",className:L.header,children:[N&&k.jsx(nZe,{variant:"caption",role:"columnheader","aria-label":K.calendarWeekNumberHeaderLabel,className:L.weekNumberLabel,children:K.calendarWeekNumberHeaderText}),tQe(n,j).map((de,oe)=>k.jsx(tZe,{variant:"caption",role:"columnheader","aria-label":n.format(de,"weekday"),className:L.weekDayLabel,children:D(de)},oe.toString()))]}),c?k.jsx(oZe,{className:L.loadingContainer,children:g()}):k.jsx(iZe,z({transKey:Se,onExited:f,reduceAnimations:m,slideDirection:y,className:fe(o,L.slideTransition)},v,{nodeRef:ne,children:k.jsx(aZe,{ref:ne,role:"rowgroup",className:L.monthContainer,children:le.map((de,oe)=>k.jsxs(sZe,{role:"row",className:L.weekContainer,"aria-rowindex":oe+1,children:[N&&k.jsx(rZe,{className:L.weekNumber,role:"rowheader","aria-label":K.calendarWeekNumberAriaLabelText(n.getWeekNumber(de[0])),children:K.calendarWeekNumberText(n.getWeekNumber(de[0]))}),de.map((ue,pe)=>k.jsx(lZe,{parentProps:t,day:ue,selectedDays:ye,isViewFocused:M,focusedDay:l,onKeyDown:Y,onFocus:Z,onBlur:ie,onDaySelect:G,isDateDisabled:W,currentMonthNumber:se,"aria-colindex":pe+1},ue.toString()))]},`week-${de[0]}`))})}))]})}function kce(e){return qe("MuiMonthCalendar",e)}const W1=Ke("MuiMonthCalendar",["root","button","disabled","selected"]),uZe=["autoFocus","classes","disabled","selected","value","onClick","onKeyDown","onFocus","onBlur","slots","slotProps"],dZe=(e,t)=>{const n={button:["button",t.isMonthDisabled&&"disabled",t.isMonthSelected&&"selected"]};return Me(n,kce,e)},fZe=ae("button",{name:"MuiMonthCalendar",slot:"Button",overridesResolver:(e,t)=>[t.button,{[`&.${W1.disabled}`]:t.disabled},{[`&.${W1.selected}`]:t.selected}]})(({theme:e})=>z({color:"unset",backgroundColor:"transparent",border:0,outline:0},e.typography.subtitle1,{height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Nt(e.palette.action.active,e.palette.action.hoverOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Nt(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${W1.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${W1.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),pZe=x.memo(function(t){const{autoFocus:n,classes:r,disabled:o,selected:i,value:a,onClick:s,onKeyDown:l,onFocus:c,onBlur:u,slots:f,slotProps:h}=t,m=$e(t,uZe),g=x.useRef(null),{ownerState:y}=Ur(),v=z({},y,{isMonthDisabled:o,isMonthSelected:i}),w=dZe(r,v);In(()=>{var I;n&&((I=g.current)==null||I.focus())},[n]);const C=(f==null?void 0:f.monthButton)??fZe,E=Dn({elementType:C,externalSlotProps:h==null?void 0:h.monthButton,externalForwardedProps:m,additionalProps:{disabled:o,ref:g,type:"button",role:"radio","aria-checked":i,onClick:I=>s(I,a),onKeyDown:I=>l(I,a),onFocus:I=>c(I,a),onBlur:I=>u(I,a)},ownerState:v,className:w.button});return k.jsx(C,z({},E))}),hZe=["autoFocus","className","classes","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","onMonthFocus","hasFocus","onFocusedViewChange","monthsPerRow","timezone","gridLabelId","slots","slotProps"],mZe=e=>Me({root:["root"]},kce,e);function gZe(e,t){const n=Pn({props:e,name:t}),r=Dw(n);return z({},n,r,{monthsPerRow:n.monthsPerRow??3})}const yZe=ae("div",{name:"MuiMonthCalendar",slot:"Root",shouldForwardProp:e=>Ca(e)&&e!=="monthsPerRow"})({display:"flex",flexWrap:"wrap",justifyContent:"space-evenly",rowGap:16,padding:"8px 0",width:zy,boxSizing:"border-box",variants:[{props:{monthsPerRow:3},style:{columnGap:24}},{props:{monthsPerRow:4},style:{columnGap:0}}]}),vZe=x.forwardRef(function(t,n){const r=gZe(t,"MuiMonthCalendar"),{autoFocus:o,className:i,classes:a,value:s,defaultValue:l,referenceDate:c,disabled:u,disableFuture:f,disablePast:h,maxDate:m,minDate:g,onChange:y,shouldDisableMonth:v,readOnly:w,onMonthFocus:C,hasFocus:E,onFocusedViewChange:I,monthsPerRow:O,timezone:P,gridLabelId:R,slots:D,slotProps:M}=r,A=$e(r,hZe),{value:_,handleValueChange:N,timezone:B}=qf({name:"MonthCalendar",timezone:P,value:s,defaultValue:l,referenceDate:c,onChange:y,valueManager:mo}),H=Kh(B),j=vr(),L=xn(),{ownerState:V}=Ur(),W=x.useMemo(()=>mo.getInitialReferenceValue({value:_,utils:L,props:r,timezone:B,referenceDate:c,granularity:Rl.month}),[]),K=mZe(a),G=x.useMemo(()=>L.getMonth(H),[L,H]),q=x.useMemo(()=>_!=null?L.getMonth(_):null,[_,L]),[Y,Z]=x.useState(()=>q||L.getMonth(W)),[ie,se]=ia({name:"MonthCalendar",state:"hasFocus",controlled:E,default:o??!1}),ce=Je(ue=>{se(ue),I&&I(ue)}),ye=x.useCallback(ue=>{const pe=L.startOfMonth(h&&L.isAfter(H,g)?H:g),Ee=L.startOfMonth(f&&L.isBefore(H,m)?H:m),xe=L.startOfMonth(ue);return L.isBefore(xe,pe)||L.isAfter(xe,Ee)?!0:v?v(xe):!1},[f,h,m,g,H,v,L]),Se=Je((ue,pe)=>{if(w)return;const Ee=L.setMonth(_??W,pe);N(Ee)}),ne=Je(ue=>{ye(L.setMonth(_??W,ue))||(Z(ue),ce(!0),C&&C(ue))});x.useEffect(()=>{Z(ue=>q!==null&&ue!==q?q:ue)},[q]);const le=Je((ue,pe)=>{switch(ue.key){case"ArrowUp":ne((12+pe-3)%12),ue.preventDefault();break;case"ArrowDown":ne((12+pe+3)%12),ue.preventDefault();break;case"ArrowLeft":ne((12+pe+(j?1:-1))%12),ue.preventDefault();break;case"ArrowRight":ne((12+pe+(j?-1:1))%12),ue.preventDefault();break}}),de=Je((ue,pe)=>{ne(pe)}),oe=Je((ue,pe)=>{Y===pe&&ce(!1)});return k.jsx(yZe,z({ref:n,className:fe(K.root,i),ownerState:V,role:"radiogroup","aria-labelledby":R,monthsPerRow:O},A,{children:Yz(L,_??W).map(ue=>{const pe=L.getMonth(ue),Ee=L.format(ue,"monthShort"),xe=L.format(ue,"month"),Re=pe===q,he=u||ye(ue);return k.jsx(pZe,{selected:Re,value:pe,onClick:Se,onKeyDown:le,autoFocus:ie&&pe===Y,disabled:he,tabIndex:pe===Y&&!he?0:-1,onFocus:de,onBlur:oe,"aria-current":G===pe?"date":void 0,"aria-label":xe,slots:D,slotProps:M,classes:a,children:Ee},Ee)})}))});function _ce(e){return qe("MuiYearCalendar",e)}const K1=Ke("MuiYearCalendar",["root","button","disabled","selected"]),bZe=["autoFocus","classes","disabled","selected","value","onClick","onKeyDown","onFocus","onBlur","slots","slotProps"],xZe=(e,t)=>{const n={button:["button",t.isYearDisabled&&"disabled",t.isYearSelected&&"selected"]};return Me(n,_ce,e)},SZe=ae("button",{name:"MuiYearCalendar",slot:"Button",overridesResolver:(e,t)=>[t.button,{[`&.${K1.disabled}`]:t.disabled},{[`&.${K1.selected}`]:t.selected}]})(({theme:e})=>z({color:"unset",backgroundColor:"transparent",border:0,outline:0},e.typography.subtitle1,{height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.focusOpacity})`:Nt(e.palette.action.active,e.palette.action.focusOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Nt(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${K1.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${K1.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),wZe=x.memo(function(t){const{autoFocus:n,classes:r,disabled:o,selected:i,value:a,onClick:s,onKeyDown:l,onFocus:c,onBlur:u,slots:f,slotProps:h}=t,m=$e(t,bZe),g=x.useRef(null),{ownerState:y}=Ur(),v=z({},y,{isYearDisabled:o,isYearSelected:i}),w=xZe(r,v);In(()=>{var I;n&&((I=g.current)==null||I.focus())},[n]);const C=(f==null?void 0:f.yearButton)??SZe,E=Dn({elementType:C,externalSlotProps:h==null?void 0:h.yearButton,externalForwardedProps:m,additionalProps:{disabled:o,ref:g,type:"button",role:"radio","aria-checked":i,onClick:I=>s(I,a),onKeyDown:I=>l(I,a),onFocus:I=>c(I,a),onBlur:I=>u(I,a)},ownerState:v,className:w.button});return k.jsx(C,z({},E))}),CZe=["autoFocus","className","classes","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","readOnly","shouldDisableYear","disableHighlightToday","onYearFocus","hasFocus","onFocusedViewChange","yearsOrder","yearsPerRow","timezone","gridLabelId","slots","slotProps"],EZe=e=>Me({root:["root"]},_ce,e);function TZe(e,t){const n=Pn({props:e,name:t}),r=Dw(n);return z({},n,r,{yearsPerRow:n.yearsPerRow??3,yearsOrder:n.yearsOrder??"asc"})}const OZe=ae("div",{name:"MuiYearCalendar",slot:"Root",shouldForwardProp:e=>Ca(e)&&e!=="yearsPerRow"})({display:"flex",flexWrap:"wrap",justifyContent:"space-evenly",rowGap:12,padding:"6px 0",overflowY:"auto",height:"100%",width:zy,maxHeight:jYe,boxSizing:"border-box",position:"relative",variants:[{props:{yearsPerRow:3},style:{columnGap:24}},{props:{yearsPerRow:4},style:{columnGap:0,padding:"0 2px"}}]}),IZe=ae("div",{name:"MuiYearCalendar",slot:"ButtonFiller"})({height:36,width:72}),PZe=x.forwardRef(function(t,n){const r=TZe(t,"MuiYearCalendar"),{autoFocus:o,className:i,classes:a,value:s,defaultValue:l,referenceDate:c,disabled:u,disableFuture:f,disablePast:h,maxDate:m,minDate:g,onChange:y,readOnly:v,shouldDisableYear:w,onYearFocus:C,hasFocus:E,onFocusedViewChange:I,yearsOrder:O,yearsPerRow:P,timezone:R,gridLabelId:D,slots:M,slotProps:A}=r,_=$e(r,CZe),{value:N,handleValueChange:B,timezone:H}=qf({name:"YearCalendar",timezone:R,value:s,defaultValue:l,referenceDate:c,onChange:y,valueManager:mo}),j=Kh(H),L=vr(),V=xn(),{ownerState:W}=Ur(),K=x.useMemo(()=>mo.getInitialReferenceValue({value:N,utils:V,props:r,timezone:H,referenceDate:c,granularity:Rl.year}),[]),G=EZe(a),q=x.useMemo(()=>V.getYear(j),[V,j]),Y=x.useMemo(()=>N!=null?V.getYear(N):null,[N,V]),[Z,ie]=x.useState(()=>Y||V.getYear(K)),[se,ce]=ia({name:"YearCalendar",state:"hasFocus",controlled:E,default:o??!1}),ye=Je(ve=>{ce(ve),I&&I(ve)}),Se=x.useCallback(ve=>{if(h&&V.isBeforeYear(ve,j)||f&&V.isAfterYear(ve,j)||g&&V.isBeforeYear(ve,g)||m&&V.isAfterYear(ve,m))return!0;if(!w)return!1;const Ie=V.startOfYear(ve);return w(Ie)},[f,h,m,g,j,w,V]),ne=Je((ve,Ie)=>{if(v)return;const te=V.setYear(N??K,Ie);B(te)}),le=Je(ve=>{Se(V.setYear(N??K,ve))||(ie(ve),ye(!0),C==null||C(ve))});x.useEffect(()=>{ie(ve=>Y!==null&&ve!==Y?Y:ve)},[Y]);const de=O!=="desc"?P*1:P*-1,oe=L&&O==="asc"||!L&&O==="desc"?-1:1,ue=Je((ve,Ie)=>{switch(ve.key){case"ArrowUp":le(Ie-de),ve.preventDefault();break;case"ArrowDown":le(Ie+de),ve.preventDefault();break;case"ArrowLeft":le(Ie-oe),ve.preventDefault();break;case"ArrowRight":le(Ie+oe),ve.preventDefault();break}}),pe=Je((ve,Ie)=>{le(Ie)}),Ee=Je((ve,Ie)=>{Z===Ie&&ye(!1)}),xe=x.useRef(null),Re=en(n,xe);x.useEffect(()=>{if(o||xe.current===null)return;const ve=xe.current.querySelector('[tabindex="0"]');if(!ve)return;const Ie=ve.offsetHeight,te=ve.offsetTop,Te=xe.current.clientHeight,De=xe.current.scrollTop,Ve=te+Ie;Ie>Te||te<De||(xe.current.scrollTop=Ve-Te/2-Ie/2)},[o]);const he=V.getYearRange([g,m]);O==="desc"&&he.reverse();let Pe=P-he.length%P;return Pe===P&&(Pe=0),k.jsxs(OZe,z({ref:Re,className:fe(G.root,i),ownerState:W,role:"radiogroup","aria-labelledby":D,yearsPerRow:P},_,{children:[he.map(ve=>{const Ie=V.getYear(ve),te=Ie===Y,Te=u||Se(ve);return k.jsx(wZe,{selected:te,value:Ie,onClick:ne,onKeyDown:ue,autoFocus:se&&Ie===Z,disabled:Te,tabIndex:Ie===Z&&!Te?0:-1,onFocus:pe,onBlur:Ee,"aria-current":q===Ie?"date":void 0,slots:M,slotProps:A,classes:a,children:V.format(ve,"year")},V.format(ve,"year"))}),Array.from({length:Pe},(ve,Ie)=>k.jsx(IZe,{},Ie))]}))}),AZe=e=>qe("MuiPickersCalendarHeader",e),MZe=Ke("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]),RZe=["slots","slotProps","currentMonth","disabled","disableFuture","disablePast","maxDate","minDate","onMonthChange","onViewChange","view","reduceAnimations","views","labelId","className","classes","timezone","format"],DZe=["ownerState"],kZe=e=>Me({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},AZe,e),_Ze=ae("div",{name:"MuiPickersCalendarHeader",slot:"Root"})({display:"flex",alignItems:"center",marginTop:12,marginBottom:4,paddingLeft:24,paddingRight:12,maxHeight:40,minHeight:40}),$Ze=ae("div",{name:"MuiPickersCalendarHeader",slot:"LabelContainer"})(({theme:e})=>z({display:"flex",overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},e.typography.body1,{fontWeight:e.typography.fontWeightMedium})),NZe=ae("div",{name:"MuiPickersCalendarHeader",slot:"Label"})({marginRight:6}),LZe=ae(pn,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton"})({marginRight:"auto",variants:[{props:{view:"year"},style:{[`.${MZe.switchViewIcon}`]:{transform:"rotate(180deg)"}}}]}),FZe=ae(vYe,{name:"MuiPickersCalendarHeader",slot:"SwitchViewIcon"})(({theme:e})=>({willChange:"transform",transition:e.transitions.create("transform"),transform:"rotate(0deg)"})),jZe=x.forwardRef(function(t,n){const r=Ei(),o=xn(),i=Pn({props:t,name:"MuiPickersCalendarHeader"}),{slots:a,slotProps:s,currentMonth:l,disabled:c,disableFuture:u,disablePast:f,maxDate:h,minDate:m,onMonthChange:g,onViewChange:y,view:v,reduceAnimations:w,views:C,labelId:E,className:I,classes:O,timezone:P,format:R=`${o.formats.month} ${o.formats.year}`}=i,D=$e(i,RZe),{ownerState:M}=Ur(),A=kZe(O),_=(a==null?void 0:a.switchViewButton)??LZe,N=Dn({elementType:_,externalSlotProps:s==null?void 0:s.switchViewButton,additionalProps:{size:"small","aria-label":r.calendarViewSwitchingButtonAriaLabel(v)},ownerState:M,className:A.switchViewButton}),B=(a==null?void 0:a.switchViewIcon)??FZe,H=Dn({elementType:B,externalSlotProps:s==null?void 0:s.switchViewIcon,ownerState:M,className:A.switchViewIcon}),j=$e(H,DZe),L=()=>g(o.addMonths(l,1)),V=()=>g(o.addMonths(l,-1)),W=LYe(l,{disableFuture:u,maxDate:h,timezone:P}),K=FYe(l,{disablePast:f,minDate:m,timezone:P}),G=()=>{if(!(C.length===1||!y||c))if(C.length===2)y(C.find(Y=>Y!==v)||C[0]);else{const Y=C.indexOf(v)!==0?0:1;y(C[Y])}};if(C.length===1&&C[0]==="year")return null;const q=o.formatByString(l,R);return k.jsxs(_Ze,z({},D,{ownerState:M,className:fe(A.root,I),ref:n,children:[k.jsxs($Ze,{role:"presentation",onClick:G,ownerState:M,"aria-live":"polite",className:A.labelContainer,children:[k.jsx(Rce,{reduceAnimations:w,transKey:q,children:k.jsx(NZe,{id:E,ownerState:M,className:A.label,children:q})}),C.length>1&&!c&&k.jsx(_,z({},N,{children:k.jsx(B,z({},j))}))]}),k.jsx(hh,{in:v==="day",appear:!w,enter:!w,children:k.jsx(qle,{slots:a,slotProps:s,onGoToPrevious:V,isPreviousDisabled:K,previousLabel:r.previousMonth,onGoToNext:L,isNextDisabled:W,nextLabel:r.nextMonth})})]}))}),BZe="@media (prefers-reduced-motion: reduce)",Vg=typeof navigator<"u"&&navigator.userAgent.match(/android\s(\d+)|OS\s(\d+)/i),sX=Vg&&Vg[1]?parseInt(Vg[1],10):null,lX=Vg&&Vg[2]?parseInt(Vg[2],10):null,zZe=sX&&sX<10||lX&&lX<13||!1;function $ce(e){const t=Tf(BZe,{defaultMatches:!1});return e??(t||zZe)}const VZe=e=>qe("MuiDateCalendar",e);Ke("MuiDateCalendar",["root","viewTransitionContainer"]);const HZe=["autoFocus","onViewChange","value","defaultValue","referenceDate","disableFuture","disablePast","onChange","onYearChange","onMonthChange","reduceAnimations","shouldDisableDate","shouldDisableMonth","shouldDisableYear","view","views","openTo","className","classes","disabled","readOnly","minDate","maxDate","disableHighlightToday","focusedView","onFocusedViewChange","showDaysOutsideCurrentMonth","fixedWeekNumber","dayOfWeekFormatter","slots","slotProps","loading","renderLoading","displayWeekNumber","yearsOrder","yearsPerRow","monthsPerRow","timezone"],UZe=e=>Me({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},VZe,e);function GZe(e,t){const n=Pn({props:e,name:t}),r=$ce(n.reduceAnimations),o=Dw(n);return z({},n,o,{loading:n.loading??!1,openTo:n.openTo??"day",views:n.views??["year","day"],reduceAnimations:r,renderLoading:n.renderLoading??(()=>k.jsx("span",{children:"..."}))})}const qZe=ae(vP,{name:"MuiDateCalendar",slot:"Root"})({display:"flex",flexDirection:"column",height:Vy}),WZe=ae(Rce,{name:"MuiDateCalendar",slot:"ViewTransitionContainer"})({}),KZe=x.forwardRef(function(t,n){const r=xn(),{ownerState:o}=Ur(),i=bn(),a=GZe(t,"MuiDateCalendar"),{autoFocus:s,onViewChange:l,value:c,defaultValue:u,referenceDate:f,disableFuture:h,disablePast:m,onChange:g,onMonthChange:y,reduceAnimations:v,shouldDisableDate:w,shouldDisableMonth:C,shouldDisableYear:E,view:I,views:O,openTo:P,className:R,classes:D,disabled:M,readOnly:A,minDate:_,maxDate:N,disableHighlightToday:B,focusedView:H,onFocusedViewChange:j,showDaysOutsideCurrentMonth:L,fixedWeekNumber:V,dayOfWeekFormatter:W,slots:K,slotProps:G,loading:q,renderLoading:Y,displayWeekNumber:Z,yearsOrder:ie,yearsPerRow:se,monthsPerRow:ce,timezone:ye}=a,Se=$e(a,HZe),{value:ne,handleValueChange:le,timezone:de}=qf({name:"DateCalendar",timezone:ye,value:c,defaultValue:u,referenceDate:f,onChange:g,valueManager:mo}),{view:oe,setView:ue,focusedView:pe,setFocusedView:Ee,goToNextView:xe,setValueAndGoToNextView:Re}=Mw({view:I,views:O,openTo:P,onChange:le,onViewChange:l,autoFocus:s,focusedView:H,onFocusedViewChange:j}),{referenceDate:he,calendarState:Pe,setVisibleDate:ve,isDateDisabled:Ie,onMonthSwitchingAnimationEnd:te}=jJe({value:ne,referenceDate:f,reduceAnimations:v,onMonthChange:y,minDate:_,maxDate:N,shouldDisableDate:w,disablePast:m,disableFuture:h,timezone:de,getCurrentMonthFromVisibleDate:(bt,vn)=>r.isSameMonth(bt,vn)?vn:r.startOfMonth(bt)}),Te=M&&ne||_,De=M&&ne||N,Ve=`${i}-grid-label`,We=pe!==null,rt=(K==null?void 0:K.calendarHeader)??jZe,ut=Dn({elementType:rt,externalSlotProps:G==null?void 0:G.calendarHeader,additionalProps:{views:O,view:oe,currentMonth:Pe.currentMonth,onViewChange:ue,onMonthChange:bt=>ve({target:bt,reason:"header-navigation"}),minDate:Te,maxDate:De,disabled:M,disablePast:m,disableFuture:h,reduceAnimations:v,timezone:de,labelId:Ve},ownerState:o}),Be=Je(bt=>{const vn=r.startOfMonth(bt),kn=r.endOfMonth(bt),Rr=Ie(bt)?SS({utils:r,date:bt,minDate:r.isBefore(_,vn)?vn:_,maxDate:r.isAfter(N,kn)?kn:N,disablePast:m,disableFuture:h,isDateDisabled:Ie,timezone:de}):bt;Rr?(Re(Rr,"finish"),ve({target:Rr,reason:"cell-interaction"})):(xe(),ve({target:vn,reason:"cell-interaction"}))}),et=Je(bt=>{const vn=r.startOfYear(bt),kn=r.endOfYear(bt),Rr=Ie(bt)?SS({utils:r,date:bt,minDate:r.isBefore(_,vn)?vn:_,maxDate:r.isAfter(N,kn)?kn:N,disablePast:m,disableFuture:h,isDateDisabled:Ie,timezone:de}):bt;Rr?(Re(Rr,"finish"),ve({target:Rr,reason:"cell-interaction"})):(xe(),ve({target:vn,reason:"cell-interaction"}))}),Le=Je(bt=>le(bt&&pO(r,bt,ne??he),"finish",oe));x.useEffect(()=>{r.isValid(ne)&&ve({target:ne,reason:"controlled-value-change"})},[ne]);const It=UZe(D),Lt={disablePast:m,disableFuture:h,maxDate:N,minDate:_},nt={disableHighlightToday:B,readOnly:A,disabled:M,timezone:de,gridLabelId:Ve,slots:K,slotProps:G},lt=x.useRef(oe);x.useEffect(()=>{lt.current!==oe&&(pe===lt.current&&Ee(oe,!0),lt.current=oe)},[pe,Ee,oe]);const vt=x.useMemo(()=>[ne],[ne]);return k.jsxs(qZe,z({ref:n,className:fe(It.root,R),ownerState:o},Se,{children:[k.jsx(rt,z({},ut,{slots:K,slotProps:G})),k.jsx(WZe,{reduceAnimations:v,className:It.viewTransitionContainer,transKey:oe,ownerState:o,children:k.jsxs("div",{children:[oe==="year"&&k.jsx(PZe,z({},Lt,nt,{value:ne,onChange:et,shouldDisableYear:E,hasFocus:We,onFocusedViewChange:bt=>Ee("year",bt),yearsOrder:ie,yearsPerRow:se,referenceDate:he})),oe==="month"&&k.jsx(vZe,z({},Lt,nt,{hasFocus:We,className:R,value:ne,onChange:Be,shouldDisableMonth:C,onFocusedViewChange:bt=>Ee("month",bt),monthsPerRow:ce,referenceDate:he})),oe==="day"&&k.jsx(cZe,z({},Pe,Lt,nt,{onMonthSwitchingAnimationEnd:te,hasFocus:We,onFocusedDayChange:bt=>ve({target:bt,reason:"cell-interaction"}),reduceAnimations:v,selectedDays:vt,onSelectedDaysChange:Le,shouldDisableDate:w,shouldDisableMonth:C,shouldDisableYear:E,onFocusedViewChange:bt=>Ee("day",bt),showDaysOutsideCurrentMonth:L,fixedWeekNumber:V,dayOfWeekFormatter:W,displayWeekNumber:Z,loading:q,renderLoading:Y}))]})})]}))});function Nce(e){return qe("MuiPickersToolbar",e)}const YZe=Ke("MuiPickersToolbar",["root","title","content"]);function CP(){const{ownerState:e}=Ur(),t=vr();return x.useMemo(()=>z({},e,{toolbarDirection:t?"rtl":"ltr"}),[e,t])}const QZe=["children","className","classes","toolbarTitle","hidden","titleId","classes","landscapeDirection"],XZe=e=>Me({root:["root"],title:["title"],content:["content"]},Nce,e),JZe=ae("div",{name:"MuiPickersToolbar",slot:"Root"})(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"space-between",padding:e.spacing(2,3),variants:[{props:{pickerOrientation:"landscape"},style:{height:"auto",maxWidth:160,padding:16,justifyContent:"flex-start",flexWrap:"wrap"}}]})),ZZe=ae("div",{name:"MuiPickersToolbar",slot:"Content",shouldForwardProp:e=>Ca(e)&&e!=="landscapeDirection"})({display:"flex",flexWrap:"wrap",width:"100%",flex:1,justifyContent:"space-between",alignItems:"center",flexDirection:"row",variants:[{props:{pickerOrientation:"landscape"},style:{justifyContent:"flex-start",alignItems:"flex-start",flexDirection:"column"}},{props:{pickerOrientation:"landscape",landscapeDirection:"row"},style:{flexDirection:"row"}}]}),fV=x.forwardRef(function(t,n){const r=Pn({props:t,name:"MuiPickersToolbar"}),{children:o,className:i,classes:a,toolbarTitle:s,hidden:l,titleId:c,landscapeDirection:u}=r,f=$e(r,QZe),h=CP(),m=XZe(a);return l?null:k.jsxs(JZe,z({ref:n,className:fe(m.root,i),ownerState:h},f,{children:[k.jsx(at,{color:"text.secondary",variant:"overline",id:c,className:m.title,children:s}),k.jsx(ZZe,{className:m.content,ownerState:h,landscapeDirection:u,children:o})]}))});function eet(e){return qe("MuiDatePickerToolbar",e)}Ke("MuiDatePickerToolbar",["root","title"]);const tet=["toolbarFormat","toolbarPlaceholder","className","classes"],net=e=>Me({root:["root"],title:["title"]},eet,e),ret=ae(fV,{name:"MuiDatePickerToolbar",slot:"Root"})({}),oet=ae(at,{name:"MuiDatePickerToolbar",slot:"Title"})({variants:[{props:{pickerOrientation:"landscape"},style:{margin:"auto 16px auto auto"}}]}),iet=x.forwardRef(function(t,n){const r=Pn({props:t,name:"MuiDatePickerToolbar"}),{toolbarFormat:o,toolbarPlaceholder:i="––",className:a,classes:s}=r,l=$e(r,tet),c=xn(),{value:u,views:f,orientation:h}=qc(),m=Ei(),g=CP(),y=net(s),v=x.useMemo(()=>{if(!c.isValid(u))return i;const w=wS(c,{format:o,views:f},!0);return c.formatByString(u,w)},[u,o,i,c,f]);return k.jsx(ret,z({ref:n,toolbarTitle:m.datePickerToolbarTitle,className:fe(y.root,a)},l,{children:k.jsx(oet,{variant:"h4",align:h==="landscape"?"left":"center",ownerState:g,className:y.title,children:v})}))});function Lce(e,t){const n=Pn({props:e,name:t}),r=Dw(n),o=x.useMemo(()=>{var i;return((i=n.localeText)==null?void 0:i.toolbarTitle)==null?n.localeText:z({},n.localeText,{datePickerToolbarTitle:n.localeText.toolbarTitle})},[n.localeText]);return z({},n,r,{localeText:o},Kz({views:n.views,openTo:n.openTo,defaultViews:["year","day"],defaultOpenTo:"day"}),{slots:z({toolbar:iet},n.slots)})}function aet(e){return qe("MuiPickerPopper",e)}Ke("MuiPickerPopper",["root","paper"]);const set=["PaperComponent","ownerState","children","paperSlotProps","paperClasses","onPaperClick","onPaperTouchStart"],cet=e=>Me({root:["root"],paper:["paper"]},aet,e),uet=ae(sv,{name:"MuiPickerPopper",slot:"Root"})(({theme:e})=>({zIndex:e.zIndex.modal})),det=ae(go,{name:"MuiPickerPopper",slot:"Paper"})({outline:0,transformOrigin:"top center",variants:[{props:({popperPlacement:e})=>["top","top-start","top-end"].includes(e),style:{transformOrigin:"bottom center"}}]});function fet(e,t){return t.documentElement.clientWidth<e.clientX||t.documentElement.clientHeight<e.clientY}function pet(e,t){const n=x.useRef(!1),r=x.useRef(!1),o=x.useRef(null),i=x.useRef(!1);x.useEffect(()=>{if(!e)return;function l(){i.current=!0}return document.addEventListener("mousedown",l,!0),document.addEventListener("touchstart",l,!0),()=>{document.removeEventListener("mousedown",l,!0),document.removeEventListener("touchstart",l,!0),i.current=!1}},[e]);const a=Je(l=>{if(!i.current)return;const c=r.current;r.current=!1;const u=Mr(o.current);if(!o.current||"clientX"in l&&fet(l,u))return;if(n.current){n.current=!1;return}let f;l.composedPath?f=l.composedPath().indexOf(o.current)>-1:f=!u.documentElement.contains(l.target)||o.current.contains(l.target),!f&&!c&&t(l)}),s=()=>{r.current=!0};return x.useEffect(()=>{if(e){const l=Mr(o.current),c=()=>{n.current=!0};return l.addEventListener("touchstart",a),l.addEventListener("touchmove",c),()=>{l.removeEventListener("touchstart",a),l.removeEventListener("touchmove",c)}}},[e,a]),x.useEffect(()=>{if(e){const l=Mr(o.current);return l.addEventListener("click",a),()=>{l.removeEventListener("click",a),r.current=!1}}},[e,a]),[o,s,s]}const het=x.forwardRef((e,t)=>{const{PaperComponent:n,ownerState:r,children:o,paperSlotProps:i,paperClasses:a,onPaperClick:s,onPaperTouchStart:l}=e,c=$e(e,set),u=Dn({elementType:n,externalSlotProps:i,additionalProps:{tabIndex:-1,elevation:8,ref:t},className:a,ownerState:r});return k.jsx(n,z({},c,u,{onClick:f=>{var h;s(f),(h=u.onClick)==null||h.call(u,f)},onTouchStart:f=>{var h;l(f),(h=u.onTouchStart)==null||h.call(u,f)},ownerState:r,children:o}))});function met(e){const t=Pn({props:e,name:"MuiPickerPopper"}),{children:n,placement:r="bottom-start",slots:o,slotProps:i,classes:a}=t,{open:s,popupRef:l,reduceAnimations:c}=qc(),{dismissViews:u,getCurrentViewMode:f,onPopperExited:h,triggerElement:m,viewContainerRole:g}=Ur();x.useEffect(()=>{function V(W){s&&W.key==="Escape"&&u()}return document.addEventListener("keydown",V),()=>{document.removeEventListener("keydown",V)}},[u,s]);const y=x.useRef(null);x.useEffect(()=>{g==="tooltip"||f()==="field"||(s?y.current=xi(document):y.current&&y.current instanceof HTMLElement&&setTimeout(()=>{y.current instanceof HTMLElement&&y.current.focus()}))},[s,g,f]);const v=cet(a),{ownerState:w,rootRefObject:C}=Ur(),E=z({},w,{popperPlacement:r}),I=Je(()=>{g==="tooltip"?NQe(()=>{var V,W;(V=C.current)!=null&&V.contains(xi(document))||(W=l.current)!=null&&W.contains(xi(document))||u()}):u()}),[O,P,R]=pet(s,I),D=x.useRef(null),M=en(D,l),A=en(M,O),_=V=>{V.key==="Escape"&&(V.stopPropagation(),u())},N=(o==null?void 0:o.desktopTransition)??c?hh:mh,B=(o==null?void 0:o.desktopTrapFocus)??lB,H=(o==null?void 0:o.desktopPaper)??det,j=(o==null?void 0:o.popper)??uet,L=Dn({elementType:j,externalSlotProps:i==null?void 0:i.popper,additionalProps:{transition:!0,role:g??void 0,open:s,placement:r,anchorEl:m,onKeyDown:_},className:v.root,ownerState:E});return k.jsx(j,z({},L,{children:({TransitionProps:V})=>k.jsx(B,z({open:s,disableAutoFocus:!0,disableRestoreFocus:!0,disableEnforceFocus:g==="tooltip",isEnabled:()=>!0},i==null?void 0:i.desktopTrapFocus,{children:k.jsx(N,z({},V,i==null?void 0:i.desktopTransition,{onExited:W=>{var K,G,q;h==null||h(),(G=(K=i==null?void 0:i.desktopTransition)==null?void 0:K.onExited)==null||G.call(K,W),(q=V==null?void 0:V.onExited)==null||q.call(V)},children:k.jsx(het,{PaperComponent:H,ownerState:E,ref:A,onPaperClick:P,onPaperTouchStart:R,paperClasses:v.paper,paperSlotProps:i==null?void 0:i.desktopPaper,children:n})}))}))}))}function cX(){return typeof window>"u"?"portrait":window.screen&&window.screen.orientation&&window.screen.orientation.angle?Math.abs(window.screen.orientation.angle)===90?"landscape":"portrait":window.orientation&&Math.abs(Number(window.orientation))===90?"landscape":"portrait"}function get(e,t){const[n,r]=x.useState(cX);return In(()=>{const o=()=>{r(cX())};return window.addEventListener("orientationchange",o),()=>{window.removeEventListener("orientationchange",o)}},[]),ug(e,["hours","minutes","seconds"])?"portrait":t??n}function yet(e){const{props:t,valueManager:n,validator:r}=e,{value:o,defaultValue:i,onChange:a,referenceDate:s,timezone:l,onAccept:c,closeOnSelect:u,open:f,onOpen:h,onClose:m}=t,{current:g}=x.useRef(i),{current:y}=x.useRef(o!==void 0),{current:v}=x.useRef(f!==void 0),w=xn(),{timezone:C,value:E,handleValueChange:I}=qf({name:"a picker component",timezone:l,value:o,defaultValue:g,referenceDate:s,onChange:a,valueManager:n}),[O,P]=x.useState(()=>({open:!1,lastExternalValue:E,clockShallowValue:void 0,lastCommittedValue:E,hasBeenModifiedSinceMount:!1})),{getValidationErrorForNewValue:R}=dce({props:t,validator:r,timezone:C,value:E,onError:t.onError}),D=Je(N=>{const B=typeof N=="function"?N(O.open):N;v||P(H=>z({},H,{open:B})),B&&h&&h(),B||m==null||m()}),M=Je((N,B)=>{const{changeImportance:H="accept",skipPublicationIfPristine:j=!1,validationError:L,shortcut:V,shouldClose:W=H==="accept"}=B??{};let K,G;!j&&!y&&!O.hasBeenModifiedSinceMount?(K=!0,G=H==="accept"):(K=!n.areValuesEqual(w,N,E),G=H==="accept"&&!n.areValuesEqual(w,N,O.lastCommittedValue)),P(Z=>z({},Z,{clockShallowValue:K?void 0:Z.clockShallowValue,lastCommittedValue:G?E:Z.lastCommittedValue,hasBeenModifiedSinceMount:!0}));let q=null;const Y=()=>(q||(q={validationError:L??R(N)},V&&(q.shortcut=V)),q);K&&I(N,Y()),G&&c&&c(N,Y()),W&&D(!1)});E!==O.lastExternalValue&&P(N=>z({},N,{lastExternalValue:E,clockShallowValue:void 0,hasBeenModifiedSinceMount:!0}));const A=Je((N,B="partial")=>{if(B==="shallow"){P(H=>z({},H,{clockShallowValue:N,hasBeenModifiedSinceMount:!0}));return}M(N,{changeImportance:B==="finish"&&u?"accept":"set"})});x.useEffect(()=>{if(v){if(f===void 0)throw new Error("You must not mix controlling and uncontrolled mode for `open` prop");P(N=>z({},N,{open:f}))}},[v,f]);const _=x.useMemo(()=>n.cleanValue(w,O.clockShallowValue===void 0?E:O.clockShallowValue),[w,n,O.clockShallowValue,E]);return{timezone:C,state:O,setValue:M,setValueFromView:A,setOpen:D,value:E,viewValue:_}}const vet=["className","sx"],Fce=({ref:e,props:t,valueManager:n,valueType:r,variant:o,validator:i,onPopperExited:a,autoFocusView:s,rendererInterceptor:l,localeText:c,viewContainerRole:u,getStepNavigation:f})=>{const{views:h,view:m,openTo:g,onViewChange:y,viewRenderers:v,reduceAnimations:w,orientation:C,disableOpenPicker:E,closeOnSelect:I,disabled:O,readOnly:P,formatDensity:R,enableAccessibleFieldDOMStructure:D,selectedSections:M,onSelectedSectionsChange:A,format:_,label:N,autoFocus:B,name:H}=t,{className:j,sx:L}=t,V=$e(t,vet),W=bn(),K=xn(),G=Wh(),q=$ce(w),Y=get(h,C),{current:Z}=x.useRef(g??null),[ie,se]=x.useState(null),ce=x.useRef(null),ye=x.useRef(null),Se=x.useRef(null),ne=en(e,Se),{timezone:le,state:de,setOpen:oe,setValue:ue,setValueFromView:pe,value:Ee,viewValue:xe}=yet({props:t,valueManager:n,validator:i}),{view:Re,setView:he,defaultView:Pe,focusedView:ve,setFocusedView:Ie,setValueAndGoToNextView:te,goToNextStep:Te,hasNextStep:De,hasSeveralSteps:Ve}=Mw({view:m,views:h,openTo:g,onChange:pe,onViewChange:y,autoFocus:s,getStepNavigation:f}),We=Je(()=>ue(n.emptyValue)),rt=Je(()=>ue(n.getTodayValue(K,le,r))),ut=Je(()=>ue(Ee)),Be=Je(()=>ue(de.lastCommittedValue,{skipPublicationIfPristine:!0})),et=Je(()=>{ue(Ee,{skipPublicationIfPristine:!0})}),{hasUIView:Le,viewModeLookup:It,timeViewsCount:Lt}=x.useMemo(()=>h.reduce((un,gt)=>{const kt=v[gt]==null?"field":"UI";return un.viewModeLookup[gt]=kt,kt==="UI"&&(un.hasUIView=!0,Th(gt)&&(un.timeViewsCount+=1)),un},{hasUIView:!1,viewModeLookup:{},timeViewsCount:0}),[v,h]),nt=It[Re],lt=Je(()=>nt),[vt,bt]=x.useState(nt==="UI"?Re:null);vt!==Re&&It[Re]==="UI"&&bt(Re),In(()=>{nt==="field"&&de.open&&(oe(!1),setTimeout(()=>{var un,gt;(un=ye==null?void 0:ye.current)==null||un.setSelectedSections(Re),(gt=ye==null?void 0:ye.current)==null||gt.focusField(Re)}))},[Re]),In(()=>{if(!de.open)return;let un=Re;nt==="field"&&vt!=null&&(un=vt),un!==Pe&&It[un]==="UI"&&It[Pe]==="UI"&&(un=Pe),un!==Re&&he(un),Ie(un,!0)},[de.open]);const vn=x.useMemo(()=>({isPickerValueEmpty:n.areValuesEqual(K,Ee,n.emptyValue),isPickerOpen:de.open,isPickerDisabled:t.disabled??!1,isPickerReadOnly:t.readOnly??!1,pickerOrientation:Y,pickerVariant:o}),[K,n,Ee,de.open,Y,o,t.disabled,t.readOnly]),kn=x.useMemo(()=>E||!Le?"hidden":O||P?"disabled":"enabled",[E,Le,O,P]),Rr=Je(Te),nr=x.useMemo(()=>I&&!Ve?[]:["cancel","nextOrAccept"],[I,Ve]),Bn=x.useMemo(()=>({setValue:ue,setOpen:oe,clearValue:We,setValueToToday:rt,acceptValueChanges:ut,cancelValueChanges:Be,setView:he,goToNextStep:Rr}),[ue,oe,We,rt,ut,Be,he,Rr]),yo=x.useMemo(()=>z({},Bn,{value:Ee,timezone:le,open:de.open,views:h,view:vt,initialView:Z,disabled:O??!1,readOnly:P??!1,autoFocus:B??!1,variant:o,orientation:Y,popupRef:ce,reduceAnimations:q,triggerRef:se,triggerStatus:kn,hasNextStep:De,fieldFormat:_??"",name:H,label:N,rootSx:L,rootRef:ne,rootClassName:j}),[Bn,Ee,ne,o,Y,q,O,P,_,j,H,N,L,kn,De,le,de.open,vt,h,Z,B]),To=x.useMemo(()=>({dismissViews:et,ownerState:vn,hasUIView:Le,getCurrentViewMode:lt,rootRefObject:Se,labelId:W,triggerElement:ie,viewContainerRole:u,defaultActionBarActions:nr,onPopperExited:a}),[et,vn,Le,lt,W,ie,u,nr,a]),oo=x.useMemo(()=>({formatDensity:R,enableAccessibleFieldDOMStructure:D,selectedSections:M,onSelectedSectionsChange:A,fieldRef:ye}),[R,D,M,A,ye]);return{providerProps:{localeText:c,contextValue:yo,privateContextValue:To,actionsContextValue:Bn,fieldPrivateContextValue:oo,isValidContextValue:un=>{const gt=i({adapter:G,value:un,timezone:le,props:t});return!n.hasError(gt)}},renderCurrentView:()=>{if(vt==null)return null;const un=v[vt];if(un==null)return null;const gt=z({},V,{views:h,timezone:le,value:xe,onChange:te,view:vt,onViewChange:he,showViewSwitcher:Lt>1,timeViewsCount:Lt},u==="tooltip"?{focusedView:null,onFocusedViewChange:()=>{}}:{focusedView:ve,onFocusedViewChange:Ie});return l?k.jsx(l,{viewRenderers:v,popperView:vt,rendererProps:gt}):un(gt)},ownerState:vn}};function jce(e){return qe("MuiPickersLayout",e)}const Pl=Ke("MuiPickersLayout",["root","landscape","contentWrapper","toolbar","actionBar","tabs","shortcuts"]),bet=["actions"],xet=ae(Px,{name:"MuiPickersLayout",slot:"ActionBar"})({});function wet(e){const{actions:t}=e,n=$e(e,bet),r=Ei(),{clearValue:o,setValueToToday:i,acceptValueChanges:a,cancelValueChanges:s,goToNextStep:l,hasNextStep:c}=qc();if(t==null||t.length===0)return null;const u=t==null?void 0:t.map(f=>{switch(f){case"clear":return k.jsx(ct,{onClick:o,children:r.clearButtonLabel},f);case"cancel":return k.jsx(ct,{onClick:s,children:r.cancelButtonLabel},f);case"accept":return k.jsx(ct,{onClick:a,children:r.okButtonLabel},f);case"today":return k.jsx(ct,{onClick:i,children:r.todayButtonLabel},f);case"next":return k.jsx(ct,{onClick:l,children:r.nextStepButtonLabel},f);case"nextOrAccept":return c?k.jsx(ct,{onClick:l,children:r.nextStepButtonLabel},f):k.jsx(ct,{onClick:a,children:r.okButtonLabel},f);default:return null}});return k.jsx(xet,z({},n,{children:u}))}const Cet=x.memo(wet),Eet=["items","changeImportance"],Tet=["getValue"],Oet=ae(ai,{name:"MuiPickersLayout",slot:"Shortcuts"})({});function Iet(e){const{items:t,changeImportance:n="accept"}=e,r=$e(e,Eet),{setValue:o}=yXe(),i=OYe();if(t==null||t.length===0)return null;const a=t.map(s=>{let{getValue:l}=s,c=$e(s,Tet);const u=l({isValid:i});return z({},c,{label:c.label,onClick:()=>{o(u,{changeImportance:n,shortcut:c})},disabled:!i(u)})});return k.jsx(Oet,z({dense:!0,sx:[{maxHeight:Vy,maxWidth:200,overflow:"auto"},...Array.isArray(r.sx)?r.sx:[r.sx]]},r,{children:a.map(s=>k.jsx(Co,{children:k.jsx(Wl,z({},s))},s.id??s.label))}))}const Pet=["ownerState"];function Aet(e){return e.view!==null}const Met=(e,t)=>{const{pickerOrientation:n}=t;return Me({root:["root",n==="landscape"&&"landscape"],contentWrapper:["contentWrapper"],toolbar:["toolbar"],actionBar:["actionBar"],tabs:["tabs"],landscape:["landscape"],shortcuts:["shortcuts"]},jce,e)},Bce=e=>{const{ownerState:t,defaultActionBarActions:n}=Ur(),{view:r}=qc(),o=vr(),{children:i,slots:a,slotProps:s,classes:l}=e,c=x.useMemo(()=>z({},t,{layoutDirection:o?"rtl":"ltr"}),[t,o]),u=Met(l,c),f=(a==null?void 0:a.actionBar)??Cet,h=Dn({elementType:f,externalSlotProps:s==null?void 0:s.actionBar,additionalProps:{actions:n},className:u.actionBar,ownerState:c}),m=$e(h,Pet),g=k.jsx(f,z({},m)),y=a==null?void 0:a.toolbar,v=Dn({elementType:y,externalSlotProps:s==null?void 0:s.toolbar,className:u.toolbar,ownerState:c}),w=Aet(v)&&y?k.jsx(y,z({},v)):null,C=i,E=a==null?void 0:a.tabs,I=r&&E?k.jsx(E,z({className:u.tabs},s==null?void 0:s.tabs)):null,O=(a==null?void 0:a.shortcuts)??Iet,P=Dn({elementType:O,externalSlotProps:s==null?void 0:s.shortcuts,className:u.shortcuts,ownerState:c}),R=r&&O?k.jsx(O,z({},P)):null;return{toolbar:w,content:C,tabs:I,actionBar:g,shortcuts:R,ownerState:c}},Ret=(e,t)=>{const{pickerOrientation:n}=t;return Me({root:["root",n==="landscape"&&"landscape"],contentWrapper:["contentWrapper"]},jce,e)},zce=ae("div",{name:"MuiPickersLayout",slot:"Root"})({display:"grid",gridAutoColumns:"max-content auto max-content",gridAutoRows:"max-content auto max-content",[`& .${Pl.actionBar}`]:{gridColumn:"1 / 4",gridRow:3},variants:[{props:{pickerOrientation:"landscape"},style:{[`& .${Pl.toolbar}`]:{gridColumn:1,gridRow:"2 / 3"},[`.${Pl.shortcuts}`]:{gridColumn:"2 / 4",gridRow:1}}},{props:{pickerOrientation:"landscape",layoutDirection:"rtl"},style:{[`& .${Pl.toolbar}`]:{gridColumn:3}}},{props:{pickerOrientation:"portrait"},style:{[`& .${Pl.toolbar}`]:{gridColumn:"2 / 4",gridRow:1},[`& .${Pl.shortcuts}`]:{gridColumn:1,gridRow:"2 / 3"}}},{props:{pickerOrientation:"portrait",layoutDirection:"rtl"},style:{[`& .${Pl.shortcuts}`]:{gridColumn:3}}}]}),Vce=ae("div",{name:"MuiPickersLayout",slot:"ContentWrapper"})({gridColumn:"2 / 4",gridRow:2,display:"flex",flexDirection:"column"}),Hce=x.forwardRef(function(t,n){const r=Pn({props:t,name:"MuiPickersLayout"}),{toolbar:o,content:i,tabs:a,actionBar:s,shortcuts:l,ownerState:c}=Bce(r),{orientation:u,variant:f}=qc(),{sx:h,className:m,classes:g}=r,y=Ret(g,c);return k.jsxs(zce,{ref:n,sx:h,className:fe(y.root,m),ownerState:c,children:[u==="landscape"?l:o,u==="landscape"?o:l,k.jsx(Vce,{className:y.contentWrapper,ownerState:c,children:f==="desktop"?k.jsxs(x.Fragment,{children:[i,a]}):k.jsxs(x.Fragment,{children:[a,i]})}),s]})});function Uce(e){const{steps:t}=e;return NYe({steps:t,isViewMatchingStep:(n,r)=>r.views==null||r.views.includes(n),onStepChange:({step:n,defaultView:r,setView:o,view:i,views:a})=>{const s=n.views==null?r:n.views.find(l=>a.includes(l));s!==i&&o(s)}})}const Det=["props","steps"],ket=["ownerState"],pV=e=>{var P;let{props:t,steps:n}=e,r=$e(e,Det);const{slots:o,slotProps:i,label:a,inputRef:s,localeText:l}=t,c=Uce({steps:n}),{providerProps:u,renderCurrentView:f,ownerState:h}=Fce(z({},r,{props:t,localeText:l,autoFocusView:!0,viewContainerRole:"dialog",variant:"desktop",getStepNavigation:c})),m=u.privateContextValue.labelId,g=((P=i==null?void 0:i.toolbar)==null?void 0:P.hidden)??!1,y=o.field,v=Dn({elementType:y,externalSlotProps:i==null?void 0:i.field,additionalProps:z({},g&&{id:m}),ownerState:h}),w=$e(v,ket),C=o.layout??Hce;let E=m;g&&(a?E=`${m}-label`:E=void 0);const I=z({},i,{toolbar:z({},i==null?void 0:i.toolbar,{titleId:m}),popper:z({"aria-labelledby":E},i==null?void 0:i.popper)});return{renderPicker:()=>k.jsx(Gle,z({},u,{children:k.jsxs(Oce,{slots:o,slotProps:I,inputRef:s,children:[k.jsx(y,z({},w)),k.jsx(met,{slots:o,slotProps:I,children:k.jsx(C,z({},I==null?void 0:I.layout,{slots:o,slotProps:I,children:f()}))})]})}))}},Qs=({view:e,onViewChange:t,views:n,focusedView:r,onFocusedViewChange:o,value:i,defaultValue:a,referenceDate:s,onChange:l,className:c,classes:u,disableFuture:f,disablePast:h,minDate:m,maxDate:g,shouldDisableDate:y,shouldDisableMonth:v,shouldDisableYear:w,reduceAnimations:C,onMonthChange:E,monthsPerRow:I,onYearChange:O,yearsOrder:P,yearsPerRow:R,slots:D,slotProps:M,loading:A,renderLoading:_,disableHighlightToday:N,readOnly:B,disabled:H,showDaysOutsideCurrentMonth:j,dayOfWeekFormatter:L,sx:V,autoFocus:W,fixedWeekNumber:K,displayWeekNumber:G,timezone:q})=>k.jsx(KZe,{view:e,onViewChange:t,views:n.filter(Uy),focusedView:r&&Uy(r)?r:null,onFocusedViewChange:o,value:i,defaultValue:a,referenceDate:s,onChange:l,className:c,classes:u,disableFuture:f,disablePast:h,minDate:m,maxDate:g,shouldDisableDate:y,shouldDisableMonth:v,shouldDisableYear:w,reduceAnimations:C,onMonthChange:E,monthsPerRow:I,onYearChange:O,yearsOrder:P,yearsPerRow:R,slots:D,slotProps:M,loading:A,renderLoading:_,disableHighlightToday:N,readOnly:B,disabled:H,showDaysOutsideCurrentMonth:j,dayOfWeekFormatter:L,sx:V,autoFocus:W,fixedWeekNumber:K,displayWeekNumber:G,timezone:q}),Gce=x.forwardRef(function(t,n){var l;const r=xn(),o=Lce(t,"MuiDesktopDatePicker"),i=z({day:Qs,month:Qs,year:Qs},o.viewRenderers),a=z({},o,{closeOnSelect:o.closeOnSelect??!0,viewRenderers:i,format:wS(r,o,!1),yearsPerRow:o.yearsPerRow??4,slots:z({field:Ice},o.slots),slotProps:z({},o.slotProps,{field:c=>{var u;return z({},Dc((u=o.slotProps)==null?void 0:u.field,c),Mv(o))},toolbar:z({hidden:!0},(l=o.slotProps)==null?void 0:l.toolbar)})}),{renderPicker:s}=pV({ref:n,props:a,valueManager:mo,valueType:"date",validator:Rv,steps:null});return s()});Gce.propTypes={autoFocus:U.bool,className:U.string,closeOnSelect:U.bool,dayOfWeekFormatter:U.func,defaultValue:U.object,disabled:U.bool,disableFuture:U.bool,disableHighlightToday:U.bool,disableOpenPicker:U.bool,disablePast:U.bool,displayWeekNumber:U.bool,enableAccessibleFieldDOMStructure:U.any,fixedWeekNumber:U.number,format:U.string,formatDensity:U.oneOf(["dense","spacious"]),inputRef:rv,label:U.node,loading:U.bool,localeText:U.object,maxDate:U.object,minDate:U.object,monthsPerRow:U.oneOf([3,4]),name:U.string,onAccept:U.func,onChange:U.func,onClose:U.func,onError:U.func,onMonthChange:U.func,onOpen:U.func,onSelectedSectionsChange:U.func,onViewChange:U.func,onYearChange:U.func,open:U.bool,openTo:U.oneOf(["day","month","year"]),orientation:U.oneOf(["landscape","portrait"]),readOnly:U.bool,reduceAnimations:U.bool,referenceDate:U.object,renderLoading:U.func,selectedSections:U.oneOfType([U.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),U.number]),shouldDisableDate:U.func,shouldDisableMonth:U.func,shouldDisableYear:U.func,showDaysOutsideCurrentMonth:U.bool,slotProps:U.object,slots:U.object,sx:U.oneOfType([U.arrayOf(U.oneOfType([U.func,U.object,U.bool])),U.func,U.object]),timezone:U.string,value:U.object,view:U.oneOf(["day","month","year"]),viewRenderers:U.shape({day:U.func,month:U.func,year:U.func}),views:U.arrayOf(U.oneOf(["day","month","year"]).isRequired),yearsOrder:U.oneOf(["asc","desc"]),yearsPerRow:U.oneOf([3,4])};const _et=ae(Ix)({[`& .${Q0.container}`]:{outline:0},[`& .${Q0.paper}`]:{outline:0,minWidth:zy}}),$et=ae(Ax)({"&:first-of-type":{padding:0}});function Net(e){const{children:t,slots:n,slotProps:r}=e,{open:o}=qc(),{dismissViews:i}=Ur(),a=(n==null?void 0:n.dialog)??_et,s=(n==null?void 0:n.mobileTransition)??hh;return k.jsx(a,z({open:o,onClose:i},r==null?void 0:r.dialog,{TransitionComponent:s,TransitionProps:r==null?void 0:r.mobileTransition,PaperComponent:n==null?void 0:n.mobilePaper,PaperProps:r==null?void 0:r.mobilePaper,children:k.jsx($et,{children:t})}))}const Let=["props","steps"],Fet=["ownerState"],hV=e=>{var P;let{props:t,steps:n}=e,r=$e(e,Let);const{slots:o,slotProps:i,label:a,inputRef:s,localeText:l}=t,c=Uce({steps:n}),{providerProps:u,renderCurrentView:f,ownerState:h}=Fce(z({},r,{props:t,localeText:l,autoFocusView:!0,viewContainerRole:"dialog",variant:"mobile",getStepNavigation:c})),m=u.privateContextValue.labelId,g=((P=i==null?void 0:i.toolbar)==null?void 0:P.hidden)??!1,y=o.field,v=Dn({elementType:y,externalSlotProps:i==null?void 0:i.field,additionalProps:z({},g&&{id:m}),ownerState:h}),w=$e(v,Fet),C=o.layout??Hce;let E=m;g&&(a?E=`${m}-label`:E=void 0);const I=z({},i,{toolbar:z({},i==null?void 0:i.toolbar,{titleId:m}),mobilePaper:z({"aria-labelledby":E},i==null?void 0:i.mobilePaper)});return{renderPicker:()=>k.jsx(Gle,z({},u,{children:k.jsxs(Oce,{slots:o,slotProps:I,inputRef:s,children:[k.jsx(y,z({},w)),k.jsx(Net,{slots:o,slotProps:I,children:k.jsx(C,z({},I==null?void 0:I.layout,{slots:o,slotProps:I,children:f()}))})]})}))}},qce=x.forwardRef(function(t,n){var l;const r=xn(),o=Lce(t,"MuiMobileDatePicker"),i=z({day:Qs,month:Qs,year:Qs},o.viewRenderers),a=z({},o,{viewRenderers:i,format:wS(r,o,!1),slots:z({field:Ice},o.slots),slotProps:z({},o.slotProps,{field:c=>{var u;return z({},Dc((u=o.slotProps)==null?void 0:u.field,c),Mv(o))},toolbar:z({hidden:!1},(l=o.slotProps)==null?void 0:l.toolbar)})}),{renderPicker:s}=hV({ref:n,props:a,valueManager:mo,valueType:"date",validator:Rv,steps:null});return s()});qce.propTypes={autoFocus:U.bool,className:U.string,closeOnSelect:U.bool,dayOfWeekFormatter:U.func,defaultValue:U.object,disabled:U.bool,disableFuture:U.bool,disableHighlightToday:U.bool,disableOpenPicker:U.bool,disablePast:U.bool,displayWeekNumber:U.bool,enableAccessibleFieldDOMStructure:U.any,fixedWeekNumber:U.number,format:U.string,formatDensity:U.oneOf(["dense","spacious"]),inputRef:rv,label:U.node,loading:U.bool,localeText:U.object,maxDate:U.object,minDate:U.object,monthsPerRow:U.oneOf([3,4]),name:U.string,onAccept:U.func,onChange:U.func,onClose:U.func,onError:U.func,onMonthChange:U.func,onOpen:U.func,onSelectedSectionsChange:U.func,onViewChange:U.func,onYearChange:U.func,open:U.bool,openTo:U.oneOf(["day","month","year"]),orientation:U.oneOf(["landscape","portrait"]),readOnly:U.bool,reduceAnimations:U.bool,referenceDate:U.object,renderLoading:U.func,selectedSections:U.oneOfType([U.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),U.number]),shouldDisableDate:U.func,shouldDisableMonth:U.func,shouldDisableYear:U.func,showDaysOutsideCurrentMonth:U.bool,slotProps:U.object,slots:U.object,sx:U.oneOfType([U.arrayOf(U.oneOfType([U.func,U.object,U.bool])),U.func,U.object]),timezone:U.string,value:U.object,view:U.oneOf(["day","month","year"]),viewRenderers:U.shape({day:U.func,month:U.func,year:U.func}),views:U.arrayOf(U.oneOf(["day","month","year"]).isRequired),yearsOrder:U.oneOf(["asc","desc"]),yearsPerRow:U.oneOf([3,4])};const jet=["desktopModeMediaQuery"],Ih=x.forwardRef(function(t,n){const r=Pn({props:t,name:"MuiDatePicker"}),{desktopModeMediaQuery:o=nV}=r,i=$e(r,jet);return Tf(o,{defaultMatches:!0})?k.jsx(Gce,z({ref:n},i)):k.jsx(qce,z({ref:n},i))});function Bet(e){return qe("MuiPickersToolbarText",e)}const zet=Ke("MuiPickersToolbarText",["root"]),Vet=["className","classes","selected","value"],Het=e=>Me({root:["root"]},Bet,e),Uet=ae(at,{name:"MuiPickersToolbarText",slot:"Root"})(({theme:e})=>({transition:e.transitions.create("color"),color:(e.vars||e).palette.text.secondary,"&[data-selected]":{color:(e.vars||e).palette.text.primary}})),mV=x.forwardRef(function(t,n){const r=Pn({props:t,name:"MuiPickersToolbarText"}),{className:o,classes:i,selected:a,value:s}=r,l=$e(r,Vet),c=Het(i);return k.jsx(Uet,z({ref:n,className:fe(c.root,o),component:"span",ownerState:r},a&&{"data-selected":!0},l,{children:s}))}),Get=["align","className","classes","selected","typographyClassName","value","variant","width"],qet=e=>Me({root:["root"]},Nce,e),Wet=ae(ct,{name:"MuiPickersToolbarButton",slot:"Root"})({padding:0,minWidth:16,textTransform:"none"}),Ha=x.forwardRef(function(t,n){const r=Pn({props:t,name:"MuiPickersToolbarButton"}),{align:o,className:i,classes:a,selected:s,typographyClassName:l,value:c,variant:u,width:f}=r,h=$e(r,Get),m=qet(a);return k.jsx(Wet,z({variant:"text",ref:n,className:fe(m.root,i),ownerState:r},f?{sx:{width:f}}:{},h,{children:k.jsx(mV,{align:o,className:l,variant:u,value:c,selected:s})}))});function Ket(e){return qe("MuiTimePickerToolbar",e)}const ux=Ke("MuiTimePickerToolbar",["root","separator","hourMinuteLabel","hourMinuteLabelLandscape","hourMinuteLabelReverse","ampmSelection","ampmLandscape","ampmLabel"]),Yet=["ampm","ampmInClock","className","classes"],Qet=(e,t)=>{const{pickerOrientation:n,toolbarDirection:r}=t;return Me({root:["root"],separator:["separator"],hourMinuteLabel:["hourMinuteLabel",n==="landscape"&&"hourMinuteLabelLandscape",r==="rtl"&&"hourMinuteLabelReverse"],ampmSelection:["ampmSelection",n==="landscape"&&"ampmLandscape"],ampmLabel:["ampmLabel"]},Ket,e)},Xet=ae(fV,{name:"MuiTimePickerToolbar",slot:"Root"})({}),Jet=ae(mV,{name:"MuiTimePickerToolbar",slot:"Separator"})({outline:0,margin:"0 4px 0 2px",cursor:"default"}),Zet=ae("div",{name:"MuiTimePickerToolbar",slot:"HourMinuteLabel",overridesResolver:(e,t)=>[{[`&.${ux.hourMinuteLabelLandscape}`]:t.hourMinuteLabelLandscape,[`&.${ux.hourMinuteLabelReverse}`]:t.hourMinuteLabelReverse},t.hourMinuteLabel]})({display:"flex",justifyContent:"flex-end",alignItems:"flex-end",variants:[{props:{toolbarDirection:"rtl"},style:{flexDirection:"row-reverse"}},{props:{pickerOrientation:"landscape"},style:{marginTop:"auto"}}]}),ett=ae("div",{name:"MuiTimePickerToolbar",slot:"AmPmSelection",overridesResolver:(e,t)=>[{[`.${ux.ampmLabel}`]:t.ampmLabel},{[`&.${ux.ampmLandscape}`]:t.ampmLandscape},t.ampmSelection]})({display:"flex",flexDirection:"column",marginRight:"auto",marginLeft:12,[`& .${ux.ampmLabel}`]:{fontSize:17},variants:[{props:{pickerOrientation:"landscape"},style:{margin:"4px 0 auto",flexDirection:"row",justifyContent:"space-around",flexBasis:"100%"}}]});function ttt(e){const t=Pn({props:e,name:"MuiTimePickerToolbar"}),{ampm:n,ampmInClock:r,className:o,classes:i}=t,a=$e(t,Yet),s=xn(),l=Ei(),c=CP(),u=Qet(i,c),{value:f,setValue:h,disabled:m,readOnly:g,view:y,setView:v,views:w}=qc(),C=!!(n&&!r&&w.includes("hours")),{meridiemMode:E,handleMeridiemChange:I}=gP(f,n,R=>h(R,{changeImportance:"set"})),O=R=>s.isValid(f)?s.format(f,R):"--",P=k.jsx(Jet,{tabIndex:-1,value:":",variant:"h3",selected:!1,className:u.separator});return k.jsxs(Xet,z({landscapeDirection:"row",toolbarTitle:l.timePickerToolbarTitle,ownerState:c,className:fe(u.root,o)},a,{children:[k.jsxs(Zet,{className:u.hourMinuteLabel,ownerState:c,children:[ug(w,"hours")&&k.jsx(Ha,{tabIndex:-1,variant:"h3",onClick:()=>v("hours"),selected:y==="hours",value:O(n?"hours12h":"hours24h")}),ug(w,["hours","minutes"])&&P,ug(w,"minutes")&&k.jsx(Ha,{tabIndex:-1,variant:"h3",onClick:()=>v("minutes"),selected:y==="minutes",value:O("minutes")}),ug(w,["minutes","seconds"])&&P,ug(w,"seconds")&&k.jsx(Ha,{variant:"h3",onClick:()=>v("seconds"),selected:y==="seconds",value:O("seconds")})]}),C&&k.jsxs(ett,{className:u.ampmSelection,ownerState:c,children:[k.jsx(Ha,{disableRipple:!0,variant:"subtitle2",selected:E==="am",typographyClassName:u.ampmLabel,value:_l(s,"am"),onClick:g?void 0:()=>I("am"),disabled:m}),k.jsx(Ha,{disableRipple:!0,variant:"subtitle2",selected:E==="pm",typographyClassName:u.ampmLabel,value:_l(s,"pm"),onClick:g?void 0:()=>I("pm"),disabled:m})]})]}))}function Wce(e,t){var s;const n=xn(),r=Pn({props:e,name:t}),o=mce(r),i=r.ampm??n.is12HourCycleInCurrentLocale(),a=x.useMemo(()=>{var l;return((l=r.localeText)==null?void 0:l.toolbarTitle)==null?r.localeText:z({},r.localeText,{timePickerToolbarTitle:r.localeText.toolbarTitle})},[r.localeText]);return z({},r,o,{ampm:i,localeText:a},Kz({views:r.views,openTo:r.openTo,defaultViews:["hours","minutes"],defaultOpenTo:"hours"}),{slots:z({toolbar:ttt},r.slots),slotProps:z({},r.slotProps,{toolbar:z({ampm:i,ampmInClock:r.ampmInClock},(s=r.slotProps)==null?void 0:s.toolbar)})})}const X_=({view:e,onViewChange:t,focusedView:n,onFocusedViewChange:r,views:o,value:i,defaultValue:a,referenceDate:s,onChange:l,className:c,classes:u,disableFuture:f,disablePast:h,minTime:m,maxTime:g,shouldDisableTime:y,minutesStep:v,ampm:w,ampmInClock:C,slots:E,slotProps:I,readOnly:O,disabled:P,sx:R,autoFocus:D,showViewSwitcher:M,disableIgnoringDatePartForTimeValidation:A,timezone:_})=>k.jsx(_Qe,{view:e,onViewChange:t,focusedView:n&&Th(n)?n:null,onFocusedViewChange:r,views:o.filter(Th),value:i,defaultValue:a,referenceDate:s,onChange:l,className:c,classes:u,disableFuture:f,disablePast:h,minTime:m,maxTime:g,shouldDisableTime:y,minutesStep:v,ampm:w,ampmInClock:C,slots:E,slotProps:I,readOnly:O,disabled:P,sx:R,autoFocus:D,showViewSwitcher:M,disableIgnoringDatePartForTimeValidation:A,timezone:_}),gV=({view:e,onViewChange:t,focusedView:n,onFocusedViewChange:r,views:o,value:i,defaultValue:a,referenceDate:s,onChange:l,className:c,classes:u,disableFuture:f,disablePast:h,minTime:m,maxTime:g,shouldDisableTime:y,minutesStep:v,ampm:w,slots:C,slotProps:E,readOnly:I,disabled:O,sx:P,autoFocus:R,disableIgnoringDatePartForTimeValidation:D,timeSteps:M,skipDisabled:A,timezone:_})=>k.jsx(HQe,{view:e,onViewChange:t,focusedView:n&&Th(n)?n:null,onFocusedViewChange:r,views:o.filter(Th),value:i,defaultValue:a,referenceDate:s,onChange:l,className:c,classes:u,disableFuture:f,disablePast:h,minTime:m,maxTime:g,shouldDisableTime:y,minutesStep:v,ampm:w,slots:C,slotProps:E,readOnly:I,disabled:O,sx:P,autoFocus:R,disableIgnoringDatePartForTimeValidation:D,timeStep:M==null?void 0:M.minutes,skipDisabled:A,timezone:_}),Gy=({view:e,onViewChange:t,focusedView:n,onFocusedViewChange:r,views:o,value:i,defaultValue:a,referenceDate:s,onChange:l,className:c,classes:u,disableFuture:f,disablePast:h,minTime:m,maxTime:g,shouldDisableTime:y,minutesStep:v,ampm:w,slots:C,slotProps:E,readOnly:I,disabled:O,sx:P,autoFocus:R,disableIgnoringDatePartForTimeValidation:D,timeSteps:M,skipDisabled:A,timezone:_})=>k.jsx(tXe,{view:e,onViewChange:t,focusedView:n&&Sg(n)?n:null,onFocusedViewChange:r,views:o.filter(Th),value:i,defaultValue:a,referenceDate:s,onChange:l,className:c,classes:u,disableFuture:f,disablePast:h,minTime:m,maxTime:g,shouldDisableTime:y,minutesStep:v,ampm:w,slots:C,slotProps:E,readOnly:I,disabled:O,sx:P,autoFocus:R,disableIgnoringDatePartForTimeValidation:D,timeSteps:M,skipDisabled:A,timezone:_}),ntt=["views","format"],Kce=(e,t,n)=>{let{views:r,format:o}=t,i=$e(t,ntt);if(o)return o;const a=[],s=[];if(r.forEach(u=>{Th(u)?s.push(u):Uy(u)&&a.push(u)}),s.length===0)return wS(e,z({views:a},i),!1);if(a.length===0)return fO(e,z({views:s},i));const l=fO(e,z({views:s},i));return`${wS(e,z({views:a},i),!1)} ${l}`},rtt=(e,t,n)=>n?t.filter(r=>!Sg(r)||r==="hours"):e?[...t,"meridiem"]:t,ott=(e,t)=>24*60/((e.hours??1)*(e.minutes??5))<=t;function Yce({thresholdToRenderTimeInASingleColumn:e,ampm:t,timeSteps:n,views:r}){const o=e??24,i=z({hours:1,minutes:5,seconds:5},n),a=ott(i,o);return{thresholdToRenderTimeInASingleColumn:o,timeSteps:i,shouldRenderTimeInASingleColumn:a,views:rtt(t,r,a)}}const Qce=x.forwardRef(function(t,n){var y,v;const r=xn(),o=Wce(t,"MuiDesktopTimePicker"),{shouldRenderTimeInASingleColumn:i,views:a,timeSteps:s}=Yce(o),l=i?gV:Gy,c=z({hours:l,minutes:l,seconds:l,meridiem:l},o.viewRenderers),u=o.ampmInClock??!0,h=((y=c.hours)==null?void 0:y.name)===Gy.name?a:a.filter(w=>w!=="meridiem"),m=z({},o,{ampmInClock:u,timeSteps:s,viewRenderers:c,format:fO(r,o),views:i?["hours"]:h,slots:z({field:Pce},o.slots),slotProps:z({},o.slotProps,{field:w=>{var C;return z({},Dc((C=o.slotProps)==null?void 0:C.field,w),Mv(o))},toolbar:z({hidden:!0,ampmInClock:u},(v=o.slotProps)==null?void 0:v.toolbar)})}),{renderPicker:g}=pV({ref:n,props:m,valueManager:mo,valueType:"time",validator:Rw,steps:null});return g()});Qce.propTypes={ampm:U.bool,ampmInClock:U.bool,autoFocus:U.bool,className:U.string,closeOnSelect:U.bool,defaultValue:U.object,disabled:U.bool,disableFuture:U.bool,disableIgnoringDatePartForTimeValidation:U.bool,disableOpenPicker:U.bool,disablePast:U.bool,enableAccessibleFieldDOMStructure:U.any,format:U.string,formatDensity:U.oneOf(["dense","spacious"]),inputRef:rv,label:U.node,localeText:U.object,maxTime:U.object,minTime:U.object,minutesStep:U.number,name:U.string,onAccept:U.func,onChange:U.func,onClose:U.func,onError:U.func,onOpen:U.func,onSelectedSectionsChange:U.func,onViewChange:U.func,open:U.bool,openTo:U.oneOf(["hours","meridiem","minutes","seconds"]),orientation:U.oneOf(["landscape","portrait"]),readOnly:U.bool,reduceAnimations:U.bool,referenceDate:U.object,selectedSections:U.oneOfType([U.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),U.number]),shouldDisableTime:U.func,skipDisabled:U.bool,slotProps:U.object,slots:U.object,sx:U.oneOfType([U.arrayOf(U.oneOfType([U.func,U.object,U.bool])),U.func,U.object]),thresholdToRenderTimeInASingleColumn:U.number,timeSteps:U.shape({hours:U.number,minutes:U.number,seconds:U.number}),timezone:U.string,value:U.object,view:U.oneOf(["hours","meridiem","minutes","seconds"]),viewRenderers:U.shape({hours:U.func,meridiem:U.func,minutes:U.func,seconds:U.func}),views:U.arrayOf(U.oneOf(["hours","minutes","seconds"]).isRequired)};const Xce=x.forwardRef(function(t,n){var c;const r=xn(),o=Wce(t,"MuiMobileTimePicker"),i=z({hours:X_,minutes:X_,seconds:X_},o.viewRenderers),a=o.ampmInClock??!1,s=z({},o,{ampmInClock:a,viewRenderers:i,format:fO(r,o),slots:z({field:Pce},o.slots),slotProps:z({},o.slotProps,{field:u=>{var f;return z({},Dc((f=o.slotProps)==null?void 0:f.field,u),Mv(o))},toolbar:z({hidden:!1,ampmInClock:a},(c=o.slotProps)==null?void 0:c.toolbar)})}),{renderPicker:l}=hV({ref:n,props:s,valueManager:mo,valueType:"time",validator:Rw,steps:null});return l()});Xce.propTypes={ampm:U.bool,ampmInClock:U.bool,autoFocus:U.bool,className:U.string,closeOnSelect:U.bool,defaultValue:U.object,disabled:U.bool,disableFuture:U.bool,disableIgnoringDatePartForTimeValidation:U.bool,disableOpenPicker:U.bool,disablePast:U.bool,enableAccessibleFieldDOMStructure:U.any,format:U.string,formatDensity:U.oneOf(["dense","spacious"]),inputRef:rv,label:U.node,localeText:U.object,maxTime:U.object,minTime:U.object,minutesStep:U.number,name:U.string,onAccept:U.func,onChange:U.func,onClose:U.func,onError:U.func,onOpen:U.func,onSelectedSectionsChange:U.func,onViewChange:U.func,open:U.bool,openTo:U.oneOf(["hours","minutes","seconds"]),orientation:U.oneOf(["landscape","portrait"]),readOnly:U.bool,reduceAnimations:U.bool,referenceDate:U.object,selectedSections:U.oneOfType([U.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),U.number]),shouldDisableTime:U.func,slotProps:U.object,slots:U.object,sx:U.oneOfType([U.arrayOf(U.oneOfType([U.func,U.object,U.bool])),U.func,U.object]),timezone:U.string,value:U.object,view:U.oneOf(["hours","minutes","seconds"]),viewRenderers:U.shape({hours:U.func,minutes:U.func,seconds:U.func}),views:U.arrayOf(U.oneOf(["hours","minutes","seconds"]).isRequired)};const itt=["desktopModeMediaQuery"],HF=x.forwardRef(function(t,n){const r=Pn({props:t,name:"MuiTimePicker"}),{desktopModeMediaQuery:o=nV}=r,i=$e(r,itt);return Tf(o,{defaultMatches:!0})?k.jsx(Qce,z({ref:n},i)):k.jsx(Xce,z({ref:n},i))});function att(e){return qe("MuiDateTimePickerTabs",e)}Ke("MuiDateTimePickerTabs",["root"]);const stt=e=>Uy(e)?"date":"time",ltt=e=>e==="date"?"day":"hours",ctt=e=>Me({root:["root"]},att,e),utt=ae(Fne,{name:"MuiDateTimePickerTabs",slot:"Root"})(({theme:e})=>({boxShadow:`0 -1px 0 0 inset ${(e.vars||e).palette.divider}`,"&:last-child":{boxShadow:`0 1px 0 0 inset ${(e.vars||e).palette.divider}`,[`& .${mE.indicator}`]:{bottom:"auto",top:0}}})),dtt=function(t){const n=Pn({props:t,name:"MuiDateTimePickerTabs"}),{dateIcon:r=k.jsx(wYe,{}),timeIcon:o=k.jsx(CYe,{}),hidden:i=typeof window>"u"||window.innerHeight<667,className:a,classes:s,sx:l}=n,c=Ei(),{ownerState:u}=Ur(),{view:f,setView:h}=qc(),m=ctt(s),g=(y,v)=>{h(ltt(v))};return i?null:k.jsxs(utt,{ownerState:u,variant:"fullWidth",value:stt(f),onChange:g,className:fe(a,m.root),sx:l,children:[k.jsx(DN,{value:"date","aria-label":c.dateTableLabel,icon:k.jsx(x.Fragment,{children:r})}),k.jsx(DN,{value:"time","aria-label":c.timeTableLabel,icon:k.jsx(x.Fragment,{children:o})})]})};function ftt(e){return qe("MuiDateTimePickerToolbar",e)}const J_=Ke("MuiDateTimePickerToolbar",["root","dateContainer","timeContainer","timeDigitsContainer","separator","timeLabelReverse","ampmSelection","ampmLandscape","ampmLabel"]),ptt=["ampm","ampmInClock","toolbarFormat","toolbarPlaceholder","toolbarTitle","className","classes"],htt=(e,t)=>{const{pickerOrientation:n,toolbarDirection:r}=t;return Me({root:["root"],dateContainer:["dateContainer"],timeContainer:["timeContainer",r==="rtl"&&"timeLabelReverse"],timeDigitsContainer:["timeDigitsContainer",r==="rtl"&&"timeLabelReverse"],separator:["separator"],ampmSelection:["ampmSelection",n==="landscape"&&"ampmLandscape"],ampmLabel:["ampmLabel"]},ftt,e)},mtt=ae(fV,{name:"MuiDateTimePickerToolbar",slot:"Root",shouldForwardProp:e=>Ca(e)&&e!=="toolbarVariant"})(({theme:e})=>({paddingLeft:16,paddingRight:16,justifyContent:"space-around",position:"relative",variants:[{props:{toolbarVariant:"desktop"},style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,[`& .${YZe.content} .${zet.root}[data-selected]`]:{color:(e.vars||e).palette.primary.main,fontWeight:e.typography.fontWeightBold}}},{props:{toolbarVariant:"desktop",pickerOrientation:"landscape"},style:{borderRight:`1px solid ${(e.vars||e).palette.divider}`}},{props:{toolbarVariant:"desktop",pickerOrientation:"portrait"},style:{paddingLeft:24,paddingRight:0}}]})),gtt=ae("div",{name:"MuiDateTimePickerToolbar",slot:"DateContainer"})({display:"flex",flexDirection:"column",alignItems:"flex-start"}),ytt=ae("div",{name:"MuiDateTimePickerToolbar",slot:"TimeContainer",shouldForwardProp:e=>Ca(e)&&e!=="toolbarVariant"})({display:"flex",flexDirection:"row",variants:[{props:{toolbarDirection:"rtl"},style:{flexDirection:"row-reverse"}},{props:{toolbarVariant:"desktop",pickerOrientation:"portrait"},style:{gap:9,marginRight:4,alignSelf:"flex-end"}},{props:({pickerOrientation:e,toolbarVariant:t})=>e==="landscape"&&t!=="desktop",style:{flexDirection:"column"}},{props:({pickerOrientation:e,toolbarVariant:t,toolbarDirection:n})=>e==="landscape"&&t!=="desktop"&&n==="rtl",style:{flexDirection:"column-reverse"}}]}),vtt=ae("div",{name:"MuiDateTimePickerToolbar",slot:"TimeDigitsContainer",shouldForwardProp:e=>Ca(e)&&e!=="toolbarVariant"})({display:"flex",variants:[{props:{toolbarDirection:"rtl"},style:{flexDirection:"row-reverse"}},{props:{toolbarVariant:"desktop"},style:{gap:1.5}}]}),uX=ae(mV,{name:"MuiDateTimePickerToolbar",slot:"Separator",shouldForwardProp:e=>Ca(e)&&e!=="toolbarVariant"})({margin:"0 4px 0 2px",cursor:"default",variants:[{props:{toolbarVariant:"desktop"},style:{margin:0}}]}),btt=ae("div",{name:"MuiDateTimePickerToolbar",slot:"AmPmSelection",overridesResolver:(e,t)=>[{[`.${J_.ampmLabel}`]:t.ampmLabel},{[`&.${J_.ampmLandscape}`]:t.ampmLandscape},t.ampmSelection]})({display:"flex",flexDirection:"column",marginRight:"auto",marginLeft:12,[`& .${J_.ampmLabel}`]:{fontSize:17},variants:[{props:{pickerOrientation:"landscape"},style:{margin:"4px 0 auto",flexDirection:"row",justifyContent:"space-around",width:"100%"}}]}),xtt=x.createContext(null);function Stt(e){const t=Pn({props:e,name:"MuiDateTimePickerToolbar"}),{ampm:n,ampmInClock:r,toolbarFormat:o,toolbarPlaceholder:i="––",toolbarTitle:a,className:s,classes:l}=t,c=$e(t,ptt),{value:u,setValue:f,disabled:h,readOnly:m,variant:g,orientation:y,view:v,setView:w,views:C}=qc(),E=Ei(),I=CP(),O=htt(l,I),P=xn(),R=x.useContext(xtt),D=R?R.value:u,M=R?R.setValue:f,A=R?R.view:v,_=R?R.setView:w,{meridiemMode:N,handleMeridiemChange:B}=gP(D,n,G=>M(G,{changeImportance:"set"})),H=R!=null&&R.forceDesktopVariant?"desktop":g,j=H==="desktop",L=!!(n&&!r),V=a??E.dateTimePickerToolbarTitle,W=x.useMemo(()=>P.isValid(D)?o?P.formatByString(D,o):P.format(D,"shortDate"):i,[D,o,i,P]),K=(G,q)=>P.isValid(D)?P.format(D,G):q;return k.jsxs(mtt,z({className:fe(O.root,s),toolbarTitle:V,toolbarVariant:H},c,{ownerState:I,children:[k.jsxs(gtt,{className:O.dateContainer,ownerState:I,children:[C.includes("year")&&k.jsx(Ha,{tabIndex:-1,variant:"subtitle1",onClick:()=>_("year"),selected:A==="year",value:K("year","–")}),C.includes("day")&&k.jsx(Ha,{tabIndex:-1,variant:j?"h5":"h4",onClick:()=>_("day"),selected:A==="day",value:W})]}),k.jsxs(ytt,{className:O.timeContainer,ownerState:I,toolbarVariant:H,children:[k.jsxs(vtt,{className:O.timeDigitsContainer,ownerState:I,toolbarVariant:H,children:[C.includes("hours")&&k.jsxs(x.Fragment,{children:[k.jsx(Ha,{variant:j?"h5":"h3",width:j&&y==="portrait"?z0:void 0,onClick:()=>_("hours"),selected:A==="hours",value:K(n?"hours12h":"hours24h","--")}),k.jsx(uX,{variant:j?"h5":"h3",value:":",className:O.separator,ownerState:I,toolbarVariant:H}),k.jsx(Ha,{variant:j?"h5":"h3",width:j&&y==="portrait"?z0:void 0,onClick:()=>_("minutes"),selected:A==="minutes"||!C.includes("minutes")&&A==="hours",value:K("minutes","--"),disabled:!C.includes("minutes")})]}),C.includes("seconds")&&k.jsxs(x.Fragment,{children:[k.jsx(uX,{variant:j?"h5":"h3",value:":",className:O.separator,ownerState:I,toolbarVariant:H}),k.jsx(Ha,{variant:j?"h5":"h3",width:j&&y==="portrait"?z0:void 0,onClick:()=>_("seconds"),selected:A==="seconds",value:K("seconds","--")})]})]}),L&&!j&&k.jsxs(btt,{className:O.ampmSelection,ownerState:I,children:[k.jsx(Ha,{variant:"subtitle2",selected:N==="am",typographyClassName:O.ampmLabel,value:_l(P,"am"),onClick:m?void 0:()=>B("am"),disabled:h}),k.jsx(Ha,{variant:"subtitle2",selected:N==="pm",typographyClassName:O.ampmLabel,value:_l(P,"pm"),onClick:m?void 0:()=>B("pm"),disabled:h})]}),n&&j&&k.jsx(Ha,{variant:"h5",onClick:()=>_("meridiem"),selected:A==="meridiem",value:D&&N?_l(P,N):"--",width:z0})]})]}))}function Jce(e,t){var m;const n=xn(),r=Pn({props:e,name:t}),o=gce(r),i=r.ampm??n.is12HourCycleInCurrentLocale(),a=x.useMemo(()=>{var g;return((g=r.localeText)==null?void 0:g.toolbarTitle)==null?r.localeText:z({},r.localeText,{dateTimePickerToolbarTitle:r.localeText.toolbarTitle})},[r.localeText]),{openTo:s,views:l}=Kz({views:r.views,openTo:r.openTo,defaultViews:["year","day","hours","minutes"],defaultOpenTo:"day"}),{shouldRenderTimeInASingleColumn:c,thresholdToRenderTimeInASingleColumn:u,views:f,timeSteps:h}=Yce({thresholdToRenderTimeInASingleColumn:r.thresholdToRenderTimeInASingleColumn,ampm:i,timeSteps:r.timeSteps,views:l});return z({},r,o,{timeSteps:h,openTo:s,shouldRenderTimeInASingleColumn:c,thresholdToRenderTimeInASingleColumn:u,views:f,ampm:i,localeText:a,orientation:r.orientation??"portrait",slots:z({toolbar:Stt,tabs:dtt},r.slots),slotProps:z({},r.slotProps,{toolbar:z({ampm:i},(m=r.slotProps)==null?void 0:m.toolbar)})})}const wtt=x.forwardRef(function(t,n){var g;const{toolbar:r,tabs:o,content:i,actionBar:a,shortcuts:s,ownerState:l}=Bce(t),{orientation:c}=qc(),{sx:u,className:f,classes:h}=t,m=a&&(((g=a.props.actions)==null?void 0:g.length)??0)>0;return k.jsxs(zce,{ref:n,className:fe(Pl.root,h==null?void 0:h.root,f),sx:[{[`& .${Pl.tabs}`]:{gridRow:4,gridColumn:"1 / 4"},[`& .${Pl.actionBar}`]:{gridRow:5}},...Array.isArray(u)?u:[u]],ownerState:l,children:[c==="landscape"?s:r,c==="landscape"?r:s,k.jsxs(Vce,{className:fe(Pl.contentWrapper,h==null?void 0:h.contentWrapper),ownerState:l,sx:{display:"grid"},children:[i,o,m&&k.jsx(ji,{sx:{gridRow:3,gridColumn:"1 / 4"}})]}),a]})}),Ctt=["openTo","focusedView","timeViewsCount"],Ett=function(t){var m,g;const{viewRenderers:n,popperView:r,rendererProps:o}=t,{openTo:i,focusedView:a,timeViewsCount:s}=o,l=$e(o,Ctt),c=z({},l,{focusedView:null,sx:[{[`&.${jF.root}`]:{borderBottom:0},[`&.${jF.root}, .${BF.root}, &.${FF.root}`]:{maxHeight:Vy}}]}),u=Sg(r),f=u?"day":r,h=u?r:"hours";return k.jsxs(x.Fragment,{children:[(m=n[f])==null?void 0:m.call(n,z({},o,{view:u?"day":r,focusedView:a&&Uy(a)?a:null,views:o.views.filter(Uy),sx:[{gridColumn:1},...c.sx]})),s>0&&k.jsxs(x.Fragment,{children:[k.jsx(ji,{orientation:"vertical",sx:{gridColumn:2}}),(g=n[h])==null?void 0:g.call(n,z({},c,{view:u?r:"hours",focusedView:a&&Sg(a)?a:null,openTo:Sg(i)?i:"hours",views:o.views.filter(Sg),sx:[{gridColumn:3},...c.sx]}))]})]})},Zce=x.forwardRef(function(t,n){var h,m,g;const r=xn(),o=Jce(t,"MuiDesktopDateTimePicker"),i=o.shouldRenderTimeInASingleColumn?gV:Gy,a=z({day:Qs,month:Qs,year:Qs,hours:i,minutes:i,seconds:i,meridiem:i},o.viewRenderers),s=o.ampmInClock??!0,c=((h=a.hours)==null?void 0:h.name)===Gy.name?o.views:o.views.filter(y=>y!=="meridiem"),u=z({},o,{viewRenderers:a,format:Kce(r,o),views:c,yearsPerRow:o.yearsPerRow??4,ampmInClock:s,slots:z({field:Ace,layout:wtt},o.slots),slotProps:z({},o.slotProps,{field:y=>{var v;return z({},Dc((v=o.slotProps)==null?void 0:v.field,y),Mv(o))},toolbar:z({hidden:!0,ampmInClock:s},(m=o.slotProps)==null?void 0:m.toolbar),tabs:z({hidden:!0},(g=o.slotProps)==null?void 0:g.tabs)})}),{renderPicker:f}=pV({ref:n,props:u,valueManager:mo,valueType:"date-time",validator:xP,rendererInterceptor:Ett,steps:null});return f()});Zce.propTypes={ampm:U.bool,ampmInClock:U.bool,autoFocus:U.bool,className:U.string,closeOnSelect:U.bool,dayOfWeekFormatter:U.func,defaultValue:U.object,disabled:U.bool,disableFuture:U.bool,disableHighlightToday:U.bool,disableIgnoringDatePartForTimeValidation:U.bool,disableOpenPicker:U.bool,disablePast:U.bool,displayWeekNumber:U.bool,enableAccessibleFieldDOMStructure:U.any,fixedWeekNumber:U.number,format:U.string,formatDensity:U.oneOf(["dense","spacious"]),inputRef:rv,label:U.node,loading:U.bool,localeText:U.object,maxDate:U.object,maxDateTime:U.object,maxTime:U.object,minDate:U.object,minDateTime:U.object,minTime:U.object,minutesStep:U.number,monthsPerRow:U.oneOf([3,4]),name:U.string,onAccept:U.func,onChange:U.func,onClose:U.func,onError:U.func,onMonthChange:U.func,onOpen:U.func,onSelectedSectionsChange:U.func,onViewChange:U.func,onYearChange:U.func,open:U.bool,openTo:U.oneOf(["day","hours","meridiem","minutes","month","seconds","year"]),orientation:U.oneOf(["landscape","portrait"]),readOnly:U.bool,reduceAnimations:U.bool,referenceDate:U.object,renderLoading:U.func,selectedSections:U.oneOfType([U.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),U.number]),shouldDisableDate:U.func,shouldDisableMonth:U.func,shouldDisableTime:U.func,shouldDisableYear:U.func,showDaysOutsideCurrentMonth:U.bool,skipDisabled:U.bool,slotProps:U.object,slots:U.object,sx:U.oneOfType([U.arrayOf(U.oneOfType([U.func,U.object,U.bool])),U.func,U.object]),thresholdToRenderTimeInASingleColumn:U.number,timeSteps:U.shape({hours:U.number,minutes:U.number,seconds:U.number}),timezone:U.string,value:U.object,view:U.oneOf(["day","hours","meridiem","minutes","month","seconds","year"]),viewRenderers:U.shape({day:U.func,hours:U.func,meridiem:U.func,minutes:U.func,month:U.func,seconds:U.func,year:U.func}),views:U.arrayOf(U.oneOf(["day","hours","minutes","month","seconds","year"]).isRequired),yearsOrder:U.oneOf(["asc","desc"]),yearsPerRow:U.oneOf([3,4])};const Ttt=[{views:Jle},{views:Wle}],eue=x.forwardRef(function(t,n){var h,m,g,y,v,w;const r=xn(),o=Jce(t,"MuiMobileDateTimePicker"),i=o.shouldRenderTimeInASingleColumn?gV:Gy,a=z({day:Qs,month:Qs,year:Qs,hours:i,minutes:i,seconds:i,meridiem:i},o.viewRenderers),s=o.ampmInClock??!1,c=((h=a.hours)==null?void 0:h.name)===Gy.name?o.views:o.views.filter(C=>C!=="meridiem"),u=z({},o,{viewRenderers:a,format:Kce(r,o),views:c,ampmInClock:s,slots:z({field:Ace},o.slots),slotProps:z({},o.slotProps,{field:C=>{var E;return z({},Dc((E=o.slotProps)==null?void 0:E.field,C),Mv(o))},toolbar:z({hidden:!1,ampmInClock:s},(m=o.slotProps)==null?void 0:m.toolbar),tabs:z({hidden:!1},(g=o.slotProps)==null?void 0:g.tabs),layout:z({},(y=o.slotProps)==null?void 0:y.layout,{sx:LQe([{[`& .${jF.root}`]:{width:zy},[`& .${BF.root}`]:{flex:1,maxHeight:Vy-1,[`.${BF.item}`]:{width:"auto"}},[`& .${FF.root}`]:{width:zy,maxHeight:Vy,flex:1,[`.${FF.item}`]:{justifyContent:"center"}}}],(w=(v=o.slotProps)==null?void 0:v.layout)==null?void 0:w.sx)})})}),{renderPicker:f}=hV({ref:n,props:u,valueManager:mo,valueType:"date-time",validator:xP,steps:Ttt});return f()});eue.propTypes={ampm:U.bool,ampmInClock:U.bool,autoFocus:U.bool,className:U.string,closeOnSelect:U.bool,dayOfWeekFormatter:U.func,defaultValue:U.object,disabled:U.bool,disableFuture:U.bool,disableHighlightToday:U.bool,disableIgnoringDatePartForTimeValidation:U.bool,disableOpenPicker:U.bool,disablePast:U.bool,displayWeekNumber:U.bool,enableAccessibleFieldDOMStructure:U.any,fixedWeekNumber:U.number,format:U.string,formatDensity:U.oneOf(["dense","spacious"]),inputRef:rv,label:U.node,loading:U.bool,localeText:U.object,maxDate:U.object,maxDateTime:U.object,maxTime:U.object,minDate:U.object,minDateTime:U.object,minTime:U.object,minutesStep:U.number,monthsPerRow:U.oneOf([3,4]),name:U.string,onAccept:U.func,onChange:U.func,onClose:U.func,onError:U.func,onMonthChange:U.func,onOpen:U.func,onSelectedSectionsChange:U.func,onViewChange:U.func,onYearChange:U.func,open:U.bool,openTo:U.oneOf(["day","hours","meridiem","minutes","month","seconds","year"]),orientation:U.oneOf(["landscape","portrait"]),readOnly:U.bool,reduceAnimations:U.bool,referenceDate:U.object,renderLoading:U.func,selectedSections:U.oneOfType([U.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),U.number]),shouldDisableDate:U.func,shouldDisableMonth:U.func,shouldDisableTime:U.func,shouldDisableYear:U.func,showDaysOutsideCurrentMonth:U.bool,skipDisabled:U.bool,slotProps:U.object,slots:U.object,sx:U.oneOfType([U.arrayOf(U.oneOfType([U.func,U.object,U.bool])),U.func,U.object]),thresholdToRenderTimeInASingleColumn:U.number,timeSteps:U.shape({hours:U.number,minutes:U.number,seconds:U.number}),timezone:U.string,value:U.object,view:U.oneOf(["day","hours","meridiem","minutes","month","seconds","year"]),viewRenderers:U.shape({day:U.func,hours:U.func,meridiem:U.func,minutes:U.func,month:U.func,seconds:U.func,year:U.func}),views:U.arrayOf(U.oneOf(["day","hours","minutes","month","seconds","year"]).isRequired),yearsOrder:U.oneOf(["asc","desc"]),yearsPerRow:U.oneOf([3,4])};const Ott=["desktopModeMediaQuery"],Itt=x.forwardRef(function(t,n){const r=Pn({props:t,name:"MuiDateTimePicker"}),{desktopModeMediaQuery:o=nV}=r,i=$e(r,Ott);return Tf(o,{defaultMatches:!0})?k.jsx(Zce,z({ref:n},i)):k.jsx(eue,z({ref:n},i))}),Ptt={y:{sectionType:"year",contentType:"digit",maxLength:4},yy:"year",yyyy:{sectionType:"year",contentType:"digit",maxLength:4},L:{sectionType:"month",contentType:"digit",maxLength:2},LL:"month",LLL:{sectionType:"month",contentType:"letter"},LLLL:{sectionType:"month",contentType:"letter"},M:{sectionType:"month",contentType:"digit",maxLength:2},MM:"month",MMM:{sectionType:"month",contentType:"letter"},MMMM:{sectionType:"month",contentType:"letter"},d:{sectionType:"day",contentType:"digit",maxLength:2},dd:"day",c:{sectionType:"weekDay",contentType:"digit",maxLength:1},ccc:{sectionType:"weekDay",contentType:"letter"},cccc:{sectionType:"weekDay",contentType:"letter"},E:{sectionType:"weekDay",contentType:"digit",maxLength:2},EEE:{sectionType:"weekDay",contentType:"letter"},EEEE:{sectionType:"weekDay",contentType:"letter"},a:"meridiem",H:{sectionType:"hours",contentType:"digit",maxLength:2},HH:"hours",h:{sectionType:"hours",contentType:"digit",maxLength:2},hh:"hours",m:{sectionType:"minutes",contentType:"digit",maxLength:2},mm:"minutes",s:{sectionType:"seconds",contentType:"digit",maxLength:2},ss:"seconds"},Att={year:"yyyy",month:"LLLL",monthShort:"MMM",dayOfMonth:"d",dayOfMonthFull:"d",weekday:"cccc",weekdayShort:"ccccc",hours24h:"HH",hours12h:"hh",meridiem:"a",minutes:"mm",seconds:"ss",fullDate:"DD",keyboardDate:"D",shortDate:"MMM d",normalDate:"d MMMM",normalDateWithWeekday:"EEE, MMM d",fullTime12h:"hh:mm a",fullTime24h:"HH:mm",keyboardDateTime12h:"D hh:mm a",keyboardDateTime24h:"D T"};class zl{constructor({locale:t,formats:n}={}){this.isMUIAdapter=!0,this.isTimezoneCompatible=!0,this.lib="luxon",this.locale=void 0,this.formats=void 0,this.escapedCharacters={start:"'",end:"'"},this.formatTokenMap=Ptt,this.setLocaleToValue=r=>{const o=this.getCurrentLocaleCode();return o===r.locale?r:r.setLocale(o)},this.date=(r,o="default")=>r===null?null:typeof r>"u"?xt.fromJSDate(new Date,{locale:this.locale,zone:o}):xt.fromISO(r,{locale:this.locale,zone:o}),this.getInvalidDate=()=>xt.fromJSDate(new Date("Invalid Date")),this.getTimezone=r=>r.zone.type==="system"?"system":r.zoneName,this.setTimezone=(r,o)=>r.zone.equals($0.normalizeZone(o))?r:r.setZone(o),this.toJsDate=r=>r.toJSDate(),this.parse=(r,o)=>r===""?null:xt.fromFormat(r,o,{locale:this.locale}),this.getCurrentLocaleCode=()=>this.locale,this.is12HourCycleInCurrentLocale=()=>{var r,o;return typeof Intl>"u"||typeof Intl.DateTimeFormat>"u"?!0:!!((o=(r=new Intl.DateTimeFormat(this.locale,{hour:"numeric"}))==null?void 0:r.resolvedOptions())!=null&&o.hour12)},this.expandFormat=r=>{const o=/''|'(''|[^'])+('|$)|[^']*/g,i=[...Object.keys(this.formatTokenMap),"yyyyy"],a=new RegExp(`^(${i.join("|")})+$`),s=/(?:^|[^a-z])([a-z]+)(?:[^a-z]|$)|([a-z]+)/gi;return r.match(o).map(l=>l[0]==="'"?l:xt.expandFormat(l,{locale:this.locale}).replace(s,(f,h,m)=>{const g=h||m;return a.test(g)?f:`'${f}'`})).join("").replace("yyyyy","yyyy")},this.isValid=r=>r===null?!1:r.isValid,this.format=(r,o)=>this.formatByString(r,this.formats[o]),this.formatByString=(r,o)=>r.setLocale(this.locale).toFormat(o),this.formatNumber=r=>r,this.isEqual=(r,o)=>r===null&&o===null?!0:r===null||o===null?!1:+r==+o,this.isSameYear=(r,o)=>{const i=this.setTimezone(o,this.getTimezone(r));return r.hasSame(i,"year")},this.isSameMonth=(r,o)=>{const i=this.setTimezone(o,this.getTimezone(r));return r.hasSame(i,"month")},this.isSameDay=(r,o)=>{const i=this.setTimezone(o,this.getTimezone(r));return r.hasSame(i,"day")},this.isSameHour=(r,o)=>{const i=this.setTimezone(o,this.getTimezone(r));return r.hasSame(i,"hour")},this.isAfter=(r,o)=>r>o,this.isAfterYear=(r,o)=>{const i=this.setTimezone(o,this.getTimezone(r));return r.diff(this.endOfYear(i),"years").toObject().years>0},this.isAfterDay=(r,o)=>{const i=this.setTimezone(o,this.getTimezone(r));return r.diff(this.endOfDay(i),"days").toObject().days>0},this.isBefore=(r,o)=>r<o,this.isBeforeYear=(r,o)=>{const i=this.setTimezone(o,this.getTimezone(r));return r.diff(this.startOfYear(i),"years").toObject().years<0},this.isBeforeDay=(r,o)=>{const i=this.setTimezone(o,this.getTimezone(r));return r.diff(this.startOfDay(i),"days").toObject().days<0},this.isWithinRange=(r,[o,i])=>this.isEqual(r,o)||this.isEqual(r,i)||this.isAfter(r,o)&&this.isBefore(r,i),this.startOfYear=r=>r.startOf("year"),this.startOfMonth=r=>r.startOf("month"),this.startOfWeek=r=>this.setLocaleToValue(r).startOf("week",{useLocaleWeeks:!0}),this.startOfDay=r=>r.startOf("day"),this.endOfYear=r=>r.endOf("year"),this.endOfMonth=r=>r.endOf("month"),this.endOfWeek=r=>this.setLocaleToValue(r).endOf("week",{useLocaleWeeks:!0}),this.endOfDay=r=>r.endOf("day"),this.addYears=(r,o)=>r.plus({years:o}),this.addMonths=(r,o)=>r.plus({months:o}),this.addWeeks=(r,o)=>r.plus({weeks:o}),this.addDays=(r,o)=>r.plus({days:o}),this.addHours=(r,o)=>r.plus({hours:o}),this.addMinutes=(r,o)=>r.plus({minutes:o}),this.addSeconds=(r,o)=>r.plus({seconds:o}),this.getYear=r=>r.get("year"),this.getMonth=r=>r.get("month")-1,this.getDate=r=>r.get("day"),this.getHours=r=>r.get("hour"),this.getMinutes=r=>r.get("minute"),this.getSeconds=r=>r.get("second"),this.getMilliseconds=r=>r.get("millisecond"),this.setYear=(r,o)=>r.set({year:o}),this.setMonth=(r,o)=>r.set({month:o+1}),this.setDate=(r,o)=>r.set({day:o}),this.setHours=(r,o)=>r.set({hour:o}),this.setMinutes=(r,o)=>r.set({minute:o}),this.setSeconds=(r,o)=>r.set({second:o}),this.setMilliseconds=(r,o)=>r.set({millisecond:o}),this.getDaysInMonth=r=>r.daysInMonth,this.getWeekArray=r=>{const o=this.startOfWeek(this.startOfMonth(r)),i=this.endOfWeek(this.endOfMonth(r)),{days:a}=i.diff(o,"days").toObject(),s=[];return new Array(Math.round(a)).fill(0).map((l,c)=>c).map(l=>o.plus({days:l})).forEach((l,c)=>{if(c===0||c%7===0&&c>6){s.push([l]);return}s[s.length-1].push(l)}),s},this.getWeekNumber=r=>r.localWeekNumber??r.weekNumber,this.getDayOfWeek=r=>r.weekday,this.getYearRange=([r,o])=>{const i=this.startOfYear(r),a=this.endOfYear(o),s=[];let l=i;for(;this.isBefore(l,a);)s.push(l),l=this.addYears(l,1);return s},this.locale=t||"en-US",this.formats=z({},Att,n)}}const yV=Ot(k.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"}));var Mtt=aae();const tue=Gn(Mtt);function vV({callback:e,initialIngredient:t}){const n=t?{value:t,data:{id:-1,name:t,image:null,image_thumbnail:null}}:null,[r,o]=x.useState(!0),[i,a]=x.useState(n),[s,l]=x.useState(""),[c,u]=x.useState([]),[f,h]=je(),m=x.useMemo(()=>tue(g=>kNe(g,h.language,r).then(y=>u(y)),200),[h.language,r]);return x.useEffect(()=>{if(s===""){u(i?[i]:[]);return}return m(s),()=>{m.cancel()}},[i,s,m]),Q(Ft,{children:[S(_c,{id:"ingredient-autocomplete",getOptionLabel:g=>g.value,"data-testid":"autocomplete",filterOptions:g=>g,options:c,autoComplete:!0,includeInputInList:!0,filterSelectedOptions:!0,value:i,noOptionsText:f("noResults"),isOptionEqualToValue:(g,y)=>g.value===y.value,onChange:(g,y)=>{u(y?[y,...c]:c),a(y),e(y)},onInputChange:(g,y)=>{l(y)},renderInput:g=>S(dn,{...g,label:f("nutrition.searchIngredientName"),fullWidth:!0,slotProps:{input:{...g.InputProps,startAdornment:Q(Tt,{children:[S(So,{position:"start",children:S(yV,{})}),g.InputProps.startAdornment]})}}}),renderOption:(g,y)=>Sx("li",{...g,key:`ingredient-${y.data.id}`},Q(Co,{disablePadding:!0,component:"div",children:[S(nl,{children:S(Kl,{alt:"",src:`${wB}${y.data.image}`,variant:"rounded",children:S(Ju,{})})}),S(Wr,{primary:y.value,slotProps:{primary:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}})]}))}),h.language!==uy&&S(Mx,{children:S(os,{control:S(qo,{checked:r,onChange:(g,y)=>o(y)}),label:f("alsoSearchEnglish")})})]})}var Rtt=function(t){return Dtt(t)&&!ktt(t)};function Dtt(e){return!!e&&typeof e=="object"}function ktt(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||Ntt(e)}var _tt=typeof Symbol=="function"&&Symbol.for,$tt=_tt?Symbol.for("react.element"):60103;function Ntt(e){return e.$$typeof===$tt}function Ltt(e){return Array.isArray(e)?[]:{}}function gO(e,t){return t.clone!==!1&&t.isMergeableObject(e)?CS(Ltt(e),e,t):e}function Ftt(e,t,n){return e.concat(t).map(function(r){return gO(r,n)})}function jtt(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(o){r[o]=gO(e[o],n)}),Object.keys(t).forEach(function(o){!n.isMergeableObject(t[o])||!e[o]?r[o]=gO(t[o],n):r[o]=CS(e[o],t[o],n)}),r}function CS(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||Ftt,n.isMergeableObject=n.isMergeableObject||Rtt;var r=Array.isArray(t),o=Array.isArray(e),i=r===o;return i?r?n.arrayMerge(e,t,n):jtt(e,t,n):gO(t,n)}CS.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,o){return CS(r,o,n)},{})};var UF=CS,nue=typeof global=="object"&&global&&global.Object===Object&&global,Btt=typeof self=="object"&&self&&self.Object===Object&&self,Wc=nue||Btt||Function("return this")(),Mf=Wc.Symbol,rue=Object.prototype,ztt=rue.hasOwnProperty,Vtt=rue.toString,g0=Mf?Mf.toStringTag:void 0;function Htt(e){var t=ztt.call(e,g0),n=e[g0];try{e[g0]=void 0;var r=!0}catch{}var o=Vtt.call(e);return r&&(t?e[g0]=n:delete e[g0]),o}var Utt=Object.prototype,Gtt=Utt.toString;function qtt(e){return Gtt.call(e)}var Wtt="[object Null]",Ktt="[object Undefined]",dX=Mf?Mf.toStringTag:void 0;function Yh(e){return e==null?e===void 0?Ktt:Wtt:dX&&dX in Object(e)?Htt(e):qtt(e)}function oue(e,t){return function(n){return e(t(n))}}var bV=oue(Object.getPrototypeOf,Object);function Qh(e){return e!=null&&typeof e=="object"}var Ytt="[object Object]",Qtt=Function.prototype,Xtt=Object.prototype,iue=Qtt.toString,Jtt=Xtt.hasOwnProperty,Ztt=iue.call(Object);function fX(e){if(!Qh(e)||Yh(e)!=Ytt)return!1;var t=bV(e);if(t===null)return!0;var n=Jtt.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&iue.call(n)==Ztt}function ent(){this.__data__=[],this.size=0}function aue(e,t){return e===t||e!==e&&t!==t}function EP(e,t){for(var n=e.length;n--;)if(aue(e[n][0],t))return n;return-1}var tnt=Array.prototype,nnt=tnt.splice;function rnt(e){var t=this.__data__,n=EP(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():nnt.call(t,n,1),--this.size,!0}function ont(e){var t=this.__data__,n=EP(t,e);return n<0?void 0:t[n][1]}function int(e){return EP(this.__data__,e)>-1}function ant(e,t){var n=this.__data__,r=EP(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function od(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}od.prototype.clear=ent;od.prototype.delete=rnt;od.prototype.get=ont;od.prototype.has=int;od.prototype.set=ant;function snt(){this.__data__=new od,this.size=0}function lnt(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function cnt(e){return this.__data__.get(e)}function unt(e){return this.__data__.has(e)}function kw(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var dnt="[object AsyncFunction]",fnt="[object Function]",pnt="[object GeneratorFunction]",hnt="[object Proxy]";function sue(e){if(!kw(e))return!1;var t=Yh(e);return t==fnt||t==pnt||t==dnt||t==hnt}var Z_=Wc["__core-js_shared__"],pX=function(){var e=/[^.]+$/.exec(Z_&&Z_.keys&&Z_.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function mnt(e){return!!pX&&pX in e}var gnt=Function.prototype,ynt=gnt.toString;function Xh(e){if(e!=null){try{return ynt.call(e)}catch{}try{return e+""}catch{}}return""}var vnt=/[\\^$.*+?()[\]{}|]/g,bnt=/^\[object .+?Constructor\]$/,xnt=Function.prototype,Snt=Object.prototype,wnt=xnt.toString,Cnt=Snt.hasOwnProperty,Ent=RegExp("^"+wnt.call(Cnt).replace(vnt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Tnt(e){if(!kw(e)||mnt(e))return!1;var t=sue(e)?Ent:bnt;return t.test(Xh(e))}function Ont(e,t){return e==null?void 0:e[t]}function Jh(e,t){var n=Ont(e,t);return Tnt(n)?n:void 0}var ES=Jh(Wc,"Map"),TS=Jh(Object,"create");function Int(){this.__data__=TS?TS(null):{},this.size=0}function Pnt(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Ant="__lodash_hash_undefined__",Mnt=Object.prototype,Rnt=Mnt.hasOwnProperty;function Dnt(e){var t=this.__data__;if(TS){var n=t[e];return n===Ant?void 0:n}return Rnt.call(t,e)?t[e]:void 0}var knt=Object.prototype,_nt=knt.hasOwnProperty;function $nt(e){var t=this.__data__;return TS?t[e]!==void 0:_nt.call(t,e)}var Nnt="__lodash_hash_undefined__";function Lnt(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=TS&&t===void 0?Nnt:t,this}function Ph(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ph.prototype.clear=Int;Ph.prototype.delete=Pnt;Ph.prototype.get=Dnt;Ph.prototype.has=$nt;Ph.prototype.set=Lnt;function Fnt(){this.size=0,this.__data__={hash:new Ph,map:new(ES||od),string:new Ph}}function jnt(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function TP(e,t){var n=e.__data__;return jnt(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Bnt(e){var t=TP(this,e).delete(e);return this.size-=t?1:0,t}function znt(e){return TP(this,e).get(e)}function Vnt(e){return TP(this,e).has(e)}function Hnt(e,t){var n=TP(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Wf(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Wf.prototype.clear=Fnt;Wf.prototype.delete=Bnt;Wf.prototype.get=znt;Wf.prototype.has=Vnt;Wf.prototype.set=Hnt;var Unt=200;function Gnt(e,t){var n=this.__data__;if(n instanceof od){var r=n.__data__;if(!ES||r.length<Unt-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Wf(r)}return n.set(e,t),this.size=n.size,this}function Dv(e){var t=this.__data__=new od(e);this.size=t.size}Dv.prototype.clear=snt;Dv.prototype.delete=lnt;Dv.prototype.get=cnt;Dv.prototype.has=unt;Dv.prototype.set=Gnt;function qnt(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var hX=function(){try{var e=Jh(Object,"defineProperty");return e({},"",{}),e}catch{}}();function lue(e,t,n){t=="__proto__"&&hX?hX(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var Wnt=Object.prototype,Knt=Wnt.hasOwnProperty;function cue(e,t,n){var r=e[t];(!(Knt.call(e,t)&&aue(r,n))||n===void 0&&!(t in e))&&lue(e,t,n)}function OP(e,t,n,r){var o=!n;n||(n={});for(var i=-1,a=t.length;++i<a;){var s=t[i],l=void 0;l===void 0&&(l=e[s]),o?lue(n,s,l):cue(n,s,l)}return n}function Ynt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Qnt="[object Arguments]";function mX(e){return Qh(e)&&Yh(e)==Qnt}var uue=Object.prototype,Xnt=uue.hasOwnProperty,Jnt=uue.propertyIsEnumerable,Znt=mX(function(){return arguments}())?mX:function(e){return Qh(e)&&Xnt.call(e,"callee")&&!Jnt.call(e,"callee")},_w=Array.isArray;function ert(){return!1}var due=typeof exports=="object"&&exports&&!exports.nodeType&&exports,gX=due&&typeof module=="object"&&module&&!module.nodeType&&module,trt=gX&&gX.exports===due,yX=trt?Wc.Buffer:void 0,nrt=yX?yX.isBuffer:void 0,fue=nrt||ert,rrt=9007199254740991,ort=/^(?:0|[1-9]\d*)$/;function irt(e,t){var n=typeof e;return t=t??rrt,!!t&&(n=="number"||n!="symbol"&&ort.test(e))&&e>-1&&e%1==0&&e<t}var art=9007199254740991;function pue(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=art}var srt="[object Arguments]",lrt="[object Array]",crt="[object Boolean]",urt="[object Date]",drt="[object Error]",frt="[object Function]",prt="[object Map]",hrt="[object Number]",mrt="[object Object]",grt="[object RegExp]",yrt="[object Set]",vrt="[object String]",brt="[object WeakMap]",xrt="[object ArrayBuffer]",Srt="[object DataView]",wrt="[object Float32Array]",Crt="[object Float64Array]",Ert="[object Int8Array]",Trt="[object Int16Array]",Ort="[object Int32Array]",Irt="[object Uint8Array]",Prt="[object Uint8ClampedArray]",Art="[object Uint16Array]",Mrt="[object Uint32Array]",Br={};Br[wrt]=Br[Crt]=Br[Ert]=Br[Trt]=Br[Ort]=Br[Irt]=Br[Prt]=Br[Art]=Br[Mrt]=!0;Br[srt]=Br[lrt]=Br[xrt]=Br[crt]=Br[Srt]=Br[urt]=Br[drt]=Br[frt]=Br[prt]=Br[hrt]=Br[mrt]=Br[grt]=Br[yrt]=Br[vrt]=Br[brt]=!1;function Rrt(e){return Qh(e)&&pue(e.length)&&!!Br[Yh(e)]}function xV(e){return function(t){return e(t)}}var hue=typeof exports=="object"&&exports&&!exports.nodeType&&exports,dx=hue&&typeof module=="object"&&module&&!module.nodeType&&module,Drt=dx&&dx.exports===hue,e$=Drt&&nue.process,qy=function(){try{var e=dx&&dx.require&&dx.require("util").types;return e||e$&&e$.binding&&e$.binding("util")}catch{}}(),vX=qy&&qy.isTypedArray,krt=vX?xV(vX):Rrt,_rt=Object.prototype,$rt=_rt.hasOwnProperty;function mue(e,t){var n=_w(e),r=!n&&Znt(e),o=!n&&!r&&fue(e),i=!n&&!r&&!o&&krt(e),a=n||r||o||i,s=a?Ynt(e.length,String):[],l=s.length;for(var c in e)(t||$rt.call(e,c))&&!(a&&(c=="length"||o&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||irt(c,l)))&&s.push(c);return s}var Nrt=Object.prototype;function SV(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Nrt;return e===n}var Lrt=oue(Object.keys,Object),Frt=Object.prototype,jrt=Frt.hasOwnProperty;function Brt(e){if(!SV(e))return Lrt(e);var t=[];for(var n in Object(e))jrt.call(e,n)&&n!="constructor"&&t.push(n);return t}function gue(e){return e!=null&&pue(e.length)&&!sue(e)}function wV(e){return gue(e)?mue(e):Brt(e)}function zrt(e,t){return e&&OP(t,wV(t),e)}function Vrt(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Hrt=Object.prototype,Urt=Hrt.hasOwnProperty;function Grt(e){if(!kw(e))return Vrt(e);var t=SV(e),n=[];for(var r in e)r=="constructor"&&(t||!Urt.call(e,r))||n.push(r);return n}function CV(e){return gue(e)?mue(e,!0):Grt(e)}function qrt(e,t){return e&&OP(t,CV(t),e)}var yue=typeof exports=="object"&&exports&&!exports.nodeType&&exports,bX=yue&&typeof module=="object"&&module&&!module.nodeType&&module,Wrt=bX&&bX.exports===yue,xX=Wrt?Wc.Buffer:void 0,SX=xX?xX.allocUnsafe:void 0;function Krt(e,t){if(t)return e.slice();var n=e.length,r=SX?SX(n):new e.constructor(n);return e.copy(r),r}function vue(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}function Yrt(e,t){for(var n=-1,r=e==null?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}function bue(){return[]}var Qrt=Object.prototype,Xrt=Qrt.propertyIsEnumerable,wX=Object.getOwnPropertySymbols,EV=wX?function(e){return e==null?[]:(e=Object(e),Yrt(wX(e),function(t){return Xrt.call(e,t)}))}:bue;function Jrt(e,t){return OP(e,EV(e),t)}function xue(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}var Zrt=Object.getOwnPropertySymbols,Sue=Zrt?function(e){for(var t=[];e;)xue(t,EV(e)),e=bV(e);return t}:bue;function eot(e,t){return OP(e,Sue(e),t)}function wue(e,t,n){var r=t(e);return _w(e)?r:xue(r,n(e))}function tot(e){return wue(e,wV,EV)}function not(e){return wue(e,CV,Sue)}var GF=Jh(Wc,"DataView"),qF=Jh(Wc,"Promise"),WF=Jh(Wc,"Set"),KF=Jh(Wc,"WeakMap"),CX="[object Map]",rot="[object Object]",EX="[object Promise]",TX="[object Set]",OX="[object WeakMap]",IX="[object DataView]",oot=Xh(GF),iot=Xh(ES),aot=Xh(qF),sot=Xh(WF),lot=Xh(KF),Eu=Yh;(GF&&Eu(new GF(new ArrayBuffer(1)))!=IX||ES&&Eu(new ES)!=CX||qF&&Eu(qF.resolve())!=EX||WF&&Eu(new WF)!=TX||KF&&Eu(new KF)!=OX)&&(Eu=function(e){var t=Yh(e),n=t==rot?e.constructor:void 0,r=n?Xh(n):"";if(r)switch(r){case oot:return IX;case iot:return CX;case aot:return EX;case sot:return TX;case lot:return OX}return t});var cot=Object.prototype,uot=cot.hasOwnProperty;function dot(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&uot.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var PX=Wc.Uint8Array;function TV(e){var t=new e.constructor(e.byteLength);return new PX(t).set(new PX(e)),t}function fot(e,t){var n=t?TV(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var pot=/\w*$/;function hot(e){var t=new e.constructor(e.source,pot.exec(e));return t.lastIndex=e.lastIndex,t}var AX=Mf?Mf.prototype:void 0,MX=AX?AX.valueOf:void 0;function mot(e){return MX?Object(MX.call(e)):{}}function got(e,t){var n=t?TV(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var yot="[object Boolean]",vot="[object Date]",bot="[object Map]",xot="[object Number]",Sot="[object RegExp]",wot="[object Set]",Cot="[object String]",Eot="[object Symbol]",Tot="[object ArrayBuffer]",Oot="[object DataView]",Iot="[object Float32Array]",Pot="[object Float64Array]",Aot="[object Int8Array]",Mot="[object Int16Array]",Rot="[object Int32Array]",Dot="[object Uint8Array]",kot="[object Uint8ClampedArray]",_ot="[object Uint16Array]",$ot="[object Uint32Array]";function Not(e,t,n){var r=e.constructor;switch(t){case Tot:return TV(e);case yot:case vot:return new r(+e);case Oot:return fot(e,n);case Iot:case Pot:case Aot:case Mot:case Rot:case Dot:case kot:case _ot:case $ot:return got(e,n);case bot:return new r;case xot:case Cot:return new r(e);case Sot:return hot(e);case wot:return new r;case Eot:return mot(e)}}var RX=Object.create,Lot=function(){function e(){}return function(t){if(!kw(t))return{};if(RX)return RX(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Fot(e){return typeof e.constructor=="function"&&!SV(e)?Lot(bV(e)):{}}var jot="[object Map]";function Bot(e){return Qh(e)&&Eu(e)==jot}var DX=qy&&qy.isMap,zot=DX?xV(DX):Bot,Vot="[object Set]";function Hot(e){return Qh(e)&&Eu(e)==Vot}var kX=qy&&qy.isSet,Uot=kX?xV(kX):Hot,Got=1,qot=2,Wot=4,Cue="[object Arguments]",Kot="[object Array]",Yot="[object Boolean]",Qot="[object Date]",Xot="[object Error]",Eue="[object Function]",Jot="[object GeneratorFunction]",Zot="[object Map]",eit="[object Number]",Tue="[object Object]",tit="[object RegExp]",nit="[object Set]",rit="[object String]",oit="[object Symbol]",iit="[object WeakMap]",ait="[object ArrayBuffer]",sit="[object DataView]",lit="[object Float32Array]",cit="[object Float64Array]",uit="[object Int8Array]",dit="[object Int16Array]",fit="[object Int32Array]",pit="[object Uint8Array]",hit="[object Uint8ClampedArray]",mit="[object Uint16Array]",git="[object Uint32Array]",kr={};kr[Cue]=kr[Kot]=kr[ait]=kr[sit]=kr[Yot]=kr[Qot]=kr[lit]=kr[cit]=kr[uit]=kr[dit]=kr[fit]=kr[Zot]=kr[eit]=kr[Tue]=kr[tit]=kr[nit]=kr[rit]=kr[oit]=kr[pit]=kr[hit]=kr[mit]=kr[git]=!0;kr[Xot]=kr[Eue]=kr[iit]=!1;function fx(e,t,n,r,o,i){var a,s=t&Got,l=t&qot,c=t&Wot;if(a!==void 0)return a;if(!kw(e))return e;var u=_w(e);if(u){if(a=dot(e),!s)return vue(e,a)}else{var f=Eu(e),h=f==Eue||f==Jot;if(fue(e))return Krt(e,s);if(f==Tue||f==Cue||h&&!o){if(a=l||h?{}:Fot(e),!s)return l?eot(e,qrt(a,e)):Jrt(e,zrt(a,e))}else{if(!kr[f])return o?e:{};a=Not(e,f,s)}}i||(i=new Dv);var m=i.get(e);if(m)return m;i.set(e,a),Uot(e)?e.forEach(function(v){a.add(fx(v,t,n,v,e,i))}):zot(e)&&e.forEach(function(v,w){a.set(w,fx(v,t,n,w,e,i))});var g=c?l?not:tot:l?CV:wV,y=u?void 0:g(e);return qnt(y||e,function(v,w){y&&(w=v,v=e[w]),cue(a,w,fx(v,t,n,w,e,i))}),a}var yit=1,vit=4;function V0(e){return fx(e,yit|vit)}var t$,_X;function bit(){if(_X)return t$;_X=1;var e=Array.isArray,t=Object.keys,n=Object.prototype.hasOwnProperty,r=typeof Element<"u";function o(i,a){if(i===a)return!0;if(i&&a&&typeof i=="object"&&typeof a=="object"){var s=e(i),l=e(a),c,u,f;if(s&&l){if(u=i.length,u!=a.length)return!1;for(c=u;c--!==0;)if(!o(i[c],a[c]))return!1;return!0}if(s!=l)return!1;var h=i instanceof Date,m=a instanceof Date;if(h!=m)return!1;if(h&&m)return i.getTime()==a.getTime();var g=i instanceof RegExp,y=a instanceof RegExp;if(g!=y)return!1;if(g&&y)return i.toString()==a.toString();var v=t(i);if(u=v.length,u!==t(a).length)return!1;for(c=u;c--!==0;)if(!n.call(a,v[c]))return!1;if(r&&i instanceof Element&&a instanceof Element)return i===a;for(c=u;c--!==0;)if(f=v[c],!(f==="_owner"&&i.$$typeof)&&!o(i[f],a[f]))return!1;return!0}return i!==i&&a!==a}return t$=function(a,s){try{return o(a,s)}catch(l){if(l.message&&l.message.match(/stack|recursion/i)||l.number===-2146828260)return console.warn("Warning: react-fast-compare does not handle circular references.",l.name,l.message),!1;throw l}},t$}var xit=bit();const Gd=Gn(xit);var Sit=4;function $X(e){return fx(e,Sit)}function Oue(e,t){for(var n=-1,r=e==null?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}var wit="[object Symbol]";function OV(e){return typeof e=="symbol"||Qh(e)&&Yh(e)==wit}var Cit="Expected a function";function IV(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Cit);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(IV.Cache||Wf),n}IV.Cache=Wf;var Eit=500;function Tit(e){var t=IV(e,function(r){return n.size===Eit&&n.clear(),r}),n=t.cache;return t}var Oit=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Iit=/\\(\\)?/g,Pit=Tit(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Oit,function(n,r,o,i){t.push(o?i.replace(Iit,"$1"):r||n)}),t});function Ait(e){if(typeof e=="string"||OV(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var NX=Mf?Mf.prototype:void 0,LX=NX?NX.toString:void 0;function Iue(e){if(typeof e=="string")return e;if(_w(e))return Oue(e,Iue)+"";if(OV(e))return LX?LX.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Mit(e){return e==null?"":Iue(e)}function Pue(e){return _w(e)?Oue(e,Ait):OV(e)?[e]:vue(Pit(Mit(e)))}function fo(){return fo=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},fo.apply(this,arguments)}function Rit(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function PV(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function FX(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var IP=x.createContext(void 0);IP.displayName="FormikContext";var Dit=IP.Provider,kit=IP.Consumer;function AV(){var e=x.useContext(IP);return e}var jX=function(t){return Array.isArray(t)&&t.length===0},ya=function(t){return typeof t=="function"},kv=function(t){return t!==null&&typeof t=="object"},_it=function(t){return String(Math.floor(Number(t)))===t},n$=function(t){return Object.prototype.toString.call(t)==="[object String]"},Aue=function(t){return x.Children.count(t)===0},r$=function(t){return kv(t)&&ya(t.then)};function ti(e,t,n,r){r===void 0&&(r=0);for(var o=Pue(t);e&&r<o.length;)e=e[o[r++]];return r!==o.length&&!e||e===void 0?n:e}function Mc(e,t,n){for(var r=$X(e),o=r,i=0,a=Pue(t);i<a.length-1;i++){var s=a[i],l=ti(e,a.slice(0,i+1));if(l&&(kv(l)||Array.isArray(l)))o=o[s]=$X(l);else{var c=a[i+1];o=o[s]=_it(c)&&Number(c)>=0?[]:{}}}return(i===0?e:o)[a[i]]===n?e:(n===void 0?delete o[a[i]]:o[a[i]]=n,i===0&&n===void 0&&delete r[a[i]],r)}function Mue(e,t,n,r){n===void 0&&(n=new WeakMap),r===void 0&&(r={});for(var o=0,i=Object.keys(e);o<i.length;o++){var a=i[o],s=e[a];kv(s)?n.get(s)||(n.set(s,!0),r[a]=Array.isArray(s)?[]:{},Mue(s,t,n,r[a])):r[a]=t}return r}function $it(e,t){switch(t.type){case"SET_VALUES":return fo({},e,{values:t.payload});case"SET_TOUCHED":return fo({},e,{touched:t.payload});case"SET_ERRORS":return Gd(e.errors,t.payload)?e:fo({},e,{errors:t.payload});case"SET_STATUS":return fo({},e,{status:t.payload});case"SET_ISSUBMITTING":return fo({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return fo({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return fo({},e,{values:Mc(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return fo({},e,{touched:Mc(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return fo({},e,{errors:Mc(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return fo({},e,t.payload);case"SET_FORMIK_STATE":return t.payload(e);case"SUBMIT_ATTEMPT":return fo({},e,{touched:Mue(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":return fo({},e,{isSubmitting:!1});case"SUBMIT_SUCCESS":return fo({},e,{isSubmitting:!1});default:return e}}var wp={},Y1={};function Nit(e){var t=e.validateOnChange,n=t===void 0?!0:t,r=e.validateOnBlur,o=r===void 0?!0:r,i=e.validateOnMount,a=i===void 0?!1:i,s=e.isInitialValid,l=e.enableReinitialize,c=l===void 0?!1:l,u=e.onSubmit,f=PV(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),h=fo({validateOnChange:n,validateOnBlur:o,validateOnMount:a,onSubmit:u},f),m=x.useRef(h.initialValues),g=x.useRef(h.initialErrors||wp),y=x.useRef(h.initialTouched||Y1),v=x.useRef(h.initialStatus),w=x.useRef(!1),C=x.useRef({});x.useEffect(function(){return w.current=!0,function(){w.current=!1}},[]);var E=x.useState(0),I=E[1],O=x.useRef({values:V0(h.initialValues),errors:V0(h.initialErrors)||wp,touched:V0(h.initialTouched)||Y1,status:V0(h.initialStatus),isSubmitting:!1,isValidating:!1,submitCount:0}),P=O.current,R=x.useCallback(function(te){var Te=O.current;O.current=$it(Te,te),Te!==O.current&&I(function(De){return De+1})},[]),D=x.useCallback(function(te,Te){return new Promise(function(De,Ve){var We=h.validate(te,Te);We==null?De(wp):r$(We)?We.then(function(rt){De(rt||wp)},function(rt){Ve(rt)}):De(We)})},[h.validate]),M=x.useCallback(function(te,Te){var De=h.validationSchema,Ve=ya(De)?De(Te):De,We=Te&&Ve.validateAt?Ve.validateAt(Te,te):Fit(te,Ve);return new Promise(function(rt,ut){We.then(function(){rt(wp)},function(Be){Be.name==="ValidationError"?rt(Lit(Be)):ut(Be)})})},[h.validationSchema]),A=x.useCallback(function(te,Te){return new Promise(function(De){return De(C.current[te].validate(Te))})},[]),_=x.useCallback(function(te){var Te=Object.keys(C.current).filter(function(Ve){return ya(C.current[Ve].validate)}),De=Te.length>0?Te.map(function(Ve){return A(Ve,ti(te,Ve))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(De).then(function(Ve){return Ve.reduce(function(We,rt,ut){return rt==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||rt&&(We=Mc(We,Te[ut],rt)),We},{})})},[A]),N=x.useCallback(function(te){return Promise.all([_(te),h.validationSchema?M(te):{},h.validate?D(te):{}]).then(function(Te){var De=Te[0],Ve=Te[1],We=Te[2],rt=UF.all([De,Ve,We],{arrayMerge:jit});return rt})},[h.validate,h.validationSchema,_,D,M]),B=As(function(te){return te===void 0&&(te=P.values),R({type:"SET_ISVALIDATING",payload:!0}),N(te).then(function(Te){return w.current&&(R({type:"SET_ISVALIDATING",payload:!1}),R({type:"SET_ERRORS",payload:Te})),Te})});x.useEffect(function(){a&&w.current===!0&&Gd(m.current,h.initialValues)&&B(m.current)},[a,B]);var H=x.useCallback(function(te){var Te=te&&te.values?te.values:m.current,De=te&&te.errors?te.errors:g.current?g.current:h.initialErrors||{},Ve=te&&te.touched?te.touched:y.current?y.current:h.initialTouched||{},We=te&&te.status?te.status:v.current?v.current:h.initialStatus;m.current=Te,g.current=De,y.current=Ve,v.current=We;var rt=function(){R({type:"RESET_FORM",payload:{isSubmitting:!!te&&!!te.isSubmitting,errors:De,touched:Ve,status:We,values:Te,isValidating:!!te&&!!te.isValidating,submitCount:te&&te.submitCount&&typeof te.submitCount=="number"?te.submitCount:0}})};if(h.onReset){var ut=h.onReset(P.values,ue);r$(ut)?ut.then(rt):rt()}else rt()},[h.initialErrors,h.initialStatus,h.initialTouched,h.onReset]);x.useEffect(function(){w.current===!0&&!Gd(m.current,h.initialValues)&&c&&(m.current=h.initialValues,H(),a&&B(m.current))},[c,h.initialValues,H,a,B]),x.useEffect(function(){c&&w.current===!0&&!Gd(g.current,h.initialErrors)&&(g.current=h.initialErrors||wp,R({type:"SET_ERRORS",payload:h.initialErrors||wp}))},[c,h.initialErrors]),x.useEffect(function(){c&&w.current===!0&&!Gd(y.current,h.initialTouched)&&(y.current=h.initialTouched||Y1,R({type:"SET_TOUCHED",payload:h.initialTouched||Y1}))},[c,h.initialTouched]),x.useEffect(function(){c&&w.current===!0&&!Gd(v.current,h.initialStatus)&&(v.current=h.initialStatus,R({type:"SET_STATUS",payload:h.initialStatus}))},[c,h.initialStatus,h.initialTouched]);var j=As(function(te){if(C.current[te]&&ya(C.current[te].validate)){var Te=ti(P.values,te),De=C.current[te].validate(Te);return r$(De)?(R({type:"SET_ISVALIDATING",payload:!0}),De.then(function(Ve){return Ve}).then(function(Ve){R({type:"SET_FIELD_ERROR",payload:{field:te,value:Ve}}),R({type:"SET_ISVALIDATING",payload:!1})})):(R({type:"SET_FIELD_ERROR",payload:{field:te,value:De}}),Promise.resolve(De))}else if(h.validationSchema)return R({type:"SET_ISVALIDATING",payload:!0}),M(P.values,te).then(function(Ve){return Ve}).then(function(Ve){R({type:"SET_FIELD_ERROR",payload:{field:te,value:ti(Ve,te)}}),R({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),L=x.useCallback(function(te,Te){var De=Te.validate;C.current[te]={validate:De}},[]),V=x.useCallback(function(te){delete C.current[te]},[]),W=As(function(te,Te){R({type:"SET_TOUCHED",payload:te});var De=Te===void 0?o:Te;return De?B(P.values):Promise.resolve()}),K=x.useCallback(function(te){R({type:"SET_ERRORS",payload:te})},[]),G=As(function(te,Te){var De=ya(te)?te(P.values):te;R({type:"SET_VALUES",payload:De});var Ve=Te===void 0?n:Te;return Ve?B(De):Promise.resolve()}),q=x.useCallback(function(te,Te){R({type:"SET_FIELD_ERROR",payload:{field:te,value:Te}})},[]),Y=As(function(te,Te,De){R({type:"SET_FIELD_VALUE",payload:{field:te,value:Te}});var Ve=De===void 0?n:De;return Ve?B(Mc(P.values,te,Te)):Promise.resolve()}),Z=x.useCallback(function(te,Te){var De=Te,Ve=te,We;if(!n$(te)){te.persist&&te.persist();var rt=te.target?te.target:te.currentTarget,ut=rt.type,Be=rt.name,et=rt.id,Le=rt.value,It=rt.checked;rt.outerHTML;var Lt=rt.options,nt=rt.multiple;De=Te||Be||et,Ve=/number|range/.test(ut)?(We=parseFloat(Le),isNaN(We)?"":We):/checkbox/.test(ut)?zit(ti(P.values,De),It,Le):Lt&&nt?Bit(Lt):Le}De&&Y(De,Ve)},[Y,P.values]),ie=As(function(te){if(n$(te))return function(Te){return Z(Te,te)};Z(te)}),se=As(function(te,Te,De){Te===void 0&&(Te=!0),R({type:"SET_FIELD_TOUCHED",payload:{field:te,value:Te}});var Ve=De===void 0?o:De;return Ve?B(P.values):Promise.resolve()}),ce=x.useCallback(function(te,Te){te.persist&&te.persist();var De=te.target,Ve=De.name,We=De.id;De.outerHTML;var rt=Te||Ve||We;se(rt,!0)},[se]),ye=As(function(te){if(n$(te))return function(Te){return ce(Te,te)};ce(te)}),Se=x.useCallback(function(te){ya(te)?R({type:"SET_FORMIK_STATE",payload:te}):R({type:"SET_FORMIK_STATE",payload:function(){return te}})},[]),ne=x.useCallback(function(te){R({type:"SET_STATUS",payload:te})},[]),le=x.useCallback(function(te){R({type:"SET_ISSUBMITTING",payload:te})},[]),de=As(function(){return R({type:"SUBMIT_ATTEMPT"}),B().then(function(te){var Te=te instanceof Error,De=!Te&&Object.keys(te).length===0;if(De){var Ve;try{if(Ve=pe(),Ve===void 0)return}catch(We){throw We}return Promise.resolve(Ve).then(function(We){return w.current&&R({type:"SUBMIT_SUCCESS"}),We}).catch(function(We){if(w.current)throw R({type:"SUBMIT_FAILURE"}),We})}else if(w.current&&(R({type:"SUBMIT_FAILURE"}),Te))throw te})}),oe=As(function(te){te&&te.preventDefault&&ya(te.preventDefault)&&te.preventDefault(),te&&te.stopPropagation&&ya(te.stopPropagation)&&te.stopPropagation(),de().catch(function(Te){console.warn("Warning: An unhandled error was caught from submitForm()",Te)})}),ue={resetForm:H,validateForm:B,validateField:j,setErrors:K,setFieldError:q,setFieldTouched:se,setFieldValue:Y,setStatus:ne,setSubmitting:le,setTouched:W,setValues:G,setFormikState:Se,submitForm:de},pe=As(function(){return u(P.values,ue)}),Ee=As(function(te){te&&te.preventDefault&&ya(te.preventDefault)&&te.preventDefault(),te&&te.stopPropagation&&ya(te.stopPropagation)&&te.stopPropagation(),H()}),xe=x.useCallback(function(te){return{value:ti(P.values,te),error:ti(P.errors,te),touched:!!ti(P.touched,te),initialValue:ti(m.current,te),initialTouched:!!ti(y.current,te),initialError:ti(g.current,te)}},[P.errors,P.touched,P.values]),Re=x.useCallback(function(te){return{setValue:function(De,Ve){return Y(te,De,Ve)},setTouched:function(De,Ve){return se(te,De,Ve)},setError:function(De){return q(te,De)}}},[Y,se,q]),he=x.useCallback(function(te){var Te=kv(te),De=Te?te.name:te,Ve=ti(P.values,De),We={name:De,value:Ve,onChange:ie,onBlur:ye};if(Te){var rt=te.type,ut=te.value,Be=te.as,et=te.multiple;rt==="checkbox"?ut===void 0?We.checked=!!Ve:(We.checked=!!(Array.isArray(Ve)&&~Ve.indexOf(ut)),We.value=ut):rt==="radio"?(We.checked=Ve===ut,We.value=ut):Be==="select"&&et&&(We.value=We.value||[],We.multiple=!0)}return We},[ye,ie,P.values]),Pe=x.useMemo(function(){return!Gd(m.current,P.values)},[m.current,P.values]),ve=x.useMemo(function(){return typeof s<"u"?Pe?P.errors&&Object.keys(P.errors).length===0:s!==!1&&ya(s)?s(h):s:P.errors&&Object.keys(P.errors).length===0},[s,Pe,P.errors,h]),Ie=fo({},P,{initialValues:m.current,initialErrors:g.current,initialTouched:y.current,initialStatus:v.current,handleBlur:ye,handleChange:ie,handleReset:Ee,handleSubmit:oe,resetForm:H,setErrors:K,setFormikState:Se,setFieldTouched:se,setFieldValue:Y,setFieldError:q,setStatus:ne,setSubmitting:le,setTouched:W,setValues:G,submitForm:de,validateForm:B,validateField:j,isValid:ve,dirty:Pe,unregisterField:V,registerField:L,getFieldProps:he,getFieldMeta:xe,getFieldHelpers:Re,validateOnBlur:o,validateOnChange:n,validateOnMount:a});return Ie}function Ti(e){var t=Nit(e),n=e.component,r=e.children,o=e.render,i=e.innerRef;return x.useImperativeHandle(i,function(){return t}),x.createElement(Dit,{value:t},n?x.createElement(n,t):o?o(t):r?ya(r)?r(t):Aue(r)?null:x.Children.only(r):null)}function Lit(e){var t={};if(e.inner){if(e.inner.length===0)return Mc(t,e.path,e.message);for(var o=e.inner,n=Array.isArray(o),r=0,o=n?o:o[Symbol.iterator]();;){var i;if(n){if(r>=o.length)break;i=o[r++]}else{if(r=o.next(),r.done)break;i=r.value}var a=i;ti(t,a.path)||(t=Mc(t,a.path,a.message))}}return t}function Fit(e,t,n,r){n===void 0&&(n=!1);var o=YF(e);return t[n?"validateSync":"validate"](o,{abortEarly:!1,context:o})}function YF(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);Array.isArray(e[r])===!0?t[r]=e[r].map(function(o){return Array.isArray(o)===!0||fX(o)?YF(o):o!==""?o:void 0}):fX(e[r])?t[r]=YF(e[r]):t[r]=e[r]!==""?e[r]:void 0}return t}function jit(e,t,n){var r=e.slice();return t.forEach(function(i,a){if(typeof r[a]>"u"){var s=n.clone!==!1,l=s&&n.isMergeableObject(i);r[a]=l?UF(Array.isArray(i)?[]:{},i,n):i}else n.isMergeableObject(i)?r[a]=UF(e[a],i,n):e.indexOf(i)===-1&&r.push(i)}),r}function Bit(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function zit(e,t,n){if(typeof e=="boolean")return!!t;var r=[],o=!1,i=-1;if(Array.isArray(e))r=e,i=e.indexOf(n),o=i>=0;else if(!n||n=="true"||n=="false")return!!t;return t&&n&&!o?r.concat(n):o?r.slice(0,i).concat(r.slice(i+1)):r}var Vit=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?x.useLayoutEffect:x.useEffect;function As(e){var t=x.useRef(e);return Vit(function(){t.current=e}),x.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current.apply(void 0,r)},[])}function us(e){var t=AV(),n=t.getFieldProps,r=t.getFieldMeta,o=t.getFieldHelpers,i=t.registerField,a=t.unregisterField,s=kv(e),l=s?e:{name:e},c=l.name,u=l.validate;x.useEffect(function(){return c&&i(c,{validate:u}),function(){c&&a(c)}},[i,a,c,u]);var f=x.useMemo(function(){return o(c)},[o,c]);return[n(l),r(c),f]}var fi=x.forwardRef(function(e,t){var n=e.action,r=PV(e,["action"]),o=n??"#",i=AV(),a=i.handleReset,s=i.handleSubmit;return x.createElement("form",fo({onSubmit:s,ref:t,onReset:a,action:o},r))});fi.displayName="Form";function Hit(e){var t=function(o){return x.createElement(kit,null,function(i){return x.createElement(e,fo({},o,{formik:i}))})},n=e.displayName||e.name||e.constructor&&e.constructor.name||"Component";return t.WrappedComponent=e,t.displayName="FormikConnect("+n+")",nve(t,e)}var Uit=function(t,n,r){var o=Ah(t),i=o[n];return o.splice(n,1),o.splice(r,0,i),o},Git=function(t,n,r){var o=Ah(t),i=o[n];return o[n]=o[r],o[r]=i,o},o$=function(t,n,r){var o=Ah(t);return o.splice(n,0,r),o},qit=function(t,n,r){var o=Ah(t);return o[n]=r,o},Ah=function(t){if(t){if(Array.isArray(t))return[].concat(t);var n=Object.keys(t).map(function(r){return parseInt(r)}).reduce(function(r,o){return o>r?o:r},0);return Array.from(fo({},t,{length:n+1}))}else return[]},BX=function(t,n){var r=typeof t=="function"?t:n;return function(o){if(Array.isArray(o)||kv(o)){var i=Ah(o);return r(i)}return o}},Rue=function(e){Rit(t,e);function t(r){var o;return o=e.call(this,r)||this,o.updateArrayField=function(i,a,s){var l=o.props,c=l.name,u=l.formik.setFormikState;u(function(f){var h=BX(s,i),m=BX(a,i),g=Mc(f.values,c,i(ti(f.values,c))),y=s?h(ti(f.errors,c)):void 0,v=a?m(ti(f.touched,c)):void 0;return jX(y)&&(y=void 0),jX(v)&&(v=void 0),fo({},f,{values:g,errors:s?Mc(f.errors,c,y):f.errors,touched:a?Mc(f.touched,c,v):f.touched})})},o.push=function(i){return o.updateArrayField(function(a){return[].concat(Ah(a),[V0(i)])},!1,!1)},o.handlePush=function(i){return function(){return o.push(i)}},o.swap=function(i,a){return o.updateArrayField(function(s){return Git(s,i,a)},!0,!0)},o.handleSwap=function(i,a){return function(){return o.swap(i,a)}},o.move=function(i,a){return o.updateArrayField(function(s){return Uit(s,i,a)},!0,!0)},o.handleMove=function(i,a){return function(){return o.move(i,a)}},o.insert=function(i,a){return o.updateArrayField(function(s){return o$(s,i,a)},function(s){return o$(s,i,null)},function(s){return o$(s,i,null)})},o.handleInsert=function(i,a){return function(){return o.insert(i,a)}},o.replace=function(i,a){return o.updateArrayField(function(s){return qit(s,i,a)},!1,!1)},o.handleReplace=function(i,a){return function(){return o.replace(i,a)}},o.unshift=function(i){var a=-1;return o.updateArrayField(function(s){var l=s?[i].concat(s):[i];return a=l.length,l},function(s){return s?[null].concat(s):[null]},function(s){return s?[null].concat(s):[null]}),a},o.handleUnshift=function(i){return function(){return o.unshift(i)}},o.handleRemove=function(i){return function(){return o.remove(i)}},o.handlePop=function(){return function(){return o.pop()}},o.remove=o.remove.bind(FX(o)),o.pop=o.pop.bind(FX(o)),o}var n=t.prototype;return n.componentDidUpdate=function(o){this.props.validateOnChange&&this.props.formik.validateOnChange&&!Gd(ti(o.formik.values,o.name),ti(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},n.remove=function(o){var i;return this.updateArrayField(function(a){var s=a?Ah(a):[];return i||(i=s[o]),ya(s.splice)&&s.splice(o,1),ya(s.every)&&s.every(function(l){return l===void 0})?[]:s},!0,!0),i},n.pop=function(){var o;return this.updateArrayField(function(i){var a=i.slice();return o||(o=a&&a.pop&&a.pop()),a},!0,!0),o},n.render=function(){var o={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},i=this.props,a=i.component,s=i.render,l=i.children,c=i.name,u=i.formik,f=PV(u,["validate","validationSchema"]),h=fo({},o,{form:f,name:c});return a?x.createElement(a,h):s?s(h):l?typeof l=="function"?l(h):Aue(l)?null:x.Children.only(l):null},t}(x.Component);Rue.defaultProps={validateOnChange:!0};var Due=Hit(Rue),i$,zX;function Wit(){if(zX)return i$;zX=1;function e(w){this._maxSize=w,this.clear()}e.prototype.clear=function(){this._size=0,this._values=Object.create(null)},e.prototype.get=function(w){return this._values[w]},e.prototype.set=function(w,C){return this._size>=this._maxSize&&this.clear(),w in this._values||this._size++,this._values[w]=C};var t=/[^.^\]^[]+|(?=\[\]|\.\.)/g,n=/^\d+$/,r=/^\d/,o=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,i=/^\s*(['"]?)(.*?)(\1)\s*$/,a=512,s=new e(a),l=new e(a),c=new e(a);i$={Cache:e,split:f,normalizePath:u,setter:function(w){var C=u(w);return l.get(w)||l.set(w,function(I,O){for(var P=0,R=C.length,D=I;P<R-1;){var M=C[P];if(M==="__proto__"||M==="constructor"||M==="prototype")return I;D=D[C[P++]]}D[C[P]]=O})},getter:function(w,C){var E=u(w);return c.get(w)||c.set(w,function(O){for(var P=0,R=E.length;P<R;)if(O!=null||!C)O=O[E[P++]];else return;return O})},join:function(w){return w.reduce(function(C,E){return C+(m(E)||n.test(E)?"["+E+"]":(C?".":"")+E)},"")},forEach:function(w,C,E){h(Array.isArray(w)?w:f(w),C,E)}};function u(w){return s.get(w)||s.set(w,f(w).map(function(C){return C.replace(i,"$2")}))}function f(w){return w.match(t)||[""]}function h(w,C,E){var I=w.length,O,P,R,D;for(P=0;P<I;P++)O=w[P],O&&(v(O)&&(O='"'+O+'"'),D=m(O),R=!D&&/^\d+$/.test(O),C.call(E,O,D,R,P,w))}function m(w){return typeof w=="string"&&w&&["'",'"'].indexOf(w.charAt(0))!==-1}function g(w){return w.match(r)&&!w.match(n)}function y(w){return o.test(w)}function v(w){return!m(w)&&(g(w)||y(w))}return i$}var ah=Wit(),a$,VX;function Kit(){if(VX)return a$;VX=1;const e=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,t=u=>u.match(e)||[],n=u=>u[0].toUpperCase()+u.slice(1),r=(u,f)=>t(u).join(f).toLowerCase(),o=u=>t(u).reduce((f,h)=>`${f}${f?h[0].toUpperCase()+h.slice(1).toLowerCase():h.toLowerCase()}`,"");return a$={words:t,upperFirst:n,camelCase:o,pascalCase:u=>n(o(u)),snakeCase:u=>r(u,"_"),kebabCase:u=>r(u,"-"),sentenceCase:u=>n(r(u," ")),titleCase:u=>t(u).map(n).join(" ")},a$}var s$=Kit(),Q1={exports:{}},HX;function Yit(){if(HX)return Q1.exports;HX=1,Q1.exports=function(o){return e(t(o),o)},Q1.exports.array=e;function e(o,i){var a=o.length,s=new Array(a),l={},c=a,u=n(i),f=r(o);for(i.forEach(function(m){if(!f.has(m[0])||!f.has(m[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});c--;)l[c]||h(o[c],c,new Set);return s;function h(m,g,y){if(y.has(m)){var v;try{v=", node was:"+JSON.stringify(m)}catch{v=""}throw new Error("Cyclic dependency"+v)}if(!f.has(m))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(m));if(!l[g]){l[g]=!0;var w=u.get(m)||new Set;if(w=Array.from(w),g=w.length){y.add(m);do{var C=w[--g];h(C,f.get(C),y)}while(g);y.delete(m)}s[--a]=m}}}function t(o){for(var i=new Set,a=0,s=o.length;a<s;a++){var l=o[a];i.add(l[0]),i.add(l[1])}return Array.from(i)}function n(o){for(var i=new Map,a=0,s=o.length;a<s;a++){var l=o[a];i.has(l[0])||i.set(l[0],new Set),i.has(l[1])||i.set(l[1],new Set),i.get(l[0]).add(l[1])}return i}function r(o){for(var i=new Map,a=0,s=o.length;a<s;a++)i.set(o[a],a);return i}return Q1.exports}var Qit=Yit();const Xit=Gn(Qit),Jit=Object.prototype.toString,Zit=Error.prototype.toString,eat=RegExp.prototype.toString,tat=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",nat=/^Symbol\((.*)\)(.*)$/;function rat(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function UX(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const n=typeof e;if(n==="number")return rat(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return tat.call(e).replace(nat,"Symbol($1)");const r=Jit.call(e).slice(8,-1);return r==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):r==="Error"||e instanceof Error?"["+Zit.call(e)+"]":r==="RegExp"?eat.call(e):null}function Nu(e,t){let n=UX(e,t);return n!==null?n:JSON.stringify(e,function(r,o){let i=UX(this[r],t);return i!==null?i:o},2)}function kue(e){return e==null?[]:[].concat(e)}let _ue,$ue,Nue,oat=/\$\{\s*(\w+)\s*\}/g;_ue=Symbol.toStringTag;class GX{constructor(t,n,r,o){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[_ue]="Error",this.name="ValidationError",this.value=n,this.path=r,this.type=o,this.errors=[],this.inner=[],kue(t).forEach(i=>{if(Sa.isError(i)){this.errors.push(...i.errors);const a=i.inner.length?i.inner:[i];this.inner.push(...a)}else this.errors.push(i)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}$ue=Symbol.hasInstance;Nue=Symbol.toStringTag;class Sa extends Error{static formatError(t,n){const r=n.label||n.path||"this";return n=Object.assign({},n,{path:r,originalPath:n.path}),typeof t=="string"?t.replace(oat,(o,i)=>Nu(n[i])):typeof t=="function"?t(n):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,n,r,o,i){const a=new GX(t,n,r,o);if(i)return a;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[Nue]="Error",this.name=a.name,this.message=a.message,this.type=a.type,this.value=a.value,this.path=a.path,this.errors=a.errors,this.inner=a.inner,Error.captureStackTrace&&Error.captureStackTrace(this,Sa)}static[$ue](t){return GX[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let dc={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:r})=>{const o=r!=null&&r!==n?` (cast from the value \`${Nu(r,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${Nu(n,!0)}\``+o:`${e} must match the configured type. The validated value was: \`${Nu(n,!0)}\``+o}},ha={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},zd={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},QF={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},XF={isValue:"${path} field must be ${value}"},TE={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},OE={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},iat={notType:e=>{const{path:t,value:n,spec:r}=e,o=r.types.length;if(Array.isArray(n)){if(n.length<o)return`${t} tuple value has too few items, expected a length of ${o} but got ${n.length} for value: \`${Nu(n,!0)}\``;if(n.length>o)return`${t} tuple value has too many items, expected a length of ${o} but got ${n.length} for value: \`${Nu(n,!0)}\``}return Sa.formatError(dc.notType,e)}};Object.assign(Object.create(null),{mixed:dc,string:ha,number:zd,date:QF,object:TE,array:OE,boolean:XF,tuple:iat});const PP=e=>e&&e.__isYupSchema__;class yO{static fromOptions(t,n){if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:o,otherwise:i}=n,a=typeof r=="function"?r:(...s)=>s.every(l=>l===r);return new yO(t,(s,l)=>{var c;let u=a(...s)?o:i;return(c=u==null?void 0:u(l))!=null?c:l})}constructor(t,n){this.fn=void 0,this.refs=t,this.refs=t,this.fn=n}resolve(t,n){let r=this.refs.map(i=>i.getValue(n==null?void 0:n.value,n==null?void 0:n.parent,n==null?void 0:n.context)),o=this.fn(r,t,n);if(o===void 0||o===t)return t;if(!PP(o))throw new TypeError("conditions must return a schema object");return o.resolve(n)}}const X1={context:"$",value:"."};function AP(e,t){return new Kf(e,t)}class Kf{constructor(t,n={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===X1.context,this.isValue=this.key[0]===X1.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?X1.context:this.isValue?X1.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&ah.getter(this.path,!0),this.map=n.map}getValue(t,n,r){let o=this.isContext?r:this.isValue?t:n;return this.getter&&(o=this.getter(o||{})),this.map&&(o=this.map(o)),o}cast(t,n){return this.getValue(t,n==null?void 0:n.parent,n==null?void 0:n.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}Kf.prototype.__isYupRef=!0;const $l=e=>e==null;function tg(e){function t({value:n,path:r="",options:o,originalValue:i,schema:a},s,l){const{name:c,test:u,params:f,message:h,skipAbsent:m}=e;let{parent:g,context:y,abortEarly:v=a.spec.abortEarly,disableStackTrace:w=a.spec.disableStackTrace}=o;function C(_){return Kf.isRef(_)?_.getValue(n,g,y):_}function E(_={}){const N=Object.assign({value:n,originalValue:i,label:a.spec.label,path:_.path||r,spec:a.spec,disableStackTrace:_.disableStackTrace||w},f,_.params);for(const H of Object.keys(N))N[H]=C(N[H]);const B=new Sa(Sa.formatError(_.message||h,N),n,N.path,_.type||c,N.disableStackTrace);return B.params=N,B}const I=v?s:l;let O={path:r,parent:g,type:c,from:o.from,createError:E,resolve:C,options:o,originalValue:i,schema:a};const P=_=>{Sa.isError(_)?I(_):_?l(null):I(E())},R=_=>{Sa.isError(_)?I(_):s(_)};if(m&&$l(n))return P(!0);let M;try{var A;if(M=u.call(O,n,O),typeof((A=M)==null?void 0:A.then)=="function"){if(o.sync)throw new Error(`Validation test of type: "${O.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(M).then(P,R)}}catch(_){R(_);return}P(M)}return t.OPTIONS=e,t}function aat(e,t,n,r=n){let o,i,a;return t?(ah.forEach(t,(s,l,c)=>{let u=l?s.slice(1,s.length-1):s;e=e.resolve({context:r,parent:o,value:n});let f=e.type==="tuple",h=c?parseInt(u,10):0;if(e.innerType||f){if(f&&!c)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${a}" must contain an index to the tuple element, e.g. "${a}[0]"`);if(n&&h>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${s}, in the path: ${t}. because there is no value at that index. `);o=n,n=n&&n[h],e=f?e.spec.types[h]:e.innerType}if(!c){if(!e.fields||!e.fields[u])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${a} which is a type: "${e.type}")`);o=n,n=n&&n[u],e=e.fields[u]}i=u,a=l?"["+s+"]":"."+s}),{schema:e,parent:o,parentPath:i}):{parent:o,parentPath:t,schema:e}}class vO extends Set{describe(){const t=[];for(const n of this.values())t.push(Kf.isRef(n)?n.describe():n);return t}resolveAll(t){let n=[];for(const r of this.values())n.push(t(r));return n}clone(){return new vO(this.values())}merge(t,n){const r=this.clone();return t.forEach(o=>r.add(o)),n.forEach(o=>r.delete(o)),r}}function Cg(e,t=new Map){if(PP(e)||!e||typeof e!="object")return e;if(t.has(e))return t.get(e);let n;if(e instanceof Date)n=new Date(e.getTime()),t.set(e,n);else if(e instanceof RegExp)n=new RegExp(e),t.set(e,n);else if(Array.isArray(e)){n=new Array(e.length),t.set(e,n);for(let r=0;r<e.length;r++)n[r]=Cg(e[r],t)}else if(e instanceof Map){n=new Map,t.set(e,n);for(const[r,o]of e.entries())n.set(r,Cg(o,t))}else if(e instanceof Set){n=new Set,t.set(e,n);for(const r of e)n.add(Cg(r,t))}else if(e instanceof Object){n={},t.set(e,n);for(const[r,o]of Object.entries(e))n[r]=Cg(o,t)}else throw Error(`Unable to clone ${e}`);return n}class is{constructor(t){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new vO,this._blacklist=new vO,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(dc.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(n=>{n.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const n=Object.create(Object.getPrototypeOf(this));return n.type=this.type,n._typeCheck=this._typeCheck,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.internalTests=Object.assign({},this.internalTests),n.exclusiveTests=Object.assign({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=Cg(Object.assign({},this.spec,t)),n}label(t){let n=this.clone();return n.spec.label=t,n}meta(...t){if(t.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},t[0]),n}withMutation(t){let n=this._mutate;this._mutate=!0;let r=t(this);return this._mutate=n,r}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let n=this,r=t.clone();const o=Object.assign({},n.spec,r.spec);return r.spec=o,r.internalTests=Object.assign({},n.internalTests,r.internalTests),r._whitelist=n._whitelist.merge(t._whitelist,t._blacklist),r._blacklist=n._blacklist.merge(t._blacklist,t._whitelist),r.tests=n.tests,r.exclusiveTests=n.exclusiveTests,r.withMutation(i=>{t.tests.forEach(a=>{i.test(a.OPTIONS)})}),r.transforms=[...n.transforms,...r.transforms],r}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let n=this;if(n.conditions.length){let r=n.conditions;n=n.clone(),n.conditions=[],n=r.reduce((o,i)=>i.resolve(o,t),n),n=n.resolve(t)}return n}resolveOptions(t){var n,r,o,i;return Object.assign({},t,{from:t.from||[],strict:(n=t.strict)!=null?n:this.spec.strict,abortEarly:(r=t.abortEarly)!=null?r:this.spec.abortEarly,recursive:(o=t.recursive)!=null?o:this.spec.recursive,disableStackTrace:(i=t.disableStackTrace)!=null?i:this.spec.disableStackTrace})}cast(t,n={}){let r=this.resolve(Object.assign({value:t},n)),o=n.assert==="ignore-optionality",i=r._cast(t,n);if(n.assert!==!1&&!r.isType(i)){if(o&&$l(i))return i;let a=Nu(t),s=Nu(i);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}".
attempted value: ${a}
-`+(s!==a?`result of cast: ${s}`:""))}return i}_cast(t,n){let r=t===void 0?t:this.transforms.reduce((o,i)=>i.call(this,o,t,this),t);return r===void 0&&(r=this.getDefault(n)),r}_validate(t,n={},r,o){let{path:i,originalValue:a=t,strict:s=this.spec.strict}=n,l=t;s||(l=this._cast(l,Object.assign({assert:!1},n)));let c=[];for(let u of Object.values(this.internalTests))u&&c.push(u);this.runTests({path:i,value:l,originalValue:a,options:n,tests:c},r,u=>{if(u.length)return o(u,l);this.runTests({path:i,value:l,originalValue:a,options:n,tests:this.tests},r,o)})}runTests(t,n,r){let o=!1,{tests:i,value:a,originalValue:s,path:l,options:c}=t,u=y=>{o||(o=!0,n(y,a))},f=y=>{o||(o=!0,r(y,a))},h=i.length,m=[];if(!h)return f([]);let g={value:a,originalValue:s,path:l,options:c,schema:this};for(let y=0;y<i.length;y++){const v=i[y];v(g,u,function(C){C&&(Array.isArray(C)?m.push(...C):m.push(C)),--h<=0&&f(m)})}}asNestedTest({key:t,index:n,parent:r,parentPath:o,originalParent:i,options:a}){const s=t??n;if(s==null)throw TypeError("Must include `key` or `index` for nested validations");const l=typeof s=="number";let c=r[s];const u=Object.assign({},a,{strict:!0,parent:r,value:c,originalValue:i[s],key:void 0,[l?"index":"key"]:s,path:l||s.includes(".")?`${o||""}[${l?s:`"${s}"`}]`:(o?`${o}.`:"")+t});return(f,h,m)=>this.resolve(u)._validate(c,u,h,m)}validate(t,n){var r;let o=this.resolve(Object.assign({},n,{value:t})),i=(r=n==null?void 0:n.disableStackTrace)!=null?r:o.spec.disableStackTrace;return new Promise((a,s)=>o._validate(t,n,(l,c)=>{Sa.isError(l)&&(l.value=c),s(l)},(l,c)=>{l.length?s(new Sa(l,c,void 0,void 0,i)):a(c)}))}validateSync(t,n){var r;let o=this.resolve(Object.assign({},n,{value:t})),i,a=(r=n==null?void 0:n.disableStackTrace)!=null?r:o.spec.disableStackTrace;return o._validate(t,Object.assign({},n,{sync:!0}),(s,l)=>{throw Sa.isError(s)&&(s.value=l),s},(s,l)=>{if(s.length)throw new Sa(s,t,void 0,void 0,a);i=l}),i}isValid(t,n){return this.validate(t,n).then(()=>!0,r=>{if(Sa.isError(r))return!1;throw r})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(r){if(Sa.isError(r))return!1;throw r}}_getDefault(t){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,t):Cg(n)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,n){const r=this.clone({nullable:t});return r.internalTests.nullable=tg({message:n,name:"nullable",test(o){return o===null?this.schema.spec.nullable:!0}}),r}optionality(t,n){const r=this.clone({optional:t});return r.internalTests.optionality=tg({message:n,name:"optionality",test(o){return o===void 0?this.schema.spec.optional:!0}}),r}optional(){return this.optionality(!0)}defined(t=dc.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=dc.notNull){return this.nullability(!1,t)}required(t=dc.required){return this.clone().withMutation(n=>n.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let n=this.clone();return n.transforms.push(t),n}test(...t){let n;if(t.length===1?typeof t[0]=="function"?n={test:t[0]}:n=t[0]:t.length===2?n={name:t[0],test:t[1]}:n={name:t[0],message:t[1],test:t[2]},n.message===void 0&&(n.message=dc.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),o=tg(n),i=n.exclusive||n.name&&r.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(r.exclusiveTests[n.name]=!!n.exclusive),r.tests=r.tests.filter(a=>!(a.OPTIONS.name===n.name&&(i||a.OPTIONS.test===o.OPTIONS.test))),r.tests.push(o),r}when(t,n){!Array.isArray(t)&&typeof t!="string"&&(n=t,t=".");let r=this.clone(),o=kue(t).map(i=>new Kf(i));return o.forEach(i=>{i.isSibling&&r.deps.push(i.key)}),r.conditions.push(typeof n=="function"?new yO(o,n):yO.fromOptions(o,n)),r}typeError(t){let n=this.clone();return n.internalTests.typeError=tg({message:t,name:"typeError",skipAbsent:!0,test(r){return this.schema._typeCheck(r)?!0:this.createError({params:{type:this.schema.type}})}}),n}oneOf(t,n=dc.oneOf){let r=this.clone();return t.forEach(o=>{r._whitelist.add(o),r._blacklist.delete(o)}),r.internalTests.whiteList=tg({message:n,name:"oneOf",skipAbsent:!0,test(o){let i=this.schema._whitelist,a=i.resolveAll(this.resolve);return a.includes(o)?!0:this.createError({params:{values:Array.from(i).join(", "),resolved:a}})}}),r}notOneOf(t,n=dc.notOneOf){let r=this.clone();return t.forEach(o=>{r._blacklist.add(o),r._whitelist.delete(o)}),r.internalTests.blacklist=tg({message:n,name:"notOneOf",test(o){let i=this.schema._blacklist,a=i.resolveAll(this.resolve);return a.includes(o)?this.createError({params:{values:Array.from(i).join(", "),resolved:a}}):!0}}),r}strip(t=!0){let n=this.clone();return n.spec.strip=t,n}describe(t){const n=(t?this.resolve(t):this).clone(),{label:r,meta:o,optional:i,nullable:a}=n.spec;return{meta:o,label:r,optional:i,nullable:a,default:n.getDefault(t),type:n.type,oneOf:n._whitelist.describe(),notOneOf:n._blacklist.describe(),tests:n.tests.map(l=>({name:l.OPTIONS.name,params:l.OPTIONS.params})).filter((l,c,u)=>u.findIndex(f=>f.name===l.name)===c)}}}is.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])is.prototype[`${e}At`]=function(t,n,r={}){const{parent:o,parentPath:i,schema:a}=aat(this,t,n,r.context);return a[e](o&&o[i],Object.assign({},r,{parent:o,path:t}))};for(const e of["equals","is"])is.prototype[e]=is.prototype.oneOf;for(const e of["not","nope"])is.prototype[e]=is.prototype.notOneOf;function Lu(){return new Lue}class Lue extends is{constructor(){super({type:"boolean",check(t){return t instanceof Boolean&&(t=t.valueOf()),typeof t=="boolean"}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(r.spec.coerce&&!r.isType(t)){if(/^(true|1)$/i.test(String(t)))return!0;if(/^(false|0)$/i.test(String(t)))return!1}return t})})}isTrue(t=XF.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"true"},test(n){return $l(n)||n===!0}})}isFalse(t=XF.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"false"},test(n){return $l(n)||n===!1}})}default(t){return super.default(t)}defined(t){return super.defined(t)}optional(){return super.optional()}required(t){return super.required(t)}notRequired(){return super.notRequired()}nullable(){return super.nullable()}nonNullable(t){return super.nonNullable(t)}strip(t){return super.strip(t)}}Lu.prototype=Lue.prototype;const sat=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function lat(e){const t=JF(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(t.z===void 0&&t.plusMinus===void 0)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let n=0;return t.z!=="Z"&&t.plusMinus!==void 0&&(n=t.hourOffset*60+t.minuteOffset,t.plusMinus==="+"&&(n=0-n)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+n,t.second,t.millisecond)}function JF(e){var t,n;const r=sat.exec(e);return r?{year:vu(r[1]),month:vu(r[2],1)-1,day:vu(r[3],1),hour:vu(r[4]),minute:vu(r[5]),second:vu(r[6]),millisecond:r[7]?vu(r[7].substring(0,3)):0,precision:(t=(n=r[7])==null?void 0:n.length)!=null?t:void 0,z:r[8]||void 0,plusMinus:r[9]||void 0,hourOffset:vu(r[10]),minuteOffset:vu(r[11])}:null}function vu(e,t=0){return Number(e)||t}let cat=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,uat=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,dat=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,fat="^\\d{4}-\\d{2}-\\d{2}",pat="\\d{2}:\\d{2}:\\d{2}",hat="(([+-]\\d{2}(:?\\d{2})?)|Z)",mat=new RegExp(`${fat}T${pat}(\\.\\d+)?${hat}$`),gat=e=>$l(e)||e===e.trim(),yat={}.toString();function Ho(){return new Fue}class Fue extends is{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(!r.spec.coerce||r.isType(t)||Array.isArray(t))return t;const o=t!=null&&t.toString?t.toString():t;return o===yat?t:o})})}required(t){return super.required(t).withMutation(n=>n.test({message:t||dc.required,name:"required",skipAbsent:!0,test:r=>!!r.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(n=>n.OPTIONS.name!=="required"),t))}length(t,n=ha.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(r){return r.length===this.resolve(t)}})}min(t,n=ha.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r.length>=this.resolve(t)}})}max(t,n=ha.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:t},skipAbsent:!0,test(r){return r.length<=this.resolve(t)}})}matches(t,n){let r=!1,o,i;return n&&(typeof n=="object"?{excludeEmptyString:r=!1,message:o,name:i}=n:o=n),this.test({name:i||"matches",message:o||ha.matches,params:{regex:t},skipAbsent:!0,test:a=>a===""&&r||a.search(t)!==-1})}email(t=ha.email){return this.matches(cat,{name:"email",message:t,excludeEmptyString:!0})}url(t=ha.url){return this.matches(uat,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=ha.uuid){return this.matches(dat,{name:"uuid",message:t,excludeEmptyString:!1})}datetime(t){let n="",r,o;return t&&(typeof t=="object"?{message:n="",allowOffset:r=!1,precision:o=void 0}=t:n=t),this.matches(mat,{name:"datetime",message:n||ha.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||ha.datetime_offset,params:{allowOffset:r},skipAbsent:!0,test:i=>{if(!i||r)return!0;const a=JF(i);return a?!!a.z:!1}}).test({name:"datetime_precision",message:n||ha.datetime_precision,params:{precision:o},skipAbsent:!0,test:i=>{if(!i||o==null)return!0;const a=JF(i);return a?a.precision===o:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=ha.trim){return this.transform(n=>n!=null?n.trim():n).test({message:t,name:"trim",test:gat})}lowercase(t=ha.lowercase){return this.transform(n=>$l(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>$l(n)||n===n.toLowerCase()})}uppercase(t=ha.uppercase){return this.transform(n=>$l(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>$l(n)||n===n.toUpperCase()})}}Ho.prototype=Fue.prototype;let vat=e=>e!=+e;function Do(){return new jue}class jue extends is{constructor(){super({type:"number",check(t){return t instanceof Number&&(t=t.valueOf()),typeof t=="number"&&!vat(t)}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(!r.spec.coerce)return t;let o=t;if(typeof o=="string"){if(o=o.replace(/\s/g,""),o==="")return NaN;o=+o}return r.isType(o)||o===null?o:parseFloat(o)})})}min(t,n=zd.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r>=this.resolve(t)}})}max(t,n=zd.max){return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(r){return r<=this.resolve(t)}})}lessThan(t,n=zd.lessThan){return this.test({message:n,name:"max",exclusive:!0,params:{less:t},skipAbsent:!0,test(r){return r<this.resolve(t)}})}moreThan(t,n=zd.moreThan){return this.test({message:n,name:"min",exclusive:!0,params:{more:t},skipAbsent:!0,test(r){return r>this.resolve(t)}})}positive(t=zd.positive){return this.moreThan(0,t)}negative(t=zd.negative){return this.lessThan(0,t)}integer(t=zd.integer){return this.test({name:"integer",message:t,skipAbsent:!0,test:n=>Number.isInteger(n)})}truncate(){return this.transform(t=>$l(t)?t:t|0)}round(t){var n;let r=["ceil","floor","round","trunc"];if(t=((n=t)==null?void 0:n.toLowerCase())||"round",t==="trunc")return this.truncate();if(r.indexOf(t.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+r.join(", "));return this.transform(o=>$l(o)?o:Math[t](o))}}Do.prototype=jue.prototype;let Bue=new Date(""),bat=e=>Object.prototype.toString.call(e)==="[object Date]";function Xs(){return new $w}class $w extends is{constructor(){super({type:"date",check(t){return bat(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,n,r)=>!r.spec.coerce||r.isType(t)||t===null?t:(t=lat(t),isNaN(t)?$w.INVALID_DATE:new Date(t)))})}prepareParam(t,n){let r;if(Kf.isRef(t))r=t;else{let o=this.cast(t);if(!this._typeCheck(o))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);r=o}return r}min(t,n=QF.min){let r=this.prepareParam(t,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(o){return o>=this.resolve(r)}})}max(t,n=QF.max){let r=this.prepareParam(t,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(o){return o<=this.resolve(r)}})}}$w.INVALID_DATE=Bue;Xs.prototype=$w.prototype;Xs.INVALID_DATE=Bue;function xat(e,t=[]){let n=[],r=new Set,o=new Set(t.map(([a,s])=>`${a}-${s}`));function i(a,s){let l=ah.split(a)[0];r.add(l),o.has(`${s}-${l}`)||n.push([s,l])}for(const a of Object.keys(e)){let s=e[a];r.add(a),Kf.isRef(s)&&s.isSibling?i(s.path,a):PP(s)&&"deps"in s&&s.deps.forEach(l=>i(l,a))}return Xit.array(Array.from(r),n).reverse()}function qX(e,t){let n=1/0;return e.some((r,o)=>{var i;if((i=t.path)!=null&&i.includes(r))return n=o,!0}),n}function zue(e){return(t,n)=>qX(e,t)-qX(e,n)}const Vue=(e,t,n)=>{if(typeof e!="string")return e;let r=e;try{r=JSON.parse(e)}catch{}return n.isType(r)?r:e};function IE(e){if("fields"in e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=IE(r);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=IE(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(IE)}):"optional"in e?e.optional():e}const Sat=(e,t)=>{const n=[...ah.normalizePath(t)];if(n.length===1)return n[0]in e;let r=n.pop(),o=ah.getter(ah.join(n),!0)(e);return!!(o&&r in o)};let WX=e=>Object.prototype.toString.call(e)==="[object Object]";function KX(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(r=>n.indexOf(r)===-1)}const wat=zue([]);function Wo(e){return new Hue(e)}class Hue extends is{constructor(t){super({type:"object",check(n){return WX(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=wat,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,n={}){var r;let o=super._cast(t,n);if(o===void 0)return this.getDefault(n);if(!this._typeCheck(o))return o;let i=this.fields,a=(r=n.stripUnknown)!=null?r:this.spec.noUnknown,s=[].concat(this._nodes,Object.keys(o).filter(f=>!this._nodes.includes(f))),l={},c=Object.assign({},n,{parent:l,__validating:n.__validating||!1}),u=!1;for(const f of s){let h=i[f],m=f in o;if(h){let g,y=o[f];c.path=(n.path?`${n.path}.`:"")+f,h=h.resolve({value:y,context:n.context,parent:l});let v=h instanceof is?h.spec:void 0,w=v==null?void 0:v.strict;if(v!=null&&v.strip){u=u||f in o;continue}g=!n.__validating||!w?h.cast(o[f],c):o[f],g!==void 0&&(l[f]=g)}else m&&!a&&(l[f]=o[f]);(m!==f in l||l[f]!==o[f])&&(u=!0)}return u?l:o}_validate(t,n={},r,o){let{from:i=[],originalValue:a=t,recursive:s=this.spec.recursive}=n;n.from=[{schema:this,value:a},...i],n.__validating=!0,n.originalValue=a,super._validate(t,n,r,(l,c)=>{if(!s||!WX(c)){o(l,c);return}a=a||c;let u=[];for(let f of this._nodes){let h=this.fields[f];!h||Kf.isRef(h)||u.push(h.asNestedTest({options:n,key:f,parent:c,parentPath:n.path,originalParent:a}))}this.runTests({tests:u,value:c,originalValue:a,options:n},r,f=>{o(f.sort(this._sortErrors).concat(l),c)})})}clone(t){const n=super.clone(t);return n.fields=Object.assign({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(t){let n=super.concat(t),r=n.fields;for(let[o,i]of Object.entries(this.fields)){const a=r[o];r[o]=a===void 0?i:a}return n.withMutation(o=>o.setFields(r,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let n={};return this._nodes.forEach(r=>{var o;const i=this.fields[r];let a=t;(o=a)!=null&&o.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[r]})),n[r]=i&&"getDefault"in i?i.getDefault(a):void 0}),n}setFields(t,n){let r=this.clone();return r.fields=t,r._nodes=xat(t,n),r._sortErrors=zue(Object.keys(t)),n&&(r._excludedEdges=n),r}shape(t,n=[]){return this.clone().withMutation(r=>{let o=r._excludedEdges;return n.length&&(Array.isArray(n[0])||(n=[n]),o=[...r._excludedEdges,...n]),r.setFields(Object.assign(r.fields,t),o)})}partial(){const t={};for(const[n,r]of Object.entries(this.fields))t[n]="optional"in r&&r.optional instanceof Function?r.optional():r;return this.setFields(t)}deepPartial(){return IE(this)}pick(t){const n={};for(const r of t)this.fields[r]&&(n[r]=this.fields[r]);return this.setFields(n,this._excludedEdges.filter(([r,o])=>t.includes(r)&&t.includes(o)))}omit(t){const n=[];for(const r of Object.keys(this.fields))t.includes(r)||n.push(r);return this.pick(n)}from(t,n,r){let o=ah.getter(t,!0);return this.transform(i=>{if(!i)return i;let a=i;return Sat(i,t)&&(a=Object.assign({},i),r||delete a[t],a[n]=o(i)),a})}json(){return this.transform(Vue)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||TE.exact,test(n){if(n==null)return!0;const r=KX(this.schema,n);return r.length===0||this.createError({params:{properties:r.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,n=TE.noUnknown){typeof t!="boolean"&&(n=t,t=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:n,test(o){if(o==null)return!0;const i=KX(this.schema,o);return!t||i.length===0||this.createError({params:{unknown:i.join(", ")}})}});return r.spec.noUnknown=t,r}unknown(t=!0,n=TE.noUnknown){return this.noUnknown(!t,n)}transformKeys(t){return this.transform(n=>{if(!n)return n;const r={};for(const o of Object.keys(n))r[t(o)]=n[o];return r})}camelCase(){return this.transformKeys(s$.camelCase)}snakeCase(){return this.transformKeys(s$.snakeCase)}constantCase(){return this.transformKeys(t=>s$.snakeCase(t).toUpperCase())}describe(t){const n=(t?this.resolve(t):this).clone(),r=super.describe(t);r.fields={};for(const[i,a]of Object.entries(n.fields)){var o;let s=t;(o=s)!=null&&o.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[i]})),r.fields[i]=a.describe(s)}return r}}Wo.prototype=Hue.prototype;function sh(e){return new Uue(e)}class Uue extends is{constructor(t){super({type:"array",spec:{types:t},check(n){return Array.isArray(n)}}),this.innerType=void 0,this.innerType=t}_cast(t,n){const r=super._cast(t,n);if(!this._typeCheck(r)||!this.innerType)return r;let o=!1;const i=r.map((a,s)=>{const l=this.innerType.cast(a,Object.assign({},n,{path:`${n.path||""}[${s}]`}));return l!==a&&(o=!0),l});return o?i:r}_validate(t,n={},r,o){var i;let a=this.innerType,s=(i=n.recursive)!=null?i:this.spec.recursive;n.originalValue!=null&&n.originalValue,super._validate(t,n,r,(l,c)=>{var u;if(!s||!a||!this._typeCheck(c)){o(l,c);return}let f=new Array(c.length);for(let m=0;m<c.length;m++){var h;f[m]=a.asNestedTest({options:n,index:m,parent:c,parentPath:n.path,originalParent:(h=n.originalValue)!=null?h:t})}this.runTests({value:c,tests:f,originalValue:(u=n.originalValue)!=null?u:t,options:n},r,m=>o(m.concat(l),c))})}clone(t){const n=super.clone(t);return n.innerType=this.innerType,n}json(){return this.transform(Vue)}concat(t){let n=super.concat(t);return n.innerType=this.innerType,t.innerType&&(n.innerType=n.innerType?n.innerType.concat(t.innerType):t.innerType),n}of(t){let n=this.clone();if(!PP(t))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+Nu(t));return n.innerType=t,n.spec=Object.assign({},n.spec,{types:t}),n}length(t,n=OE.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(r){return r.length===this.resolve(t)}})}min(t,n){return n=n||OE.min,this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r.length>=this.resolve(t)}})}max(t,n){return n=n||OE.max,this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(r){return r.length<=this.resolve(t)}})}ensure(){return this.default(()=>[]).transform((t,n)=>this._typeCheck(t)?t:n==null?[]:[].concat(n))}compact(t){let n=t?(r,o,i)=>!t(r,o,i):r=>!!r;return this.transform(r=>r!=null?r.filter(n):r)}describe(t){const n=(t?this.resolve(t):this).clone(),r=super.describe(t);if(n.innerType){var o;let i=t;(o=i)!=null&&o.value&&(i=Object.assign({},i,{parent:i.value,value:i.value[0]})),r.innerType=n.innerType.describe(i)}return r}}sh.prototype=Uue.prototype;const MV=({planId:e,entry:t,mealId:n,meals:r,closeFn:o})=>{const i=n===void 0?null:n,a=r===void 0?[]:r,[s,l]=je(),c=rFe(e),u=oFe(e),[f,h]=x.useState(t?xt.fromJSDate(t.datetime):xt.now()),[m,g]=x.useState(i),y=Wo({amount:Do().required(s("forms.fieldRequired")).max(1e3,s("forms.maxValue",{value:"1000"})).min(1,s("forms.minValue",{value:"1"})),ingredient:Do().required(s("forms.fieldRequired")),datetime:Xs().required(s("forms.fieldRequired"))});return S(Ti,{initialValues:{datetime:new Date,amount:0,ingredient:0},validationSchema:y,onSubmit:async v=>{const w={...v,plan:e,meal:m,weight_unit:null,datetime:v.datetime.toISOString()};t?u.mutate({...w,id:t.id}):c.mutate(w),o&&o()},children:v=>S(fi,{children:Q(Ft,{spacing:2,children:[S(vV,{callback:w=>v.setFieldValue("ingredient",w==null?void 0:w.data.id)}),S(dn,{fullWidth:!0,id:"amount",label:"amount",InputProps:{endAdornment:S(So,{position:"end",children:s("nutrition.gramShort")})},error:v.touched.amount&&!!v.errors.amount,helperText:v.touched.amount&&v.errors.amount,...v.getFieldProps("amount")}),a.length>0&&S(_c,{value:m,options:a.map(w=>w.id),getOptionLabel:w=>a.find(C=>C.id===w).displayName,onChange:(w,C)=>g(C),renderInput:w=>S(dn,{label:s("nutrition.meal"),value:m,...w})}),S(Ys,{dateAdapter:zl,adapterLocale:l.language,children:S(Itt,{format:"yyyy-MM-dd HH:mm",label:s("date"),value:f,disableFuture:!0,onChange:w=>{v.setFieldValue("datetime",w==null?void 0:w.toJSDate()),h(w)},shouldDisableDate:w=>(t&&Jn(t.datetime)===Jn(w.toJSDate()),!1)})}),Q(Ft,{direction:"row",justifyContent:"end",spacing:2,children:[o!==void 0&&S(ct,{color:"primary",variant:"outlined",onClick:()=>o(),children:s("close")}),S(ct,{color:"primary",variant:"contained",type:"submit",children:s("submit")})]})]})})})},RV=({plan:e,closeFn:t})=>{const[n]=je(),r=ZLe(),o=tFe(e==null?void 0:e.id),[i,a]=x.useState(e==null?void 0:e.hasAnyGoals),[s,l]=x.useState(e?xt.fromJSDate(e.start):xt.now),[c,u]=x.useState(e&&(e==null?void 0:e.end)!==null?xt.fromJSDate(e.end):null),f=Wo({description:Ho().required().max(25,n("forms.maxLength",{chars:"25"})).min(3,n("forms.minLength",{chars:"3"})),onlyLogging:Lu(),goalEnergy:Do().notRequired().positive().max(6e3,n("forms.maxValue",{value:"6000kcal"})),goalProtein:Do().notRequired().positive().max(500,n("forms.maxValue",{value:"500"})),goalCarbohydrates:Do().notRequired().positive().max(750,n("forms.maxValue",{value:"750"})),goalFiber:Do().notRequired().positive().max(500,n("forms.maxValue",{value:"500"})),goalFat:Do().notRequired().positive().max(500,n("forms.maxValue",{value:"500"})),start:Xs().required(),end:Xs().required().min(AP("start"),n("forms.endBeforeStart"))});return S(Ti,{initialValues:{description:e?e.description:n("nutrition.plan"),start:Jn(new Date),end:Jn(new Date),onlyLogging:e?e.onlyLogging:!0,goalEnergy:e?e.goalEnergy:null,goalProtein:e?e.goalProtein:null,goalCarbohydrates:e?e.goalCarbohydrates:null,goalFiber:e?e.goalFiber:null,goalFat:e?e.goalFat:null},validationSchema:f,onSubmit:async h=>{h.goalEnergy=h.goalEnergy?h.goalEnergy:null,h.goalProtein=h.goalProtein?h.goalProtein:null,h.goalCarbohydrates=h.goalCarbohydrates?h.goalCarbohydrates:null,h.goalFiber=h.goalFiber?h.goalFiber:null,h.goalFat=h.goalFat?h.goalFat:null,i||(h.goalEnergy=null,h.goalProtein=null,h.goalCarbohydrates=null,h.goalFiber=null,h.goalFat=null);const m=new SI({start:new Date(h.start),end:h.end?new Date(h.end):null,description:h.description,onlyLogging:h.onlyLogging,goalEnergy:h.goalEnergy,goalProtein:h.goalProtein,goalCarbohydrates:h.goalCarbohydrates,goalFiber:h.goalFiber,goalFat:h.goalFat});e?(m.id=e.id,o.mutate(m)):r.mutate(m),t&&t()},children:h=>S(fi,{children:Q(Ft,{spacing:2,children:[S(dn,{fullWidth:!0,id:"description",label:n("description"),error:h.touched.description&&!!h.errors.description,helperText:h.touched.description&&h.errors.description,...h.getFieldProps("description")}),Q(me,{container:!0,spacing:1,children:[S(me,{size:6,children:S(Ys,{dateAdapter:zl,adapterLocale:hr.language,children:S(Ih,{format:"yyyy-MM-dd",label:n("start"),value:s,slotProps:{textField:{variant:"standard",fullWidth:!0,error:h.touched.start&&!!h.errors.start,helperText:h.touched.start&&h.errors.start?String(h.errors.start):""}},onChange:m=>{m&&h.setFieldValue("start",m.toJSDate()),l(m)}})})}),S(me,{size:6,children:S(Ys,{dateAdapter:zl,adapterLocale:hr.language,children:S(Ih,{format:"yyyy-MM-dd",label:n("end"),value:c,slotProps:{textField:{variant:"standard",fullWidth:!0,error:h.touched.end&&!!h.errors.end,helperText:h.touched.end&&h.errors.end?String(h.errors.end):""}},onChange:m=>{m&&h.setFieldValue("end",m.toJSDate()),u(m)}})})})]}),S(Mx,{children:S(os,{label:n("nutrition.onlyLoggingHelpText"),control:S(qo,{id:"onlyLogging",checked:h.values.onlyLogging,...h.getFieldProps("onlyLogging")})})}),S(Mx,{children:S(os,{label:n("nutrition.useGoalsHelpText"),control:S(qo,{id:"goalEnergy",checked:i,onChange:()=>a(!i)})})}),S(aw,{children:n("nutrition.useGoalsHelpTextLong")}),i&&Q(Tt,{children:[S(dn,{fullWidth:!0,id:"energy",label:n("nutrition.goalEnergy"),error:h.touched.goalEnergy&&!!h.errors.goalEnergy,helperText:h.touched.goalEnergy&&h.errors.goalEnergy,...h.getFieldProps("goalEnergy"),InputProps:{endAdornment:S(So,{position:"end",children:n("nutrition.kcal")})}}),Q(me,{container:!0,spacing:1,children:[S(me,{size:4,children:S(dn,{id:"protein",fullWidth:!0,label:n("nutrition.goalProtein"),error:h.touched.goalProtein&&!!h.errors.goalProtein,helperText:h.touched.goalProtein&&h.errors.goalProtein,...h.getFieldProps("goalProtein"),InputProps:{startAdornment:S(So,{position:"start",children:h.values.goalProtein!==null&&h.values.goalProtein!==void 0?n("nutrition.valueEnergyKcal",{value:h.values.goalProtein*_g.protein}):""}),endAdornment:S(So,{position:"end",children:n("nutrition.gramShort")})}})}),S(me,{size:4,children:S(dn,{id:"carbohydrates",fullWidth:!0,label:n("nutrition.goalCarbohydrates"),error:h.touched.goalCarbohydrates&&!!h.errors.goalCarbohydrates,helperText:h.touched.goalCarbohydrates&&h.errors.goalCarbohydrates,...h.getFieldProps("goalCarbohydrates"),InputProps:{startAdornment:S(So,{position:"start",children:h.values.goalCarbohydrates!==null&&h.values.goalCarbohydrates!==void 0?n("nutrition.valueEnergyKcal",{value:h.values.goalCarbohydrates*_g.carbohydrates}):""}),endAdornment:S(So,{position:"end",children:n("nutrition.gramShort")})}})}),S(me,{size:4,children:S(dn,{id:"fat",fullWidth:!0,label:n("nutrition.goalFat"),error:h.touched.goalFat&&!!h.errors.goalFat,helperText:h.touched.goalFat&&h.errors.goalFat,...h.getFieldProps("goalFat"),InputProps:{startAdornment:S(So,{position:"start",children:h.values.goalFat!==null&&h.values.goalFat!==void 0?n("nutrition.valueEnergyKcal",{value:h.values.goalFat*_g.fat}):""}),endAdornment:S(So,{position:"end",children:n("nutrition.gramShort")})}})})]}),S(me,{container:!0,spacing:1,children:S(me,{size:4,children:S(dn,{id:"fiber",fullWidth:!0,label:n("nutrition.goalFiber"),error:h.touched.goalFiber&&!!h.errors.goalFiber,helperText:h.touched.goalFiber&&h.errors.goalFiber,...h.getFieldProps("goalFiber"),InputProps:{startAdornment:S(So,{position:"start",children:n("nutrition.valueEnergyKcal",{value:0})}),endAdornment:S(So,{position:"end",children:n("nutrition.gramShort")})}})})})]}),S(Ft,{direction:"row",justifyContent:"end",sx:{mt:2},children:S(ct,{color:"primary",variant:"contained",type:"submit",sx:{mt:2},children:n("submit")})})]})})})},Gue=()=>{const[e]=je(),t=QLe();return t.isLoading?S(Er,{}):t.data!==null?S(Cat,{plan:t.data}):S(gB,{title:e("nutritionalPlan"),modalContent:S(RV,{}),modalTitle:e("add")})};function Cat(e){const[t,n]=je(),[r,o]=J.useState(!1),i=()=>o(!0),a=()=>o(!1);return Q(Tt,{children:[Q(ho,{children:[S(Jl,{title:t("nutritionalPlan"),subheader:e.plan.description}),Q(Fi,{sx:{height:"500px",overflow:"auto"},children:[S(hYe,{percentage:e.plan.percentageValuesLoggedToday,planned:e.plan.plannedNutritionalValues,logged:e.plan.loggedNutritionalValuesToday}),S(ai,{children:e.plan.meals.map(s=>S(Eat,{meal:s,planId:e.plan.id},s.id))})]}),Q(ll,{sx:{justifyContent:"space-between",alignItems:"flex-start"},children:[S(ct,{size:"small",href:cn(Qt.NUTRITION_DETAIL,n.language,{id:e.plan.id}),children:t("seeDetails")}),S(Go,{title:t("nutrition.logThisMealItem"),children:S(pn,{onClick:i,children:S(lw,{})})})]})]}),S(Bi,{title:t("nutrition.addNutritionalDiary"),isOpen:r,closeFn:a,children:S(MV,{closeFn:a,planId:e.plan.id,meals:e.plan.meals})})]})}const Eat=e=>{const[t,n]=je(),r=oie(e.planId),[o,i]=x.useState(!1),[a,s]=J.useState(!1),l=()=>i(!o),c=(m,g)=>{g!=="clickaway"&&s(!1)},u=m=>{const g=[{plan:e.planId,meal:e.meal.id,mealItem:m.id,ingredient:m.ingredientId,weight_unit:m.weightUnitId,datetime:new Date().toISOString(),amount:m.amount}];r.mutate(g),s(!0)},f=e.meal.name?e.meal.name:nT(e.meal.time,n.language),h=e.meal.name?nT(e.meal.time,n.language):null;return Q(Tt,{children:[Q(Fl,{onClick:l,selected:o,children:[S(nl,{children:o?S(J0,{}):S(Du,{})}),S(Wr,{primary:f,secondary:h})]}),S(aa,{in:o,timeout:"auto",unmountOnExit:!0,children:S(ai,{children:e.meal.items.map(m=>{var g,y,v,w;return Q(Co,{secondaryAction:S(Go,{title:t("nutrition.logThisMealItem"),children:S(pn,{edge:"end",onClick:()=>u(m),children:S(lw,{})})}),children:[S(fB,{children:S(Kl,{alt:(g=m.ingredient)==null?void 0:g.name,src:(v=(y=m.ingredient)==null?void 0:y.image)==null?void 0:v.url,sx:{width:45,height:45},children:S(Ju,{})})}),S(Wr,{primary:(w=m.ingredient)==null?void 0:w.name,secondary:$n(m.amount,n.language)})]},m.id)})})}),S(dI,{open:a,autoHideDuration:EI,onClose:c,children:S(Ci,{onClose:c,severity:"success",sx:{width:"100%"},children:t("nutrition.diaryEntrySaved")})})]})},que=Ot(k.jsx("path",{d:"M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16H5V8h14zM7 10h5v5H7z"}));function Kc(e){return yr({queryKey:[st.ROUTINE_DETAIL,e],queryFn:()=>lNe(e)})}function Tat(e){return yr({queryKey:[st.ROUTINE_STATS,e],queryFn:()=>vNe(e)})}function Wue(e){return yr({queryKey:[st.ROUTINE_LOG_DATA,e],queryFn:()=>yNe(e)})}function Oat(){return yr({queryKey:[st.ROUTINES_SHALLOW],queryFn:cNe})}function Iat(){return yr({queryKey:[st.PRIVATE_TEMPLATES],queryFn:uNe})}function Pat(){return yr({queryKey:[st.PUBLIC_TEMPLATES],queryFn:dNe})}function Aat(){return yr({queryKey:[st.ROUTINES_ACTIVE],queryFn:sNe})}const Mat=()=>{const e=Mt();return Dt({mutationFn:t=>fNe(t),onSuccess:()=>e.invalidateQueries({queryKey:[st.ROUTINE_OVERVIEW]})})},Kue=e=>{const t=Mt();return Dt({mutationFn:n=>pNe(n),onSuccess:()=>{t.invalidateQueries({queryKey:[st.ROUTINE_OVERVIEW]}),t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})}})},Rat=e=>{const t=Mt();return Dt({mutationFn:()=>hNe(e),onSuccess:()=>{t.invalidateQueries({queryKey:[st.ROUTINE_OVERVIEW]}),t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})}})},Dat=e=>{const t=Mt();return Dt({mutationFn:n=>oLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},kat=e=>{const t=Mt();return Dt({mutationFn:n=>iLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},_at=e=>{const t=Mt();return Dt({mutationFn:n=>aLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},$at=e=>{const t=Mt();return Dt({mutationFn:n=>sLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Nat=e=>{const t=Mt();return Dt({mutationFn:n=>lLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Lat=e=>{const t=Mt();return Dt({mutationFn:n=>cLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Fat=e=>{const t=Mt();return Dt({mutationFn:n=>uLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},jat=e=>{const t=Mt();return Dt({mutationFn:n=>dLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Bat=e=>{const t=Mt();return Dt({mutationFn:n=>fLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},zat=e=>{const t=Mt();return Dt({mutationFn:n=>pLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Vat=e=>{const t=Mt();return Dt({mutationFn:n=>hLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},YX=e=>{const t=Mt();return Dt({mutationFn:n=>mLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Hat=e=>{const t=Mt();return Dt({mutationFn:n=>gLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Uat=e=>{const t=Mt();return Dt({mutationFn:n=>yLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Gat=e=>{const t=Mt();return Dt({mutationFn:n=>vLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},qat=e=>{const t=Mt();return Dt({mutationFn:n=>bLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Wat=e=>{const t=Mt();return Dt({mutationFn:n=>xLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Kat=e=>{const t=Mt();return Dt({mutationFn:n=>SLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Yue=e=>{const t=Mt();return Dt({mutationFn:n=>wLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Que=e=>{const t=Mt();return Dt({mutationFn:n=>CLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Xue=e=>{const t=Mt();return Dt({mutationFn:n=>ELe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Yat=e=>{const t=Mt();return Dt({mutationFn:n=>TLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Qat=e=>{const t=Mt();return Dt({mutationFn:n=>OLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Xat=e=>{const t=Mt();return Dt({mutationFn:n=>ILe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Jat=e=>{const t=Mt();return Dt({mutationFn:n=>PLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Zat=e=>{const t=Mt();return Dt({mutationFn:n=>ALe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},est=e=>{const t=Mt();return Dt({mutationFn:n=>MLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},tst=e=>{const t=Mt();return Dt({mutationFn:n=>RLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},nst=e=>{const t=Mt();return Dt({mutationFn:n=>DLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},rst=e=>{const t=Mt();return Dt({mutationFn:n=>kLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},ost=e=>{const t=Mt();return Dt({mutationFn:n=>QNe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},ist=e=>{const t=Mt();return Dt({mutationFn:n=>XNe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},ast=e=>{const t=Mt();return Dt({mutationFn:n=>JNe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},sst=e=>{const t=Mt();return Dt({mutationFn:n=>ZNe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})};function lst(e){const t=Mt();return Dt({mutationFn:n=>UNe(n),onSuccess:()=>{t.invalidateQueries({queryKey:[st.ROUTINE_LOG_DATA,e]}),t.invalidateQueries({queryKey:[st.ROUTINE_STATS,e]})}})}function cst(e){const t=Mt();return Dt({mutationFn:n=>GNe(n),onSuccess:()=>{t.invalidateQueries({queryKey:[st.ROUTINE_LOGS,e]}),t.invalidateQueries({queryKey:[st.ROUTINE_STATS,e]})}})}function ust(e){const t=Mt();return Dt({mutationFn:n=>qNe(n),onSuccess:()=>{t.invalidateQueries({queryKey:[st.ROUTINE_LOGS,e]}),t.invalidateQueries({queryKey:[st.ROUTINE_STATS,e]})}})}const Nw=e=>{const t=Mt();return Dt({mutationFn:n=>WNe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},dst=e=>{const t=Mt();return Dt({mutationFn:n=>YNe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},fst=e=>{const t=Mt();return Dt({mutationFn:n=>KNe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},pst=()=>yr({queryKey:[st.ROUTINE_WEIGHT_UNITS],queryFn:Qoe}),hst=()=>yr({queryKey:[st.ROUTINE_REP_UNITS],queryFn:Yoe}),mst=e=>{const t=Mt();return Dt({mutationFn:n=>eLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},gst=e=>{const t=Mt();return Dt({mutationFn:n=>tLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},yst=e=>{const t=Mt();return Dt({mutationFn:n=>nLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},vst=e=>{const t=Mt();return Dt({mutationFn:n=>rLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},bst=(e,t)=>yr({queryFn:()=>_Le(t),queryKey:[st.SESSION_SEARCH,e,JSON.stringify(t)]}),xst=()=>{const e=Mt();return Dt({mutationFn:t=>NLe(t),onSuccess:()=>e.invalidateQueries({queryKey:[st.ROUTINE_OVERVIEW]})})},Sst=e=>yr({queryFn:()=>$Le(e),queryKey:[st.SESSIONS_FULL,JSON.stringify(e||{})]}),wst=e=>{const t=Mt();return Dt({mutationFn:n=>LLe(n),onSuccess:()=>{t.invalidateQueries({queryKey:[st.ROUTINE_OVERVIEW]}),t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})}})},Ko=Ot(k.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"})),Jue=Ot(k.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m5 11h-4v4h-2v-4H7v-2h4V7h2v4h4z"})),Cst=Ot(k.jsx("path",{d:"M22 5v2h-3v3h-2V7h-3V5h3V2h2v3zm-3 14H5V5h6V3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-6h-2zm-4-6v4h2v-4zm-4 4h2V9h-2zm-2 0v-6H7v6z"})),Est=Ot(k.jsx("path",{d:"m7 10 5 5 5-5z"})),Tst=Ot(k.jsx("path",{d:"m7 14 5-5 5 5z"})),Ost=Ot(k.jsx("path",{d:"M6.23 20.23 8 22l10-10L8 2 6.23 3.77 14.46 12z"})),Zue=Ot(k.jsx("path",{d:"M4 9h4v11H4zm12 4h4v7h-4zm-6-9h4v16h-4z"})),Ist=Ot(k.jsx("path",{d:"m19 8-4 4h3c0 3.31-2.69 6-6 6-1.01 0-1.97-.25-2.8-.7l-1.46 1.46C8.97 19.54 10.43 20 12 20c4.42 0 8-3.58 8-8h3zM6 12c0-3.31 2.69-6 6-6 1.01 0 1.97.25 2.8.7l1.46-1.46C15.03 4.46 13.57 4 12 4c-4.42 0-8 3.58-8 8H1l4 4 4-4z"})),Pst=Ot(k.jsx("path",{d:"M19 4h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m0 16H5V10h14zM9 14H7v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2zm-8 4H7v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2z"})),Ast=Ot([k.jsx("circle",{cx:"12",cy:"12",r:"3.2"},"0"),k.jsx("path",{d:"M9 2 7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5"},"1")]),Mst=Ot(k.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12z"})),Rst=Ot(k.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2m-9 14-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"})),Dst=Ot(k.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"})),kst=Ot(k.jsx("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"})),ede=Ot(k.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),_st=Ot(k.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),$st=Ot(k.jsx("path",{d:"M22 16V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2m-11-4 2.03 2.71L16 11l4 5H8zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6z"})),Nst=Ot(k.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"})),MP=Ot(k.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"})),Lst=Ot(k.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM8 9h8v10H8zm7.5-5-1-1h-5l-1 1H5v2h14V4z"})),OS=Ot(k.jsx("path",{d:"M16 9v10H8V9zm-1.5-6h-5l-1 1H5v2h14V4h-3.5zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2z"})),tde=Ot(k.jsx("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"})),DV=Ot(k.jsx("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"})),Fst=Ot(k.jsx("path",{d:"m12.126 8.125 1.937-1.937 3.747 3.747-1.937 1.938zM20.71 5.63l-2.34-2.34a1 1 0 0 0-1.41 0l-1.83 1.83 3.75 3.75L20.71 7a1 1 0 0 0 0-1.37M2 5l6.63 6.63L3 17.25V21h3.75l5.63-5.62L18 21l2-2L4 3z"})),jst=Ot(k.jsx("path",{d:"M4.25 5.61C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39c.51-.66.04-1.61-.79-1.61H5.04c-.83 0-1.3.95-.79 1.61"})),Bst=Ot(k.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m6 13h-5l-1-2H9.5v5H8V7h6l1 2h3z"})),IS=Ot(k.jsx("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"})),nde=Ot(k.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z"})),rde=Ot(k.jsx("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"})),zst=Ot(k.jsx("path",{d:"m14 6-3.75 5 2.85 3.8-1.6 1.2C9.81 13.75 7 10 7 10l-6 8h22z"})),Vst=Ot(k.jsx("path",{d:"m14 6-4.22 5.63 1.25 1.67L14 9.33 19 16h-8.46l-4.01-5.37L1 18h22zM5 16l1.52-2.03L8.04 16z"})),Hst=Ot([k.jsx("path",{d:"M5 16h3.04l-1.52-2.03z",opacity:".3"},"0"),k.jsx("path",{d:"m9.78 11.63 1.25 1.67L14 9.33 19 16h-8.46l-4.01-5.37L1 18h22L14 6zM5 16l1.52-2.03L8.04 16z"},"1")]),kV=Ot(k.jsx("path",{d:"M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"})),Ust=Ot(k.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"})),ode=Ot(k.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"})),Gst=Ot(k.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),qst=Ot(k.jsx("path",{d:"M9 5v2h6.59L4 18.59 5.41 20 17 8.41V15h2V5z"})),Wst=Ot([k.jsx("circle",{cx:"12",cy:"12",r:"3.2"},"0"),k.jsx("path",{d:"M9 2 7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5"},"1")]),Kst=Ot(k.jsx("path",{d:"M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7z"})),ide=Ot(k.jsx("path",{d:"M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3m3-10H5V5h10z"})),Yst=Ot([k.jsx("path",{d:"M9 15.5h6v1H9z"},"0"),k.jsx("circle",{cx:"15.5",cy:"9.5",r:"1.5"},"1"),k.jsx("circle",{cx:"8.5",cy:"9.5",r:"1.5"},"2"),k.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"},"3")]),Qst=Ot([k.jsx("circle",{cx:"15.5",cy:"9.5",r:"1.5"},"0"),k.jsx("circle",{cx:"8.5",cy:"9.5",r:"1.5"},"1"),k.jsx("circle",{cx:"15.5",cy:"9.5",r:"1.5"},"2"),k.jsx("circle",{cx:"8.5",cy:"9.5",r:"1.5"},"3"),k.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8m0-2.5c2.33 0 4.32-1.45 5.12-3.5h-1.67c-.69 1.19-1.97 2-3.45 2s-2.75-.81-3.45-2H6.88c.8 2.05 2.79 3.5 5.12 3.5"},"4")]),Xst=Ot([k.jsx("circle",{cx:"15.5",cy:"9.5",r:"1.5"},"0"),k.jsx("circle",{cx:"8.5",cy:"9.5",r:"1.5"},"1"),k.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8m0-6c-2.33 0-4.32 1.45-5.12 3.5h1.67c.69-1.19 1.97-2 3.45-2s2.75.81 3.45 2h1.67c-.8-2.05-2.79-3.5-5.12-3.5"},"2")]),Jst=Ot(k.jsx("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"})),Zst=Ot(k.jsx("path",{d:"M19 9h-2v6.59L5.41 4 4 5.41 15.59 17H9v2h10z"})),elt=Ot(k.jsx("path",{d:"M21 5.47 12 12 7.62 7.62 3 11V8.52L7.83 5l4.38 4.38L21 3zM21 15h-4.7l-4.17 3.34L6 12.41l-3 2.13V17l2.8-2 6.2 6 5-4h4z"})),tlt=Ot(k.jsx("path",{d:"M6.99 11 3 15l3.99 4v-3H14v-2H6.99zM21 9l-3.99-4v3H10v2h7.01v3z"})),RP=e=>{if(e.query.isLoading)return S(Er,{});if(e.query.isError)return S(Zt,{sx:{height:200,alignItems:"center",mt:2},component:Ft,direction:"column",justifyContent:"center",children:Q(Ci,{severity:"error",children:["Error while fetching data: ",e.query.error.message]})});if(e.query.isSuccess)return e.child},nlt=e=>{var r;const t=e.avatarSize||40,n=e.iconSize||40;return S(Kl,{sx:{height:t,width:t},src:(r=e.image)==null?void 0:r.url,children:S(Ju,{sx:{height:n,width:n}})})};function ade(){return yr({queryKey:[st.EXERCISES],queryFn:h2e})}function rlt(e){return yr({queryKey:[st.EXERCISE_DETAIL,e],queryFn:()=>pv(e)})}function olt(e){const t=Mt();return Dt({mutationFn:n=>QN(n),onSuccess:()=>{t.invalidateQueries({queryKey:[st.EXERCISES]}),t.invalidateQueries({queryKey:[st.EXERCISE_DETAIL,e]})}})}function ilt(e){const t=Mt();return Dt({mutationFn:n=>b2e(n),onSuccess:()=>{t.invalidateQueries({queryKey:[st.EXERCISES]}),t.invalidateQueries({queryKey:[st.EXERCISE_DETAIL,e]})}})}function alt(e){const t=Mt();return Dt({mutationFn:n=>C2e(n),onSuccess:()=>{t.invalidateQueries({queryKey:[st.EXERCISES]}),t.invalidateQueries({queryKey:[st.EXERCISE_DETAIL,e]})}})}function slt(e){const t=Mt();return Dt({mutationFn:n=>jre(n),onSuccess:()=>{t.invalidateQueries({queryKey:[st.EXERCISES]}),t.invalidateQueries({queryKey:[st.EXERCISE_DETAIL,e]})}})}function DP(){return yr({queryKey:[st.CATEGORIES],queryFn:Qke})}function _v(){return yr({queryKey:[st.MUSCLES],queryFn:vke})}function kP(){return yr({queryKey:[st.EQUIPMENT],queryFn:Wke})}function Yc(){return yr({queryKey:[st.LANGUAGES],queryFn:w2e})}var y0={},QX;function llt(){if(QX)return y0;QX=1,Object.defineProperty(y0,"__esModule",{value:!0}),y0.parse=a,y0.serialize=c;const e=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,t=/^[\u0021-\u003A\u003C-\u007E]*$/,n=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,r=/^[\u0020-\u003A\u003D-\u007E]*$/,o=Object.prototype.toString,i=(()=>{const h=function(){};return h.prototype=Object.create(null),h})();function a(h,m){const g=new i,y=h.length;if(y<2)return g;const v=(m==null?void 0:m.decode)||u;let w=0;do{const C=h.indexOf("=",w);if(C===-1)break;const E=h.indexOf(";",w),I=E===-1?y:E;if(C>I){w=h.lastIndexOf(";",C-1)+1;continue}const O=s(h,w,C),P=l(h,C,O),R=h.slice(O,P);if(g[R]===void 0){let D=s(h,C+1,I),M=l(h,I,D);const A=v(h.slice(D,M));g[R]=A}w=I+1}while(w<y);return g}function s(h,m,g){do{const y=h.charCodeAt(m);if(y!==32&&y!==9)return m}while(++m<g);return g}function l(h,m,g){for(;m>g;){const y=h.charCodeAt(--m);if(y!==32&&y!==9)return m+1}return g}function c(h,m,g){const y=(g==null?void 0:g.encode)||encodeURIComponent;if(!e.test(h))throw new TypeError(`argument name is invalid: ${h}`);const v=y(m);if(!t.test(v))throw new TypeError(`argument val is invalid: ${m}`);let w=h+"="+v;if(!g)return w;if(g.maxAge!==void 0){if(!Number.isInteger(g.maxAge))throw new TypeError(`option maxAge is invalid: ${g.maxAge}`);w+="; Max-Age="+g.maxAge}if(g.domain){if(!n.test(g.domain))throw new TypeError(`option domain is invalid: ${g.domain}`);w+="; Domain="+g.domain}if(g.path){if(!r.test(g.path))throw new TypeError(`option path is invalid: ${g.path}`);w+="; Path="+g.path}if(g.expires){if(!f(g.expires)||!Number.isFinite(g.expires.valueOf()))throw new TypeError(`option expires is invalid: ${g.expires}`);w+="; Expires="+g.expires.toUTCString()}if(g.httpOnly&&(w+="; HttpOnly"),g.secure&&(w+="; Secure"),g.partitioned&&(w+="; Partitioned"),g.priority)switch(typeof g.priority=="string"?g.priority.toLowerCase():void 0){case"low":w+="; Priority=Low";break;case"medium":w+="; Priority=Medium";break;case"high":w+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${g.priority}`)}if(g.sameSite)switch(typeof g.sameSite=="string"?g.sameSite.toLowerCase():g.sameSite){case!0:case"strict":w+="; SameSite=Strict";break;case"lax":w+="; SameSite=Lax";break;case"none":w+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${g.sameSite}`)}return w}function u(h){if(h.indexOf("%")===-1)return h;try{return decodeURIComponent(h)}catch{return h}}function f(h){return o.call(h)==="[object Date]"}return y0}llt();var XX="popstate";function clt(e={}){function t(r,o){let{pathname:i,search:a,hash:s}=r.location;return ZF("",{pathname:i,search:a,hash:s},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:PS(o)}return dlt(t,n,null,e)}function ro(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Bc(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function ult(){return Math.random().toString(36).substring(2,10)}function JX(e,t){return{usr:e.state,key:e.key,idx:t}}function ZF(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?$v(t):t,state:n,key:t&&t.key||r||ult()}}function PS({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function $v(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function dlt(e,t,n,r={}){let{window:o=document.defaultView,v5Compat:i=!1}=r,a=o.history,s="POP",l=null,c=u();c==null&&(c=0,a.replaceState({...a.state,idx:c},""));function u(){return(a.state||{idx:null}).idx}function f(){s="POP";let v=u(),w=v==null?null:v-c;c=v,l&&l({action:s,location:y.location,delta:w})}function h(v,w){s="PUSH";let C=ZF(y.location,v,w);c=u()+1;let E=JX(C,c),I=y.createHref(C);try{a.pushState(E,"",I)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;o.location.assign(I)}i&&l&&l({action:s,location:y.location,delta:1})}function m(v,w){s="REPLACE";let C=ZF(y.location,v,w);c=u();let E=JX(C,c),I=y.createHref(C);a.replaceState(E,"",I),i&&l&&l({action:s,location:y.location,delta:0})}function g(v){return flt(v)}let y={get action(){return s},get location(){return e(o,a)},listen(v){if(l)throw new Error("A history only accepts one active listener");return o.addEventListener(XX,f),l=v,()=>{o.removeEventListener(XX,f),l=null}},createHref(v){return t(o,v)},createURL:g,encodeLocation(v){let w=g(v);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:h,replace:m,go(v){return a.go(v)}};return y}function flt(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),ro(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:PS(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function sde(e,t,n="/"){return plt(e,t,n,!1)}function plt(e,t,n,r){let o=typeof t=="string"?$v(t):t,i=Qu(o.pathname||"/",n);if(i==null)return null;let a=lde(e);hlt(a);let s=null;for(let l=0;s==null&&l<a.length;++l){let c=Tlt(i);s=Clt(a[l],c,r)}return s}function lde(e,t=[],n=[],r=""){let o=(i,a,s)=>{let l={relativePath:s===void 0?i.path||"":s,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};l.relativePath.startsWith("/")&&(ro(l.relativePath.startsWith(r),`Absolute route path "${l.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),l.relativePath=l.relativePath.slice(r.length));let c=Fu([r,l.relativePath]),u=n.concat(l);i.children&&i.children.length>0&&(ro(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${c}".`),lde(i.children,t,u,c)),!(i.path==null&&!i.index)&&t.push({path:c,score:Slt(c,i.index),routesMeta:u})};return e.forEach((i,a)=>{var s;if(i.path===""||!((s=i.path)!=null&&s.includes("?")))o(i,a);else for(let l of cde(i.path))o(i,a,l)}),t}function cde(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let a=cde(r.join("/")),s=[];return s.push(...a.map(l=>l===""?i:[i,l].join("/"))),o&&s.push(...a),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function hlt(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:wlt(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var mlt=/^:[\w-]+$/,glt=3,ylt=2,vlt=1,blt=10,xlt=-2,ZX=e=>e==="*";function Slt(e,t){let n=e.split("/"),r=n.length;return n.some(ZX)&&(r+=xlt),t&&(r+=ylt),n.filter(o=>!ZX(o)).reduce((o,i)=>o+(mlt.test(i)?glt:i===""?vlt:blt),r)}function wlt(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function Clt(e,t,n=!1){let{routesMeta:r}=e,o={},i="/",a=[];for(let s=0;s<r.length;++s){let l=r[s],c=s===r.length-1,u=i==="/"?t:t.slice(i.length)||"/",f=bO({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},u),h=l.route;if(!f&&c&&n&&!r[r.length-1].route.index&&(f=bO({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},u)),!f)return null;Object.assign(o,f.params),a.push({params:o,pathname:Fu([i,f.pathname]),pathnameBase:Alt(Fu([i,f.pathnameBase])),route:h}),f.pathnameBase!=="/"&&(i=Fu([i,f.pathnameBase]))}return a}function bO(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Elt(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let i=o[0],a=i.replace(/(.)\/+$/,"$1"),s=o.slice(1);return{params:r.reduce((c,{paramName:u,isOptional:f},h)=>{if(u==="*"){let g=s[h]||"";a=i.slice(0,i.length-g.length).replace(/(.)\/+$/,"$1")}const m=s[h];return f&&!m?c[u]=void 0:c[u]=(m||"").replace(/%2F/g,"/"),c},{}),pathname:i,pathnameBase:a,pattern:e}}function Elt(e,t=!1,n=!0){Bc(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,s,l)=>(r.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function Tlt(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Bc(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Qu(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function Olt(e,t="/"){let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?$v(e):e;return{pathname:n?n.startsWith("/")?n:Ilt(n,t):t,search:Mlt(r),hash:Rlt(o)}}function Ilt(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function l$(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Plt(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function ude(e){let t=Plt(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function dde(e,t,n,r=!1){let o;typeof e=="string"?o=$v(e):(o={...e},ro(!o.pathname||!o.pathname.includes("?"),l$("?","pathname","search",o)),ro(!o.pathname||!o.pathname.includes("#"),l$("#","pathname","hash",o)),ro(!o.search||!o.search.includes("#"),l$("#","search","hash",o)));let i=e===""||o.pathname==="",a=i?"/":o.pathname,s;if(a==null)s=n;else{let f=t.length-1;if(!r&&a.startsWith("..")){let h=a.split("/");for(;h[0]==="..";)h.shift(),f-=1;o.pathname=h.join("/")}s=f>=0?t[f]:"/"}let l=Olt(o,s),c=a&&a!=="/"&&a.endsWith("/"),u=(i||a===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}var Fu=e=>e.join("/").replace(/\/\/+/g,"/"),Alt=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Mlt=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Rlt=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Dlt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var fde=["POST","PUT","PATCH","DELETE"];new Set(fde);var klt=["GET",...fde];new Set(klt);var Nv=x.createContext(null);Nv.displayName="DataRouter";var _P=x.createContext(null);_P.displayName="DataRouterState";var pde=x.createContext({isTransitioning:!1});pde.displayName="ViewTransition";var _lt=x.createContext(new Map);_lt.displayName="Fetchers";var $lt=x.createContext(null);$lt.displayName="Await";var Qc=x.createContext(null);Qc.displayName="Navigation";var Lw=x.createContext(null);Lw.displayName="Location";var Xc=x.createContext({outlet:null,matches:[],isDataRoute:!1});Xc.displayName="Route";var _V=x.createContext(null);_V.displayName="RouteError";function Nlt(e,{relative:t}={}){ro(Fw(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=x.useContext(Qc),{hash:o,pathname:i,search:a}=jw(e,{relative:t}),s=i;return n!=="/"&&(s=i==="/"?n:Fu([n,i])),r.createHref({pathname:s,search:a,hash:o})}function Fw(){return x.useContext(Lw)!=null}function Zh(){return ro(Fw(),"useLocation() may be used only in the context of a <Router> component."),x.useContext(Lw).location}var hde="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function mde(e){x.useContext(Qc).static||x.useLayoutEffect(e)}function id(){let{isDataRoute:e}=x.useContext(Xc);return e?Ylt():Llt()}function Llt(){ro(Fw(),"useNavigate() may be used only in the context of a <Router> component.");let e=x.useContext(Nv),{basename:t,navigator:n}=x.useContext(Qc),{matches:r}=x.useContext(Xc),{pathname:o}=Zh(),i=JSON.stringify(ude(r)),a=x.useRef(!1);return mde(()=>{a.current=!0}),x.useCallback((l,c={})=>{if(Bc(a.current,hde),!a.current)return;if(typeof l=="number"){n.go(l);return}let u=dde(l,JSON.parse(i),o,c.relative==="path");e==null&&t!=="/"&&(u.pathname=u.pathname==="/"?t:Fu([t,u.pathname])),(c.replace?n.replace:n.push)(u,c.state,c)},[t,n,i,o,e])}x.createContext(null);function Ma(){let{matches:e}=x.useContext(Xc),t=e[e.length-1];return t?t.params:{}}function jw(e,{relative:t}={}){let{matches:n}=x.useContext(Xc),{pathname:r}=Zh(),o=JSON.stringify(ude(n));return x.useMemo(()=>dde(e,JSON.parse(o),r,t==="path"),[e,o,r,t])}function Flt(e,t){return gde(e,t)}function gde(e,t,n,r){var w;ro(Fw(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=x.useContext(Qc),{matches:i}=x.useContext(Xc),a=i[i.length-1],s=a?a.params:{},l=a?a.pathname:"/",c=a?a.pathnameBase:"/",u=a&&a.route;{let C=u&&u.path||"";yde(l,!u||C.endsWith("*")||C.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${C}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
+`+(s!==a?`result of cast: ${s}`:""))}return i}_cast(t,n){let r=t===void 0?t:this.transforms.reduce((o,i)=>i.call(this,o,t,this),t);return r===void 0&&(r=this.getDefault(n)),r}_validate(t,n={},r,o){let{path:i,originalValue:a=t,strict:s=this.spec.strict}=n,l=t;s||(l=this._cast(l,Object.assign({assert:!1},n)));let c=[];for(let u of Object.values(this.internalTests))u&&c.push(u);this.runTests({path:i,value:l,originalValue:a,options:n,tests:c},r,u=>{if(u.length)return o(u,l);this.runTests({path:i,value:l,originalValue:a,options:n,tests:this.tests},r,o)})}runTests(t,n,r){let o=!1,{tests:i,value:a,originalValue:s,path:l,options:c}=t,u=y=>{o||(o=!0,n(y,a))},f=y=>{o||(o=!0,r(y,a))},h=i.length,m=[];if(!h)return f([]);let g={value:a,originalValue:s,path:l,options:c,schema:this};for(let y=0;y<i.length;y++){const v=i[y];v(g,u,function(C){C&&(Array.isArray(C)?m.push(...C):m.push(C)),--h<=0&&f(m)})}}asNestedTest({key:t,index:n,parent:r,parentPath:o,originalParent:i,options:a}){const s=t??n;if(s==null)throw TypeError("Must include `key` or `index` for nested validations");const l=typeof s=="number";let c=r[s];const u=Object.assign({},a,{strict:!0,parent:r,value:c,originalValue:i[s],key:void 0,[l?"index":"key"]:s,path:l||s.includes(".")?`${o||""}[${l?s:`"${s}"`}]`:(o?`${o}.`:"")+t});return(f,h,m)=>this.resolve(u)._validate(c,u,h,m)}validate(t,n){var r;let o=this.resolve(Object.assign({},n,{value:t})),i=(r=n==null?void 0:n.disableStackTrace)!=null?r:o.spec.disableStackTrace;return new Promise((a,s)=>o._validate(t,n,(l,c)=>{Sa.isError(l)&&(l.value=c),s(l)},(l,c)=>{l.length?s(new Sa(l,c,void 0,void 0,i)):a(c)}))}validateSync(t,n){var r;let o=this.resolve(Object.assign({},n,{value:t})),i,a=(r=n==null?void 0:n.disableStackTrace)!=null?r:o.spec.disableStackTrace;return o._validate(t,Object.assign({},n,{sync:!0}),(s,l)=>{throw Sa.isError(s)&&(s.value=l),s},(s,l)=>{if(s.length)throw new Sa(s,t,void 0,void 0,a);i=l}),i}isValid(t,n){return this.validate(t,n).then(()=>!0,r=>{if(Sa.isError(r))return!1;throw r})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(r){if(Sa.isError(r))return!1;throw r}}_getDefault(t){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,t):Cg(n)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,n){const r=this.clone({nullable:t});return r.internalTests.nullable=tg({message:n,name:"nullable",test(o){return o===null?this.schema.spec.nullable:!0}}),r}optionality(t,n){const r=this.clone({optional:t});return r.internalTests.optionality=tg({message:n,name:"optionality",test(o){return o===void 0?this.schema.spec.optional:!0}}),r}optional(){return this.optionality(!0)}defined(t=dc.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=dc.notNull){return this.nullability(!1,t)}required(t=dc.required){return this.clone().withMutation(n=>n.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let n=this.clone();return n.transforms.push(t),n}test(...t){let n;if(t.length===1?typeof t[0]=="function"?n={test:t[0]}:n=t[0]:t.length===2?n={name:t[0],test:t[1]}:n={name:t[0],message:t[1],test:t[2]},n.message===void 0&&(n.message=dc.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),o=tg(n),i=n.exclusive||n.name&&r.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(r.exclusiveTests[n.name]=!!n.exclusive),r.tests=r.tests.filter(a=>!(a.OPTIONS.name===n.name&&(i||a.OPTIONS.test===o.OPTIONS.test))),r.tests.push(o),r}when(t,n){!Array.isArray(t)&&typeof t!="string"&&(n=t,t=".");let r=this.clone(),o=kue(t).map(i=>new Kf(i));return o.forEach(i=>{i.isSibling&&r.deps.push(i.key)}),r.conditions.push(typeof n=="function"?new yO(o,n):yO.fromOptions(o,n)),r}typeError(t){let n=this.clone();return n.internalTests.typeError=tg({message:t,name:"typeError",skipAbsent:!0,test(r){return this.schema._typeCheck(r)?!0:this.createError({params:{type:this.schema.type}})}}),n}oneOf(t,n=dc.oneOf){let r=this.clone();return t.forEach(o=>{r._whitelist.add(o),r._blacklist.delete(o)}),r.internalTests.whiteList=tg({message:n,name:"oneOf",skipAbsent:!0,test(o){let i=this.schema._whitelist,a=i.resolveAll(this.resolve);return a.includes(o)?!0:this.createError({params:{values:Array.from(i).join(", "),resolved:a}})}}),r}notOneOf(t,n=dc.notOneOf){let r=this.clone();return t.forEach(o=>{r._blacklist.add(o),r._whitelist.delete(o)}),r.internalTests.blacklist=tg({message:n,name:"notOneOf",test(o){let i=this.schema._blacklist,a=i.resolveAll(this.resolve);return a.includes(o)?this.createError({params:{values:Array.from(i).join(", "),resolved:a}}):!0}}),r}strip(t=!0){let n=this.clone();return n.spec.strip=t,n}describe(t){const n=(t?this.resolve(t):this).clone(),{label:r,meta:o,optional:i,nullable:a}=n.spec;return{meta:o,label:r,optional:i,nullable:a,default:n.getDefault(t),type:n.type,oneOf:n._whitelist.describe(),notOneOf:n._blacklist.describe(),tests:n.tests.map(l=>({name:l.OPTIONS.name,params:l.OPTIONS.params})).filter((l,c,u)=>u.findIndex(f=>f.name===l.name)===c)}}}is.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])is.prototype[`${e}At`]=function(t,n,r={}){const{parent:o,parentPath:i,schema:a}=aat(this,t,n,r.context);return a[e](o&&o[i],Object.assign({},r,{parent:o,path:t}))};for(const e of["equals","is"])is.prototype[e]=is.prototype.oneOf;for(const e of["not","nope"])is.prototype[e]=is.prototype.notOneOf;function Lu(){return new Lue}class Lue extends is{constructor(){super({type:"boolean",check(t){return t instanceof Boolean&&(t=t.valueOf()),typeof t=="boolean"}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(r.spec.coerce&&!r.isType(t)){if(/^(true|1)$/i.test(String(t)))return!0;if(/^(false|0)$/i.test(String(t)))return!1}return t})})}isTrue(t=XF.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"true"},test(n){return $l(n)||n===!0}})}isFalse(t=XF.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"false"},test(n){return $l(n)||n===!1}})}default(t){return super.default(t)}defined(t){return super.defined(t)}optional(){return super.optional()}required(t){return super.required(t)}notRequired(){return super.notRequired()}nullable(){return super.nullable()}nonNullable(t){return super.nonNullable(t)}strip(t){return super.strip(t)}}Lu.prototype=Lue.prototype;const sat=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function lat(e){const t=JF(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(t.z===void 0&&t.plusMinus===void 0)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let n=0;return t.z!=="Z"&&t.plusMinus!==void 0&&(n=t.hourOffset*60+t.minuteOffset,t.plusMinus==="+"&&(n=0-n)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+n,t.second,t.millisecond)}function JF(e){var t,n;const r=sat.exec(e);return r?{year:vu(r[1]),month:vu(r[2],1)-1,day:vu(r[3],1),hour:vu(r[4]),minute:vu(r[5]),second:vu(r[6]),millisecond:r[7]?vu(r[7].substring(0,3)):0,precision:(t=(n=r[7])==null?void 0:n.length)!=null?t:void 0,z:r[8]||void 0,plusMinus:r[9]||void 0,hourOffset:vu(r[10]),minuteOffset:vu(r[11])}:null}function vu(e,t=0){return Number(e)||t}let cat=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,uat=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,dat=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,fat="^\\d{4}-\\d{2}-\\d{2}",pat="\\d{2}:\\d{2}:\\d{2}",hat="(([+-]\\d{2}(:?\\d{2})?)|Z)",mat=new RegExp(`${fat}T${pat}(\\.\\d+)?${hat}$`),gat=e=>$l(e)||e===e.trim(),yat={}.toString();function Ho(){return new Fue}class Fue extends is{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(!r.spec.coerce||r.isType(t)||Array.isArray(t))return t;const o=t!=null&&t.toString?t.toString():t;return o===yat?t:o})})}required(t){return super.required(t).withMutation(n=>n.test({message:t||dc.required,name:"required",skipAbsent:!0,test:r=>!!r.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(n=>n.OPTIONS.name!=="required"),t))}length(t,n=ha.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(r){return r.length===this.resolve(t)}})}min(t,n=ha.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r.length>=this.resolve(t)}})}max(t,n=ha.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:t},skipAbsent:!0,test(r){return r.length<=this.resolve(t)}})}matches(t,n){let r=!1,o,i;return n&&(typeof n=="object"?{excludeEmptyString:r=!1,message:o,name:i}=n:o=n),this.test({name:i||"matches",message:o||ha.matches,params:{regex:t},skipAbsent:!0,test:a=>a===""&&r||a.search(t)!==-1})}email(t=ha.email){return this.matches(cat,{name:"email",message:t,excludeEmptyString:!0})}url(t=ha.url){return this.matches(uat,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=ha.uuid){return this.matches(dat,{name:"uuid",message:t,excludeEmptyString:!1})}datetime(t){let n="",r,o;return t&&(typeof t=="object"?{message:n="",allowOffset:r=!1,precision:o=void 0}=t:n=t),this.matches(mat,{name:"datetime",message:n||ha.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||ha.datetime_offset,params:{allowOffset:r},skipAbsent:!0,test:i=>{if(!i||r)return!0;const a=JF(i);return a?!!a.z:!1}}).test({name:"datetime_precision",message:n||ha.datetime_precision,params:{precision:o},skipAbsent:!0,test:i=>{if(!i||o==null)return!0;const a=JF(i);return a?a.precision===o:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=ha.trim){return this.transform(n=>n!=null?n.trim():n).test({message:t,name:"trim",test:gat})}lowercase(t=ha.lowercase){return this.transform(n=>$l(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>$l(n)||n===n.toLowerCase()})}uppercase(t=ha.uppercase){return this.transform(n=>$l(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>$l(n)||n===n.toUpperCase()})}}Ho.prototype=Fue.prototype;let vat=e=>e!=+e;function Do(){return new jue}class jue extends is{constructor(){super({type:"number",check(t){return t instanceof Number&&(t=t.valueOf()),typeof t=="number"&&!vat(t)}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(!r.spec.coerce)return t;let o=t;if(typeof o=="string"){if(o=o.replace(/\s/g,""),o==="")return NaN;o=+o}return r.isType(o)||o===null?o:parseFloat(o)})})}min(t,n=zd.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r>=this.resolve(t)}})}max(t,n=zd.max){return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(r){return r<=this.resolve(t)}})}lessThan(t,n=zd.lessThan){return this.test({message:n,name:"max",exclusive:!0,params:{less:t},skipAbsent:!0,test(r){return r<this.resolve(t)}})}moreThan(t,n=zd.moreThan){return this.test({message:n,name:"min",exclusive:!0,params:{more:t},skipAbsent:!0,test(r){return r>this.resolve(t)}})}positive(t=zd.positive){return this.moreThan(0,t)}negative(t=zd.negative){return this.lessThan(0,t)}integer(t=zd.integer){return this.test({name:"integer",message:t,skipAbsent:!0,test:n=>Number.isInteger(n)})}truncate(){return this.transform(t=>$l(t)?t:t|0)}round(t){var n;let r=["ceil","floor","round","trunc"];if(t=((n=t)==null?void 0:n.toLowerCase())||"round",t==="trunc")return this.truncate();if(r.indexOf(t.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+r.join(", "));return this.transform(o=>$l(o)?o:Math[t](o))}}Do.prototype=jue.prototype;let Bue=new Date(""),bat=e=>Object.prototype.toString.call(e)==="[object Date]";function Xs(){return new $w}class $w extends is{constructor(){super({type:"date",check(t){return bat(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,n,r)=>!r.spec.coerce||r.isType(t)||t===null?t:(t=lat(t),isNaN(t)?$w.INVALID_DATE:new Date(t)))})}prepareParam(t,n){let r;if(Kf.isRef(t))r=t;else{let o=this.cast(t);if(!this._typeCheck(o))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);r=o}return r}min(t,n=QF.min){let r=this.prepareParam(t,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(o){return o>=this.resolve(r)}})}max(t,n=QF.max){let r=this.prepareParam(t,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(o){return o<=this.resolve(r)}})}}$w.INVALID_DATE=Bue;Xs.prototype=$w.prototype;Xs.INVALID_DATE=Bue;function xat(e,t=[]){let n=[],r=new Set,o=new Set(t.map(([a,s])=>`${a}-${s}`));function i(a,s){let l=ah.split(a)[0];r.add(l),o.has(`${s}-${l}`)||n.push([s,l])}for(const a of Object.keys(e)){let s=e[a];r.add(a),Kf.isRef(s)&&s.isSibling?i(s.path,a):PP(s)&&"deps"in s&&s.deps.forEach(l=>i(l,a))}return Xit.array(Array.from(r),n).reverse()}function qX(e,t){let n=1/0;return e.some((r,o)=>{var i;if((i=t.path)!=null&&i.includes(r))return n=o,!0}),n}function zue(e){return(t,n)=>qX(e,t)-qX(e,n)}const Vue=(e,t,n)=>{if(typeof e!="string")return e;let r=e;try{r=JSON.parse(e)}catch{}return n.isType(r)?r:e};function IE(e){if("fields"in e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=IE(r);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=IE(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(IE)}):"optional"in e?e.optional():e}const Sat=(e,t)=>{const n=[...ah.normalizePath(t)];if(n.length===1)return n[0]in e;let r=n.pop(),o=ah.getter(ah.join(n),!0)(e);return!!(o&&r in o)};let WX=e=>Object.prototype.toString.call(e)==="[object Object]";function KX(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(r=>n.indexOf(r)===-1)}const wat=zue([]);function Wo(e){return new Hue(e)}class Hue extends is{constructor(t){super({type:"object",check(n){return WX(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=wat,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,n={}){var r;let o=super._cast(t,n);if(o===void 0)return this.getDefault(n);if(!this._typeCheck(o))return o;let i=this.fields,a=(r=n.stripUnknown)!=null?r:this.spec.noUnknown,s=[].concat(this._nodes,Object.keys(o).filter(f=>!this._nodes.includes(f))),l={},c=Object.assign({},n,{parent:l,__validating:n.__validating||!1}),u=!1;for(const f of s){let h=i[f],m=f in o;if(h){let g,y=o[f];c.path=(n.path?`${n.path}.`:"")+f,h=h.resolve({value:y,context:n.context,parent:l});let v=h instanceof is?h.spec:void 0,w=v==null?void 0:v.strict;if(v!=null&&v.strip){u=u||f in o;continue}g=!n.__validating||!w?h.cast(o[f],c):o[f],g!==void 0&&(l[f]=g)}else m&&!a&&(l[f]=o[f]);(m!==f in l||l[f]!==o[f])&&(u=!0)}return u?l:o}_validate(t,n={},r,o){let{from:i=[],originalValue:a=t,recursive:s=this.spec.recursive}=n;n.from=[{schema:this,value:a},...i],n.__validating=!0,n.originalValue=a,super._validate(t,n,r,(l,c)=>{if(!s||!WX(c)){o(l,c);return}a=a||c;let u=[];for(let f of this._nodes){let h=this.fields[f];!h||Kf.isRef(h)||u.push(h.asNestedTest({options:n,key:f,parent:c,parentPath:n.path,originalParent:a}))}this.runTests({tests:u,value:c,originalValue:a,options:n},r,f=>{o(f.sort(this._sortErrors).concat(l),c)})})}clone(t){const n=super.clone(t);return n.fields=Object.assign({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(t){let n=super.concat(t),r=n.fields;for(let[o,i]of Object.entries(this.fields)){const a=r[o];r[o]=a===void 0?i:a}return n.withMutation(o=>o.setFields(r,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let n={};return this._nodes.forEach(r=>{var o;const i=this.fields[r];let a=t;(o=a)!=null&&o.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[r]})),n[r]=i&&"getDefault"in i?i.getDefault(a):void 0}),n}setFields(t,n){let r=this.clone();return r.fields=t,r._nodes=xat(t,n),r._sortErrors=zue(Object.keys(t)),n&&(r._excludedEdges=n),r}shape(t,n=[]){return this.clone().withMutation(r=>{let o=r._excludedEdges;return n.length&&(Array.isArray(n[0])||(n=[n]),o=[...r._excludedEdges,...n]),r.setFields(Object.assign(r.fields,t),o)})}partial(){const t={};for(const[n,r]of Object.entries(this.fields))t[n]="optional"in r&&r.optional instanceof Function?r.optional():r;return this.setFields(t)}deepPartial(){return IE(this)}pick(t){const n={};for(const r of t)this.fields[r]&&(n[r]=this.fields[r]);return this.setFields(n,this._excludedEdges.filter(([r,o])=>t.includes(r)&&t.includes(o)))}omit(t){const n=[];for(const r of Object.keys(this.fields))t.includes(r)||n.push(r);return this.pick(n)}from(t,n,r){let o=ah.getter(t,!0);return this.transform(i=>{if(!i)return i;let a=i;return Sat(i,t)&&(a=Object.assign({},i),r||delete a[t],a[n]=o(i)),a})}json(){return this.transform(Vue)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||TE.exact,test(n){if(n==null)return!0;const r=KX(this.schema,n);return r.length===0||this.createError({params:{properties:r.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,n=TE.noUnknown){typeof t!="boolean"&&(n=t,t=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:n,test(o){if(o==null)return!0;const i=KX(this.schema,o);return!t||i.length===0||this.createError({params:{unknown:i.join(", ")}})}});return r.spec.noUnknown=t,r}unknown(t=!0,n=TE.noUnknown){return this.noUnknown(!t,n)}transformKeys(t){return this.transform(n=>{if(!n)return n;const r={};for(const o of Object.keys(n))r[t(o)]=n[o];return r})}camelCase(){return this.transformKeys(s$.camelCase)}snakeCase(){return this.transformKeys(s$.snakeCase)}constantCase(){return this.transformKeys(t=>s$.snakeCase(t).toUpperCase())}describe(t){const n=(t?this.resolve(t):this).clone(),r=super.describe(t);r.fields={};for(const[i,a]of Object.entries(n.fields)){var o;let s=t;(o=s)!=null&&o.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[i]})),r.fields[i]=a.describe(s)}return r}}Wo.prototype=Hue.prototype;function sh(e){return new Uue(e)}class Uue extends is{constructor(t){super({type:"array",spec:{types:t},check(n){return Array.isArray(n)}}),this.innerType=void 0,this.innerType=t}_cast(t,n){const r=super._cast(t,n);if(!this._typeCheck(r)||!this.innerType)return r;let o=!1;const i=r.map((a,s)=>{const l=this.innerType.cast(a,Object.assign({},n,{path:`${n.path||""}[${s}]`}));return l!==a&&(o=!0),l});return o?i:r}_validate(t,n={},r,o){var i;let a=this.innerType,s=(i=n.recursive)!=null?i:this.spec.recursive;n.originalValue!=null&&n.originalValue,super._validate(t,n,r,(l,c)=>{var u;if(!s||!a||!this._typeCheck(c)){o(l,c);return}let f=new Array(c.length);for(let m=0;m<c.length;m++){var h;f[m]=a.asNestedTest({options:n,index:m,parent:c,parentPath:n.path,originalParent:(h=n.originalValue)!=null?h:t})}this.runTests({value:c,tests:f,originalValue:(u=n.originalValue)!=null?u:t,options:n},r,m=>o(m.concat(l),c))})}clone(t){const n=super.clone(t);return n.innerType=this.innerType,n}json(){return this.transform(Vue)}concat(t){let n=super.concat(t);return n.innerType=this.innerType,t.innerType&&(n.innerType=n.innerType?n.innerType.concat(t.innerType):t.innerType),n}of(t){let n=this.clone();if(!PP(t))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+Nu(t));return n.innerType=t,n.spec=Object.assign({},n.spec,{types:t}),n}length(t,n=OE.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(r){return r.length===this.resolve(t)}})}min(t,n){return n=n||OE.min,this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r.length>=this.resolve(t)}})}max(t,n){return n=n||OE.max,this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(r){return r.length<=this.resolve(t)}})}ensure(){return this.default(()=>[]).transform((t,n)=>this._typeCheck(t)?t:n==null?[]:[].concat(n))}compact(t){let n=t?(r,o,i)=>!t(r,o,i):r=>!!r;return this.transform(r=>r!=null?r.filter(n):r)}describe(t){const n=(t?this.resolve(t):this).clone(),r=super.describe(t);if(n.innerType){var o;let i=t;(o=i)!=null&&o.value&&(i=Object.assign({},i,{parent:i.value,value:i.value[0]})),r.innerType=n.innerType.describe(i)}return r}}sh.prototype=Uue.prototype;const MV=({planId:e,entry:t,mealId:n,meals:r,closeFn:o})=>{const i=n===void 0?null:n,a=r===void 0?[]:r,[s,l]=je(),c=rFe(e),u=oFe(e),[f,h]=x.useState(t?xt.fromJSDate(t.datetime):xt.now()),[m,g]=x.useState(i),y=Wo({amount:Do().required(s("forms.fieldRequired")).max(1e3,s("forms.maxValue",{value:"1000"})).min(1,s("forms.minValue",{value:"1"})),ingredient:Do().required(s("forms.fieldRequired")),datetime:Xs().required(s("forms.fieldRequired"))});return S(Ti,{initialValues:{datetime:new Date,amount:0,ingredient:0},validationSchema:y,onSubmit:async v=>{const w={...v,plan:e,meal:m,weight_unit:null,datetime:v.datetime.toISOString()};t?u.mutate({...w,id:t.id}):c.mutate(w),o&&o()},children:v=>S(fi,{children:Q(Ft,{spacing:2,children:[S(vV,{callback:w=>v.setFieldValue("ingredient",w==null?void 0:w.data.id)}),S(dn,{fullWidth:!0,id:"amount",label:"amount",InputProps:{endAdornment:S(So,{position:"end",children:s("nutrition.gramShort")})},error:v.touched.amount&&!!v.errors.amount,helperText:v.touched.amount&&v.errors.amount,...v.getFieldProps("amount")}),a.length>0&&S(_c,{value:m,options:a.map(w=>w.id),getOptionLabel:w=>a.find(C=>C.id===w).displayName,onChange:(w,C)=>g(C),renderInput:w=>S(dn,{label:s("nutrition.meal"),value:m,...w})}),S(Ys,{dateAdapter:zl,adapterLocale:l.language,children:S(Itt,{format:"yyyy-MM-dd HH:mm",label:s("date"),value:f,disableFuture:!0,onChange:w=>{v.setFieldValue("datetime",w==null?void 0:w.toJSDate()),h(w)},shouldDisableDate:w=>(t&&Zn(t.datetime)===Zn(w.toJSDate()),!1)})}),Q(Ft,{direction:"row",justifyContent:"end",spacing:2,children:[o!==void 0&&S(ct,{color:"primary",variant:"outlined",onClick:()=>o(),children:s("close")}),S(ct,{color:"primary",variant:"contained",type:"submit",children:s("submit")})]})]})})})},RV=({plan:e,closeFn:t})=>{const[n]=je(),r=ZLe(),o=tFe(e==null?void 0:e.id),[i,a]=x.useState(e==null?void 0:e.hasAnyGoals),[s,l]=x.useState(e?xt.fromJSDate(e.start):xt.now),[c,u]=x.useState(e&&(e==null?void 0:e.end)!==null?xt.fromJSDate(e.end):null),f=Wo({description:Ho().required().max(25,n("forms.maxLength",{chars:"25"})).min(3,n("forms.minLength",{chars:"3"})),onlyLogging:Lu(),goalEnergy:Do().notRequired().positive().max(6e3,n("forms.maxValue",{value:"6000kcal"})),goalProtein:Do().notRequired().positive().max(500,n("forms.maxValue",{value:"500"})),goalCarbohydrates:Do().notRequired().positive().max(750,n("forms.maxValue",{value:"750"})),goalFiber:Do().notRequired().positive().max(500,n("forms.maxValue",{value:"500"})),goalFat:Do().notRequired().positive().max(500,n("forms.maxValue",{value:"500"})),start:Xs().required(),end:Xs().nullable().min(AP("start"),n("forms.endBeforeStart"))});return S(Ti,{initialValues:{description:e?e.description:n("nutrition.plan"),start:Zn(new Date),end:null,onlyLogging:e?e.onlyLogging:!0,goalEnergy:e?e.goalEnergy:null,goalProtein:e?e.goalProtein:null,goalCarbohydrates:e?e.goalCarbohydrates:null,goalFiber:e?e.goalFiber:null,goalFat:e?e.goalFat:null},validationSchema:f,onSubmit:async h=>{h.goalEnergy=h.goalEnergy?h.goalEnergy:null,h.goalProtein=h.goalProtein?h.goalProtein:null,h.goalCarbohydrates=h.goalCarbohydrates?h.goalCarbohydrates:null,h.goalFiber=h.goalFiber?h.goalFiber:null,h.goalFat=h.goalFat?h.goalFat:null,i||(h.goalEnergy=null,h.goalProtein=null,h.goalCarbohydrates=null,h.goalFiber=null,h.goalFat=null);const m=new SI({start:new Date(h.start),end:h.end?new Date(h.end):null,description:h.description,onlyLogging:h.onlyLogging,goalEnergy:h.goalEnergy,goalProtein:h.goalProtein,goalCarbohydrates:h.goalCarbohydrates,goalFiber:h.goalFiber,goalFat:h.goalFat});e?(m.id=e.id,o.mutate(m)):r.mutate(m),t&&t()},children:h=>S(fi,{children:Q(Ft,{spacing:2,children:[S(dn,{fullWidth:!0,id:"description",label:n("description"),error:h.touched.description&&!!h.errors.description,helperText:h.touched.description&&h.errors.description,...h.getFieldProps("description")}),Q(me,{container:!0,spacing:1,children:[S(me,{size:6,children:S(Ys,{dateAdapter:zl,adapterLocale:hr.language,children:S(Ih,{format:"yyyy-MM-dd",label:n("start"),value:s,slotProps:{textField:{variant:"standard",fullWidth:!0,error:h.touched.start&&!!h.errors.start,helperText:h.touched.start&&h.errors.start?String(h.errors.start):""}},onChange:m=>{m&&h.setFieldValue("start",m.toJSDate()),l(m)}})})}),S(me,{size:6,children:S(Ys,{dateAdapter:zl,adapterLocale:hr.language,children:S(Ih,{format:"yyyy-MM-dd",label:n("end"),value:c,slotProps:{textField:{variant:"standard",fullWidth:!0,error:h.touched.end&&!!h.errors.end,helperText:h.touched.end&&h.errors.end?String(h.errors.end):""}},onChange:m=>{m&&h.setFieldValue("end",m.toJSDate()),u(m)}})})})]}),S(Mx,{children:S(os,{label:n("nutrition.onlyLoggingHelpText"),control:S(qo,{id:"onlyLogging",checked:h.values.onlyLogging,...h.getFieldProps("onlyLogging")})})}),S(Mx,{children:S(os,{label:n("nutrition.useGoalsHelpText"),control:S(qo,{id:"goalEnergy",checked:i,onChange:()=>a(!i)})})}),S(aw,{children:n("nutrition.useGoalsHelpTextLong")}),i&&Q(Tt,{children:[S(dn,{fullWidth:!0,id:"energy",label:n("nutrition.goalEnergy"),error:h.touched.goalEnergy&&!!h.errors.goalEnergy,helperText:h.touched.goalEnergy&&h.errors.goalEnergy,...h.getFieldProps("goalEnergy"),InputProps:{endAdornment:S(So,{position:"end",children:n("nutrition.kcal")})}}),Q(me,{container:!0,spacing:1,children:[S(me,{size:4,children:S(dn,{id:"protein",fullWidth:!0,label:n("nutrition.goalProtein"),error:h.touched.goalProtein&&!!h.errors.goalProtein,helperText:h.touched.goalProtein&&h.errors.goalProtein,...h.getFieldProps("goalProtein"),InputProps:{startAdornment:S(So,{position:"start",children:h.values.goalProtein!==null&&h.values.goalProtein!==void 0?n("nutrition.valueEnergyKcal",{value:h.values.goalProtein*_g.protein}):""}),endAdornment:S(So,{position:"end",children:n("nutrition.gramShort")})}})}),S(me,{size:4,children:S(dn,{id:"carbohydrates",fullWidth:!0,label:n("nutrition.goalCarbohydrates"),error:h.touched.goalCarbohydrates&&!!h.errors.goalCarbohydrates,helperText:h.touched.goalCarbohydrates&&h.errors.goalCarbohydrates,...h.getFieldProps("goalCarbohydrates"),InputProps:{startAdornment:S(So,{position:"start",children:h.values.goalCarbohydrates!==null&&h.values.goalCarbohydrates!==void 0?n("nutrition.valueEnergyKcal",{value:h.values.goalCarbohydrates*_g.carbohydrates}):""}),endAdornment:S(So,{position:"end",children:n("nutrition.gramShort")})}})}),S(me,{size:4,children:S(dn,{id:"fat",fullWidth:!0,label:n("nutrition.goalFat"),error:h.touched.goalFat&&!!h.errors.goalFat,helperText:h.touched.goalFat&&h.errors.goalFat,...h.getFieldProps("goalFat"),InputProps:{startAdornment:S(So,{position:"start",children:h.values.goalFat!==null&&h.values.goalFat!==void 0?n("nutrition.valueEnergyKcal",{value:h.values.goalFat*_g.fat}):""}),endAdornment:S(So,{position:"end",children:n("nutrition.gramShort")})}})})]}),S(me,{container:!0,spacing:1,children:S(me,{size:4,children:S(dn,{id:"fiber",fullWidth:!0,label:n("nutrition.goalFiber"),error:h.touched.goalFiber&&!!h.errors.goalFiber,helperText:h.touched.goalFiber&&h.errors.goalFiber,...h.getFieldProps("goalFiber"),InputProps:{startAdornment:S(So,{position:"start",children:n("nutrition.valueEnergyKcal",{value:0})}),endAdornment:S(So,{position:"end",children:n("nutrition.gramShort")})}})})})]}),S(Ft,{direction:"row",justifyContent:"end",sx:{mt:2},children:S(ct,{color:"primary",variant:"contained",type:"submit",sx:{mt:2},children:n("submit")})})]})})})},Gue=()=>{const[e]=je(),t=QLe();return t.isLoading?S(Er,{}):t.data!==null?S(Cat,{plan:t.data}):S(gB,{title:e("nutritionalPlan"),modalContent:S(RV,{}),modalTitle:e("add")})};function Cat(e){const[t,n]=je(),[r,o]=J.useState(!1),i=()=>o(!0),a=()=>o(!1);return Q(Tt,{children:[Q(ho,{children:[S(Jl,{title:t("nutritionalPlan"),subheader:e.plan.description}),Q(Fi,{sx:{height:"500px",overflow:"auto"},children:[S(hYe,{percentage:e.plan.percentageValuesLoggedToday,planned:e.plan.plannedNutritionalValues,logged:e.plan.loggedNutritionalValuesToday}),S(ai,{children:e.plan.meals.map(s=>S(Eat,{meal:s,planId:e.plan.id},s.id))})]}),Q(ll,{sx:{justifyContent:"space-between",alignItems:"flex-start"},children:[S(ct,{size:"small",href:cn(Qt.NUTRITION_DETAIL,n.language,{id:e.plan.id}),children:t("seeDetails")}),S(Go,{title:t("nutrition.logThisMealItem"),children:S(pn,{onClick:i,children:S(lw,{})})})]})]}),S(Bi,{title:t("nutrition.addNutritionalDiary"),isOpen:r,closeFn:a,children:S(MV,{closeFn:a,planId:e.plan.id,meals:e.plan.meals})})]})}const Eat=e=>{const[t,n]=je(),r=oie(e.planId),[o,i]=x.useState(!1),[a,s]=J.useState(!1),l=()=>i(!o),c=(m,g)=>{g!=="clickaway"&&s(!1)},u=m=>{const g=[{plan:e.planId,meal:e.meal.id,mealItem:m.id,ingredient:m.ingredientId,weight_unit:m.weightUnitId,datetime:new Date().toISOString(),amount:m.amount}];r.mutate(g),s(!0)},f=e.meal.name?e.meal.name:nT(e.meal.time,n.language),h=e.meal.name?nT(e.meal.time,n.language):null;return Q(Tt,{children:[Q(Fl,{onClick:l,selected:o,children:[S(nl,{children:o?S(J0,{}):S(Du,{})}),S(Wr,{primary:f,secondary:h})]}),S(aa,{in:o,timeout:"auto",unmountOnExit:!0,children:S(ai,{children:e.meal.items.map(m=>{var g,y,v,w;return Q(Co,{secondaryAction:S(Go,{title:t("nutrition.logThisMealItem"),children:S(pn,{edge:"end",onClick:()=>u(m),children:S(lw,{})})}),children:[S(fB,{children:S(Kl,{alt:(g=m.ingredient)==null?void 0:g.name,src:(v=(y=m.ingredient)==null?void 0:y.image)==null?void 0:v.url,sx:{width:45,height:45},children:S(Ju,{})})}),S(Wr,{primary:(w=m.ingredient)==null?void 0:w.name,secondary:$n(m.amount,n.language)})]},m.id)})})}),S(dI,{open:a,autoHideDuration:EI,onClose:c,children:S(Ci,{onClose:c,severity:"success",sx:{width:"100%"},children:t("nutrition.diaryEntrySaved")})})]})},que=Ot(k.jsx("path",{d:"M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16H5V8h14zM7 10h5v5H7z"}));function Kc(e){return yr({queryKey:[st.ROUTINE_DETAIL,e],queryFn:()=>lNe(e)})}function Tat(e){return yr({queryKey:[st.ROUTINE_STATS,e],queryFn:()=>vNe(e)})}function Wue(e){return yr({queryKey:[st.ROUTINE_LOG_DATA,e],queryFn:()=>yNe(e)})}function Oat(){return yr({queryKey:[st.ROUTINES_SHALLOW],queryFn:cNe})}function Iat(){return yr({queryKey:[st.PRIVATE_TEMPLATES],queryFn:uNe})}function Pat(){return yr({queryKey:[st.PUBLIC_TEMPLATES],queryFn:dNe})}function Aat(){return yr({queryKey:[st.ROUTINES_ACTIVE],queryFn:sNe})}const Mat=()=>{const e=Mt();return Dt({mutationFn:t=>fNe(t),onSuccess:()=>e.invalidateQueries({queryKey:[st.ROUTINE_OVERVIEW]})})},Kue=e=>{const t=Mt();return Dt({mutationFn:n=>pNe(n),onSuccess:()=>{t.invalidateQueries({queryKey:[st.ROUTINE_OVERVIEW]}),t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})}})},Rat=e=>{const t=Mt();return Dt({mutationFn:()=>hNe(e),onSuccess:()=>{t.invalidateQueries({queryKey:[st.ROUTINE_OVERVIEW]}),t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})}})},Dat=e=>{const t=Mt();return Dt({mutationFn:n=>oLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},kat=e=>{const t=Mt();return Dt({mutationFn:n=>iLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},_at=e=>{const t=Mt();return Dt({mutationFn:n=>aLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},$at=e=>{const t=Mt();return Dt({mutationFn:n=>sLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Nat=e=>{const t=Mt();return Dt({mutationFn:n=>lLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Lat=e=>{const t=Mt();return Dt({mutationFn:n=>cLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Fat=e=>{const t=Mt();return Dt({mutationFn:n=>uLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},jat=e=>{const t=Mt();return Dt({mutationFn:n=>dLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Bat=e=>{const t=Mt();return Dt({mutationFn:n=>fLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},zat=e=>{const t=Mt();return Dt({mutationFn:n=>pLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Vat=e=>{const t=Mt();return Dt({mutationFn:n=>hLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},YX=e=>{const t=Mt();return Dt({mutationFn:n=>mLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Hat=e=>{const t=Mt();return Dt({mutationFn:n=>gLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Uat=e=>{const t=Mt();return Dt({mutationFn:n=>yLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Gat=e=>{const t=Mt();return Dt({mutationFn:n=>vLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},qat=e=>{const t=Mt();return Dt({mutationFn:n=>bLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Wat=e=>{const t=Mt();return Dt({mutationFn:n=>xLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Kat=e=>{const t=Mt();return Dt({mutationFn:n=>SLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Yue=e=>{const t=Mt();return Dt({mutationFn:n=>wLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Que=e=>{const t=Mt();return Dt({mutationFn:n=>CLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Xue=e=>{const t=Mt();return Dt({mutationFn:n=>ELe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Yat=e=>{const t=Mt();return Dt({mutationFn:n=>TLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Qat=e=>{const t=Mt();return Dt({mutationFn:n=>OLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Xat=e=>{const t=Mt();return Dt({mutationFn:n=>ILe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Jat=e=>{const t=Mt();return Dt({mutationFn:n=>PLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Zat=e=>{const t=Mt();return Dt({mutationFn:n=>ALe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},est=e=>{const t=Mt();return Dt({mutationFn:n=>MLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},tst=e=>{const t=Mt();return Dt({mutationFn:n=>RLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},nst=e=>{const t=Mt();return Dt({mutationFn:n=>DLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},rst=e=>{const t=Mt();return Dt({mutationFn:n=>kLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},ost=e=>{const t=Mt();return Dt({mutationFn:n=>QNe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},ist=e=>{const t=Mt();return Dt({mutationFn:n=>XNe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},ast=e=>{const t=Mt();return Dt({mutationFn:n=>JNe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},sst=e=>{const t=Mt();return Dt({mutationFn:n=>ZNe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})};function lst(e){const t=Mt();return Dt({mutationFn:n=>UNe(n),onSuccess:()=>{t.invalidateQueries({queryKey:[st.ROUTINE_LOG_DATA,e]}),t.invalidateQueries({queryKey:[st.ROUTINE_STATS,e]})}})}function cst(e){const t=Mt();return Dt({mutationFn:n=>GNe(n),onSuccess:()=>{t.invalidateQueries({queryKey:[st.ROUTINE_LOGS,e]}),t.invalidateQueries({queryKey:[st.ROUTINE_STATS,e]})}})}function ust(e){const t=Mt();return Dt({mutationFn:n=>qNe(n),onSuccess:()=>{t.invalidateQueries({queryKey:[st.ROUTINE_LOGS,e]}),t.invalidateQueries({queryKey:[st.ROUTINE_STATS,e]})}})}const Nw=e=>{const t=Mt();return Dt({mutationFn:n=>WNe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},dst=e=>{const t=Mt();return Dt({mutationFn:n=>YNe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},fst=e=>{const t=Mt();return Dt({mutationFn:n=>KNe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},pst=()=>yr({queryKey:[st.ROUTINE_WEIGHT_UNITS],queryFn:Qoe}),hst=()=>yr({queryKey:[st.ROUTINE_REP_UNITS],queryFn:Yoe}),mst=e=>{const t=Mt();return Dt({mutationFn:n=>eLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},gst=e=>{const t=Mt();return Dt({mutationFn:n=>tLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},yst=e=>{const t=Mt();return Dt({mutationFn:n=>nLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},vst=e=>{const t=Mt();return Dt({mutationFn:n=>rLe(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},bst=(e,t)=>yr({queryFn:()=>_Le(t),queryKey:[st.SESSION_SEARCH,e,JSON.stringify(t)]}),xst=()=>{const e=Mt();return Dt({mutationFn:t=>NLe(t),onSuccess:()=>e.invalidateQueries({queryKey:[st.ROUTINE_OVERVIEW]})})},Sst=e=>yr({queryFn:()=>$Le(e),queryKey:[st.SESSIONS_FULL,JSON.stringify(e||{})]}),wst=e=>{const t=Mt();return Dt({mutationFn:n=>LLe(n),onSuccess:()=>{t.invalidateQueries({queryKey:[st.ROUTINE_OVERVIEW]}),t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})}})},Ko=Ot(k.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"})),Jue=Ot(k.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m5 11h-4v4h-2v-4H7v-2h4V7h2v4h4z"})),Cst=Ot(k.jsx("path",{d:"M22 5v2h-3v3h-2V7h-3V5h3V2h2v3zm-3 14H5V5h6V3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-6h-2zm-4-6v4h2v-4zm-4 4h2V9h-2zm-2 0v-6H7v6z"})),Est=Ot(k.jsx("path",{d:"m7 10 5 5 5-5z"})),Tst=Ot(k.jsx("path",{d:"m7 14 5-5 5 5z"})),Ost=Ot(k.jsx("path",{d:"M6.23 20.23 8 22l10-10L8 2 6.23 3.77 14.46 12z"})),Zue=Ot(k.jsx("path",{d:"M4 9h4v11H4zm12 4h4v7h-4zm-6-9h4v16h-4z"})),Ist=Ot(k.jsx("path",{d:"m19 8-4 4h3c0 3.31-2.69 6-6 6-1.01 0-1.97-.25-2.8-.7l-1.46 1.46C8.97 19.54 10.43 20 12 20c4.42 0 8-3.58 8-8h3zM6 12c0-3.31 2.69-6 6-6 1.01 0 1.97.25 2.8.7l1.46-1.46C15.03 4.46 13.57 4 12 4c-4.42 0-8 3.58-8 8H1l4 4 4-4z"})),Pst=Ot(k.jsx("path",{d:"M19 4h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m0 16H5V10h14zM9 14H7v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2zm-8 4H7v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2z"})),Ast=Ot([k.jsx("circle",{cx:"12",cy:"12",r:"3.2"},"0"),k.jsx("path",{d:"M9 2 7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5"},"1")]),Mst=Ot(k.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12z"})),Rst=Ot(k.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2m-9 14-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"})),Dst=Ot(k.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"})),kst=Ot(k.jsx("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"})),ede=Ot(k.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),_st=Ot(k.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),$st=Ot(k.jsx("path",{d:"M22 16V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2m-11-4 2.03 2.71L16 11l4 5H8zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6z"})),Nst=Ot(k.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"})),MP=Ot(k.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"})),Lst=Ot(k.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM8 9h8v10H8zm7.5-5-1-1h-5l-1 1H5v2h14V4z"})),OS=Ot(k.jsx("path",{d:"M16 9v10H8V9zm-1.5-6h-5l-1 1H5v2h14V4h-3.5zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2z"})),tde=Ot(k.jsx("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"})),DV=Ot(k.jsx("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"})),Fst=Ot(k.jsx("path",{d:"m12.126 8.125 1.937-1.937 3.747 3.747-1.937 1.938zM20.71 5.63l-2.34-2.34a1 1 0 0 0-1.41 0l-1.83 1.83 3.75 3.75L20.71 7a1 1 0 0 0 0-1.37M2 5l6.63 6.63L3 17.25V21h3.75l5.63-5.62L18 21l2-2L4 3z"})),jst=Ot(k.jsx("path",{d:"M4.25 5.61C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39c.51-.66.04-1.61-.79-1.61H5.04c-.83 0-1.3.95-.79 1.61"})),Bst=Ot(k.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m6 13h-5l-1-2H9.5v5H8V7h6l1 2h3z"})),IS=Ot(k.jsx("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"})),nde=Ot(k.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z"})),rde=Ot(k.jsx("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"})),zst=Ot(k.jsx("path",{d:"m14 6-3.75 5 2.85 3.8-1.6 1.2C9.81 13.75 7 10 7 10l-6 8h22z"})),Vst=Ot(k.jsx("path",{d:"m14 6-4.22 5.63 1.25 1.67L14 9.33 19 16h-8.46l-4.01-5.37L1 18h22zM5 16l1.52-2.03L8.04 16z"})),Hst=Ot([k.jsx("path",{d:"M5 16h3.04l-1.52-2.03z",opacity:".3"},"0"),k.jsx("path",{d:"m9.78 11.63 1.25 1.67L14 9.33 19 16h-8.46l-4.01-5.37L1 18h22L14 6zM5 16l1.52-2.03L8.04 16z"},"1")]),kV=Ot(k.jsx("path",{d:"M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"})),Ust=Ot(k.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"})),ode=Ot(k.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"})),Gst=Ot(k.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),qst=Ot(k.jsx("path",{d:"M9 5v2h6.59L4 18.59 5.41 20 17 8.41V15h2V5z"})),Wst=Ot([k.jsx("circle",{cx:"12",cy:"12",r:"3.2"},"0"),k.jsx("path",{d:"M9 2 7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5"},"1")]),Kst=Ot(k.jsx("path",{d:"M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7z"})),ide=Ot(k.jsx("path",{d:"M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3m3-10H5V5h10z"})),Yst=Ot([k.jsx("path",{d:"M9 15.5h6v1H9z"},"0"),k.jsx("circle",{cx:"15.5",cy:"9.5",r:"1.5"},"1"),k.jsx("circle",{cx:"8.5",cy:"9.5",r:"1.5"},"2"),k.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"},"3")]),Qst=Ot([k.jsx("circle",{cx:"15.5",cy:"9.5",r:"1.5"},"0"),k.jsx("circle",{cx:"8.5",cy:"9.5",r:"1.5"},"1"),k.jsx("circle",{cx:"15.5",cy:"9.5",r:"1.5"},"2"),k.jsx("circle",{cx:"8.5",cy:"9.5",r:"1.5"},"3"),k.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8m0-2.5c2.33 0 4.32-1.45 5.12-3.5h-1.67c-.69 1.19-1.97 2-3.45 2s-2.75-.81-3.45-2H6.88c.8 2.05 2.79 3.5 5.12 3.5"},"4")]),Xst=Ot([k.jsx("circle",{cx:"15.5",cy:"9.5",r:"1.5"},"0"),k.jsx("circle",{cx:"8.5",cy:"9.5",r:"1.5"},"1"),k.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8m0-6c-2.33 0-4.32 1.45-5.12 3.5h1.67c.69-1.19 1.97-2 3.45-2s2.75.81 3.45 2h1.67c-.8-2.05-2.79-3.5-5.12-3.5"},"2")]),Jst=Ot(k.jsx("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"})),Zst=Ot(k.jsx("path",{d:"M19 9h-2v6.59L5.41 4 4 5.41 15.59 17H9v2h10z"})),elt=Ot(k.jsx("path",{d:"M21 5.47 12 12 7.62 7.62 3 11V8.52L7.83 5l4.38 4.38L21 3zM21 15h-4.7l-4.17 3.34L6 12.41l-3 2.13V17l2.8-2 6.2 6 5-4h4z"})),tlt=Ot(k.jsx("path",{d:"M6.99 11 3 15l3.99 4v-3H14v-2H6.99zM21 9l-3.99-4v3H10v2h7.01v3z"})),RP=e=>{if(e.query.isLoading)return S(Er,{});if(e.query.isError)return S(Zt,{sx:{height:200,alignItems:"center",mt:2},component:Ft,direction:"column",justifyContent:"center",children:Q(Ci,{severity:"error",children:["Error while fetching data: ",e.query.error.message]})});if(e.query.isSuccess)return e.child},nlt=e=>{var r;const t=e.avatarSize||40,n=e.iconSize||40;return S(Kl,{sx:{height:t,width:t},src:(r=e.image)==null?void 0:r.url,children:S(Ju,{sx:{height:n,width:n}})})};function ade(){return yr({queryKey:[st.EXERCISES],queryFn:h2e})}function rlt(e){return yr({queryKey:[st.EXERCISE_DETAIL,e],queryFn:()=>pv(e)})}function olt(e){const t=Mt();return Dt({mutationFn:n=>QN(n),onSuccess:()=>{t.invalidateQueries({queryKey:[st.EXERCISES]}),t.invalidateQueries({queryKey:[st.EXERCISE_DETAIL,e]})}})}function ilt(e){const t=Mt();return Dt({mutationFn:n=>b2e(n),onSuccess:()=>{t.invalidateQueries({queryKey:[st.EXERCISES]}),t.invalidateQueries({queryKey:[st.EXERCISE_DETAIL,e]})}})}function alt(e){const t=Mt();return Dt({mutationFn:n=>C2e(n),onSuccess:()=>{t.invalidateQueries({queryKey:[st.EXERCISES]}),t.invalidateQueries({queryKey:[st.EXERCISE_DETAIL,e]})}})}function slt(e){const t=Mt();return Dt({mutationFn:n=>jre(n),onSuccess:()=>{t.invalidateQueries({queryKey:[st.EXERCISES]}),t.invalidateQueries({queryKey:[st.EXERCISE_DETAIL,e]})}})}function DP(){return yr({queryKey:[st.CATEGORIES],queryFn:Qke})}function _v(){return yr({queryKey:[st.MUSCLES],queryFn:vke})}function kP(){return yr({queryKey:[st.EQUIPMENT],queryFn:Wke})}function Yc(){return yr({queryKey:[st.LANGUAGES],queryFn:w2e})}var y0={},QX;function llt(){if(QX)return y0;QX=1,Object.defineProperty(y0,"__esModule",{value:!0}),y0.parse=a,y0.serialize=c;const e=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,t=/^[\u0021-\u003A\u003C-\u007E]*$/,n=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,r=/^[\u0020-\u003A\u003D-\u007E]*$/,o=Object.prototype.toString,i=(()=>{const h=function(){};return h.prototype=Object.create(null),h})();function a(h,m){const g=new i,y=h.length;if(y<2)return g;const v=(m==null?void 0:m.decode)||u;let w=0;do{const C=h.indexOf("=",w);if(C===-1)break;const E=h.indexOf(";",w),I=E===-1?y:E;if(C>I){w=h.lastIndexOf(";",C-1)+1;continue}const O=s(h,w,C),P=l(h,C,O),R=h.slice(O,P);if(g[R]===void 0){let D=s(h,C+1,I),M=l(h,I,D);const A=v(h.slice(D,M));g[R]=A}w=I+1}while(w<y);return g}function s(h,m,g){do{const y=h.charCodeAt(m);if(y!==32&&y!==9)return m}while(++m<g);return g}function l(h,m,g){for(;m>g;){const y=h.charCodeAt(--m);if(y!==32&&y!==9)return m+1}return g}function c(h,m,g){const y=(g==null?void 0:g.encode)||encodeURIComponent;if(!e.test(h))throw new TypeError(`argument name is invalid: ${h}`);const v=y(m);if(!t.test(v))throw new TypeError(`argument val is invalid: ${m}`);let w=h+"="+v;if(!g)return w;if(g.maxAge!==void 0){if(!Number.isInteger(g.maxAge))throw new TypeError(`option maxAge is invalid: ${g.maxAge}`);w+="; Max-Age="+g.maxAge}if(g.domain){if(!n.test(g.domain))throw new TypeError(`option domain is invalid: ${g.domain}`);w+="; Domain="+g.domain}if(g.path){if(!r.test(g.path))throw new TypeError(`option path is invalid: ${g.path}`);w+="; Path="+g.path}if(g.expires){if(!f(g.expires)||!Number.isFinite(g.expires.valueOf()))throw new TypeError(`option expires is invalid: ${g.expires}`);w+="; Expires="+g.expires.toUTCString()}if(g.httpOnly&&(w+="; HttpOnly"),g.secure&&(w+="; Secure"),g.partitioned&&(w+="; Partitioned"),g.priority)switch(typeof g.priority=="string"?g.priority.toLowerCase():void 0){case"low":w+="; Priority=Low";break;case"medium":w+="; Priority=Medium";break;case"high":w+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${g.priority}`)}if(g.sameSite)switch(typeof g.sameSite=="string"?g.sameSite.toLowerCase():g.sameSite){case!0:case"strict":w+="; SameSite=Strict";break;case"lax":w+="; SameSite=Lax";break;case"none":w+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${g.sameSite}`)}return w}function u(h){if(h.indexOf("%")===-1)return h;try{return decodeURIComponent(h)}catch{return h}}function f(h){return o.call(h)==="[object Date]"}return y0}llt();var XX="popstate";function clt(e={}){function t(r,o){let{pathname:i,search:a,hash:s}=r.location;return ZF("",{pathname:i,search:a,hash:s},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:PS(o)}return dlt(t,n,null,e)}function ro(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Bc(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function ult(){return Math.random().toString(36).substring(2,10)}function JX(e,t){return{usr:e.state,key:e.key,idx:t}}function ZF(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?$v(t):t,state:n,key:t&&t.key||r||ult()}}function PS({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function $v(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function dlt(e,t,n,r={}){let{window:o=document.defaultView,v5Compat:i=!1}=r,a=o.history,s="POP",l=null,c=u();c==null&&(c=0,a.replaceState({...a.state,idx:c},""));function u(){return(a.state||{idx:null}).idx}function f(){s="POP";let v=u(),w=v==null?null:v-c;c=v,l&&l({action:s,location:y.location,delta:w})}function h(v,w){s="PUSH";let C=ZF(y.location,v,w);c=u()+1;let E=JX(C,c),I=y.createHref(C);try{a.pushState(E,"",I)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;o.location.assign(I)}i&&l&&l({action:s,location:y.location,delta:1})}function m(v,w){s="REPLACE";let C=ZF(y.location,v,w);c=u();let E=JX(C,c),I=y.createHref(C);a.replaceState(E,"",I),i&&l&&l({action:s,location:y.location,delta:0})}function g(v){return flt(v)}let y={get action(){return s},get location(){return e(o,a)},listen(v){if(l)throw new Error("A history only accepts one active listener");return o.addEventListener(XX,f),l=v,()=>{o.removeEventListener(XX,f),l=null}},createHref(v){return t(o,v)},createURL:g,encodeLocation(v){let w=g(v);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:h,replace:m,go(v){return a.go(v)}};return y}function flt(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),ro(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:PS(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function sde(e,t,n="/"){return plt(e,t,n,!1)}function plt(e,t,n,r){let o=typeof t=="string"?$v(t):t,i=Qu(o.pathname||"/",n);if(i==null)return null;let a=lde(e);hlt(a);let s=null;for(let l=0;s==null&&l<a.length;++l){let c=Tlt(i);s=Clt(a[l],c,r)}return s}function lde(e,t=[],n=[],r=""){let o=(i,a,s)=>{let l={relativePath:s===void 0?i.path||"":s,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};l.relativePath.startsWith("/")&&(ro(l.relativePath.startsWith(r),`Absolute route path "${l.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),l.relativePath=l.relativePath.slice(r.length));let c=Fu([r,l.relativePath]),u=n.concat(l);i.children&&i.children.length>0&&(ro(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${c}".`),lde(i.children,t,u,c)),!(i.path==null&&!i.index)&&t.push({path:c,score:Slt(c,i.index),routesMeta:u})};return e.forEach((i,a)=>{var s;if(i.path===""||!((s=i.path)!=null&&s.includes("?")))o(i,a);else for(let l of cde(i.path))o(i,a,l)}),t}function cde(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let a=cde(r.join("/")),s=[];return s.push(...a.map(l=>l===""?i:[i,l].join("/"))),o&&s.push(...a),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function hlt(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:wlt(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var mlt=/^:[\w-]+$/,glt=3,ylt=2,vlt=1,blt=10,xlt=-2,ZX=e=>e==="*";function Slt(e,t){let n=e.split("/"),r=n.length;return n.some(ZX)&&(r+=xlt),t&&(r+=ylt),n.filter(o=>!ZX(o)).reduce((o,i)=>o+(mlt.test(i)?glt:i===""?vlt:blt),r)}function wlt(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function Clt(e,t,n=!1){let{routesMeta:r}=e,o={},i="/",a=[];for(let s=0;s<r.length;++s){let l=r[s],c=s===r.length-1,u=i==="/"?t:t.slice(i.length)||"/",f=bO({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},u),h=l.route;if(!f&&c&&n&&!r[r.length-1].route.index&&(f=bO({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},u)),!f)return null;Object.assign(o,f.params),a.push({params:o,pathname:Fu([i,f.pathname]),pathnameBase:Alt(Fu([i,f.pathnameBase])),route:h}),f.pathnameBase!=="/"&&(i=Fu([i,f.pathnameBase]))}return a}function bO(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Elt(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let i=o[0],a=i.replace(/(.)\/+$/,"$1"),s=o.slice(1);return{params:r.reduce((c,{paramName:u,isOptional:f},h)=>{if(u==="*"){let g=s[h]||"";a=i.slice(0,i.length-g.length).replace(/(.)\/+$/,"$1")}const m=s[h];return f&&!m?c[u]=void 0:c[u]=(m||"").replace(/%2F/g,"/"),c},{}),pathname:i,pathnameBase:a,pattern:e}}function Elt(e,t=!1,n=!0){Bc(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,s,l)=>(r.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function Tlt(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Bc(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Qu(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function Olt(e,t="/"){let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?$v(e):e;return{pathname:n?n.startsWith("/")?n:Ilt(n,t):t,search:Mlt(r),hash:Rlt(o)}}function Ilt(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function l$(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Plt(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function ude(e){let t=Plt(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function dde(e,t,n,r=!1){let o;typeof e=="string"?o=$v(e):(o={...e},ro(!o.pathname||!o.pathname.includes("?"),l$("?","pathname","search",o)),ro(!o.pathname||!o.pathname.includes("#"),l$("#","pathname","hash",o)),ro(!o.search||!o.search.includes("#"),l$("#","search","hash",o)));let i=e===""||o.pathname==="",a=i?"/":o.pathname,s;if(a==null)s=n;else{let f=t.length-1;if(!r&&a.startsWith("..")){let h=a.split("/");for(;h[0]==="..";)h.shift(),f-=1;o.pathname=h.join("/")}s=f>=0?t[f]:"/"}let l=Olt(o,s),c=a&&a!=="/"&&a.endsWith("/"),u=(i||a===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}var Fu=e=>e.join("/").replace(/\/\/+/g,"/"),Alt=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Mlt=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Rlt=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Dlt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var fde=["POST","PUT","PATCH","DELETE"];new Set(fde);var klt=["GET",...fde];new Set(klt);var Nv=x.createContext(null);Nv.displayName="DataRouter";var _P=x.createContext(null);_P.displayName="DataRouterState";var pde=x.createContext({isTransitioning:!1});pde.displayName="ViewTransition";var _lt=x.createContext(new Map);_lt.displayName="Fetchers";var $lt=x.createContext(null);$lt.displayName="Await";var Qc=x.createContext(null);Qc.displayName="Navigation";var Lw=x.createContext(null);Lw.displayName="Location";var Xc=x.createContext({outlet:null,matches:[],isDataRoute:!1});Xc.displayName="Route";var _V=x.createContext(null);_V.displayName="RouteError";function Nlt(e,{relative:t}={}){ro(Fw(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=x.useContext(Qc),{hash:o,pathname:i,search:a}=jw(e,{relative:t}),s=i;return n!=="/"&&(s=i==="/"?n:Fu([n,i])),r.createHref({pathname:s,search:a,hash:o})}function Fw(){return x.useContext(Lw)!=null}function Zh(){return ro(Fw(),"useLocation() may be used only in the context of a <Router> component."),x.useContext(Lw).location}var hde="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function mde(e){x.useContext(Qc).static||x.useLayoutEffect(e)}function id(){let{isDataRoute:e}=x.useContext(Xc);return e?Ylt():Llt()}function Llt(){ro(Fw(),"useNavigate() may be used only in the context of a <Router> component.");let e=x.useContext(Nv),{basename:t,navigator:n}=x.useContext(Qc),{matches:r}=x.useContext(Xc),{pathname:o}=Zh(),i=JSON.stringify(ude(r)),a=x.useRef(!1);return mde(()=>{a.current=!0}),x.useCallback((l,c={})=>{if(Bc(a.current,hde),!a.current)return;if(typeof l=="number"){n.go(l);return}let u=dde(l,JSON.parse(i),o,c.relative==="path");e==null&&t!=="/"&&(u.pathname=u.pathname==="/"?t:Fu([t,u.pathname])),(c.replace?n.replace:n.push)(u,c.state,c)},[t,n,i,o,e])}x.createContext(null);function Ma(){let{matches:e}=x.useContext(Xc),t=e[e.length-1];return t?t.params:{}}function jw(e,{relative:t}={}){let{matches:n}=x.useContext(Xc),{pathname:r}=Zh(),o=JSON.stringify(ude(n));return x.useMemo(()=>dde(e,JSON.parse(o),r,t==="path"),[e,o,r,t])}function Flt(e,t){return gde(e,t)}function gde(e,t,n,r){var w;ro(Fw(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=x.useContext(Qc),{matches:i}=x.useContext(Xc),a=i[i.length-1],s=a?a.params:{},l=a?a.pathname:"/",c=a?a.pathnameBase:"/",u=a&&a.route;{let C=u&&u.path||"";yde(l,!u||C.endsWith("*")||C.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${C}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
-Please change the parent <Route path="${C}"> to <Route path="${C==="/"?"*":`${C}/*`}">.`)}let f=Zh(),h;if(t){let C=typeof t=="string"?$v(t):t;ro(c==="/"||((w=C.pathname)==null?void 0:w.startsWith(c)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${C.pathname}" was given in the \`location\` prop.`),h=C}else h=f;let m=h.pathname||"/",g=m;if(c!=="/"){let C=c.replace(/^\//,"").split("/");g="/"+m.replace(/^\//,"").split("/").slice(C.length).join("/")}let y=sde(e,{pathname:g});Bc(u||y!=null,`No routes matched location "${h.pathname}${h.search}${h.hash}" `),Bc(y==null||y[y.length-1].route.element!==void 0||y[y.length-1].route.Component!==void 0||y[y.length-1].route.lazy!==void 0,`Matched leaf route at location "${h.pathname}${h.search}${h.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let v=Hlt(y&&y.map(C=>Object.assign({},C,{params:Object.assign({},s,C.params),pathname:Fu([c,o.encodeLocation?o.encodeLocation(C.pathname).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?c:Fu([c,o.encodeLocation?o.encodeLocation(C.pathnameBase).pathname:C.pathnameBase])})),i,n,r);return t&&v?x.createElement(Lw.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...h},navigationType:"POP"}},v):v}function jlt(){let e=Klt(),t=Dlt(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:r},i={padding:"2px 4px",backgroundColor:r},a=null;return console.error("Error handled by React Router default ErrorBoundary:",e),a=x.createElement(x.Fragment,null,x.createElement("p",null,"💿 Hey developer 👋"),x.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",x.createElement("code",{style:i},"ErrorBoundary")," or"," ",x.createElement("code",{style:i},"errorElement")," prop on your route.")),x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},t),n?x.createElement("pre",{style:o},n):null,a)}var Blt=x.createElement(jlt,null),zlt=class extends x.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?x.createElement(Xc.Provider,{value:this.props.routeContext},x.createElement(_V.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function Vlt({routeContext:e,match:t,children:n}){let r=x.useContext(Nv);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),x.createElement(Xc.Provider,{value:e},n)}function Hlt(e,t=[],n=null,r=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,i=n==null?void 0:n.errors;if(i!=null){let l=o.findIndex(c=>c.route.id&&(i==null?void 0:i[c.route.id])!==void 0);ro(l>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),o=o.slice(0,Math.min(o.length,l+1))}let a=!1,s=-1;if(n)for(let l=0;l<o.length;l++){let c=o[l];if((c.route.HydrateFallback||c.route.hydrateFallbackElement)&&(s=l),c.route.id){let{loaderData:u,errors:f}=n,h=c.route.loader&&!u.hasOwnProperty(c.route.id)&&(!f||f[c.route.id]===void 0);if(c.route.lazy||h){a=!0,s>=0?o=o.slice(0,s+1):o=[o[0]];break}}}return o.reduceRight((l,c,u)=>{let f,h=!1,m=null,g=null;n&&(f=i&&c.route.id?i[c.route.id]:void 0,m=c.route.errorElement||Blt,a&&(s<0&&u===0?(yde("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),h=!0,g=null):s===u&&(h=!0,g=c.route.hydrateFallbackElement||null)));let y=t.concat(o.slice(0,u+1)),v=()=>{let w;return f?w=m:h?w=g:c.route.Component?w=x.createElement(c.route.Component,null):c.route.element?w=c.route.element:w=l,x.createElement(Vlt,{match:c,routeContext:{outlet:l,matches:y,isDataRoute:n!=null},children:w})};return n&&(c.route.ErrorBoundary||c.route.errorElement||u===0)?x.createElement(zlt,{location:n.location,revalidation:n.revalidation,component:m,error:f,children:v(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):v()},null)}function $V(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ult(e){let t=x.useContext(Nv);return ro(t,$V(e)),t}function Glt(e){let t=x.useContext(_P);return ro(t,$V(e)),t}function qlt(e){let t=x.useContext(Xc);return ro(t,$V(e)),t}function NV(e){let t=qlt(e),n=t.matches[t.matches.length-1];return ro(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Wlt(){return NV("useRouteId")}function Klt(){var r;let e=x.useContext(_V),t=Glt("useRouteError"),n=NV("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function Ylt(){let{router:e}=Ult("useNavigate"),t=NV("useNavigate"),n=x.useRef(!1);return mde(()=>{n.current=!0}),x.useCallback(async(o,i={})=>{Bc(n.current,hde),n.current&&(typeof o=="number"?e.navigate(o):await e.navigate(o,{fromRouteId:t,...i}))},[e,t])}var eJ={};function yde(e,t,n){!t&&!eJ[e]&&(eJ[e]=!0,Bc(!1,n))}x.memo(Qlt);function Qlt({routes:e,future:t,state:n}){return gde(e,void 0,n,t)}function Ht(e){ro(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Xlt({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:o,static:i=!1}){ro(!Fw(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let a=e.replace(/^\/*/,"/"),s=x.useMemo(()=>({basename:a,navigator:o,static:i,future:{}}),[a,o,i]);typeof n=="string"&&(n=$v(n));let{pathname:l="/",search:c="",hash:u="",state:f=null,key:h="default"}=n,m=x.useMemo(()=>{let g=Qu(l,a);return g==null?null:{location:{pathname:g,search:c,hash:u,state:f,key:h},navigationType:r}},[a,l,c,u,f,h,r]);return Bc(m!=null,`<Router basename="${a}"> is not able to match the URL "${l}${c}${u}" because it does not start with the basename, so the <Router> won't render anything.`),m==null?null:x.createElement(Qc.Provider,{value:s},x.createElement(Lw.Provider,{children:t,value:m}))}function Jlt({children:e,location:t}){return Flt(ej(e),t)}function ej(e,t=[]){let n=[];return x.Children.forEach(e,(r,o)=>{if(!x.isValidElement(r))return;let i=[...t,o];if(r.type===x.Fragment){n.push.apply(n,ej(r.props.children,i));return}ro(r.type===Ht,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ro(!r.props.index||!r.props.children,"An index route cannot have child routes.");let a={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(a.children=ej(r.props.children,i)),n.push(a)}),n}var PE="get",AE="application/x-www-form-urlencoded";function $P(e){return e!=null&&typeof e.tagName=="string"}function Zlt(e){return $P(e)&&e.tagName.toLowerCase()==="button"}function ect(e){return $P(e)&&e.tagName.toLowerCase()==="form"}function tct(e){return $P(e)&&e.tagName.toLowerCase()==="input"}function nct(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function rct(e,t){return e.button===0&&(!t||t==="_self")&&!nct(e)}var J1=null;function oct(){if(J1===null)try{new FormData(document.createElement("form"),0),J1=!1}catch{J1=!0}return J1}var ict=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function c$(e){return e!=null&&!ict.has(e)?(Bc(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${AE}"`),null):e}function act(e,t){let n,r,o,i,a;if(ect(e)){let s=e.getAttribute("action");r=s?Qu(s,t):null,n=e.getAttribute("method")||PE,o=c$(e.getAttribute("enctype"))||AE,i=new FormData(e)}else if(Zlt(e)||tct(e)&&(e.type==="submit"||e.type==="image")){let s=e.form;if(s==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||s.getAttribute("action");if(r=l?Qu(l,t):null,n=e.getAttribute("formmethod")||s.getAttribute("method")||PE,o=c$(e.getAttribute("formenctype"))||c$(s.getAttribute("enctype"))||AE,i=new FormData(s,e),!oct()){let{name:c,type:u,value:f}=e;if(u==="image"){let h=c?`${c}.`:"";i.append(`${h}x`,"0"),i.append(`${h}y`,"0")}else c&&i.append(c,f)}}else{if($P(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=PE,r=null,o=AE,a=e}return i&&o==="text/plain"&&(a=i,i=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:i,body:a}}function LV(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}async function sct(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function lct(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function cct(e,t,n){let r=await Promise.all(e.map(async o=>{let i=t.routes[o.route.id];if(i){let a=await sct(i,n);return a.links?a.links():[]}return[]}));return pct(r.flat(1).filter(lct).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function tJ(e,t,n,r,o,i){let a=(l,c)=>n[c]?l.route.id!==n[c].route.id:!0,s=(l,c)=>{var u;return n[c].pathname!==l.pathname||((u=n[c].route.path)==null?void 0:u.endsWith("*"))&&n[c].params["*"]!==l.params["*"]};return i==="assets"?t.filter((l,c)=>a(l,c)||s(l,c)):i==="data"?t.filter((l,c)=>{var f;let u=r.routes[l.route.id];if(!u||!u.hasLoader)return!1;if(a(l,c)||s(l,c))return!0;if(l.route.shouldRevalidate){let h=l.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((f=n[0])==null?void 0:f.params)||{},nextUrl:new URL(e,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof h=="boolean")return h}return!0}):[]}function uct(e,t,{includeHydrateFallback:n}={}){return dct(e.map(r=>{let o=t.routes[r.route.id];if(!o)return[];let i=[o.module];return o.clientActionModule&&(i=i.concat(o.clientActionModule)),o.clientLoaderModule&&(i=i.concat(o.clientLoaderModule)),n&&o.hydrateFallbackModule&&(i=i.concat(o.hydrateFallbackModule)),o.imports&&(i=i.concat(o.imports)),i}).flat(1))}function dct(e){return[...new Set(e)]}function fct(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function pct(e,t){let n=new Set;return new Set(t),e.reduce((r,o)=>{let i=JSON.stringify(fct(o));return n.has(i)||(n.add(i),r.push({key:i,link:o})),r},[])}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var hct=new Set([100,101,204,205]);function mct(e,t){let n=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n.pathname==="/"?n.pathname="_root.data":t&&Qu(n.pathname,t)==="/"?n.pathname=`${t.replace(/\/$/,"")}/_root.data`:n.pathname=`${n.pathname.replace(/\/$/,"")}.data`,n}function vde(){let e=x.useContext(Nv);return LV(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function gct(){let e=x.useContext(_P);return LV(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var FV=x.createContext(void 0);FV.displayName="FrameworkContext";function bde(){let e=x.useContext(FV);return LV(e,"You must render this element inside a <HydratedRouter> element"),e}function yct(e,t){let n=x.useContext(FV),[r,o]=x.useState(!1),[i,a]=x.useState(!1),{onFocus:s,onBlur:l,onMouseEnter:c,onMouseLeave:u,onTouchStart:f}=t,h=x.useRef(null);x.useEffect(()=>{if(e==="render"&&a(!0),e==="viewport"){let y=w=>{w.forEach(C=>{a(C.isIntersecting)})},v=new IntersectionObserver(y,{threshold:.5});return h.current&&v.observe(h.current),()=>{v.disconnect()}}},[e]),x.useEffect(()=>{if(r){let y=setTimeout(()=>{a(!0)},100);return()=>{clearTimeout(y)}}},[r]);let m=()=>{o(!0)},g=()=>{o(!1),a(!1)};return n?e!=="intent"?[i,h,{}]:[i,h,{onFocus:v0(s,m),onBlur:v0(l,g),onMouseEnter:v0(c,m),onMouseLeave:v0(u,g),onTouchStart:v0(f,m)}]:[!1,h,{}]}function v0(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function vct({page:e,...t}){let{router:n}=vde(),r=x.useMemo(()=>sde(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?x.createElement(xct,{page:e,matches:r,...t}):null}function bct(e){let{manifest:t,routeModules:n}=bde(),[r,o]=x.useState([]);return x.useEffect(()=>{let i=!1;return cct(e,t,n).then(a=>{i||o(a)}),()=>{i=!0}},[e,t,n]),r}function xct({page:e,matches:t,...n}){let r=Zh(),{manifest:o,routeModules:i}=bde(),{basename:a}=vde(),{loaderData:s,matches:l}=gct(),c=x.useMemo(()=>tJ(e,t,l,o,r,"data"),[e,t,l,o,r]),u=x.useMemo(()=>tJ(e,t,l,o,r,"assets"),[e,t,l,o,r]),f=x.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let g=new Set,y=!1;if(t.forEach(w=>{var E;let C=o.routes[w.route.id];!C||!C.hasLoader||(!c.some(I=>I.route.id===w.route.id)&&w.route.id in s&&((E=i[w.route.id])!=null&&E.shouldRevalidate)||C.hasClientLoader?y=!0:g.add(w.route.id))}),g.size===0)return[];let v=mct(e,a);return y&&g.size>0&&v.searchParams.set("_routes",t.filter(w=>g.has(w.route.id)).map(w=>w.route.id).join(",")),[v.pathname+v.search]},[a,s,r,o,c,t,e,i]),h=x.useMemo(()=>uct(u,o),[u,o]),m=bct(u);return x.createElement(x.Fragment,null,f.map(g=>x.createElement("link",{key:g,rel:"prefetch",as:"fetch",href:g,...n})),h.map(g=>x.createElement("link",{key:g,rel:"modulepreload",href:g,...n})),m.map(({key:g,link:y})=>x.createElement("link",{key:g,...y})))}function Sct(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var xde=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{xde&&(window.__reactRouterVersion="7.6.1")}catch{}function jV({basename:e,children:t,window:n}){let r=x.useRef();r.current==null&&(r.current=clt({window:n,v5Compat:!0}));let o=r.current,[i,a]=x.useState({action:o.action,location:o.location}),s=x.useCallback(l=>{x.startTransition(()=>a(l))},[a]);return x.useLayoutEffect(()=>o.listen(s),[o,s]),x.createElement(Xlt,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:o})}var Sde=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ro=x.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:o,reloadDocument:i,replace:a,state:s,target:l,to:c,preventScrollReset:u,viewTransition:f,...h},m){let{basename:g}=x.useContext(Qc),y=typeof c=="string"&&Sde.test(c),v,w=!1;if(typeof c=="string"&&y&&(v=c,xde))try{let M=new URL(window.location.href),A=c.startsWith("//")?new URL(M.protocol+c):new URL(c),_=Qu(A.pathname,g);A.origin===M.origin&&_!=null?c=_+A.search+A.hash:w=!0}catch{Bc(!1,`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let C=Nlt(c,{relative:o}),[E,I,O]=yct(r,h),P=Tct(c,{replace:a,state:s,target:l,preventScrollReset:u,relative:o,viewTransition:f});function R(M){t&&t(M),M.defaultPrevented||P(M)}let D=x.createElement("a",{...h,...O,href:v||C,onClick:w||i?t:R,ref:Sct(m,I),target:l,"data-discover":!y&&n==="render"?"true":void 0});return E&&!y?x.createElement(x.Fragment,null,D,x.createElement(vct,{page:C})):D});Ro.displayName="Link";var wct=x.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:o=!1,style:i,to:a,viewTransition:s,children:l,...c},u){let f=jw(a,{relative:c.relative}),h=Zh(),m=x.useContext(_P),{navigator:g,basename:y}=x.useContext(Qc),v=m!=null&&Mct(f)&&s===!0,w=g.encodeLocation?g.encodeLocation(f).pathname:f.pathname,C=h.pathname,E=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;n||(C=C.toLowerCase(),E=E?E.toLowerCase():null,w=w.toLowerCase()),E&&y&&(E=Qu(E,y)||E);const I=w!=="/"&&w.endsWith("/")?w.length-1:w.length;let O=C===w||!o&&C.startsWith(w)&&C.charAt(I)==="/",P=E!=null&&(E===w||!o&&E.startsWith(w)&&E.charAt(w.length)==="/"),R={isActive:O,isPending:P,isTransitioning:v},D=O?t:void 0,M;typeof r=="function"?M=r(R):M=[r,O?"active":null,P?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let A=typeof i=="function"?i(R):i;return x.createElement(Ro,{...c,"aria-current":D,className:M,ref:u,style:A,to:a,viewTransition:s},typeof l=="function"?l(R):l)});wct.displayName="NavLink";var Cct=x.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:o,state:i,method:a=PE,action:s,onSubmit:l,relative:c,preventScrollReset:u,viewTransition:f,...h},m)=>{let g=Pct(),y=Act(s,{relative:c}),v=a.toLowerCase()==="get"?"get":"post",w=typeof s=="string"&&Sde.test(s),C=E=>{if(l&&l(E),E.defaultPrevented)return;E.preventDefault();let I=E.nativeEvent.submitter,O=(I==null?void 0:I.getAttribute("formmethod"))||a;g(I||E.currentTarget,{fetcherKey:t,method:O,navigate:n,replace:o,state:i,relative:c,preventScrollReset:u,viewTransition:f})};return x.createElement("form",{ref:m,method:v,action:y,onSubmit:r?l:C,...h,"data-discover":!w&&e==="render"?"true":void 0})});Cct.displayName="Form";function Ect(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function wde(e){let t=x.useContext(Nv);return ro(t,Ect(e)),t}function Tct(e,{target:t,replace:n,state:r,preventScrollReset:o,relative:i,viewTransition:a}={}){let s=id(),l=Zh(),c=jw(e,{relative:i});return x.useCallback(u=>{if(rct(u,t)){u.preventDefault();let f=n!==void 0?n:PS(l)===PS(c);s(e,{replace:f,state:r,preventScrollReset:o,relative:i,viewTransition:a})}},[l,s,c,n,r,t,e,o,i,a])}var Oct=0,Ict=()=>`__${String(++Oct)}__`;function Pct(){let{router:e}=wde("useSubmit"),{basename:t}=x.useContext(Qc),n=Wlt();return x.useCallback(async(r,o={})=>{let{action:i,method:a,encType:s,formData:l,body:c}=act(r,t);if(o.navigate===!1){let u=o.fetcherKey||Ict();await e.fetch(u,n,o.action||i,{preventScrollReset:o.preventScrollReset,formData:l,body:c,formMethod:o.method||a,formEncType:o.encType||s,flushSync:o.flushSync})}else await e.navigate(o.action||i,{preventScrollReset:o.preventScrollReset,formData:l,body:c,formMethod:o.method||a,formEncType:o.encType||s,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[e,t,n])}function Act(e,{relative:t}={}){let{basename:n}=x.useContext(Qc),r=x.useContext(Xc);ro(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),i={...jw(e||".",{relative:t})},a=Zh();if(e==null){i.search=a.search;let s=new URLSearchParams(i.search),l=s.getAll("index");if(l.some(u=>u==="")){s.delete("index"),l.filter(f=>f).forEach(f=>s.append("index",f));let u=s.toString();i.search=u?`?${u}`:""}}return(!e||e===".")&&o.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:Fu([n,i.pathname])),PS(i)}function Mct(e,t={}){let n=x.useContext(pde);ro(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=wde("useViewTransitionState"),o=jw(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=Qu(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=Qu(n.nextLocation.pathname,r)||n.nextLocation.pathname;return bO(o.pathname,a)!=null||bO(o.pathname,i)!=null}[...hct];const Rct=()=>{var r,o;const e=Ma(),t=parseInt(e.routineId??"");if(Number.isNaN(t))return S("p",{children:"Please pass an integer as the routine id."});const n=Kc(t);return S(Uu,{maxWidth:"lg",children:S(RP,{query:n,child:n.isSuccess&&Q(Tt,{children:[((r=n.data)==null?void 0:r.description)!==""&&S(at,{variant:"body2",sx:{whiteSpace:"pre-line"},children:(o=n.data)==null?void 0:o.description}),S(Ft,{spacing:2,sx:{mt:2},children:n.data.dayDataCurrentIteration.filter(i=>i.day!==null).map((i,a)=>S(BV,{routineId:t,dayData:i},`dayDetails-${a}`))})]})})})};function Cde(e){var o;const{i18n:t}=je(),n=Yc();let r;return n.isSuccess&&(r=Gu(t.language,n.data)),S(me,{container:!0,alignItems:"center",justifyContent:"center",sx:{height:e.rowHeight,marginBottom:e.marginBottom},children:S(me,{size:12,children:Q(Ft,{spacing:0,children:[S(at,{variant:"h6",children:e.showExercise?(o=e.setConfigData.exercise)==null?void 0:o.getTranslation(r).name:""}),Q("div",{children:[e.setConfigData.textRepr,e.setConfigData.isSpecialType&&S(Wl,{label:e.setConfigData.type,color:"info",size:"small",sx:{marginLeft:"0.5em"}})]}),S(at,{variant:"caption",children:e.setConfigData.comment})]})})})}function Dct(e){return Q(me,{container:!0,justifyContent:"space-between",alignItems:"flex-start",children:[S(me,{size:1,children:S(Ft,{divider:S(Zt,{height:"10px"}),children:e.slotData.exercises.map((t,n)=>S(nlt,{image:t.mainImage,iconSize:40,avatarSize:50},n))})}),S(me,{size:11,children:e.slotData.setConfigs.map((t,n)=>{var o;const r=n===0||t.exerciseId!==((o=e.slotData.setConfigs[n-1])==null?void 0:o.exerciseId);return S(Cde,{setConfigData:t,marginBottom:"1em",showExercise:r},n)})})]})}const BV=e=>{var i;const t=(e.readOnly??!1)||e.dayData.day===null||e.dayData.day.isRest,n=Lr(),[r,o]=je();return Q(ho,{sx:{minWidth:275},children:[S(Jl,{sx:{bgcolor:n.palette.grey.A200},action:e.dayData.day===null||e.dayData.day.isRest||t?null:S(Go,{title:r("routines.addWeightLog"),children:S(pn,{href:cn(Qt.ROUTINE_ADD_LOG,o.language,{id:e.routineId,id2:e.dayData.day.id}),children:S(Cst,{})})}),title:Gre(e.dayData.day),avatar:xa(e.dayData.date,new Date)?S(que,{}):void 0,subheader:S(at,{sx:{whiteSpace:"pre-line"},children:(i=e.dayData.day)==null?void 0:i.description})}),e.dayData.slots.length>0&&S(Fi,{sx:{padding:0,marginBottom:0},children:S(Ft,{children:e.dayData.slots.map((a,s)=>Q("div",{children:[S(Zt,{padding:1,children:S(Dct,{slotData:a,index:s})}),S(ji,{})]},s))})})]})},Ede=()=>{const[e,t]=je(),n=Aat();return n.isLoading?S(Er,{}):n.data!==null?S(kct,{routine:n.data}):S(gB,{title:e("routines.routine"),link:cn(Qt.ROUTINE_ADD,t.language)})},kct=e=>{const[t,n]=je();return Q(ho,{children:[S(Jl,{title:t("routines.routine"),subheader:e.routine.name??"."}),S(Fi,{sx:{height:"510px",overflow:"auto"},children:S(ai,{children:e.routine.dayDataCurrentIteration.filter(r=>r.day!==null).map((r,o)=>S(_ct,{dayData:r},o))})}),S(ll,{children:S(ct,{size:"small",href:cn(Qt.ROUTINE_DETAIL,n.language,{id:e.routine.id}),children:t("seeDetails")})})]})},_ct=e=>{var i,a;const[t,n]=x.useState(!1),{t:r}=je();return Q(Tt,{children:[Q(Fl,{onClick:()=>n(!t),selected:t,disabled:e.dayData.day===null||((i=e.dayData.day)==null?void 0:i.isRest),children:[S(nl,{children:t?S(J0,{}):S(Du,{})}),S(Wr,{primary:Gre(e.dayData.day),slotProps:{secondary:{noWrap:!0,style:{overflow:"hidden",textOverflow:"ellipsis"}}},secondary:(a=e.dayData.day)==null?void 0:a.description}),S(nl,{children:xa(e.dayData.date,new Date)?S(que,{}):void 0})]}),S(aa,{in:t,timeout:"auto",unmountOnExit:!0,children:e.dayData.slots.map((s,l)=>S("div",{children:s.setConfigs.map((c,u)=>S(Cde,{setConfigData:c,rowHeight:"70px",showExercise:!0},u))},l))})]})};function Bw(e="lastWeek"){return yr({queryKey:[st.BODY_WEIGHT,e],queryFn:()=>UDe(e)})}const $ct=()=>{const e=Mt();return Dt({mutationFn:t=>GDe(t),onSuccess:()=>e.invalidateQueries({queryKey:[st.BODY_WEIGHT]})})},Nct=()=>{const e=Mt();return Dt({mutationFn:t=>WDe(t),onError:t=>{console.log(t)},onSuccess:()=>e.invalidateQueries({queryKey:[st.BODY_WEIGHT]})})},Lct=()=>{const e=Mt();return Dt({mutationFn:t=>qDe(t),onSuccess:()=>{e.invalidateQueries({queryKey:[st.BODY_WEIGHT]})}})},Lv=({weightEntry:e,closeFn:t})=>{const n=Bw(),r=Nct(),o=Lct(),[i,a]=x.useState(e?xt.fromJSDate(e.date):xt.now),[s,l]=je(),c=Wo({weight:Do().min(30,"Min weight is 30 kg").max(300,"Max weight is 300 kg").required("Weight field is required")});return n.isLoading?S(Er,{}):S(Ti,{initialValues:{weight:e?e.weight:0,date:Jn(e?e.date:new Date)},validationSchema:c,onSubmit:async u=>{e?(e.weight=u.weight,e.date=new Date(u.date),o.mutate(e)):(e=new gre(new Date(u.date),u.weight),r.mutate(e)),t&&t()},children:u=>S(fi,{children:Q(Ft,{spacing:2,children:[S(dn,{fullWidth:!0,id:"weight",label:s("weight"),error:u.touched.weight&&!!u.touched.weight,helperText:u.touched.weight&&u.errors.weight,...u.getFieldProps("weight")}),S(Ys,{dateAdapter:zl,adapterLocale:l.language,children:S(Ih,{format:"yyyy-MM-dd",label:s("date"),value:i,slotProps:{textField:{variant:"outlined"}},disableFuture:!0,onChange:f=>{f&&u.setFieldValue("date",f.toJSDate()),a(f)},shouldDisableDate:f=>e&&Jn(e.date)===f.toISODate()?!1:f?n.data.some(h=>Jn(h.date)===f.toISODate()):!1})}),S(Ft,{direction:"row",justifyContent:"end",sx:{mt:2},children:S(ct,{color:"primary",variant:"contained",type:"submit",sx:{mt:2},children:s("submit")})})]})})})},Fct="WeightTableDashboard",Tde={table:`${Fct}-table`},jct=ae("div")(({theme:e})=>({[`&.${Tde.table}`]:{"& .MuiPaper-root":{border:"1px solid #bababa"}}})),Bct=({weights:e})=>{const[t]=je(),r=e.slice(0,5);return S(jct,{className:Tde.table,children:S(Fc,{children:Q(Nc,{size:"small",children:[S(Ff,{children:Q(ln,{children:[S(ke,{align:"center",children:t("date")}),S(ke,{align:"center",children:t("weight")})]})}),S(Lc,{children:r.map(o=>Q(ln,{children:[S(ke,{align:"center",children:o.date.toLocaleDateString()}),S(ke,{align:"center",children:o.weight})]},o.date.toLocaleDateString()))})]})})})},zct=({active:e,payload:t,label:n})=>{const[r,o]=je();return e&&t&&t.length?Q(go,{style:{padding:8},children:[S("p",{children:S("strong",{children:new Date(n).toLocaleDateString(o.language)})}),Q("p",{children:[r("weight"),": ",t[0].value]})]}):null},Ode=({weights:e,height:t})=>{t=t||300;const r=Lr(),[o,i]=je(),[a,s]=J.useState(!1),[l,c]=J.useState(),u=()=>s(!1),f=[...e].sort((m,g)=>m.date.getTime()-g.date.getTime()).map(m=>({date:m.date.getTime(),weight:m.weight,entry:m}));function h(m,g){c(g.payload.entry),s(!0)}return Q("div",{children:[l&&S(Bi,{title:o("edit"),isOpen:a,closeFn:u,children:S(Lv,{weightEntry:l})}),S(nd,{height:t,children:Q(qz,{data:f,children:[S(qh,{type:"monotone",dataKey:"weight",stroke:r.palette.secondary.main,strokeWidth:2,dot:f.length>30?!1:{strokeWidth:1,r:4},activeDot:{stroke:"black",strokeWidth:1,r:6,onClick:h}}),S(Uf,{stroke:"#ccc",strokeDasharray:"5 5"}),S(ls,{dataKey:"date",type:"number",domain:["dataMin","dataMax"],tickFormatter:m=>new Date(m).toLocaleDateString(i.language)}),S(cs,{domain:["auto","auto"]}),S(ba,{content:S(zct,{})})]})})]})},Ide=()=>{var n,r;const[e]=je(),t=Bw("lastYear");return t.isLoading?S(Er,{}):((n=t.data)==null?void 0:n.length)!==void 0&&((r=t.data)==null?void 0:r.length)>0?S(Vct,{entries:t.data}):S(gB,{title:e("weight"),modalContent:S(Lv,{})})},Vct=e=>{const[t,n]=J.useState(!1),r=()=>n(!0),o=()=>n(!1),[i,a]=je();return Q(Tt,{children:[Q(ho,{children:[S(Jl,{title:i("weight"),subheader:"."}),Q(Fi,{sx:{height:"500px",overflow:"auto"},children:[S(Ode,{weights:e.entries,height:200}),S(Zt,{sx:{mt:2},children:S(Bct,{weights:e.entries})})]}),Q(ll,{sx:{justifyContent:"space-between",alignItems:"flex-start"},children:[S(ct,{size:"small",href:cn(Qt.WEIGHT_OVERVIEW,a.language),children:i("seeDetails")}),S(Go,{title:i("addEntry"),children:S(pn,{onClick:r,children:S(Ko,{})})})]})]}),S(Bi,{title:i("add"),isOpen:t,closeFn:o,children:S(Lv,{closeFn:o})})]})},Hct=()=>{const[e,t]=je();return S(vV,{callback:r=>{r!==null&&(window.location.href=cn(Qt.INGREDIENT_DETAIL,t.language,{id:r.data.id}))}})};var u$={exports:{}},b0={},d$={exports:{}},f$={};/**
+Please change the parent <Route path="${C}"> to <Route path="${C==="/"?"*":`${C}/*`}">.`)}let f=Zh(),h;if(t){let C=typeof t=="string"?$v(t):t;ro(c==="/"||((w=C.pathname)==null?void 0:w.startsWith(c)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${C.pathname}" was given in the \`location\` prop.`),h=C}else h=f;let m=h.pathname||"/",g=m;if(c!=="/"){let C=c.replace(/^\//,"").split("/");g="/"+m.replace(/^\//,"").split("/").slice(C.length).join("/")}let y=sde(e,{pathname:g});Bc(u||y!=null,`No routes matched location "${h.pathname}${h.search}${h.hash}" `),Bc(y==null||y[y.length-1].route.element!==void 0||y[y.length-1].route.Component!==void 0||y[y.length-1].route.lazy!==void 0,`Matched leaf route at location "${h.pathname}${h.search}${h.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let v=Hlt(y&&y.map(C=>Object.assign({},C,{params:Object.assign({},s,C.params),pathname:Fu([c,o.encodeLocation?o.encodeLocation(C.pathname).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?c:Fu([c,o.encodeLocation?o.encodeLocation(C.pathnameBase).pathname:C.pathnameBase])})),i,n,r);return t&&v?x.createElement(Lw.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...h},navigationType:"POP"}},v):v}function jlt(){let e=Klt(),t=Dlt(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:r},i={padding:"2px 4px",backgroundColor:r},a=null;return console.error("Error handled by React Router default ErrorBoundary:",e),a=x.createElement(x.Fragment,null,x.createElement("p",null,"💿 Hey developer 👋"),x.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",x.createElement("code",{style:i},"ErrorBoundary")," or"," ",x.createElement("code",{style:i},"errorElement")," prop on your route.")),x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},t),n?x.createElement("pre",{style:o},n):null,a)}var Blt=x.createElement(jlt,null),zlt=class extends x.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?x.createElement(Xc.Provider,{value:this.props.routeContext},x.createElement(_V.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function Vlt({routeContext:e,match:t,children:n}){let r=x.useContext(Nv);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),x.createElement(Xc.Provider,{value:e},n)}function Hlt(e,t=[],n=null,r=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,i=n==null?void 0:n.errors;if(i!=null){let l=o.findIndex(c=>c.route.id&&(i==null?void 0:i[c.route.id])!==void 0);ro(l>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),o=o.slice(0,Math.min(o.length,l+1))}let a=!1,s=-1;if(n)for(let l=0;l<o.length;l++){let c=o[l];if((c.route.HydrateFallback||c.route.hydrateFallbackElement)&&(s=l),c.route.id){let{loaderData:u,errors:f}=n,h=c.route.loader&&!u.hasOwnProperty(c.route.id)&&(!f||f[c.route.id]===void 0);if(c.route.lazy||h){a=!0,s>=0?o=o.slice(0,s+1):o=[o[0]];break}}}return o.reduceRight((l,c,u)=>{let f,h=!1,m=null,g=null;n&&(f=i&&c.route.id?i[c.route.id]:void 0,m=c.route.errorElement||Blt,a&&(s<0&&u===0?(yde("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),h=!0,g=null):s===u&&(h=!0,g=c.route.hydrateFallbackElement||null)));let y=t.concat(o.slice(0,u+1)),v=()=>{let w;return f?w=m:h?w=g:c.route.Component?w=x.createElement(c.route.Component,null):c.route.element?w=c.route.element:w=l,x.createElement(Vlt,{match:c,routeContext:{outlet:l,matches:y,isDataRoute:n!=null},children:w})};return n&&(c.route.ErrorBoundary||c.route.errorElement||u===0)?x.createElement(zlt,{location:n.location,revalidation:n.revalidation,component:m,error:f,children:v(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):v()},null)}function $V(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ult(e){let t=x.useContext(Nv);return ro(t,$V(e)),t}function Glt(e){let t=x.useContext(_P);return ro(t,$V(e)),t}function qlt(e){let t=x.useContext(Xc);return ro(t,$V(e)),t}function NV(e){let t=qlt(e),n=t.matches[t.matches.length-1];return ro(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Wlt(){return NV("useRouteId")}function Klt(){var r;let e=x.useContext(_V),t=Glt("useRouteError"),n=NV("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function Ylt(){let{router:e}=Ult("useNavigate"),t=NV("useNavigate"),n=x.useRef(!1);return mde(()=>{n.current=!0}),x.useCallback(async(o,i={})=>{Bc(n.current,hde),n.current&&(typeof o=="number"?e.navigate(o):await e.navigate(o,{fromRouteId:t,...i}))},[e,t])}var eJ={};function yde(e,t,n){!t&&!eJ[e]&&(eJ[e]=!0,Bc(!1,n))}x.memo(Qlt);function Qlt({routes:e,future:t,state:n}){return gde(e,void 0,n,t)}function Ht(e){ro(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Xlt({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:o,static:i=!1}){ro(!Fw(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let a=e.replace(/^\/*/,"/"),s=x.useMemo(()=>({basename:a,navigator:o,static:i,future:{}}),[a,o,i]);typeof n=="string"&&(n=$v(n));let{pathname:l="/",search:c="",hash:u="",state:f=null,key:h="default"}=n,m=x.useMemo(()=>{let g=Qu(l,a);return g==null?null:{location:{pathname:g,search:c,hash:u,state:f,key:h},navigationType:r}},[a,l,c,u,f,h,r]);return Bc(m!=null,`<Router basename="${a}"> is not able to match the URL "${l}${c}${u}" because it does not start with the basename, so the <Router> won't render anything.`),m==null?null:x.createElement(Qc.Provider,{value:s},x.createElement(Lw.Provider,{children:t,value:m}))}function Jlt({children:e,location:t}){return Flt(ej(e),t)}function ej(e,t=[]){let n=[];return x.Children.forEach(e,(r,o)=>{if(!x.isValidElement(r))return;let i=[...t,o];if(r.type===x.Fragment){n.push.apply(n,ej(r.props.children,i));return}ro(r.type===Ht,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ro(!r.props.index||!r.props.children,"An index route cannot have child routes.");let a={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(a.children=ej(r.props.children,i)),n.push(a)}),n}var PE="get",AE="application/x-www-form-urlencoded";function $P(e){return e!=null&&typeof e.tagName=="string"}function Zlt(e){return $P(e)&&e.tagName.toLowerCase()==="button"}function ect(e){return $P(e)&&e.tagName.toLowerCase()==="form"}function tct(e){return $P(e)&&e.tagName.toLowerCase()==="input"}function nct(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function rct(e,t){return e.button===0&&(!t||t==="_self")&&!nct(e)}var J1=null;function oct(){if(J1===null)try{new FormData(document.createElement("form"),0),J1=!1}catch{J1=!0}return J1}var ict=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function c$(e){return e!=null&&!ict.has(e)?(Bc(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${AE}"`),null):e}function act(e,t){let n,r,o,i,a;if(ect(e)){let s=e.getAttribute("action");r=s?Qu(s,t):null,n=e.getAttribute("method")||PE,o=c$(e.getAttribute("enctype"))||AE,i=new FormData(e)}else if(Zlt(e)||tct(e)&&(e.type==="submit"||e.type==="image")){let s=e.form;if(s==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||s.getAttribute("action");if(r=l?Qu(l,t):null,n=e.getAttribute("formmethod")||s.getAttribute("method")||PE,o=c$(e.getAttribute("formenctype"))||c$(s.getAttribute("enctype"))||AE,i=new FormData(s,e),!oct()){let{name:c,type:u,value:f}=e;if(u==="image"){let h=c?`${c}.`:"";i.append(`${h}x`,"0"),i.append(`${h}y`,"0")}else c&&i.append(c,f)}}else{if($P(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=PE,r=null,o=AE,a=e}return i&&o==="text/plain"&&(a=i,i=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:i,body:a}}function LV(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}async function sct(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function lct(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function cct(e,t,n){let r=await Promise.all(e.map(async o=>{let i=t.routes[o.route.id];if(i){let a=await sct(i,n);return a.links?a.links():[]}return[]}));return pct(r.flat(1).filter(lct).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function tJ(e,t,n,r,o,i){let a=(l,c)=>n[c]?l.route.id!==n[c].route.id:!0,s=(l,c)=>{var u;return n[c].pathname!==l.pathname||((u=n[c].route.path)==null?void 0:u.endsWith("*"))&&n[c].params["*"]!==l.params["*"]};return i==="assets"?t.filter((l,c)=>a(l,c)||s(l,c)):i==="data"?t.filter((l,c)=>{var f;let u=r.routes[l.route.id];if(!u||!u.hasLoader)return!1;if(a(l,c)||s(l,c))return!0;if(l.route.shouldRevalidate){let h=l.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((f=n[0])==null?void 0:f.params)||{},nextUrl:new URL(e,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof h=="boolean")return h}return!0}):[]}function uct(e,t,{includeHydrateFallback:n}={}){return dct(e.map(r=>{let o=t.routes[r.route.id];if(!o)return[];let i=[o.module];return o.clientActionModule&&(i=i.concat(o.clientActionModule)),o.clientLoaderModule&&(i=i.concat(o.clientLoaderModule)),n&&o.hydrateFallbackModule&&(i=i.concat(o.hydrateFallbackModule)),o.imports&&(i=i.concat(o.imports)),i}).flat(1))}function dct(e){return[...new Set(e)]}function fct(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function pct(e,t){let n=new Set;return new Set(t),e.reduce((r,o)=>{let i=JSON.stringify(fct(o));return n.has(i)||(n.add(i),r.push({key:i,link:o})),r},[])}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var hct=new Set([100,101,204,205]);function mct(e,t){let n=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n.pathname==="/"?n.pathname="_root.data":t&&Qu(n.pathname,t)==="/"?n.pathname=`${t.replace(/\/$/,"")}/_root.data`:n.pathname=`${n.pathname.replace(/\/$/,"")}.data`,n}function vde(){let e=x.useContext(Nv);return LV(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function gct(){let e=x.useContext(_P);return LV(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var FV=x.createContext(void 0);FV.displayName="FrameworkContext";function bde(){let e=x.useContext(FV);return LV(e,"You must render this element inside a <HydratedRouter> element"),e}function yct(e,t){let n=x.useContext(FV),[r,o]=x.useState(!1),[i,a]=x.useState(!1),{onFocus:s,onBlur:l,onMouseEnter:c,onMouseLeave:u,onTouchStart:f}=t,h=x.useRef(null);x.useEffect(()=>{if(e==="render"&&a(!0),e==="viewport"){let y=w=>{w.forEach(C=>{a(C.isIntersecting)})},v=new IntersectionObserver(y,{threshold:.5});return h.current&&v.observe(h.current),()=>{v.disconnect()}}},[e]),x.useEffect(()=>{if(r){let y=setTimeout(()=>{a(!0)},100);return()=>{clearTimeout(y)}}},[r]);let m=()=>{o(!0)},g=()=>{o(!1),a(!1)};return n?e!=="intent"?[i,h,{}]:[i,h,{onFocus:v0(s,m),onBlur:v0(l,g),onMouseEnter:v0(c,m),onMouseLeave:v0(u,g),onTouchStart:v0(f,m)}]:[!1,h,{}]}function v0(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function vct({page:e,...t}){let{router:n}=vde(),r=x.useMemo(()=>sde(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?x.createElement(xct,{page:e,matches:r,...t}):null}function bct(e){let{manifest:t,routeModules:n}=bde(),[r,o]=x.useState([]);return x.useEffect(()=>{let i=!1;return cct(e,t,n).then(a=>{i||o(a)}),()=>{i=!0}},[e,t,n]),r}function xct({page:e,matches:t,...n}){let r=Zh(),{manifest:o,routeModules:i}=bde(),{basename:a}=vde(),{loaderData:s,matches:l}=gct(),c=x.useMemo(()=>tJ(e,t,l,o,r,"data"),[e,t,l,o,r]),u=x.useMemo(()=>tJ(e,t,l,o,r,"assets"),[e,t,l,o,r]),f=x.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let g=new Set,y=!1;if(t.forEach(w=>{var E;let C=o.routes[w.route.id];!C||!C.hasLoader||(!c.some(I=>I.route.id===w.route.id)&&w.route.id in s&&((E=i[w.route.id])!=null&&E.shouldRevalidate)||C.hasClientLoader?y=!0:g.add(w.route.id))}),g.size===0)return[];let v=mct(e,a);return y&&g.size>0&&v.searchParams.set("_routes",t.filter(w=>g.has(w.route.id)).map(w=>w.route.id).join(",")),[v.pathname+v.search]},[a,s,r,o,c,t,e,i]),h=x.useMemo(()=>uct(u,o),[u,o]),m=bct(u);return x.createElement(x.Fragment,null,f.map(g=>x.createElement("link",{key:g,rel:"prefetch",as:"fetch",href:g,...n})),h.map(g=>x.createElement("link",{key:g,rel:"modulepreload",href:g,...n})),m.map(({key:g,link:y})=>x.createElement("link",{key:g,...y})))}function Sct(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var xde=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{xde&&(window.__reactRouterVersion="7.6.1")}catch{}function jV({basename:e,children:t,window:n}){let r=x.useRef();r.current==null&&(r.current=clt({window:n,v5Compat:!0}));let o=r.current,[i,a]=x.useState({action:o.action,location:o.location}),s=x.useCallback(l=>{x.startTransition(()=>a(l))},[a]);return x.useLayoutEffect(()=>o.listen(s),[o,s]),x.createElement(Xlt,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:o})}var Sde=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ro=x.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:o,reloadDocument:i,replace:a,state:s,target:l,to:c,preventScrollReset:u,viewTransition:f,...h},m){let{basename:g}=x.useContext(Qc),y=typeof c=="string"&&Sde.test(c),v,w=!1;if(typeof c=="string"&&y&&(v=c,xde))try{let M=new URL(window.location.href),A=c.startsWith("//")?new URL(M.protocol+c):new URL(c),_=Qu(A.pathname,g);A.origin===M.origin&&_!=null?c=_+A.search+A.hash:w=!0}catch{Bc(!1,`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let C=Nlt(c,{relative:o}),[E,I,O]=yct(r,h),P=Tct(c,{replace:a,state:s,target:l,preventScrollReset:u,relative:o,viewTransition:f});function R(M){t&&t(M),M.defaultPrevented||P(M)}let D=x.createElement("a",{...h,...O,href:v||C,onClick:w||i?t:R,ref:Sct(m,I),target:l,"data-discover":!y&&n==="render"?"true":void 0});return E&&!y?x.createElement(x.Fragment,null,D,x.createElement(vct,{page:C})):D});Ro.displayName="Link";var wct=x.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:o=!1,style:i,to:a,viewTransition:s,children:l,...c},u){let f=jw(a,{relative:c.relative}),h=Zh(),m=x.useContext(_P),{navigator:g,basename:y}=x.useContext(Qc),v=m!=null&&Mct(f)&&s===!0,w=g.encodeLocation?g.encodeLocation(f).pathname:f.pathname,C=h.pathname,E=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;n||(C=C.toLowerCase(),E=E?E.toLowerCase():null,w=w.toLowerCase()),E&&y&&(E=Qu(E,y)||E);const I=w!=="/"&&w.endsWith("/")?w.length-1:w.length;let O=C===w||!o&&C.startsWith(w)&&C.charAt(I)==="/",P=E!=null&&(E===w||!o&&E.startsWith(w)&&E.charAt(w.length)==="/"),R={isActive:O,isPending:P,isTransitioning:v},D=O?t:void 0,M;typeof r=="function"?M=r(R):M=[r,O?"active":null,P?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let A=typeof i=="function"?i(R):i;return x.createElement(Ro,{...c,"aria-current":D,className:M,ref:u,style:A,to:a,viewTransition:s},typeof l=="function"?l(R):l)});wct.displayName="NavLink";var Cct=x.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:o,state:i,method:a=PE,action:s,onSubmit:l,relative:c,preventScrollReset:u,viewTransition:f,...h},m)=>{let g=Pct(),y=Act(s,{relative:c}),v=a.toLowerCase()==="get"?"get":"post",w=typeof s=="string"&&Sde.test(s),C=E=>{if(l&&l(E),E.defaultPrevented)return;E.preventDefault();let I=E.nativeEvent.submitter,O=(I==null?void 0:I.getAttribute("formmethod"))||a;g(I||E.currentTarget,{fetcherKey:t,method:O,navigate:n,replace:o,state:i,relative:c,preventScrollReset:u,viewTransition:f})};return x.createElement("form",{ref:m,method:v,action:y,onSubmit:r?l:C,...h,"data-discover":!w&&e==="render"?"true":void 0})});Cct.displayName="Form";function Ect(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function wde(e){let t=x.useContext(Nv);return ro(t,Ect(e)),t}function Tct(e,{target:t,replace:n,state:r,preventScrollReset:o,relative:i,viewTransition:a}={}){let s=id(),l=Zh(),c=jw(e,{relative:i});return x.useCallback(u=>{if(rct(u,t)){u.preventDefault();let f=n!==void 0?n:PS(l)===PS(c);s(e,{replace:f,state:r,preventScrollReset:o,relative:i,viewTransition:a})}},[l,s,c,n,r,t,e,o,i,a])}var Oct=0,Ict=()=>`__${String(++Oct)}__`;function Pct(){let{router:e}=wde("useSubmit"),{basename:t}=x.useContext(Qc),n=Wlt();return x.useCallback(async(r,o={})=>{let{action:i,method:a,encType:s,formData:l,body:c}=act(r,t);if(o.navigate===!1){let u=o.fetcherKey||Ict();await e.fetch(u,n,o.action||i,{preventScrollReset:o.preventScrollReset,formData:l,body:c,formMethod:o.method||a,formEncType:o.encType||s,flushSync:o.flushSync})}else await e.navigate(o.action||i,{preventScrollReset:o.preventScrollReset,formData:l,body:c,formMethod:o.method||a,formEncType:o.encType||s,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[e,t,n])}function Act(e,{relative:t}={}){let{basename:n}=x.useContext(Qc),r=x.useContext(Xc);ro(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),i={...jw(e||".",{relative:t})},a=Zh();if(e==null){i.search=a.search;let s=new URLSearchParams(i.search),l=s.getAll("index");if(l.some(u=>u==="")){s.delete("index"),l.filter(f=>f).forEach(f=>s.append("index",f));let u=s.toString();i.search=u?`?${u}`:""}}return(!e||e===".")&&o.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:Fu([n,i.pathname])),PS(i)}function Mct(e,t={}){let n=x.useContext(pde);ro(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=wde("useViewTransitionState"),o=jw(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=Qu(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=Qu(n.nextLocation.pathname,r)||n.nextLocation.pathname;return bO(o.pathname,a)!=null||bO(o.pathname,i)!=null}[...hct];const Rct=()=>{var r,o;const e=Ma(),t=parseInt(e.routineId??"");if(Number.isNaN(t))return S("p",{children:"Please pass an integer as the routine id."});const n=Kc(t);return S(Uu,{maxWidth:"lg",children:S(RP,{query:n,child:n.isSuccess&&Q(Tt,{children:[((r=n.data)==null?void 0:r.description)!==""&&S(at,{variant:"body2",sx:{whiteSpace:"pre-line"},children:(o=n.data)==null?void 0:o.description}),S(Ft,{spacing:2,sx:{mt:2},children:n.data.dayDataCurrentIteration.filter(i=>i.day!==null).map((i,a)=>S(BV,{routineId:t,dayData:i},`dayDetails-${a}`))})]})})})};function Cde(e){var o;const{i18n:t}=je(),n=Yc();let r;return n.isSuccess&&(r=Gu(t.language,n.data)),S(me,{container:!0,alignItems:"center",justifyContent:"center",sx:{height:e.rowHeight,marginBottom:e.marginBottom},children:S(me,{size:12,children:Q(Ft,{spacing:0,children:[S(at,{variant:"h6",children:e.showExercise?(o=e.setConfigData.exercise)==null?void 0:o.getTranslation(r).name:""}),Q("div",{children:[e.setConfigData.textRepr,e.setConfigData.isSpecialType&&S(Wl,{label:e.setConfigData.type,color:"info",size:"small",sx:{marginLeft:"0.5em"}})]}),S(at,{variant:"caption",children:e.setConfigData.comment})]})})})}function Dct(e){return Q(me,{container:!0,justifyContent:"space-between",alignItems:"flex-start",children:[S(me,{size:1,children:S(Ft,{divider:S(Zt,{height:"10px"}),children:e.slotData.exercises.map((t,n)=>S(nlt,{image:t.mainImage,iconSize:40,avatarSize:50},n))})}),S(me,{size:11,children:e.slotData.setConfigs.map((t,n)=>{var o;const r=n===0||t.exerciseId!==((o=e.slotData.setConfigs[n-1])==null?void 0:o.exerciseId);return S(Cde,{setConfigData:t,marginBottom:"1em",showExercise:r},n)})})]})}const BV=e=>{var i;const t=(e.readOnly??!1)||e.dayData.day===null||e.dayData.day.isRest,n=Lr(),[r,o]=je();return Q(ho,{sx:{minWidth:275},children:[S(Jl,{sx:{bgcolor:n.palette.grey.A200},action:e.dayData.day===null||e.dayData.day.isRest||t?null:S(Go,{title:r("routines.addWeightLog"),children:S(pn,{href:cn(Qt.ROUTINE_ADD_LOG,o.language,{id:e.routineId,id2:e.dayData.day.id}),children:S(Cst,{})})}),title:Gre(e.dayData.day),avatar:xa(e.dayData.date,new Date)?S(que,{}):void 0,subheader:S(at,{sx:{whiteSpace:"pre-line"},children:(i=e.dayData.day)==null?void 0:i.description})}),e.dayData.slots.length>0&&S(Fi,{sx:{padding:0,marginBottom:0},children:S(Ft,{children:e.dayData.slots.map((a,s)=>Q("div",{children:[S(Zt,{padding:1,children:S(Dct,{slotData:a,index:s})}),S(ji,{})]},s))})})]})},Ede=()=>{const[e,t]=je(),n=Aat();return n.isLoading?S(Er,{}):n.data!==null?S(kct,{routine:n.data}):S(gB,{title:e("routines.routine"),link:cn(Qt.ROUTINE_ADD,t.language)})},kct=e=>{const[t,n]=je();return Q(ho,{children:[S(Jl,{title:t("routines.routine"),subheader:e.routine.name??"."}),S(Fi,{sx:{height:"510px",overflow:"auto"},children:S(ai,{children:e.routine.dayDataCurrentIteration.filter(r=>r.day!==null).map((r,o)=>S(_ct,{dayData:r},o))})}),S(ll,{children:S(ct,{size:"small",href:cn(Qt.ROUTINE_DETAIL,n.language,{id:e.routine.id}),children:t("seeDetails")})})]})},_ct=e=>{var i,a;const[t,n]=x.useState(!1),{t:r}=je();return Q(Tt,{children:[Q(Fl,{onClick:()=>n(!t),selected:t,disabled:e.dayData.day===null||((i=e.dayData.day)==null?void 0:i.isRest),children:[S(nl,{children:t?S(J0,{}):S(Du,{})}),S(Wr,{primary:Gre(e.dayData.day),slotProps:{secondary:{noWrap:!0,style:{overflow:"hidden",textOverflow:"ellipsis"}}},secondary:(a=e.dayData.day)==null?void 0:a.description}),S(nl,{children:xa(e.dayData.date,new Date)?S(que,{}):void 0})]}),S(aa,{in:t,timeout:"auto",unmountOnExit:!0,children:e.dayData.slots.map((s,l)=>S("div",{children:s.setConfigs.map((c,u)=>S(Cde,{setConfigData:c,rowHeight:"70px",showExercise:!0},u))},l))})]})};function Bw(e="lastWeek"){return yr({queryKey:[st.BODY_WEIGHT,e],queryFn:()=>UDe(e)})}const $ct=()=>{const e=Mt();return Dt({mutationFn:t=>GDe(t),onSuccess:()=>e.invalidateQueries({queryKey:[st.BODY_WEIGHT]})})},Nct=()=>{const e=Mt();return Dt({mutationFn:t=>WDe(t),onError:t=>{console.log(t)},onSuccess:()=>e.invalidateQueries({queryKey:[st.BODY_WEIGHT]})})},Lct=()=>{const e=Mt();return Dt({mutationFn:t=>qDe(t),onSuccess:()=>{e.invalidateQueries({queryKey:[st.BODY_WEIGHT]})}})},Lv=({weightEntry:e,closeFn:t})=>{const n=Bw(),r=Nct(),o=Lct(),[i,a]=x.useState(e?xt.fromJSDate(e.date):xt.now),[s,l]=je(),c=Wo({weight:Do().min(30,"Min weight is 30 kg").max(300,"Max weight is 300 kg").required("Weight field is required")});return n.isLoading?S(Er,{}):S(Ti,{initialValues:{weight:e?e.weight:0,date:Zn(e?e.date:new Date)},validationSchema:c,onSubmit:async u=>{e?(e.weight=u.weight,e.date=new Date(u.date),o.mutate(e)):(e=new gre(new Date(u.date),u.weight),r.mutate(e)),t&&t()},children:u=>S(fi,{children:Q(Ft,{spacing:2,children:[S(dn,{fullWidth:!0,id:"weight",label:s("weight"),error:u.touched.weight&&!!u.touched.weight,helperText:u.touched.weight&&u.errors.weight,...u.getFieldProps("weight")}),S(Ys,{dateAdapter:zl,adapterLocale:l.language,children:S(Ih,{format:"yyyy-MM-dd",label:s("date"),value:i,slotProps:{textField:{variant:"outlined"}},disableFuture:!0,onChange:f=>{f&&u.setFieldValue("date",f.toJSDate()),a(f)},shouldDisableDate:f=>e&&Zn(e.date)===f.toISODate()?!1:f?n.data.some(h=>Zn(h.date)===f.toISODate()):!1})}),S(Ft,{direction:"row",justifyContent:"end",sx:{mt:2},children:S(ct,{color:"primary",variant:"contained",type:"submit",sx:{mt:2},children:s("submit")})})]})})})},Fct="WeightTableDashboard",Tde={table:`${Fct}-table`},jct=ae("div")(({theme:e})=>({[`&.${Tde.table}`]:{"& .MuiPaper-root":{border:"1px solid #bababa"}}})),Bct=({weights:e})=>{const[t]=je(),r=e.slice(0,5);return S(jct,{className:Tde.table,children:S(Fc,{children:Q(Nc,{size:"small",children:[S(Ff,{children:Q(ln,{children:[S(ke,{align:"center",children:t("date")}),S(ke,{align:"center",children:t("weight")})]})}),S(Lc,{children:r.map(o=>Q(ln,{children:[S(ke,{align:"center",children:o.date.toLocaleDateString()}),S(ke,{align:"center",children:o.weight})]},o.date.toLocaleDateString()))})]})})})},zct=({active:e,payload:t,label:n})=>{const[r,o]=je();return e&&t&&t.length?Q(go,{style:{padding:8},children:[S("p",{children:S("strong",{children:new Date(n).toLocaleDateString(o.language)})}),Q("p",{children:[r("weight"),": ",t[0].value]})]}):null},Ode=({weights:e,height:t})=>{t=t||300;const r=Lr(),[o,i]=je(),[a,s]=J.useState(!1),[l,c]=J.useState(),u=()=>s(!1),f=[...e].sort((m,g)=>m.date.getTime()-g.date.getTime()).map(m=>({date:m.date.getTime(),weight:m.weight,entry:m}));function h(m,g){c(g.payload.entry),s(!0)}return Q("div",{children:[l&&S(Bi,{title:o("edit"),isOpen:a,closeFn:u,children:S(Lv,{weightEntry:l})}),S(nd,{height:t,children:Q(qz,{data:f,children:[S(qh,{type:"monotone",dataKey:"weight",stroke:r.palette.secondary.main,strokeWidth:2,dot:f.length>30?!1:{strokeWidth:1,r:4},activeDot:{stroke:"black",strokeWidth:1,r:6,onClick:h}}),S(Uf,{stroke:"#ccc",strokeDasharray:"5 5"}),S(ls,{dataKey:"date",type:"number",domain:["dataMin","dataMax"],tickFormatter:m=>new Date(m).toLocaleDateString(i.language)}),S(cs,{domain:["auto","auto"]}),S(ba,{content:S(zct,{})})]})})]})},Ide=()=>{var n,r;const[e]=je(),t=Bw("lastYear");return t.isLoading?S(Er,{}):((n=t.data)==null?void 0:n.length)!==void 0&&((r=t.data)==null?void 0:r.length)>0?S(Vct,{entries:t.data}):S(gB,{title:e("weight"),modalContent:S(Lv,{})})},Vct=e=>{const[t,n]=J.useState(!1),r=()=>n(!0),o=()=>n(!1),[i,a]=je();return Q(Tt,{children:[Q(ho,{children:[S(Jl,{title:i("weight"),subheader:"."}),Q(Fi,{sx:{height:"500px",overflow:"auto"},children:[S(Ode,{weights:e.entries,height:200}),S(Zt,{sx:{mt:2},children:S(Bct,{weights:e.entries})})]}),Q(ll,{sx:{justifyContent:"space-between",alignItems:"flex-start"},children:[S(ct,{size:"small",href:cn(Qt.WEIGHT_OVERVIEW,a.language),children:i("seeDetails")}),S(Go,{title:i("addEntry"),children:S(pn,{onClick:r,children:S(Ko,{})})})]})]}),S(Bi,{title:i("add"),isOpen:t,closeFn:o,children:S(Lv,{closeFn:o})})]})},Hct=()=>{const[e,t]=je();return S(vV,{callback:r=>{r!==null&&(window.location.href=cn(Qt.INGREDIENT_DETAIL,t.language,{id:r.data.id}))}})};var u$={exports:{}},b0={},d$={exports:{}},f$={};/**
* @license React
* scheduler.production.js
*
@@ -372,7 +372,7 @@ Please change the parent <Route path="${C}"> to <Route path="${C==="/"?"*":`${C}
`);for($=T=0;T<ge.length&&!ge[T].includes("DetermineComponentFrameRoot");)T++;for(;$<Ne.length&&!Ne[$].includes("DetermineComponentFrameRoot");)$++;if(T===ge.length||$===Ne.length)for(T=ge.length-1,$=Ne.length-1;1<=T&&0<=$&&ge[T]!==Ne[$];)$--;for(;1<=T&&0<=$;T--,$--)if(ge[T]!==Ne[$]){if(T!==1||$!==1)do if(T--,$--,0>$||ge[T]!==Ne[$]){var Ze=`
`+ge[T].replace(" at new "," at ");return d.displayName&&Ze.includes("<anonymous>")&&(Ze=Ze.replace("<anonymous>",d.displayName)),Ze}while(1<=T&&0<=$);break}}}finally{hs=!1,Error.prepareStackTrace=b}return(b=d?d.displayName||d.name:"")?Hi(b):""}function fme(d){switch(d.tag){case 26:case 27:case 5:return Hi(d.type);case 16:return Hi("Lazy");case 13:return Hi("Suspense");case 19:return Hi("SuspenseList");case 0:case 15:return eu(d.type,!1);case 11:return eu(d.type.render,!1);case 1:return eu(d.type,!0);case 31:return Hi("Activity");default:return""}}function WH(d){try{var p="";do p+=fme(d),d=d.return;while(d);return p}catch(b){return`
Error generating stack: `+b.message+`
-`+b.stack}}function ms(d){switch(typeof d){case"bigint":case"boolean":case"number":case"string":case"undefined":return d;case"object":return d;default:return""}}function KH(d){var p=d.type;return(d=d.nodeName)&&d.toLowerCase()==="input"&&(p==="checkbox"||p==="radio")}function pme(d){var p=KH(d)?"checked":"value",b=Object.getOwnPropertyDescriptor(d.constructor.prototype,p),T=""+d[p];if(!d.hasOwnProperty(p)&&typeof b<"u"&&typeof b.get=="function"&&typeof b.set=="function"){var $=b.get,F=b.set;return Object.defineProperty(d,p,{configurable:!0,get:function(){return $.call(this)},set:function(X){T=""+X,F.call(this,X)}}),Object.defineProperty(d,p,{enumerable:b.enumerable}),{getValue:function(){return T},setValue:function(X){T=""+X},stopTracking:function(){d._valueTracker=null,delete d[p]}}}}function rC(d){d._valueTracker||(d._valueTracker=pme(d))}function YH(d){if(!d)return!1;var p=d._valueTracker;if(!p)return!0;var b=p.getValue(),T="";return d&&(T=KH(d)?d.checked?"true":"false":d.value),d=T,d!==b?(p.setValue(d),!0):!1}function oC(d){if(d=d||(typeof document<"u"?document:void 0),typeof d>"u")return null;try{return d.activeElement||d.body}catch{return d.body}}var hme=/[\n"\\]/g;function gs(d){return d.replace(hme,function(p){return"\\"+p.charCodeAt(0).toString(16)+" "})}function aA(d,p,b,T,$,F,X,re){d.name="",X!=null&&typeof X!="function"&&typeof X!="symbol"&&typeof X!="boolean"?d.type=X:d.removeAttribute("type"),p!=null?X==="number"?(p===0&&d.value===""||d.value!=p)&&(d.value=""+ms(p)):d.value!==""+ms(p)&&(d.value=""+ms(p)):X!=="submit"&&X!=="reset"||d.removeAttribute("value"),p!=null?sA(d,X,ms(p)):b!=null?sA(d,X,ms(b)):T!=null&&d.removeAttribute("value"),$==null&&F!=null&&(d.defaultChecked=!!F),$!=null&&(d.checked=$&&typeof $!="function"&&typeof $!="symbol"),re!=null&&typeof re!="function"&&typeof re!="symbol"&&typeof re!="boolean"?d.name=""+ms(re):d.removeAttribute("name")}function QH(d,p,b,T,$,F,X,re){if(F!=null&&typeof F!="function"&&typeof F!="symbol"&&typeof F!="boolean"&&(d.type=F),p!=null||b!=null){if(!(F!=="submit"&&F!=="reset"||p!=null))return;b=b!=null?""+ms(b):"",p=p!=null?""+ms(p):b,re||p===d.value||(d.value=p),d.defaultValue=p}T=T??$,T=typeof T!="function"&&typeof T!="symbol"&&!!T,d.checked=re?d.checked:!!T,d.defaultChecked=!!T,X!=null&&typeof X!="function"&&typeof X!="symbol"&&typeof X!="boolean"&&(d.name=X)}function sA(d,p,b){p==="number"&&oC(d.ownerDocument)===d||d.defaultValue===""+b||(d.defaultValue=""+b)}function rm(d,p,b,T){if(d=d.options,p){p={};for(var $=0;$<b.length;$++)p["$"+b[$]]=!0;for(b=0;b<d.length;b++)$=p.hasOwnProperty("$"+d[b].value),d[b].selected!==$&&(d[b].selected=$),$&&T&&(d[b].defaultSelected=!0)}else{for(b=""+ms(b),p=null,$=0;$<d.length;$++){if(d[$].value===b){d[$].selected=!0,T&&(d[$].defaultSelected=!0);return}p!==null||d[$].disabled||(p=d[$])}p!==null&&(p.selected=!0)}}function XH(d,p,b){if(p!=null&&(p=""+ms(p),p!==d.value&&(d.value=p),b==null)){d.defaultValue!==p&&(d.defaultValue=p);return}d.defaultValue=b!=null?""+ms(b):""}function JH(d,p,b,T){if(p==null){if(T!=null){if(b!=null)throw Error(r(92));if(j(T)){if(1<T.length)throw Error(r(93));T=T[0]}b=T}b==null&&(b=""),p=b}b=ms(p),d.defaultValue=b,T=d.textContent,T===b&&T!==""&&T!==null&&(d.value=T)}function om(d,p){if(p){var b=d.firstChild;if(b&&b===d.lastChild&&b.nodeType===3){b.nodeValue=p;return}}d.textContent=p}var mme=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function ZH(d,p,b){var T=p.indexOf("--")===0;b==null||typeof b=="boolean"||b===""?T?d.setProperty(p,""):p==="float"?d.cssFloat="":d[p]="":T?d.setProperty(p,b):typeof b!="number"||b===0||mme.has(p)?p==="float"?d.cssFloat=b:d[p]=(""+b).trim():d[p]=b+"px"}function e5(d,p,b){if(p!=null&&typeof p!="object")throw Error(r(62));if(d=d.style,b!=null){for(var T in b)!b.hasOwnProperty(T)||p!=null&&p.hasOwnProperty(T)||(T.indexOf("--")===0?d.setProperty(T,""):T==="float"?d.cssFloat="":d[T]="");for(var $ in p)T=p[$],p.hasOwnProperty($)&&b[$]!==T&&ZH(d,$,T)}else for(var F in p)p.hasOwnProperty(F)&&ZH(d,F,p[F])}function lA(d){if(d.indexOf("-")===-1)return!1;switch(d){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var gme=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),yme=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function iC(d){return yme.test(""+d)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":d}var cA=null;function uA(d){return d=d.target||d.srcElement||window,d.correspondingUseElement&&(d=d.correspondingUseElement),d.nodeType===3?d.parentNode:d}var im=null,am=null;function t5(d){var p=zi(d);if(p&&(d=p.stateNode)){var b=d[Xt]||null;e:switch(d=p.stateNode,p.type){case"input":if(aA(d,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name),p=b.name,b.type==="radio"&&p!=null){for(b=d;b.parentNode;)b=b.parentNode;for(b=b.querySelectorAll('input[name="'+gs(""+p)+'"][type="radio"]'),p=0;p<b.length;p++){var T=b[p];if(T!==d&&T.form===d.form){var $=T[Xt]||null;if(!$)throw Error(r(90));aA(T,$.value,$.defaultValue,$.defaultValue,$.checked,$.defaultChecked,$.type,$.name)}}for(p=0;p<b.length;p++)T=b[p],T.form===d.form&&YH(T)}break e;case"textarea":XH(d,b.value,b.defaultValue);break e;case"select":p=b.value,p!=null&&rm(d,!!b.multiple,p,!1)}}}var dA=!1;function n5(d,p,b){if(dA)return d(p,b);dA=!0;try{var T=d(p);return T}finally{if(dA=!1,(im!==null||am!==null)&&(UC(),im&&(p=im,d=am,am=im=null,t5(p),d)))for(p=0;p<d.length;p++)t5(d[p])}}function Zv(d,p){var b=d.stateNode;if(b===null)return null;var T=b[Xt]||null;if(T===null)return null;b=T[p];e:switch(p){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(T=!T.disabled)||(d=d.type,T=!(d==="button"||d==="input"||d==="select"||d==="textarea")),d=!T;break e;default:d=!1}if(d)return null;if(b&&typeof b!="function")throw Error(r(231,p,typeof b));return b}var tu=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),fA=!1;if(tu)try{var eb={};Object.defineProperty(eb,"passive",{get:function(){fA=!0}}),window.addEventListener("test",eb,eb),window.removeEventListener("test",eb,eb)}catch{fA=!1}var fd=null,pA=null,aC=null;function r5(){if(aC)return aC;var d,p=pA,b=p.length,T,$="value"in fd?fd.value:fd.textContent,F=$.length;for(d=0;d<b&&p[d]===$[d];d++);var X=b-d;for(T=1;T<=X&&p[b-T]===$[F-T];T++);return aC=$.slice(d,1<T?1-T:void 0)}function sC(d){var p=d.keyCode;return"charCode"in d?(d=d.charCode,d===0&&p===13&&(d=13)):d=p,d===10&&(d=13),32<=d||d===13?d:0}function lC(){return!0}function o5(){return!1}function ua(d){function p(b,T,$,F,X){this._reactName=b,this._targetInst=$,this.type=T,this.nativeEvent=F,this.target=X,this.currentTarget=null;for(var re in d)d.hasOwnProperty(re)&&(b=d[re],this[re]=b?b(F):F[re]);return this.isDefaultPrevented=(F.defaultPrevented!=null?F.defaultPrevented:F.returnValue===!1)?lC:o5,this.isPropagationStopped=o5,this}return u(p.prototype,{preventDefault:function(){this.defaultPrevented=!0;var b=this.nativeEvent;b&&(b.preventDefault?b.preventDefault():typeof b.returnValue!="unknown"&&(b.returnValue=!1),this.isDefaultPrevented=lC)},stopPropagation:function(){var b=this.nativeEvent;b&&(b.stopPropagation?b.stopPropagation():typeof b.cancelBubble!="unknown"&&(b.cancelBubble=!0),this.isPropagationStopped=lC)},persist:function(){},isPersistent:lC}),p}var Jf={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(d){return d.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},cC=ua(Jf),tb=u({},Jf,{view:0,detail:0}),vme=ua(tb),hA,mA,nb,uC=u({},tb,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:yA,button:0,buttons:0,relatedTarget:function(d){return d.relatedTarget===void 0?d.fromElement===d.srcElement?d.toElement:d.fromElement:d.relatedTarget},movementX:function(d){return"movementX"in d?d.movementX:(d!==nb&&(nb&&d.type==="mousemove"?(hA=d.screenX-nb.screenX,mA=d.screenY-nb.screenY):mA=hA=0,nb=d),hA)},movementY:function(d){return"movementY"in d?d.movementY:mA}}),i5=ua(uC),bme=u({},uC,{dataTransfer:0}),xme=ua(bme),Sme=u({},tb,{relatedTarget:0}),gA=ua(Sme),wme=u({},Jf,{animationName:0,elapsedTime:0,pseudoElement:0}),Cme=ua(wme),Eme=u({},Jf,{clipboardData:function(d){return"clipboardData"in d?d.clipboardData:window.clipboardData}}),Tme=ua(Eme),Ome=u({},Jf,{data:0}),a5=ua(Ome),Ime={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Pme={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Ame={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Mme(d){var p=this.nativeEvent;return p.getModifierState?p.getModifierState(d):(d=Ame[d])?!!p[d]:!1}function yA(){return Mme}var Rme=u({},tb,{key:function(d){if(d.key){var p=Ime[d.key]||d.key;if(p!=="Unidentified")return p}return d.type==="keypress"?(d=sC(d),d===13?"Enter":String.fromCharCode(d)):d.type==="keydown"||d.type==="keyup"?Pme[d.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:yA,charCode:function(d){return d.type==="keypress"?sC(d):0},keyCode:function(d){return d.type==="keydown"||d.type==="keyup"?d.keyCode:0},which:function(d){return d.type==="keypress"?sC(d):d.type==="keydown"||d.type==="keyup"?d.keyCode:0}}),Dme=ua(Rme),kme=u({},uC,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),s5=ua(kme),_me=u({},tb,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:yA}),$me=ua(_me),Nme=u({},Jf,{propertyName:0,elapsedTime:0,pseudoElement:0}),Lme=ua(Nme),Fme=u({},uC,{deltaX:function(d){return"deltaX"in d?d.deltaX:"wheelDeltaX"in d?-d.wheelDeltaX:0},deltaY:function(d){return"deltaY"in d?d.deltaY:"wheelDeltaY"in d?-d.wheelDeltaY:"wheelDelta"in d?-d.wheelDelta:0},deltaZ:0,deltaMode:0}),jme=ua(Fme),Bme=u({},Jf,{newState:0,oldState:0}),zme=ua(Bme),Vme=[9,13,27,32],vA=tu&&"CompositionEvent"in window,rb=null;tu&&"documentMode"in document&&(rb=document.documentMode);var Hme=tu&&"TextEvent"in window&&!rb,l5=tu&&(!vA||rb&&8<rb&&11>=rb),c5=" ",u5=!1;function d5(d,p){switch(d){case"keyup":return Vme.indexOf(p.keyCode)!==-1;case"keydown":return p.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function f5(d){return d=d.detail,typeof d=="object"&&"data"in d?d.data:null}var sm=!1;function Ume(d,p){switch(d){case"compositionend":return f5(p);case"keypress":return p.which!==32?null:(u5=!0,c5);case"textInput":return d=p.data,d===c5&&u5?null:d;default:return null}}function Gme(d,p){if(sm)return d==="compositionend"||!vA&&d5(d,p)?(d=r5(),aC=pA=fd=null,sm=!1,d):null;switch(d){case"paste":return null;case"keypress":if(!(p.ctrlKey||p.altKey||p.metaKey)||p.ctrlKey&&p.altKey){if(p.char&&1<p.char.length)return p.char;if(p.which)return String.fromCharCode(p.which)}return null;case"compositionend":return l5&&p.locale!=="ko"?null:p.data;default:return null}}var qme={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function p5(d){var p=d&&d.nodeName&&d.nodeName.toLowerCase();return p==="input"?!!qme[d.type]:p==="textarea"}function h5(d,p,b,T){im?am?am.push(T):am=[T]:im=T,p=QC(p,"onChange"),0<p.length&&(b=new cC("onChange","change",null,b,T),d.push({event:b,listeners:p}))}var ob=null,ib=null;function Wme(d){K4(d,0)}function dC(d){var p=ul(d);if(YH(p))return d}function m5(d,p){if(d==="change")return p}var g5=!1;if(tu){var bA;if(tu){var xA="oninput"in document;if(!xA){var y5=document.createElement("div");y5.setAttribute("oninput","return;"),xA=typeof y5.oninput=="function"}bA=xA}else bA=!1;g5=bA&&(!document.documentMode||9<document.documentMode)}function v5(){ob&&(ob.detachEvent("onpropertychange",b5),ib=ob=null)}function b5(d){if(d.propertyName==="value"&&dC(ib)){var p=[];h5(p,ib,d,uA(d)),n5(Wme,p)}}function Kme(d,p,b){d==="focusin"?(v5(),ob=p,ib=b,ob.attachEvent("onpropertychange",b5)):d==="focusout"&&v5()}function Yme(d){if(d==="selectionchange"||d==="keyup"||d==="keydown")return dC(ib)}function Qme(d,p){if(d==="click")return dC(p)}function Xme(d,p){if(d==="input"||d==="change")return dC(p)}function Jme(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var ka=typeof Object.is=="function"?Object.is:Jme;function ab(d,p){if(ka(d,p))return!0;if(typeof d!="object"||d===null||typeof p!="object"||p===null)return!1;var b=Object.keys(d),T=Object.keys(p);if(b.length!==T.length)return!1;for(T=0;T<b.length;T++){var $=b[T];if(!oe.call(p,$)||!ka(d[$],p[$]))return!1}return!0}function x5(d){for(;d&&d.firstChild;)d=d.firstChild;return d}function S5(d,p){var b=x5(d);d=0;for(var T;b;){if(b.nodeType===3){if(T=d+b.textContent.length,d<=p&&T>=p)return{node:b,offset:p-d};d=T}e:{for(;b;){if(b.nextSibling){b=b.nextSibling;break e}b=b.parentNode}b=void 0}b=x5(b)}}function w5(d,p){return d&&p?d===p?!0:d&&d.nodeType===3?!1:p&&p.nodeType===3?w5(d,p.parentNode):"contains"in d?d.contains(p):d.compareDocumentPosition?!!(d.compareDocumentPosition(p)&16):!1:!1}function C5(d){d=d!=null&&d.ownerDocument!=null&&d.ownerDocument.defaultView!=null?d.ownerDocument.defaultView:window;for(var p=oC(d.document);p instanceof d.HTMLIFrameElement;){try{var b=typeof p.contentWindow.location.href=="string"}catch{b=!1}if(b)d=p.contentWindow;else break;p=oC(d.document)}return p}function SA(d){var p=d&&d.nodeName&&d.nodeName.toLowerCase();return p&&(p==="input"&&(d.type==="text"||d.type==="search"||d.type==="tel"||d.type==="url"||d.type==="password")||p==="textarea"||d.contentEditable==="true")}var Zme=tu&&"documentMode"in document&&11>=document.documentMode,lm=null,wA=null,sb=null,CA=!1;function E5(d,p,b){var T=b.window===b?b.document:b.nodeType===9?b:b.ownerDocument;CA||lm==null||lm!==oC(T)||(T=lm,"selectionStart"in T&&SA(T)?T={start:T.selectionStart,end:T.selectionEnd}:(T=(T.ownerDocument&&T.ownerDocument.defaultView||window).getSelection(),T={anchorNode:T.anchorNode,anchorOffset:T.anchorOffset,focusNode:T.focusNode,focusOffset:T.focusOffset}),sb&&ab(sb,T)||(sb=T,T=QC(wA,"onSelect"),0<T.length&&(p=new cC("onSelect","select",null,p,b),d.push({event:p,listeners:T}),p.target=lm)))}function Zf(d,p){var b={};return b[d.toLowerCase()]=p.toLowerCase(),b["Webkit"+d]="webkit"+p,b["Moz"+d]="moz"+p,b}var cm={animationend:Zf("Animation","AnimationEnd"),animationiteration:Zf("Animation","AnimationIteration"),animationstart:Zf("Animation","AnimationStart"),transitionrun:Zf("Transition","TransitionRun"),transitionstart:Zf("Transition","TransitionStart"),transitioncancel:Zf("Transition","TransitionCancel"),transitionend:Zf("Transition","TransitionEnd")},EA={},T5={};tu&&(T5=document.createElement("div").style,"AnimationEvent"in window||(delete cm.animationend.animation,delete cm.animationiteration.animation,delete cm.animationstart.animation),"TransitionEvent"in window||delete cm.transitionend.transition);function ep(d){if(EA[d])return EA[d];if(!cm[d])return d;var p=cm[d],b;for(b in p)if(p.hasOwnProperty(b)&&b in T5)return EA[d]=p[b];return d}var O5=ep("animationend"),I5=ep("animationiteration"),P5=ep("animationstart"),ege=ep("transitionrun"),tge=ep("transitionstart"),nge=ep("transitioncancel"),A5=ep("transitionend"),M5=new Map,TA="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");TA.push("scrollEnd");function fl(d,p){M5.set(d,p),hn(p,[d])}var R5=new WeakMap;function ys(d,p){if(typeof d=="object"&&d!==null){var b=R5.get(d);return b!==void 0?b:(p={value:d,source:p,stack:WH(p)},R5.set(d,p),p)}return{value:d,source:p,stack:WH(p)}}var vs=[],um=0,OA=0;function fC(){for(var d=um,p=OA=um=0;p<d;){var b=vs[p];vs[p++]=null;var T=vs[p];vs[p++]=null;var $=vs[p];vs[p++]=null;var F=vs[p];if(vs[p++]=null,T!==null&&$!==null){var X=T.pending;X===null?$.next=$:($.next=X.next,X.next=$),T.pending=$}F!==0&&D5(b,$,F)}}function pC(d,p,b,T){vs[um++]=d,vs[um++]=p,vs[um++]=b,vs[um++]=T,OA|=T,d.lanes|=T,d=d.alternate,d!==null&&(d.lanes|=T)}function IA(d,p,b,T){return pC(d,p,b,T),hC(d)}function dm(d,p){return pC(d,null,null,p),hC(d)}function D5(d,p,b){d.lanes|=b;var T=d.alternate;T!==null&&(T.lanes|=b);for(var $=!1,F=d.return;F!==null;)F.childLanes|=b,T=F.alternate,T!==null&&(T.childLanes|=b),F.tag===22&&(d=F.stateNode,d===null||d._visibility&1||($=!0)),d=F,F=F.return;return d.tag===3?(F=d.stateNode,$&&p!==null&&($=31-Be(b),d=F.hiddenUpdates,T=d[$],T===null?d[$]=[p]:T.push(p),p.lane=b|536870912),F):null}function hC(d){if(50<Db)throw Db=0,kM=null,Error(r(185));for(var p=d.return;p!==null;)d=p,p=d.return;return d.tag===3?d.stateNode:null}var fm={};function rge(d,p,b,T){this.tag=d,this.key=b,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=p,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=T,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _a(d,p,b,T){return new rge(d,p,b,T)}function PA(d){return d=d.prototype,!(!d||!d.isReactComponent)}function nu(d,p){var b=d.alternate;return b===null?(b=_a(d.tag,p,d.key,d.mode),b.elementType=d.elementType,b.type=d.type,b.stateNode=d.stateNode,b.alternate=d,d.alternate=b):(b.pendingProps=p,b.type=d.type,b.flags=0,b.subtreeFlags=0,b.deletions=null),b.flags=d.flags&65011712,b.childLanes=d.childLanes,b.lanes=d.lanes,b.child=d.child,b.memoizedProps=d.memoizedProps,b.memoizedState=d.memoizedState,b.updateQueue=d.updateQueue,p=d.dependencies,b.dependencies=p===null?null:{lanes:p.lanes,firstContext:p.firstContext},b.sibling=d.sibling,b.index=d.index,b.ref=d.ref,b.refCleanup=d.refCleanup,b}function k5(d,p){d.flags&=65011714;var b=d.alternate;return b===null?(d.childLanes=0,d.lanes=p,d.child=null,d.subtreeFlags=0,d.memoizedProps=null,d.memoizedState=null,d.updateQueue=null,d.dependencies=null,d.stateNode=null):(d.childLanes=b.childLanes,d.lanes=b.lanes,d.child=b.child,d.subtreeFlags=0,d.deletions=null,d.memoizedProps=b.memoizedProps,d.memoizedState=b.memoizedState,d.updateQueue=b.updateQueue,d.type=b.type,p=b.dependencies,d.dependencies=p===null?null:{lanes:p.lanes,firstContext:p.firstContext}),d}function mC(d,p,b,T,$,F){var X=0;if(T=d,typeof d=="function")PA(d)&&(X=1);else if(typeof d=="string")X=iye(d,b,ie.current)?26:d==="html"||d==="head"||d==="body"?27:5;else e:switch(d){case M:return d=_a(31,b,p,$),d.elementType=M,d.lanes=F,d;case g:return tp(b.children,$,F,p);case y:X=8,$|=24;break;case v:return d=_a(12,b,p,$|2),d.elementType=v,d.lanes=F,d;case O:return d=_a(13,b,p,$),d.elementType=O,d.lanes=F,d;case P:return d=_a(19,b,p,$),d.elementType=P,d.lanes=F,d;default:if(typeof d=="object"&&d!==null)switch(d.$$typeof){case w:case E:X=10;break e;case C:X=9;break e;case I:X=11;break e;case R:X=14;break e;case D:X=16,T=null;break e}X=29,b=Error(r(130,d===null?"null":typeof d,"")),T=null}return p=_a(X,b,p,$),p.elementType=d,p.type=T,p.lanes=F,p}function tp(d,p,b,T){return d=_a(7,d,T,p),d.lanes=b,d}function AA(d,p,b){return d=_a(6,d,null,p),d.lanes=b,d}function MA(d,p,b){return p=_a(4,d.children!==null?d.children:[],d.key,p),p.lanes=b,p.stateNode={containerInfo:d.containerInfo,pendingChildren:null,implementation:d.implementation},p}var pm=[],hm=0,gC=null,yC=0,bs=[],xs=0,np=null,ru=1,ou="";function rp(d,p){pm[hm++]=yC,pm[hm++]=gC,gC=d,yC=p}function _5(d,p,b){bs[xs++]=ru,bs[xs++]=ou,bs[xs++]=np,np=d;var T=ru;d=ou;var $=32-Be(T)-1;T&=~(1<<$),b+=1;var F=32-Be(p)+$;if(30<F){var X=$-$%5;F=(T&(1<<X)-1).toString(32),T>>=X,$-=X,ru=1<<32-Be(p)+$|b<<$|T,ou=F+d}else ru=1<<F|b<<$|T,ou=d}function RA(d){d.return!==null&&(rp(d,1),_5(d,1,0))}function DA(d){for(;d===gC;)gC=pm[--hm],pm[hm]=null,yC=pm[--hm],pm[hm]=null;for(;d===np;)np=bs[--xs],bs[xs]=null,ou=bs[--xs],bs[xs]=null,ru=bs[--xs],bs[xs]=null}var Ui=null,io=null,rr=!1,op=null,oc=!1,kA=Error(r(519));function ip(d){var p=Error(r(418,""));throw ub(ys(p,d)),kA}function $5(d){var p=d.stateNode,b=d.type,T=d.memoizedProps;switch(p[Ut]=d,p[Xt]=T,b){case"dialog":Fn("cancel",p),Fn("close",p);break;case"iframe":case"object":case"embed":Fn("load",p);break;case"video":case"audio":for(b=0;b<_b.length;b++)Fn(_b[b],p);break;case"source":Fn("error",p);break;case"img":case"image":case"link":Fn("error",p),Fn("load",p);break;case"details":Fn("toggle",p);break;case"input":Fn("invalid",p),QH(p,T.value,T.defaultValue,T.checked,T.defaultChecked,T.type,T.name,!0),rC(p);break;case"select":Fn("invalid",p);break;case"textarea":Fn("invalid",p),JH(p,T.value,T.defaultValue,T.children),rC(p)}b=T.children,typeof b!="string"&&typeof b!="number"&&typeof b!="bigint"||p.textContent===""+b||T.suppressHydrationWarning===!0||J4(p.textContent,b)?(T.popover!=null&&(Fn("beforetoggle",p),Fn("toggle",p)),T.onScroll!=null&&Fn("scroll",p),T.onScrollEnd!=null&&Fn("scrollend",p),T.onClick!=null&&(p.onclick=XC),p=!0):p=!1,p||ip(d)}function N5(d){for(Ui=d.return;Ui;)switch(Ui.tag){case 5:case 13:oc=!1;return;case 27:case 3:oc=!0;return;default:Ui=Ui.return}}function lb(d){if(d!==Ui)return!1;if(!rr)return N5(d),rr=!0,!1;var p=d.tag,b;if((b=p!==3&&p!==27)&&((b=p===5)&&(b=d.type,b=!(b!=="form"&&b!=="button")||YM(d.type,d.memoizedProps)),b=!b),b&&io&&ip(d),N5(d),p===13){if(d=d.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(r(317));e:{for(d=d.nextSibling,p=0;d;){if(d.nodeType===8)if(b=d.data,b==="/$"){if(p===0){io=hl(d.nextSibling);break e}p--}else b!=="$"&&b!=="$!"&&b!=="$?"||p++;d=d.nextSibling}io=null}}else p===27?(p=io,Pd(d.type)?(d=ZM,ZM=null,io=d):io=p):io=Ui?hl(d.stateNode.nextSibling):null;return!0}function cb(){io=Ui=null,rr=!1}function L5(){var d=op;return d!==null&&(pa===null?pa=d:pa.push.apply(pa,d),op=null),d}function ub(d){op===null?op=[d]:op.push(d)}var _A=q(null),ap=null,iu=null;function pd(d,p,b){Z(_A,p._currentValue),p._currentValue=b}function au(d){d._currentValue=_A.current,Y(_A)}function $A(d,p,b){for(;d!==null;){var T=d.alternate;if((d.childLanes&p)!==p?(d.childLanes|=p,T!==null&&(T.childLanes|=p)):T!==null&&(T.childLanes&p)!==p&&(T.childLanes|=p),d===b)break;d=d.return}}function NA(d,p,b,T){var $=d.child;for($!==null&&($.return=d);$!==null;){var F=$.dependencies;if(F!==null){var X=$.child;F=F.firstContext;e:for(;F!==null;){var re=F;F=$;for(var ge=0;ge<p.length;ge++)if(re.context===p[ge]){F.lanes|=b,re=F.alternate,re!==null&&(re.lanes|=b),$A(F.return,b,d),T||(X=null);break e}F=re.next}}else if($.tag===18){if(X=$.return,X===null)throw Error(r(341));X.lanes|=b,F=X.alternate,F!==null&&(F.lanes|=b),$A(X,b,d),X=null}else X=$.child;if(X!==null)X.return=$;else for(X=$;X!==null;){if(X===d){X=null;break}if($=X.sibling,$!==null){$.return=X.return,X=$;break}X=X.return}$=X}}function db(d,p,b,T){d=null;for(var $=p,F=!1;$!==null;){if(!F){if(($.flags&524288)!==0)F=!0;else if(($.flags&262144)!==0)break}if($.tag===10){var X=$.alternate;if(X===null)throw Error(r(387));if(X=X.memoizedProps,X!==null){var re=$.type;ka($.pendingProps.value,X.value)||(d!==null?d.push(re):d=[re])}}else if($===ye.current){if(X=$.alternate,X===null)throw Error(r(387));X.memoizedState.memoizedState!==$.memoizedState.memoizedState&&(d!==null?d.push(Bb):d=[Bb])}$=$.return}d!==null&&NA(p,d,b,T),p.flags|=262144}function vC(d){for(d=d.firstContext;d!==null;){if(!ka(d.context._currentValue,d.memoizedValue))return!0;d=d.next}return!1}function sp(d){ap=d,iu=null,d=d.dependencies,d!==null&&(d.firstContext=null)}function Pi(d){return F5(ap,d)}function bC(d,p){return ap===null&&sp(d),F5(d,p)}function F5(d,p){var b=p._currentValue;if(p={context:p,memoizedValue:b,next:null},iu===null){if(d===null)throw Error(r(308));iu=p,d.dependencies={lanes:0,firstContext:p},d.flags|=524288}else iu=iu.next=p;return b}var oge=typeof AbortController<"u"?AbortController:function(){var d=[],p=this.signal={aborted:!1,addEventListener:function(b,T){d.push(T)}};this.abort=function(){p.aborted=!0,d.forEach(function(b){return b()})}},ige=e.unstable_scheduleCallback,age=e.unstable_NormalPriority,$o={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function LA(){return{controller:new oge,data:new Map,refCount:0}}function fb(d){d.refCount--,d.refCount===0&&ige(age,function(){d.controller.abort()})}var pb=null,FA=0,mm=0,gm=null;function sge(d,p){if(pb===null){var b=pb=[];FA=0,mm=BM(),gm={status:"pending",value:void 0,then:function(T){b.push(T)}}}return FA++,p.then(j5,j5),p}function j5(){if(--FA===0&&pb!==null){gm!==null&&(gm.status="fulfilled");var d=pb;pb=null,mm=0,gm=null;for(var p=0;p<d.length;p++)(0,d[p])()}}function lge(d,p){var b=[],T={status:"pending",value:null,reason:null,then:function($){b.push($)}};return d.then(function(){T.status="fulfilled",T.value=p;for(var $=0;$<b.length;$++)(0,b[$])(p)},function($){for(T.status="rejected",T.reason=$,$=0;$<b.length;$++)(0,b[$])(void 0)}),T}var B5=L.S;L.S=function(d,p){typeof p=="object"&&p!==null&&typeof p.then=="function"&&sge(d,p),B5!==null&&B5(d,p)};var lp=q(null);function jA(){var d=lp.current;return d!==null?d:Dr.pooledCache}function xC(d,p){p===null?Z(lp,lp.current):Z(lp,p.pool)}function z5(){var d=jA();return d===null?null:{parent:$o._currentValue,pool:d}}var hb=Error(r(460)),V5=Error(r(474)),SC=Error(r(542)),BA={then:function(){}};function H5(d){return d=d.status,d==="fulfilled"||d==="rejected"}function wC(){}function U5(d,p,b){switch(b=d[b],b===void 0?d.push(p):b!==p&&(p.then(wC,wC),p=b),p.status){case"fulfilled":return p.value;case"rejected":throw d=p.reason,q5(d),d;default:if(typeof p.status=="string")p.then(wC,wC);else{if(d=Dr,d!==null&&100<d.shellSuspendCounter)throw Error(r(482));d=p,d.status="pending",d.then(function(T){if(p.status==="pending"){var $=p;$.status="fulfilled",$.value=T}},function(T){if(p.status==="pending"){var $=p;$.status="rejected",$.reason=T}})}switch(p.status){case"fulfilled":return p.value;case"rejected":throw d=p.reason,q5(d),d}throw mb=p,hb}}var mb=null;function G5(){if(mb===null)throw Error(r(459));var d=mb;return mb=null,d}function q5(d){if(d===hb||d===SC)throw Error(r(483))}var hd=!1;function zA(d){d.updateQueue={baseState:d.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function VA(d,p){d=d.updateQueue,p.updateQueue===d&&(p.updateQueue={baseState:d.baseState,firstBaseUpdate:d.firstBaseUpdate,lastBaseUpdate:d.lastBaseUpdate,shared:d.shared,callbacks:null})}function md(d){return{lane:d,tag:0,payload:null,callback:null,next:null}}function gd(d,p,b){var T=d.updateQueue;if(T===null)return null;if(T=T.shared,(mr&2)!==0){var $=T.pending;return $===null?p.next=p:(p.next=$.next,$.next=p),T.pending=p,p=hC(d),D5(d,null,b),p}return pC(d,T,p,b),hC(d)}function gb(d,p,b){if(p=p.updateQueue,p!==null&&(p=p.shared,(b&4194048)!==0)){var T=p.lanes;T&=d.pendingLanes,b|=T,p.lanes=b,oo(d,b)}}function HA(d,p){var b=d.updateQueue,T=d.alternate;if(T!==null&&(T=T.updateQueue,b===T)){var $=null,F=null;if(b=b.firstBaseUpdate,b!==null){do{var X={lane:b.lane,tag:b.tag,payload:b.payload,callback:null,next:null};F===null?$=F=X:F=F.next=X,b=b.next}while(b!==null);F===null?$=F=p:F=F.next=p}else $=F=p;b={baseState:T.baseState,firstBaseUpdate:$,lastBaseUpdate:F,shared:T.shared,callbacks:T.callbacks},d.updateQueue=b;return}d=b.lastBaseUpdate,d===null?b.firstBaseUpdate=p:d.next=p,b.lastBaseUpdate=p}var UA=!1;function yb(){if(UA){var d=gm;if(d!==null)throw d}}function vb(d,p,b,T){UA=!1;var $=d.updateQueue;hd=!1;var F=$.firstBaseUpdate,X=$.lastBaseUpdate,re=$.shared.pending;if(re!==null){$.shared.pending=null;var ge=re,Ne=ge.next;ge.next=null,X===null?F=Ne:X.next=Ne,X=ge;var Ze=d.alternate;Ze!==null&&(Ze=Ze.updateQueue,re=Ze.lastBaseUpdate,re!==X&&(re===null?Ze.firstBaseUpdate=Ne:re.next=Ne,Ze.lastBaseUpdate=ge))}if(F!==null){var ot=$.baseState;X=0,Ze=Ne=ge=null,re=F;do{var Fe=re.lane&-536870913,ze=Fe!==re.lane;if(ze?(qn&Fe)===Fe:(T&Fe)===Fe){Fe!==0&&Fe===mm&&(UA=!0),Ze!==null&&(Ze=Ze.next={lane:0,tag:re.tag,payload:re.payload,callback:null,next:null});e:{var fn=d,nn=re;Fe=p;var Sr=b;switch(nn.tag){case 1:if(fn=nn.payload,typeof fn=="function"){ot=fn.call(Sr,ot,Fe);break e}ot=fn;break e;case 3:fn.flags=fn.flags&-65537|128;case 0:if(fn=nn.payload,Fe=typeof fn=="function"?fn.call(Sr,ot,Fe):fn,Fe==null)break e;ot=u({},ot,Fe);break e;case 2:hd=!0}}Fe=re.callback,Fe!==null&&(d.flags|=64,ze&&(d.flags|=8192),ze=$.callbacks,ze===null?$.callbacks=[Fe]:ze.push(Fe))}else ze={lane:Fe,tag:re.tag,payload:re.payload,callback:re.callback,next:null},Ze===null?(Ne=Ze=ze,ge=ot):Ze=Ze.next=ze,X|=Fe;if(re=re.next,re===null){if(re=$.shared.pending,re===null)break;ze=re,re=ze.next,ze.next=null,$.lastBaseUpdate=ze,$.shared.pending=null}}while(!0);Ze===null&&(ge=ot),$.baseState=ge,$.firstBaseUpdate=Ne,$.lastBaseUpdate=Ze,F===null&&($.shared.lanes=0),Ed|=X,d.lanes=X,d.memoizedState=ot}}function W5(d,p){if(typeof d!="function")throw Error(r(191,d));d.call(p)}function K5(d,p){var b=d.callbacks;if(b!==null)for(d.callbacks=null,d=0;d<b.length;d++)W5(b[d],p)}var ym=q(null),CC=q(0);function Y5(d,p){d=pu,Z(CC,d),Z(ym,p),pu=d|p.baseLanes}function GA(){Z(CC,pu),Z(ym,ym.current)}function qA(){pu=CC.current,Y(ym),Y(CC)}var yd=0,Rn=null,br=null,Oo=null,EC=!1,vm=!1,cp=!1,TC=0,bb=0,bm=null,cge=0;function bo(){throw Error(r(321))}function WA(d,p){if(p===null)return!1;for(var b=0;b<p.length&&b<d.length;b++)if(!ka(d[b],p[b]))return!1;return!0}function KA(d,p,b,T,$,F){return yd=F,Rn=p,p.memoizedState=null,p.updateQueue=null,p.lanes=0,L.H=d===null||d.memoizedState===null?DU:kU,cp=!1,F=b(T,$),cp=!1,vm&&(F=X5(p,b,T,$)),Q5(d),F}function Q5(d){L.H=RC;var p=br!==null&&br.next!==null;if(yd=0,Oo=br=Rn=null,EC=!1,bb=0,bm=null,p)throw Error(r(300));d===null||Jo||(d=d.dependencies,d!==null&&vC(d)&&(Jo=!0))}function X5(d,p,b,T){Rn=d;var $=0;do{if(vm&&(bm=null),bb=0,vm=!1,25<=$)throw Error(r(301));if($+=1,Oo=br=null,d.updateQueue!=null){var F=d.updateQueue;F.lastEffect=null,F.events=null,F.stores=null,F.memoCache!=null&&(F.memoCache.index=0)}L.H=gge,F=p(b,T)}while(vm);return F}function uge(){var d=L.H,p=d.useState()[0];return p=typeof p.then=="function"?xb(p):p,d=d.useState()[0],(br!==null?br.memoizedState:null)!==d&&(Rn.flags|=1024),p}function YA(){var d=TC!==0;return TC=0,d}function QA(d,p,b){p.updateQueue=d.updateQueue,p.flags&=-2053,d.lanes&=~b}function XA(d){if(EC){for(d=d.memoizedState;d!==null;){var p=d.queue;p!==null&&(p.pending=null),d=d.next}EC=!1}yd=0,Oo=br=Rn=null,vm=!1,bb=TC=0,bm=null}function da(){var d={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Oo===null?Rn.memoizedState=Oo=d:Oo=Oo.next=d,Oo}function Io(){if(br===null){var d=Rn.alternate;d=d!==null?d.memoizedState:null}else d=br.next;var p=Oo===null?Rn.memoizedState:Oo.next;if(p!==null)Oo=p,br=d;else{if(d===null)throw Rn.alternate===null?Error(r(467)):Error(r(310));br=d,d={memoizedState:br.memoizedState,baseState:br.baseState,baseQueue:br.baseQueue,queue:br.queue,next:null},Oo===null?Rn.memoizedState=Oo=d:Oo=Oo.next=d}return Oo}function JA(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function xb(d){var p=bb;return bb+=1,bm===null&&(bm=[]),d=U5(bm,d,p),p=Rn,(Oo===null?p.memoizedState:Oo.next)===null&&(p=p.alternate,L.H=p===null||p.memoizedState===null?DU:kU),d}function OC(d){if(d!==null&&typeof d=="object"){if(typeof d.then=="function")return xb(d);if(d.$$typeof===E)return Pi(d)}throw Error(r(438,String(d)))}function ZA(d){var p=null,b=Rn.updateQueue;if(b!==null&&(p=b.memoCache),p==null){var T=Rn.alternate;T!==null&&(T=T.updateQueue,T!==null&&(T=T.memoCache,T!=null&&(p={data:T.data.map(function($){return $.slice()}),index:0})))}if(p==null&&(p={data:[],index:0}),b===null&&(b=JA(),Rn.updateQueue=b),b.memoCache=p,b=p.data[p.index],b===void 0)for(b=p.data[p.index]=Array(d),T=0;T<d;T++)b[T]=A;return p.index++,b}function su(d,p){return typeof p=="function"?p(d):p}function IC(d){var p=Io();return eM(p,br,d)}function eM(d,p,b){var T=d.queue;if(T===null)throw Error(r(311));T.lastRenderedReducer=b;var $=d.baseQueue,F=T.pending;if(F!==null){if($!==null){var X=$.next;$.next=F.next,F.next=X}p.baseQueue=$=F,T.pending=null}if(F=d.baseState,$===null)d.memoizedState=F;else{p=$.next;var re=X=null,ge=null,Ne=p,Ze=!1;do{var ot=Ne.lane&-536870913;if(ot!==Ne.lane?(qn&ot)===ot:(yd&ot)===ot){var Fe=Ne.revertLane;if(Fe===0)ge!==null&&(ge=ge.next={lane:0,revertLane:0,action:Ne.action,hasEagerState:Ne.hasEagerState,eagerState:Ne.eagerState,next:null}),ot===mm&&(Ze=!0);else if((yd&Fe)===Fe){Ne=Ne.next,Fe===mm&&(Ze=!0);continue}else ot={lane:0,revertLane:Ne.revertLane,action:Ne.action,hasEagerState:Ne.hasEagerState,eagerState:Ne.eagerState,next:null},ge===null?(re=ge=ot,X=F):ge=ge.next=ot,Rn.lanes|=Fe,Ed|=Fe;ot=Ne.action,cp&&b(F,ot),F=Ne.hasEagerState?Ne.eagerState:b(F,ot)}else Fe={lane:ot,revertLane:Ne.revertLane,action:Ne.action,hasEagerState:Ne.hasEagerState,eagerState:Ne.eagerState,next:null},ge===null?(re=ge=Fe,X=F):ge=ge.next=Fe,Rn.lanes|=ot,Ed|=ot;Ne=Ne.next}while(Ne!==null&&Ne!==p);if(ge===null?X=F:ge.next=re,!ka(F,d.memoizedState)&&(Jo=!0,Ze&&(b=gm,b!==null)))throw b;d.memoizedState=F,d.baseState=X,d.baseQueue=ge,T.lastRenderedState=F}return $===null&&(T.lanes=0),[d.memoizedState,T.dispatch]}function tM(d){var p=Io(),b=p.queue;if(b===null)throw Error(r(311));b.lastRenderedReducer=d;var T=b.dispatch,$=b.pending,F=p.memoizedState;if($!==null){b.pending=null;var X=$=$.next;do F=d(F,X.action),X=X.next;while(X!==$);ka(F,p.memoizedState)||(Jo=!0),p.memoizedState=F,p.baseQueue===null&&(p.baseState=F),b.lastRenderedState=F}return[F,T]}function J5(d,p,b){var T=Rn,$=Io(),F=rr;if(F){if(b===void 0)throw Error(r(407));b=b()}else b=p();var X=!ka((br||$).memoizedState,b);X&&($.memoizedState=b,Jo=!0),$=$.queue;var re=tU.bind(null,T,$,d);if(Sb(2048,8,re,[d]),$.getSnapshot!==p||X||Oo!==null&&Oo.memoizedState.tag&1){if(T.flags|=2048,xm(9,PC(),eU.bind(null,T,$,b,p),null),Dr===null)throw Error(r(349));F||(yd&124)!==0||Z5(T,p,b)}return b}function Z5(d,p,b){d.flags|=16384,d={getSnapshot:p,value:b},p=Rn.updateQueue,p===null?(p=JA(),Rn.updateQueue=p,p.stores=[d]):(b=p.stores,b===null?p.stores=[d]:b.push(d))}function eU(d,p,b,T){p.value=b,p.getSnapshot=T,nU(p)&&rU(d)}function tU(d,p,b){return b(function(){nU(p)&&rU(d)})}function nU(d){var p=d.getSnapshot;d=d.value;try{var b=p();return!ka(d,b)}catch{return!0}}function rU(d){var p=dm(d,2);p!==null&&ja(p,d,2)}function nM(d){var p=da();if(typeof d=="function"){var b=d;if(d=b(),cp){ut(!0);try{b()}finally{ut(!1)}}}return p.memoizedState=p.baseState=d,p.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:su,lastRenderedState:d},p}function oU(d,p,b,T){return d.baseState=b,eM(d,br,typeof T=="function"?T:su)}function dge(d,p,b,T,$){if(MC(d))throw Error(r(485));if(d=p.action,d!==null){var F={payload:$,action:d,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(X){F.listeners.push(X)}};L.T!==null?b(!0):F.isTransition=!1,T(F),b=p.pending,b===null?(F.next=p.pending=F,iU(p,F)):(F.next=b.next,p.pending=b.next=F)}}function iU(d,p){var b=p.action,T=p.payload,$=d.state;if(p.isTransition){var F=L.T,X={};L.T=X;try{var re=b($,T),ge=L.S;ge!==null&&ge(X,re),aU(d,p,re)}catch(Ne){rM(d,p,Ne)}finally{L.T=F}}else try{F=b($,T),aU(d,p,F)}catch(Ne){rM(d,p,Ne)}}function aU(d,p,b){b!==null&&typeof b=="object"&&typeof b.then=="function"?b.then(function(T){sU(d,p,T)},function(T){return rM(d,p,T)}):sU(d,p,b)}function sU(d,p,b){p.status="fulfilled",p.value=b,lU(p),d.state=b,p=d.pending,p!==null&&(b=p.next,b===p?d.pending=null:(b=b.next,p.next=b,iU(d,b)))}function rM(d,p,b){var T=d.pending;if(d.pending=null,T!==null){T=T.next;do p.status="rejected",p.reason=b,lU(p),p=p.next;while(p!==T)}d.action=null}function lU(d){d=d.listeners;for(var p=0;p<d.length;p++)(0,d[p])()}function cU(d,p){return p}function uU(d,p){if(rr){var b=Dr.formState;if(b!==null){e:{var T=Rn;if(rr){if(io){t:{for(var $=io,F=oc;$.nodeType!==8;){if(!F){$=null;break t}if($=hl($.nextSibling),$===null){$=null;break t}}F=$.data,$=F==="F!"||F==="F"?$:null}if($){io=hl($.nextSibling),T=$.data==="F!";break e}}ip(T)}T=!1}T&&(p=b[0])}}return b=da(),b.memoizedState=b.baseState=p,T={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cU,lastRenderedState:p},b.queue=T,b=AU.bind(null,Rn,T),T.dispatch=b,T=nM(!1),F=lM.bind(null,Rn,!1,T.queue),T=da(),$={state:p,dispatch:null,action:d,pending:null},T.queue=$,b=dge.bind(null,Rn,$,F,b),$.dispatch=b,T.memoizedState=d,[p,b,!1]}function dU(d){var p=Io();return fU(p,br,d)}function fU(d,p,b){if(p=eM(d,p,cU)[0],d=IC(su)[0],typeof p=="object"&&p!==null&&typeof p.then=="function")try{var T=xb(p)}catch(X){throw X===hb?SC:X}else T=p;p=Io();var $=p.queue,F=$.dispatch;return b!==p.memoizedState&&(Rn.flags|=2048,xm(9,PC(),fge.bind(null,$,b),null)),[T,F,d]}function fge(d,p){d.action=p}function pU(d){var p=Io(),b=br;if(b!==null)return fU(p,b,d);Io(),p=p.memoizedState,b=Io();var T=b.queue.dispatch;return b.memoizedState=d,[p,T,!1]}function xm(d,p,b,T){return d={tag:d,create:b,deps:T,inst:p,next:null},p=Rn.updateQueue,p===null&&(p=JA(),Rn.updateQueue=p),b=p.lastEffect,b===null?p.lastEffect=d.next=d:(T=b.next,b.next=d,d.next=T,p.lastEffect=d),d}function PC(){return{destroy:void 0,resource:void 0}}function hU(){return Io().memoizedState}function AC(d,p,b,T){var $=da();T=T===void 0?null:T,Rn.flags|=d,$.memoizedState=xm(1|p,PC(),b,T)}function Sb(d,p,b,T){var $=Io();T=T===void 0?null:T;var F=$.memoizedState.inst;br!==null&&T!==null&&WA(T,br.memoizedState.deps)?$.memoizedState=xm(p,F,b,T):(Rn.flags|=d,$.memoizedState=xm(1|p,F,b,T))}function mU(d,p){AC(8390656,8,d,p)}function gU(d,p){Sb(2048,8,d,p)}function yU(d,p){return Sb(4,2,d,p)}function vU(d,p){return Sb(4,4,d,p)}function bU(d,p){if(typeof p=="function"){d=d();var b=p(d);return function(){typeof b=="function"?b():p(null)}}if(p!=null)return d=d(),p.current=d,function(){p.current=null}}function xU(d,p,b){b=b!=null?b.concat([d]):null,Sb(4,4,bU.bind(null,p,d),b)}function oM(){}function SU(d,p){var b=Io();p=p===void 0?null:p;var T=b.memoizedState;return p!==null&&WA(p,T[1])?T[0]:(b.memoizedState=[d,p],d)}function wU(d,p){var b=Io();p=p===void 0?null:p;var T=b.memoizedState;if(p!==null&&WA(p,T[1]))return T[0];if(T=d(),cp){ut(!0);try{d()}finally{ut(!1)}}return b.memoizedState=[T,p],T}function iM(d,p,b){return b===void 0||(yd&1073741824)!==0?d.memoizedState=p:(d.memoizedState=b,d=T4(),Rn.lanes|=d,Ed|=d,b)}function CU(d,p,b,T){return ka(b,p)?b:ym.current!==null?(d=iM(d,b,T),ka(d,p)||(Jo=!0),d):(yd&42)===0?(Jo=!0,d.memoizedState=b):(d=T4(),Rn.lanes|=d,Ed|=d,p)}function EU(d,p,b,T,$){var F=V.p;V.p=F!==0&&8>F?F:8;var X=L.T,re={};L.T=re,lM(d,!1,p,b);try{var ge=$(),Ne=L.S;if(Ne!==null&&Ne(re,ge),ge!==null&&typeof ge=="object"&&typeof ge.then=="function"){var Ze=lge(ge,T);wb(d,p,Ze,Fa(d))}else wb(d,p,T,Fa(d))}catch(ot){wb(d,p,{then:function(){},status:"rejected",reason:ot},Fa())}finally{V.p=F,L.T=X}}function pge(){}function aM(d,p,b,T){if(d.tag!==5)throw Error(r(476));var $=TU(d).queue;EU(d,$,p,W,b===null?pge:function(){return OU(d),b(T)})}function TU(d){var p=d.memoizedState;if(p!==null)return p;p={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:su,lastRenderedState:W},next:null};var b={};return p.next={memoizedState:b,baseState:b,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:su,lastRenderedState:b},next:null},d.memoizedState=p,d=d.alternate,d!==null&&(d.memoizedState=p),p}function OU(d){var p=TU(d).next.queue;wb(d,p,{},Fa())}function sM(){return Pi(Bb)}function IU(){return Io().memoizedState}function PU(){return Io().memoizedState}function hge(d){for(var p=d.return;p!==null;){switch(p.tag){case 24:case 3:var b=Fa();d=md(b);var T=gd(p,d,b);T!==null&&(ja(T,p,b),gb(T,p,b)),p={cache:LA()},d.payload=p;return}p=p.return}}function mge(d,p,b){var T=Fa();b={lane:T,revertLane:0,action:b,hasEagerState:!1,eagerState:null,next:null},MC(d)?MU(p,b):(b=IA(d,p,b,T),b!==null&&(ja(b,d,T),RU(b,p,T)))}function AU(d,p,b){var T=Fa();wb(d,p,b,T)}function wb(d,p,b,T){var $={lane:T,revertLane:0,action:b,hasEagerState:!1,eagerState:null,next:null};if(MC(d))MU(p,$);else{var F=d.alternate;if(d.lanes===0&&(F===null||F.lanes===0)&&(F=p.lastRenderedReducer,F!==null))try{var X=p.lastRenderedState,re=F(X,b);if($.hasEagerState=!0,$.eagerState=re,ka(re,X))return pC(d,p,$,0),Dr===null&&fC(),!1}catch{}finally{}if(b=IA(d,p,$,T),b!==null)return ja(b,d,T),RU(b,p,T),!0}return!1}function lM(d,p,b,T){if(T={lane:2,revertLane:BM(),action:T,hasEagerState:!1,eagerState:null,next:null},MC(d)){if(p)throw Error(r(479))}else p=IA(d,b,T,2),p!==null&&ja(p,d,2)}function MC(d){var p=d.alternate;return d===Rn||p!==null&&p===Rn}function MU(d,p){vm=EC=!0;var b=d.pending;b===null?p.next=p:(p.next=b.next,b.next=p),d.pending=p}function RU(d,p,b){if((b&4194048)!==0){var T=p.lanes;T&=d.pendingLanes,b|=T,p.lanes=b,oo(d,b)}}var RC={readContext:Pi,use:OC,useCallback:bo,useContext:bo,useEffect:bo,useImperativeHandle:bo,useLayoutEffect:bo,useInsertionEffect:bo,useMemo:bo,useReducer:bo,useRef:bo,useState:bo,useDebugValue:bo,useDeferredValue:bo,useTransition:bo,useSyncExternalStore:bo,useId:bo,useHostTransitionStatus:bo,useFormState:bo,useActionState:bo,useOptimistic:bo,useMemoCache:bo,useCacheRefresh:bo},DU={readContext:Pi,use:OC,useCallback:function(d,p){return da().memoizedState=[d,p===void 0?null:p],d},useContext:Pi,useEffect:mU,useImperativeHandle:function(d,p,b){b=b!=null?b.concat([d]):null,AC(4194308,4,bU.bind(null,p,d),b)},useLayoutEffect:function(d,p){return AC(4194308,4,d,p)},useInsertionEffect:function(d,p){AC(4,2,d,p)},useMemo:function(d,p){var b=da();p=p===void 0?null:p;var T=d();if(cp){ut(!0);try{d()}finally{ut(!1)}}return b.memoizedState=[T,p],T},useReducer:function(d,p,b){var T=da();if(b!==void 0){var $=b(p);if(cp){ut(!0);try{b(p)}finally{ut(!1)}}}else $=p;return T.memoizedState=T.baseState=$,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:d,lastRenderedState:$},T.queue=d,d=d.dispatch=mge.bind(null,Rn,d),[T.memoizedState,d]},useRef:function(d){var p=da();return d={current:d},p.memoizedState=d},useState:function(d){d=nM(d);var p=d.queue,b=AU.bind(null,Rn,p);return p.dispatch=b,[d.memoizedState,b]},useDebugValue:oM,useDeferredValue:function(d,p){var b=da();return iM(b,d,p)},useTransition:function(){var d=nM(!1);return d=EU.bind(null,Rn,d.queue,!0,!1),da().memoizedState=d,[!1,d]},useSyncExternalStore:function(d,p,b){var T=Rn,$=da();if(rr){if(b===void 0)throw Error(r(407));b=b()}else{if(b=p(),Dr===null)throw Error(r(349));(qn&124)!==0||Z5(T,p,b)}$.memoizedState=b;var F={value:b,getSnapshot:p};return $.queue=F,mU(tU.bind(null,T,F,d),[d]),T.flags|=2048,xm(9,PC(),eU.bind(null,T,F,b,p),null),b},useId:function(){var d=da(),p=Dr.identifierPrefix;if(rr){var b=ou,T=ru;b=(T&~(1<<32-Be(T)-1)).toString(32)+b,p="«"+p+"R"+b,b=TC++,0<b&&(p+="H"+b.toString(32)),p+="»"}else b=cge++,p="«"+p+"r"+b.toString(32)+"»";return d.memoizedState=p},useHostTransitionStatus:sM,useFormState:uU,useActionState:uU,useOptimistic:function(d){var p=da();p.memoizedState=p.baseState=d;var b={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return p.queue=b,p=lM.bind(null,Rn,!0,b),b.dispatch=p,[d,p]},useMemoCache:ZA,useCacheRefresh:function(){return da().memoizedState=hge.bind(null,Rn)}},kU={readContext:Pi,use:OC,useCallback:SU,useContext:Pi,useEffect:gU,useImperativeHandle:xU,useInsertionEffect:yU,useLayoutEffect:vU,useMemo:wU,useReducer:IC,useRef:hU,useState:function(){return IC(su)},useDebugValue:oM,useDeferredValue:function(d,p){var b=Io();return CU(b,br.memoizedState,d,p)},useTransition:function(){var d=IC(su)[0],p=Io().memoizedState;return[typeof d=="boolean"?d:xb(d),p]},useSyncExternalStore:J5,useId:IU,useHostTransitionStatus:sM,useFormState:dU,useActionState:dU,useOptimistic:function(d,p){var b=Io();return oU(b,br,d,p)},useMemoCache:ZA,useCacheRefresh:PU},gge={readContext:Pi,use:OC,useCallback:SU,useContext:Pi,useEffect:gU,useImperativeHandle:xU,useInsertionEffect:yU,useLayoutEffect:vU,useMemo:wU,useReducer:tM,useRef:hU,useState:function(){return tM(su)},useDebugValue:oM,useDeferredValue:function(d,p){var b=Io();return br===null?iM(b,d,p):CU(b,br.memoizedState,d,p)},useTransition:function(){var d=tM(su)[0],p=Io().memoizedState;return[typeof d=="boolean"?d:xb(d),p]},useSyncExternalStore:J5,useId:IU,useHostTransitionStatus:sM,useFormState:pU,useActionState:pU,useOptimistic:function(d,p){var b=Io();return br!==null?oU(b,br,d,p):(b.baseState=d,[d,b.queue.dispatch])},useMemoCache:ZA,useCacheRefresh:PU},Sm=null,Cb=0;function DC(d){var p=Cb;return Cb+=1,Sm===null&&(Sm=[]),U5(Sm,d,p)}function Eb(d,p){p=p.props.ref,d.ref=p!==void 0?p:null}function kC(d,p){throw p.$$typeof===f?Error(r(525)):(d=Object.prototype.toString.call(p),Error(r(31,d==="[object Object]"?"object with keys {"+Object.keys(p).join(", ")+"}":d)))}function _U(d){var p=d._init;return p(d._payload)}function $U(d){function p(Ae,we){if(d){var _e=Ae.deletions;_e===null?(Ae.deletions=[we],Ae.flags|=16):_e.push(we)}}function b(Ae,we){if(!d)return null;for(;we!==null;)p(Ae,we),we=we.sibling;return null}function T(Ae){for(var we=new Map;Ae!==null;)Ae.key!==null?we.set(Ae.key,Ae):we.set(Ae.index,Ae),Ae=Ae.sibling;return we}function $(Ae,we){return Ae=nu(Ae,we),Ae.index=0,Ae.sibling=null,Ae}function F(Ae,we,_e){return Ae.index=_e,d?(_e=Ae.alternate,_e!==null?(_e=_e.index,_e<we?(Ae.flags|=67108866,we):_e):(Ae.flags|=67108866,we)):(Ae.flags|=1048576,we)}function X(Ae){return d&&Ae.alternate===null&&(Ae.flags|=67108866),Ae}function re(Ae,we,_e,tt){return we===null||we.tag!==6?(we=AA(_e,Ae.mode,tt),we.return=Ae,we):(we=$(we,_e),we.return=Ae,we)}function ge(Ae,we,_e,tt){var Bt=_e.type;return Bt===g?Ze(Ae,we,_e.props.children,tt,_e.key):we!==null&&(we.elementType===Bt||typeof Bt=="object"&&Bt!==null&&Bt.$$typeof===D&&_U(Bt)===we.type)?(we=$(we,_e.props),Eb(we,_e),we.return=Ae,we):(we=mC(_e.type,_e.key,_e.props,null,Ae.mode,tt),Eb(we,_e),we.return=Ae,we)}function Ne(Ae,we,_e,tt){return we===null||we.tag!==4||we.stateNode.containerInfo!==_e.containerInfo||we.stateNode.implementation!==_e.implementation?(we=MA(_e,Ae.mode,tt),we.return=Ae,we):(we=$(we,_e.children||[]),we.return=Ae,we)}function Ze(Ae,we,_e,tt,Bt){return we===null||we.tag!==7?(we=tp(_e,Ae.mode,tt,Bt),we.return=Ae,we):(we=$(we,_e),we.return=Ae,we)}function ot(Ae,we,_e){if(typeof we=="string"&&we!==""||typeof we=="number"||typeof we=="bigint")return we=AA(""+we,Ae.mode,_e),we.return=Ae,we;if(typeof we=="object"&&we!==null){switch(we.$$typeof){case h:return _e=mC(we.type,we.key,we.props,null,Ae.mode,_e),Eb(_e,we),_e.return=Ae,_e;case m:return we=MA(we,Ae.mode,_e),we.return=Ae,we;case D:var tt=we._init;return we=tt(we._payload),ot(Ae,we,_e)}if(j(we)||N(we))return we=tp(we,Ae.mode,_e,null),we.return=Ae,we;if(typeof we.then=="function")return ot(Ae,DC(we),_e);if(we.$$typeof===E)return ot(Ae,bC(Ae,we),_e);kC(Ae,we)}return null}function Fe(Ae,we,_e,tt){var Bt=we!==null?we.key:null;if(typeof _e=="string"&&_e!==""||typeof _e=="number"||typeof _e=="bigint")return Bt!==null?null:re(Ae,we,""+_e,tt);if(typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case h:return _e.key===Bt?ge(Ae,we,_e,tt):null;case m:return _e.key===Bt?Ne(Ae,we,_e,tt):null;case D:return Bt=_e._init,_e=Bt(_e._payload),Fe(Ae,we,_e,tt)}if(j(_e)||N(_e))return Bt!==null?null:Ze(Ae,we,_e,tt,null);if(typeof _e.then=="function")return Fe(Ae,we,DC(_e),tt);if(_e.$$typeof===E)return Fe(Ae,we,bC(Ae,_e),tt);kC(Ae,_e)}return null}function ze(Ae,we,_e,tt,Bt){if(typeof tt=="string"&&tt!==""||typeof tt=="number"||typeof tt=="bigint")return Ae=Ae.get(_e)||null,re(we,Ae,""+tt,Bt);if(typeof tt=="object"&&tt!==null){switch(tt.$$typeof){case h:return Ae=Ae.get(tt.key===null?_e:tt.key)||null,ge(we,Ae,tt,Bt);case m:return Ae=Ae.get(tt.key===null?_e:tt.key)||null,Ne(we,Ae,tt,Bt);case D:var _n=tt._init;return tt=_n(tt._payload),ze(Ae,we,_e,tt,Bt)}if(j(tt)||N(tt))return Ae=Ae.get(_e)||null,Ze(we,Ae,tt,Bt,null);if(typeof tt.then=="function")return ze(Ae,we,_e,DC(tt),Bt);if(tt.$$typeof===E)return ze(Ae,we,_e,bC(we,tt),Bt);kC(we,tt)}return null}function fn(Ae,we,_e,tt){for(var Bt=null,_n=null,qt=we,an=we=0,ei=null;qt!==null&&an<_e.length;an++){qt.index>an?(ei=qt,qt=null):ei=qt.sibling;var Zn=Fe(Ae,qt,_e[an],tt);if(Zn===null){qt===null&&(qt=ei);break}d&&qt&&Zn.alternate===null&&p(Ae,qt),we=F(Zn,we,an),_n===null?Bt=Zn:_n.sibling=Zn,_n=Zn,qt=ei}if(an===_e.length)return b(Ae,qt),rr&&rp(Ae,an),Bt;if(qt===null){for(;an<_e.length;an++)qt=ot(Ae,_e[an],tt),qt!==null&&(we=F(qt,we,an),_n===null?Bt=qt:_n.sibling=qt,_n=qt);return rr&&rp(Ae,an),Bt}for(qt=T(qt);an<_e.length;an++)ei=ze(qt,Ae,an,_e[an],tt),ei!==null&&(d&&ei.alternate!==null&&qt.delete(ei.key===null?an:ei.key),we=F(ei,we,an),_n===null?Bt=ei:_n.sibling=ei,_n=ei);return d&&qt.forEach(function(kd){return p(Ae,kd)}),rr&&rp(Ae,an),Bt}function nn(Ae,we,_e,tt){if(_e==null)throw Error(r(151));for(var Bt=null,_n=null,qt=we,an=we=0,ei=null,Zn=_e.next();qt!==null&&!Zn.done;an++,Zn=_e.next()){qt.index>an?(ei=qt,qt=null):ei=qt.sibling;var kd=Fe(Ae,qt,Zn.value,tt);if(kd===null){qt===null&&(qt=ei);break}d&&qt&&kd.alternate===null&&p(Ae,qt),we=F(kd,we,an),_n===null?Bt=kd:_n.sibling=kd,_n=kd,qt=ei}if(Zn.done)return b(Ae,qt),rr&&rp(Ae,an),Bt;if(qt===null){for(;!Zn.done;an++,Zn=_e.next())Zn=ot(Ae,Zn.value,tt),Zn!==null&&(we=F(Zn,we,an),_n===null?Bt=Zn:_n.sibling=Zn,_n=Zn);return rr&&rp(Ae,an),Bt}for(qt=T(qt);!Zn.done;an++,Zn=_e.next())Zn=ze(qt,Ae,an,Zn.value,tt),Zn!==null&&(d&&Zn.alternate!==null&&qt.delete(Zn.key===null?an:Zn.key),we=F(Zn,we,an),_n===null?Bt=Zn:_n.sibling=Zn,_n=Zn);return d&&qt.forEach(function(yye){return p(Ae,yye)}),rr&&rp(Ae,an),Bt}function Sr(Ae,we,_e,tt){if(typeof _e=="object"&&_e!==null&&_e.type===g&&_e.key===null&&(_e=_e.props.children),typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case h:e:{for(var Bt=_e.key;we!==null;){if(we.key===Bt){if(Bt=_e.type,Bt===g){if(we.tag===7){b(Ae,we.sibling),tt=$(we,_e.props.children),tt.return=Ae,Ae=tt;break e}}else if(we.elementType===Bt||typeof Bt=="object"&&Bt!==null&&Bt.$$typeof===D&&_U(Bt)===we.type){b(Ae,we.sibling),tt=$(we,_e.props),Eb(tt,_e),tt.return=Ae,Ae=tt;break e}b(Ae,we);break}else p(Ae,we);we=we.sibling}_e.type===g?(tt=tp(_e.props.children,Ae.mode,tt,_e.key),tt.return=Ae,Ae=tt):(tt=mC(_e.type,_e.key,_e.props,null,Ae.mode,tt),Eb(tt,_e),tt.return=Ae,Ae=tt)}return X(Ae);case m:e:{for(Bt=_e.key;we!==null;){if(we.key===Bt)if(we.tag===4&&we.stateNode.containerInfo===_e.containerInfo&&we.stateNode.implementation===_e.implementation){b(Ae,we.sibling),tt=$(we,_e.children||[]),tt.return=Ae,Ae=tt;break e}else{b(Ae,we);break}else p(Ae,we);we=we.sibling}tt=MA(_e,Ae.mode,tt),tt.return=Ae,Ae=tt}return X(Ae);case D:return Bt=_e._init,_e=Bt(_e._payload),Sr(Ae,we,_e,tt)}if(j(_e))return fn(Ae,we,_e,tt);if(N(_e)){if(Bt=N(_e),typeof Bt!="function")throw Error(r(150));return _e=Bt.call(_e),nn(Ae,we,_e,tt)}if(typeof _e.then=="function")return Sr(Ae,we,DC(_e),tt);if(_e.$$typeof===E)return Sr(Ae,we,bC(Ae,_e),tt);kC(Ae,_e)}return typeof _e=="string"&&_e!==""||typeof _e=="number"||typeof _e=="bigint"?(_e=""+_e,we!==null&&we.tag===6?(b(Ae,we.sibling),tt=$(we,_e),tt.return=Ae,Ae=tt):(b(Ae,we),tt=AA(_e,Ae.mode,tt),tt.return=Ae,Ae=tt),X(Ae)):b(Ae,we)}return function(Ae,we,_e,tt){try{Cb=0;var Bt=Sr(Ae,we,_e,tt);return Sm=null,Bt}catch(qt){if(qt===hb||qt===SC)throw qt;var _n=_a(29,qt,null,Ae.mode);return _n.lanes=tt,_n.return=Ae,_n}finally{}}}var wm=$U(!0),NU=$U(!1),Ss=q(null),ic=null;function vd(d){var p=d.alternate;Z(No,No.current&1),Z(Ss,d),ic===null&&(p===null||ym.current!==null||p.memoizedState!==null)&&(ic=d)}function LU(d){if(d.tag===22){if(Z(No,No.current),Z(Ss,d),ic===null){var p=d.alternate;p!==null&&p.memoizedState!==null&&(ic=d)}}else bd()}function bd(){Z(No,No.current),Z(Ss,Ss.current)}function lu(d){Y(Ss),ic===d&&(ic=null),Y(No)}var No=q(0);function _C(d){for(var p=d;p!==null;){if(p.tag===13){var b=p.memoizedState;if(b!==null&&(b=b.dehydrated,b===null||b.data==="$?"||JM(b)))return p}else if(p.tag===19&&p.memoizedProps.revealOrder!==void 0){if((p.flags&128)!==0)return p}else if(p.child!==null){p.child.return=p,p=p.child;continue}if(p===d)break;for(;p.sibling===null;){if(p.return===null||p.return===d)return null;p=p.return}p.sibling.return=p.return,p=p.sibling}return null}function cM(d,p,b,T){p=d.memoizedState,b=b(T,p),b=b==null?p:u({},p,b),d.memoizedState=b,d.lanes===0&&(d.updateQueue.baseState=b)}var uM={enqueueSetState:function(d,p,b){d=d._reactInternals;var T=Fa(),$=md(T);$.payload=p,b!=null&&($.callback=b),p=gd(d,$,T),p!==null&&(ja(p,d,T),gb(p,d,T))},enqueueReplaceState:function(d,p,b){d=d._reactInternals;var T=Fa(),$=md(T);$.tag=1,$.payload=p,b!=null&&($.callback=b),p=gd(d,$,T),p!==null&&(ja(p,d,T),gb(p,d,T))},enqueueForceUpdate:function(d,p){d=d._reactInternals;var b=Fa(),T=md(b);T.tag=2,p!=null&&(T.callback=p),p=gd(d,T,b),p!==null&&(ja(p,d,b),gb(p,d,b))}};function FU(d,p,b,T,$,F,X){return d=d.stateNode,typeof d.shouldComponentUpdate=="function"?d.shouldComponentUpdate(T,F,X):p.prototype&&p.prototype.isPureReactComponent?!ab(b,T)||!ab($,F):!0}function jU(d,p,b,T){d=p.state,typeof p.componentWillReceiveProps=="function"&&p.componentWillReceiveProps(b,T),typeof p.UNSAFE_componentWillReceiveProps=="function"&&p.UNSAFE_componentWillReceiveProps(b,T),p.state!==d&&uM.enqueueReplaceState(p,p.state,null)}function up(d,p){var b=p;if("ref"in p){b={};for(var T in p)T!=="ref"&&(b[T]=p[T])}if(d=d.defaultProps){b===p&&(b=u({},b));for(var $ in d)b[$]===void 0&&(b[$]=d[$])}return b}var $C=typeof reportError=="function"?reportError:function(d){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var p=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof d=="object"&&d!==null&&typeof d.message=="string"?String(d.message):String(d),error:d});if(!window.dispatchEvent(p))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",d);return}console.error(d)};function BU(d){$C(d)}function zU(d){console.error(d)}function VU(d){$C(d)}function NC(d,p){try{var b=d.onUncaughtError;b(p.value,{componentStack:p.stack})}catch(T){setTimeout(function(){throw T})}}function HU(d,p,b){try{var T=d.onCaughtError;T(b.value,{componentStack:b.stack,errorBoundary:p.tag===1?p.stateNode:null})}catch($){setTimeout(function(){throw $})}}function dM(d,p,b){return b=md(b),b.tag=3,b.payload={element:null},b.callback=function(){NC(d,p)},b}function UU(d){return d=md(d),d.tag=3,d}function GU(d,p,b,T){var $=b.type.getDerivedStateFromError;if(typeof $=="function"){var F=T.value;d.payload=function(){return $(F)},d.callback=function(){HU(p,b,T)}}var X=b.stateNode;X!==null&&typeof X.componentDidCatch=="function"&&(d.callback=function(){HU(p,b,T),typeof $!="function"&&(Td===null?Td=new Set([this]):Td.add(this));var re=T.stack;this.componentDidCatch(T.value,{componentStack:re!==null?re:""})})}function yge(d,p,b,T,$){if(b.flags|=32768,T!==null&&typeof T=="object"&&typeof T.then=="function"){if(p=b.alternate,p!==null&&db(p,b,$,!0),b=Ss.current,b!==null){switch(b.tag){case 13:return ic===null?$M():b.alternate===null&&ao===0&&(ao=3),b.flags&=-257,b.flags|=65536,b.lanes=$,T===BA?b.flags|=16384:(p=b.updateQueue,p===null?b.updateQueue=new Set([T]):p.add(T),LM(d,T,$)),!1;case 22:return b.flags|=65536,T===BA?b.flags|=16384:(p=b.updateQueue,p===null?(p={transitions:null,markerInstances:null,retryQueue:new Set([T])},b.updateQueue=p):(b=p.retryQueue,b===null?p.retryQueue=new Set([T]):b.add(T)),LM(d,T,$)),!1}throw Error(r(435,b.tag))}return LM(d,T,$),$M(),!1}if(rr)return p=Ss.current,p!==null?((p.flags&65536)===0&&(p.flags|=256),p.flags|=65536,p.lanes=$,T!==kA&&(d=Error(r(422),{cause:T}),ub(ys(d,b)))):(T!==kA&&(p=Error(r(423),{cause:T}),ub(ys(p,b))),d=d.current.alternate,d.flags|=65536,$&=-$,d.lanes|=$,T=ys(T,b),$=dM(d.stateNode,T,$),HA(d,$),ao!==4&&(ao=2)),!1;var F=Error(r(520),{cause:T});if(F=ys(F,b),Rb===null?Rb=[F]:Rb.push(F),ao!==4&&(ao=2),p===null)return!0;T=ys(T,b),b=p;do{switch(b.tag){case 3:return b.flags|=65536,d=$&-$,b.lanes|=d,d=dM(b.stateNode,T,d),HA(b,d),!1;case 1:if(p=b.type,F=b.stateNode,(b.flags&128)===0&&(typeof p.getDerivedStateFromError=="function"||F!==null&&typeof F.componentDidCatch=="function"&&(Td===null||!Td.has(F))))return b.flags|=65536,$&=-$,b.lanes|=$,$=UU($),GU($,d,b,T),HA(b,$),!1}b=b.return}while(b!==null);return!1}var qU=Error(r(461)),Jo=!1;function pi(d,p,b,T){p.child=d===null?NU(p,null,b,T):wm(p,d.child,b,T)}function WU(d,p,b,T,$){b=b.render;var F=p.ref;if("ref"in T){var X={};for(var re in T)re!=="ref"&&(X[re]=T[re])}else X=T;return sp(p),T=KA(d,p,b,X,F,$),re=YA(),d!==null&&!Jo?(QA(d,p,$),cu(d,p,$)):(rr&&re&&RA(p),p.flags|=1,pi(d,p,T,$),p.child)}function KU(d,p,b,T,$){if(d===null){var F=b.type;return typeof F=="function"&&!PA(F)&&F.defaultProps===void 0&&b.compare===null?(p.tag=15,p.type=F,YU(d,p,F,T,$)):(d=mC(b.type,null,T,p,p.mode,$),d.ref=p.ref,d.return=p,p.child=d)}if(F=d.child,!bM(d,$)){var X=F.memoizedProps;if(b=b.compare,b=b!==null?b:ab,b(X,T)&&d.ref===p.ref)return cu(d,p,$)}return p.flags|=1,d=nu(F,T),d.ref=p.ref,d.return=p,p.child=d}function YU(d,p,b,T,$){if(d!==null){var F=d.memoizedProps;if(ab(F,T)&&d.ref===p.ref)if(Jo=!1,p.pendingProps=T=F,bM(d,$))(d.flags&131072)!==0&&(Jo=!0);else return p.lanes=d.lanes,cu(d,p,$)}return fM(d,p,b,T,$)}function QU(d,p,b){var T=p.pendingProps,$=T.children,F=d!==null?d.memoizedState:null;if(T.mode==="hidden"){if((p.flags&128)!==0){if(T=F!==null?F.baseLanes|b:b,d!==null){for($=p.child=d.child,F=0;$!==null;)F=F|$.lanes|$.childLanes,$=$.sibling;p.childLanes=F&~T}else p.childLanes=0,p.child=null;return XU(d,p,T,b)}if((b&536870912)!==0)p.memoizedState={baseLanes:0,cachePool:null},d!==null&&xC(p,F!==null?F.cachePool:null),F!==null?Y5(p,F):GA(),LU(p);else return p.lanes=p.childLanes=536870912,XU(d,p,F!==null?F.baseLanes|b:b,b)}else F!==null?(xC(p,F.cachePool),Y5(p,F),bd(),p.memoizedState=null):(d!==null&&xC(p,null),GA(),bd());return pi(d,p,$,b),p.child}function XU(d,p,b,T){var $=jA();return $=$===null?null:{parent:$o._currentValue,pool:$},p.memoizedState={baseLanes:b,cachePool:$},d!==null&&xC(p,null),GA(),LU(p),d!==null&&db(d,p,T,!0),null}function LC(d,p){var b=p.ref;if(b===null)d!==null&&d.ref!==null&&(p.flags|=4194816);else{if(typeof b!="function"&&typeof b!="object")throw Error(r(284));(d===null||d.ref!==b)&&(p.flags|=4194816)}}function fM(d,p,b,T,$){return sp(p),b=KA(d,p,b,T,void 0,$),T=YA(),d!==null&&!Jo?(QA(d,p,$),cu(d,p,$)):(rr&&T&&RA(p),p.flags|=1,pi(d,p,b,$),p.child)}function JU(d,p,b,T,$,F){return sp(p),p.updateQueue=null,b=X5(p,T,b,$),Q5(d),T=YA(),d!==null&&!Jo?(QA(d,p,F),cu(d,p,F)):(rr&&T&&RA(p),p.flags|=1,pi(d,p,b,F),p.child)}function ZU(d,p,b,T,$){if(sp(p),p.stateNode===null){var F=fm,X=b.contextType;typeof X=="object"&&X!==null&&(F=Pi(X)),F=new b(T,F),p.memoizedState=F.state!==null&&F.state!==void 0?F.state:null,F.updater=uM,p.stateNode=F,F._reactInternals=p,F=p.stateNode,F.props=T,F.state=p.memoizedState,F.refs={},zA(p),X=b.contextType,F.context=typeof X=="object"&&X!==null?Pi(X):fm,F.state=p.memoizedState,X=b.getDerivedStateFromProps,typeof X=="function"&&(cM(p,b,X,T),F.state=p.memoizedState),typeof b.getDerivedStateFromProps=="function"||typeof F.getSnapshotBeforeUpdate=="function"||typeof F.UNSAFE_componentWillMount!="function"&&typeof F.componentWillMount!="function"||(X=F.state,typeof F.componentWillMount=="function"&&F.componentWillMount(),typeof F.UNSAFE_componentWillMount=="function"&&F.UNSAFE_componentWillMount(),X!==F.state&&uM.enqueueReplaceState(F,F.state,null),vb(p,T,F,$),yb(),F.state=p.memoizedState),typeof F.componentDidMount=="function"&&(p.flags|=4194308),T=!0}else if(d===null){F=p.stateNode;var re=p.memoizedProps,ge=up(b,re);F.props=ge;var Ne=F.context,Ze=b.contextType;X=fm,typeof Ze=="object"&&Ze!==null&&(X=Pi(Ze));var ot=b.getDerivedStateFromProps;Ze=typeof ot=="function"||typeof F.getSnapshotBeforeUpdate=="function",re=p.pendingProps!==re,Ze||typeof F.UNSAFE_componentWillReceiveProps!="function"&&typeof F.componentWillReceiveProps!="function"||(re||Ne!==X)&&jU(p,F,T,X),hd=!1;var Fe=p.memoizedState;F.state=Fe,vb(p,T,F,$),yb(),Ne=p.memoizedState,re||Fe!==Ne||hd?(typeof ot=="function"&&(cM(p,b,ot,T),Ne=p.memoizedState),(ge=hd||FU(p,b,ge,T,Fe,Ne,X))?(Ze||typeof F.UNSAFE_componentWillMount!="function"&&typeof F.componentWillMount!="function"||(typeof F.componentWillMount=="function"&&F.componentWillMount(),typeof F.UNSAFE_componentWillMount=="function"&&F.UNSAFE_componentWillMount()),typeof F.componentDidMount=="function"&&(p.flags|=4194308)):(typeof F.componentDidMount=="function"&&(p.flags|=4194308),p.memoizedProps=T,p.memoizedState=Ne),F.props=T,F.state=Ne,F.context=X,T=ge):(typeof F.componentDidMount=="function"&&(p.flags|=4194308),T=!1)}else{F=p.stateNode,VA(d,p),X=p.memoizedProps,Ze=up(b,X),F.props=Ze,ot=p.pendingProps,Fe=F.context,Ne=b.contextType,ge=fm,typeof Ne=="object"&&Ne!==null&&(ge=Pi(Ne)),re=b.getDerivedStateFromProps,(Ne=typeof re=="function"||typeof F.getSnapshotBeforeUpdate=="function")||typeof F.UNSAFE_componentWillReceiveProps!="function"&&typeof F.componentWillReceiveProps!="function"||(X!==ot||Fe!==ge)&&jU(p,F,T,ge),hd=!1,Fe=p.memoizedState,F.state=Fe,vb(p,T,F,$),yb();var ze=p.memoizedState;X!==ot||Fe!==ze||hd||d!==null&&d.dependencies!==null&&vC(d.dependencies)?(typeof re=="function"&&(cM(p,b,re,T),ze=p.memoizedState),(Ze=hd||FU(p,b,Ze,T,Fe,ze,ge)||d!==null&&d.dependencies!==null&&vC(d.dependencies))?(Ne||typeof F.UNSAFE_componentWillUpdate!="function"&&typeof F.componentWillUpdate!="function"||(typeof F.componentWillUpdate=="function"&&F.componentWillUpdate(T,ze,ge),typeof F.UNSAFE_componentWillUpdate=="function"&&F.UNSAFE_componentWillUpdate(T,ze,ge)),typeof F.componentDidUpdate=="function"&&(p.flags|=4),typeof F.getSnapshotBeforeUpdate=="function"&&(p.flags|=1024)):(typeof F.componentDidUpdate!="function"||X===d.memoizedProps&&Fe===d.memoizedState||(p.flags|=4),typeof F.getSnapshotBeforeUpdate!="function"||X===d.memoizedProps&&Fe===d.memoizedState||(p.flags|=1024),p.memoizedProps=T,p.memoizedState=ze),F.props=T,F.state=ze,F.context=ge,T=Ze):(typeof F.componentDidUpdate!="function"||X===d.memoizedProps&&Fe===d.memoizedState||(p.flags|=4),typeof F.getSnapshotBeforeUpdate!="function"||X===d.memoizedProps&&Fe===d.memoizedState||(p.flags|=1024),T=!1)}return F=T,LC(d,p),T=(p.flags&128)!==0,F||T?(F=p.stateNode,b=T&&typeof b.getDerivedStateFromError!="function"?null:F.render(),p.flags|=1,d!==null&&T?(p.child=wm(p,d.child,null,$),p.child=wm(p,null,b,$)):pi(d,p,b,$),p.memoizedState=F.state,d=p.child):d=cu(d,p,$),d}function e4(d,p,b,T){return cb(),p.flags|=256,pi(d,p,b,T),p.child}var pM={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function hM(d){return{baseLanes:d,cachePool:z5()}}function mM(d,p,b){return d=d!==null?d.childLanes&~b:0,p&&(d|=ws),d}function t4(d,p,b){var T=p.pendingProps,$=!1,F=(p.flags&128)!==0,X;if((X=F)||(X=d!==null&&d.memoizedState===null?!1:(No.current&2)!==0),X&&($=!0,p.flags&=-129),X=(p.flags&32)!==0,p.flags&=-33,d===null){if(rr){if($?vd(p):bd(),rr){var re=io,ge;if(ge=re){e:{for(ge=re,re=oc;ge.nodeType!==8;){if(!re){re=null;break e}if(ge=hl(ge.nextSibling),ge===null){re=null;break e}}re=ge}re!==null?(p.memoizedState={dehydrated:re,treeContext:np!==null?{id:ru,overflow:ou}:null,retryLane:536870912,hydrationErrors:null},ge=_a(18,null,null,0),ge.stateNode=re,ge.return=p,p.child=ge,Ui=p,io=null,ge=!0):ge=!1}ge||ip(p)}if(re=p.memoizedState,re!==null&&(re=re.dehydrated,re!==null))return JM(re)?p.lanes=32:p.lanes=536870912,null;lu(p)}return re=T.children,T=T.fallback,$?(bd(),$=p.mode,re=FC({mode:"hidden",children:re},$),T=tp(T,$,b,null),re.return=p,T.return=p,re.sibling=T,p.child=re,$=p.child,$.memoizedState=hM(b),$.childLanes=mM(d,X,b),p.memoizedState=pM,T):(vd(p),gM(p,re))}if(ge=d.memoizedState,ge!==null&&(re=ge.dehydrated,re!==null)){if(F)p.flags&256?(vd(p),p.flags&=-257,p=yM(d,p,b)):p.memoizedState!==null?(bd(),p.child=d.child,p.flags|=128,p=null):(bd(),$=T.fallback,re=p.mode,T=FC({mode:"visible",children:T.children},re),$=tp($,re,b,null),$.flags|=2,T.return=p,$.return=p,T.sibling=$,p.child=T,wm(p,d.child,null,b),T=p.child,T.memoizedState=hM(b),T.childLanes=mM(d,X,b),p.memoizedState=pM,p=$);else if(vd(p),JM(re)){if(X=re.nextSibling&&re.nextSibling.dataset,X)var Ne=X.dgst;X=Ne,T=Error(r(419)),T.stack="",T.digest=X,ub({value:T,source:null,stack:null}),p=yM(d,p,b)}else if(Jo||db(d,p,b,!1),X=(b&d.childLanes)!==0,Jo||X){if(X=Dr,X!==null&&(T=b&-b,T=(T&42)!==0?1:Oi(T),T=(T&(X.suspendedLanes|b))!==0?0:T,T!==0&&T!==ge.retryLane))throw ge.retryLane=T,dm(d,T),ja(X,d,T),qU;re.data==="$?"||$M(),p=yM(d,p,b)}else re.data==="$?"?(p.flags|=192,p.child=d.child,p=null):(d=ge.treeContext,io=hl(re.nextSibling),Ui=p,rr=!0,op=null,oc=!1,d!==null&&(bs[xs++]=ru,bs[xs++]=ou,bs[xs++]=np,ru=d.id,ou=d.overflow,np=p),p=gM(p,T.children),p.flags|=4096);return p}return $?(bd(),$=T.fallback,re=p.mode,ge=d.child,Ne=ge.sibling,T=nu(ge,{mode:"hidden",children:T.children}),T.subtreeFlags=ge.subtreeFlags&65011712,Ne!==null?$=nu(Ne,$):($=tp($,re,b,null),$.flags|=2),$.return=p,T.return=p,T.sibling=$,p.child=T,T=$,$=p.child,re=d.child.memoizedState,re===null?re=hM(b):(ge=re.cachePool,ge!==null?(Ne=$o._currentValue,ge=ge.parent!==Ne?{parent:Ne,pool:Ne}:ge):ge=z5(),re={baseLanes:re.baseLanes|b,cachePool:ge}),$.memoizedState=re,$.childLanes=mM(d,X,b),p.memoizedState=pM,T):(vd(p),b=d.child,d=b.sibling,b=nu(b,{mode:"visible",children:T.children}),b.return=p,b.sibling=null,d!==null&&(X=p.deletions,X===null?(p.deletions=[d],p.flags|=16):X.push(d)),p.child=b,p.memoizedState=null,b)}function gM(d,p){return p=FC({mode:"visible",children:p},d.mode),p.return=d,d.child=p}function FC(d,p){return d=_a(22,d,null,p),d.lanes=0,d.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},d}function yM(d,p,b){return wm(p,d.child,null,b),d=gM(p,p.pendingProps.children),d.flags|=2,p.memoizedState=null,d}function n4(d,p,b){d.lanes|=p;var T=d.alternate;T!==null&&(T.lanes|=p),$A(d.return,p,b)}function vM(d,p,b,T,$){var F=d.memoizedState;F===null?d.memoizedState={isBackwards:p,rendering:null,renderingStartTime:0,last:T,tail:b,tailMode:$}:(F.isBackwards=p,F.rendering=null,F.renderingStartTime=0,F.last=T,F.tail=b,F.tailMode=$)}function r4(d,p,b){var T=p.pendingProps,$=T.revealOrder,F=T.tail;if(pi(d,p,T.children,b),T=No.current,(T&2)!==0)T=T&1|2,p.flags|=128;else{if(d!==null&&(d.flags&128)!==0)e:for(d=p.child;d!==null;){if(d.tag===13)d.memoizedState!==null&&n4(d,b,p);else if(d.tag===19)n4(d,b,p);else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===p)break e;for(;d.sibling===null;){if(d.return===null||d.return===p)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}T&=1}switch(Z(No,T),$){case"forwards":for(b=p.child,$=null;b!==null;)d=b.alternate,d!==null&&_C(d)===null&&($=b),b=b.sibling;b=$,b===null?($=p.child,p.child=null):($=b.sibling,b.sibling=null),vM(p,!1,$,b,F);break;case"backwards":for(b=null,$=p.child,p.child=null;$!==null;){if(d=$.alternate,d!==null&&_C(d)===null){p.child=$;break}d=$.sibling,$.sibling=b,b=$,$=d}vM(p,!0,b,null,F);break;case"together":vM(p,!1,null,null,void 0);break;default:p.memoizedState=null}return p.child}function cu(d,p,b){if(d!==null&&(p.dependencies=d.dependencies),Ed|=p.lanes,(b&p.childLanes)===0)if(d!==null){if(db(d,p,b,!1),(b&p.childLanes)===0)return null}else return null;if(d!==null&&p.child!==d.child)throw Error(r(153));if(p.child!==null){for(d=p.child,b=nu(d,d.pendingProps),p.child=b,b.return=p;d.sibling!==null;)d=d.sibling,b=b.sibling=nu(d,d.pendingProps),b.return=p;b.sibling=null}return p.child}function bM(d,p){return(d.lanes&p)!==0?!0:(d=d.dependencies,!!(d!==null&&vC(d)))}function vge(d,p,b){switch(p.tag){case 3:Se(p,p.stateNode.containerInfo),pd(p,$o,d.memoizedState.cache),cb();break;case 27:case 5:le(p);break;case 4:Se(p,p.stateNode.containerInfo);break;case 10:pd(p,p.type,p.memoizedProps.value);break;case 13:var T=p.memoizedState;if(T!==null)return T.dehydrated!==null?(vd(p),p.flags|=128,null):(b&p.child.childLanes)!==0?t4(d,p,b):(vd(p),d=cu(d,p,b),d!==null?d.sibling:null);vd(p);break;case 19:var $=(d.flags&128)!==0;if(T=(b&p.childLanes)!==0,T||(db(d,p,b,!1),T=(b&p.childLanes)!==0),$){if(T)return r4(d,p,b);p.flags|=128}if($=p.memoizedState,$!==null&&($.rendering=null,$.tail=null,$.lastEffect=null),Z(No,No.current),T)break;return null;case 22:case 23:return p.lanes=0,QU(d,p,b);case 24:pd(p,$o,d.memoizedState.cache)}return cu(d,p,b)}function o4(d,p,b){if(d!==null)if(d.memoizedProps!==p.pendingProps)Jo=!0;else{if(!bM(d,b)&&(p.flags&128)===0)return Jo=!1,vge(d,p,b);Jo=(d.flags&131072)!==0}else Jo=!1,rr&&(p.flags&1048576)!==0&&_5(p,yC,p.index);switch(p.lanes=0,p.tag){case 16:e:{d=p.pendingProps;var T=p.elementType,$=T._init;if(T=$(T._payload),p.type=T,typeof T=="function")PA(T)?(d=up(T,d),p.tag=1,p=ZU(null,p,T,d,b)):(p.tag=0,p=fM(null,p,T,d,b));else{if(T!=null){if($=T.$$typeof,$===I){p.tag=11,p=WU(null,p,T,d,b);break e}else if($===R){p.tag=14,p=KU(null,p,T,d,b);break e}}throw p=H(T)||T,Error(r(306,p,""))}}return p;case 0:return fM(d,p,p.type,p.pendingProps,b);case 1:return T=p.type,$=up(T,p.pendingProps),ZU(d,p,T,$,b);case 3:e:{if(Se(p,p.stateNode.containerInfo),d===null)throw Error(r(387));T=p.pendingProps;var F=p.memoizedState;$=F.element,VA(d,p),vb(p,T,null,b);var X=p.memoizedState;if(T=X.cache,pd(p,$o,T),T!==F.cache&&NA(p,[$o],b,!0),yb(),T=X.element,F.isDehydrated)if(F={element:T,isDehydrated:!1,cache:X.cache},p.updateQueue.baseState=F,p.memoizedState=F,p.flags&256){p=e4(d,p,T,b);break e}else if(T!==$){$=ys(Error(r(424)),p),ub($),p=e4(d,p,T,b);break e}else{switch(d=p.stateNode.containerInfo,d.nodeType){case 9:d=d.body;break;default:d=d.nodeName==="HTML"?d.ownerDocument.body:d}for(io=hl(d.firstChild),Ui=p,rr=!0,op=null,oc=!0,b=NU(p,null,T,b),p.child=b;b;)b.flags=b.flags&-3|4096,b=b.sibling}else{if(cb(),T===$){p=cu(d,p,b);break e}pi(d,p,T,b)}p=p.child}return p;case 26:return LC(d,p),d===null?(b=l3(p.type,null,p.pendingProps,null))?p.memoizedState=b:rr||(b=p.type,d=p.pendingProps,T=JC(ce.current).createElement(b),T[Ut]=p,T[Xt]=d,mi(T,b,d),He(T),p.stateNode=T):p.memoizedState=l3(p.type,d.memoizedProps,p.pendingProps,d.memoizedState),null;case 27:return le(p),d===null&&rr&&(T=p.stateNode=i3(p.type,p.pendingProps,ce.current),Ui=p,oc=!0,$=io,Pd(p.type)?(ZM=$,io=hl(T.firstChild)):io=$),pi(d,p,p.pendingProps.children,b),LC(d,p),d===null&&(p.flags|=4194304),p.child;case 5:return d===null&&rr&&(($=T=io)&&(T=qge(T,p.type,p.pendingProps,oc),T!==null?(p.stateNode=T,Ui=p,io=hl(T.firstChild),oc=!1,$=!0):$=!1),$||ip(p)),le(p),$=p.type,F=p.pendingProps,X=d!==null?d.memoizedProps:null,T=F.children,YM($,F)?T=null:X!==null&&YM($,X)&&(p.flags|=32),p.memoizedState!==null&&($=KA(d,p,uge,null,null,b),Bb._currentValue=$),LC(d,p),pi(d,p,T,b),p.child;case 6:return d===null&&rr&&((d=b=io)&&(b=Wge(b,p.pendingProps,oc),b!==null?(p.stateNode=b,Ui=p,io=null,d=!0):d=!1),d||ip(p)),null;case 13:return t4(d,p,b);case 4:return Se(p,p.stateNode.containerInfo),T=p.pendingProps,d===null?p.child=wm(p,null,T,b):pi(d,p,T,b),p.child;case 11:return WU(d,p,p.type,p.pendingProps,b);case 7:return pi(d,p,p.pendingProps,b),p.child;case 8:return pi(d,p,p.pendingProps.children,b),p.child;case 12:return pi(d,p,p.pendingProps.children,b),p.child;case 10:return T=p.pendingProps,pd(p,p.type,T.value),pi(d,p,T.children,b),p.child;case 9:return $=p.type._context,T=p.pendingProps.children,sp(p),$=Pi($),T=T($),p.flags|=1,pi(d,p,T,b),p.child;case 14:return KU(d,p,p.type,p.pendingProps,b);case 15:return YU(d,p,p.type,p.pendingProps,b);case 19:return r4(d,p,b);case 31:return T=p.pendingProps,b=p.mode,T={mode:T.mode,children:T.children},d===null?(b=FC(T,b),b.ref=p.ref,p.child=b,b.return=p,p=b):(b=nu(d.child,T),b.ref=p.ref,p.child=b,b.return=p,p=b),p;case 22:return QU(d,p,b);case 24:return sp(p),T=Pi($o),d===null?($=jA(),$===null&&($=Dr,F=LA(),$.pooledCache=F,F.refCount++,F!==null&&($.pooledCacheLanes|=b),$=F),p.memoizedState={parent:T,cache:$},zA(p),pd(p,$o,$)):((d.lanes&b)!==0&&(VA(d,p),vb(p,null,null,b),yb()),$=d.memoizedState,F=p.memoizedState,$.parent!==T?($={parent:T,cache:T},p.memoizedState=$,p.lanes===0&&(p.memoizedState=p.updateQueue.baseState=$),pd(p,$o,T)):(T=F.cache,pd(p,$o,T),T!==$.cache&&NA(p,[$o],b,!0))),pi(d,p,p.pendingProps.children,b),p.child;case 29:throw p.pendingProps}throw Error(r(156,p.tag))}function uu(d){d.flags|=4}function i4(d,p){if(p.type!=="stylesheet"||(p.state.loading&4)!==0)d.flags&=-16777217;else if(d.flags|=16777216,!p3(p)){if(p=Ss.current,p!==null&&((qn&4194048)===qn?ic!==null:(qn&62914560)!==qn&&(qn&536870912)===0||p!==ic))throw mb=BA,V5;d.flags|=8192}}function jC(d,p){p!==null&&(d.flags|=4),d.flags&16384&&(p=d.tag!==22?Rr():536870912,d.lanes|=p,Om|=p)}function Tb(d,p){if(!rr)switch(d.tailMode){case"hidden":p=d.tail;for(var b=null;p!==null;)p.alternate!==null&&(b=p),p=p.sibling;b===null?d.tail=null:b.sibling=null;break;case"collapsed":b=d.tail;for(var T=null;b!==null;)b.alternate!==null&&(T=b),b=b.sibling;T===null?p||d.tail===null?d.tail=null:d.tail.sibling=null:T.sibling=null}}function Zr(d){var p=d.alternate!==null&&d.alternate.child===d.child,b=0,T=0;if(p)for(var $=d.child;$!==null;)b|=$.lanes|$.childLanes,T|=$.subtreeFlags&65011712,T|=$.flags&65011712,$.return=d,$=$.sibling;else for($=d.child;$!==null;)b|=$.lanes|$.childLanes,T|=$.subtreeFlags,T|=$.flags,$.return=d,$=$.sibling;return d.subtreeFlags|=T,d.childLanes=b,p}function bge(d,p,b){var T=p.pendingProps;switch(DA(p),p.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Zr(p),null;case 1:return Zr(p),null;case 3:return b=p.stateNode,T=null,d!==null&&(T=d.memoizedState.cache),p.memoizedState.cache!==T&&(p.flags|=2048),au($o),ne(),b.pendingContext&&(b.context=b.pendingContext,b.pendingContext=null),(d===null||d.child===null)&&(lb(p)?uu(p):d===null||d.memoizedState.isDehydrated&&(p.flags&256)===0||(p.flags|=1024,L5())),Zr(p),null;case 26:return b=p.memoizedState,d===null?(uu(p),b!==null?(Zr(p),i4(p,b)):(Zr(p),p.flags&=-16777217)):b?b!==d.memoizedState?(uu(p),Zr(p),i4(p,b)):(Zr(p),p.flags&=-16777217):(d.memoizedProps!==T&&uu(p),Zr(p),p.flags&=-16777217),null;case 27:de(p),b=ce.current;var $=p.type;if(d!==null&&p.stateNode!=null)d.memoizedProps!==T&&uu(p);else{if(!T){if(p.stateNode===null)throw Error(r(166));return Zr(p),null}d=ie.current,lb(p)?$5(p):(d=i3($,T,b),p.stateNode=d,uu(p))}return Zr(p),null;case 5:if(de(p),b=p.type,d!==null&&p.stateNode!=null)d.memoizedProps!==T&&uu(p);else{if(!T){if(p.stateNode===null)throw Error(r(166));return Zr(p),null}if(d=ie.current,lb(p))$5(p);else{switch($=JC(ce.current),d){case 1:d=$.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:d=$.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":d=$.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":d=$.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":d=$.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof T.is=="string"?$.createElement("select",{is:T.is}):$.createElement("select"),T.multiple?d.multiple=!0:T.size&&(d.size=T.size);break;default:d=typeof T.is=="string"?$.createElement(b,{is:T.is}):$.createElement(b)}}d[Ut]=p,d[Xt]=T;e:for($=p.child;$!==null;){if($.tag===5||$.tag===6)d.appendChild($.stateNode);else if($.tag!==4&&$.tag!==27&&$.child!==null){$.child.return=$,$=$.child;continue}if($===p)break e;for(;$.sibling===null;){if($.return===null||$.return===p)break e;$=$.return}$.sibling.return=$.return,$=$.sibling}p.stateNode=d;e:switch(mi(d,b,T),b){case"button":case"input":case"select":case"textarea":d=!!T.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&uu(p)}}return Zr(p),p.flags&=-16777217,null;case 6:if(d&&p.stateNode!=null)d.memoizedProps!==T&&uu(p);else{if(typeof T!="string"&&p.stateNode===null)throw Error(r(166));if(d=ce.current,lb(p)){if(d=p.stateNode,b=p.memoizedProps,T=null,$=Ui,$!==null)switch($.tag){case 27:case 5:T=$.memoizedProps}d[Ut]=p,d=!!(d.nodeValue===b||T!==null&&T.suppressHydrationWarning===!0||J4(d.nodeValue,b)),d||ip(p)}else d=JC(d).createTextNode(T),d[Ut]=p,p.stateNode=d}return Zr(p),null;case 13:if(T=p.memoizedState,d===null||d.memoizedState!==null&&d.memoizedState.dehydrated!==null){if($=lb(p),T!==null&&T.dehydrated!==null){if(d===null){if(!$)throw Error(r(318));if($=p.memoizedState,$=$!==null?$.dehydrated:null,!$)throw Error(r(317));$[Ut]=p}else cb(),(p.flags&128)===0&&(p.memoizedState=null),p.flags|=4;Zr(p),$=!1}else $=L5(),d!==null&&d.memoizedState!==null&&(d.memoizedState.hydrationErrors=$),$=!0;if(!$)return p.flags&256?(lu(p),p):(lu(p),null)}if(lu(p),(p.flags&128)!==0)return p.lanes=b,p;if(b=T!==null,d=d!==null&&d.memoizedState!==null,b){T=p.child,$=null,T.alternate!==null&&T.alternate.memoizedState!==null&&T.alternate.memoizedState.cachePool!==null&&($=T.alternate.memoizedState.cachePool.pool);var F=null;T.memoizedState!==null&&T.memoizedState.cachePool!==null&&(F=T.memoizedState.cachePool.pool),F!==$&&(T.flags|=2048)}return b!==d&&b&&(p.child.flags|=8192),jC(p,p.updateQueue),Zr(p),null;case 4:return ne(),d===null&&UM(p.stateNode.containerInfo),Zr(p),null;case 10:return au(p.type),Zr(p),null;case 19:if(Y(No),$=p.memoizedState,$===null)return Zr(p),null;if(T=(p.flags&128)!==0,F=$.rendering,F===null)if(T)Tb($,!1);else{if(ao!==0||d!==null&&(d.flags&128)!==0)for(d=p.child;d!==null;){if(F=_C(d),F!==null){for(p.flags|=128,Tb($,!1),d=F.updateQueue,p.updateQueue=d,jC(p,d),p.subtreeFlags=0,d=b,b=p.child;b!==null;)k5(b,d),b=b.sibling;return Z(No,No.current&1|2),p.child}d=d.sibling}$.tail!==null&&Re()>VC&&(p.flags|=128,T=!0,Tb($,!1),p.lanes=4194304)}else{if(!T)if(d=_C(F),d!==null){if(p.flags|=128,T=!0,d=d.updateQueue,p.updateQueue=d,jC(p,d),Tb($,!0),$.tail===null&&$.tailMode==="hidden"&&!F.alternate&&!rr)return Zr(p),null}else 2*Re()-$.renderingStartTime>VC&&b!==536870912&&(p.flags|=128,T=!0,Tb($,!1),p.lanes=4194304);$.isBackwards?(F.sibling=p.child,p.child=F):(d=$.last,d!==null?d.sibling=F:p.child=F,$.last=F)}return $.tail!==null?(p=$.tail,$.rendering=p,$.tail=p.sibling,$.renderingStartTime=Re(),p.sibling=null,d=No.current,Z(No,T?d&1|2:d&1),p):(Zr(p),null);case 22:case 23:return lu(p),qA(),T=p.memoizedState!==null,d!==null?d.memoizedState!==null!==T&&(p.flags|=8192):T&&(p.flags|=8192),T?(b&536870912)!==0&&(p.flags&128)===0&&(Zr(p),p.subtreeFlags&6&&(p.flags|=8192)):Zr(p),b=p.updateQueue,b!==null&&jC(p,b.retryQueue),b=null,d!==null&&d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(b=d.memoizedState.cachePool.pool),T=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(T=p.memoizedState.cachePool.pool),T!==b&&(p.flags|=2048),d!==null&&Y(lp),null;case 24:return b=null,d!==null&&(b=d.memoizedState.cache),p.memoizedState.cache!==b&&(p.flags|=2048),au($o),Zr(p),null;case 25:return null;case 30:return null}throw Error(r(156,p.tag))}function xge(d,p){switch(DA(p),p.tag){case 1:return d=p.flags,d&65536?(p.flags=d&-65537|128,p):null;case 3:return au($o),ne(),d=p.flags,(d&65536)!==0&&(d&128)===0?(p.flags=d&-65537|128,p):null;case 26:case 27:case 5:return de(p),null;case 13:if(lu(p),d=p.memoizedState,d!==null&&d.dehydrated!==null){if(p.alternate===null)throw Error(r(340));cb()}return d=p.flags,d&65536?(p.flags=d&-65537|128,p):null;case 19:return Y(No),null;case 4:return ne(),null;case 10:return au(p.type),null;case 22:case 23:return lu(p),qA(),d!==null&&Y(lp),d=p.flags,d&65536?(p.flags=d&-65537|128,p):null;case 24:return au($o),null;case 25:return null;default:return null}}function a4(d,p){switch(DA(p),p.tag){case 3:au($o),ne();break;case 26:case 27:case 5:de(p);break;case 4:ne();break;case 13:lu(p);break;case 19:Y(No);break;case 10:au(p.type);break;case 22:case 23:lu(p),qA(),d!==null&&Y(lp);break;case 24:au($o)}}function Ob(d,p){try{var b=p.updateQueue,T=b!==null?b.lastEffect:null;if(T!==null){var $=T.next;b=$;do{if((b.tag&d)===d){T=void 0;var F=b.create,X=b.inst;T=F(),X.destroy=T}b=b.next}while(b!==$)}}catch(re){Or(p,p.return,re)}}function xd(d,p,b){try{var T=p.updateQueue,$=T!==null?T.lastEffect:null;if($!==null){var F=$.next;T=F;do{if((T.tag&d)===d){var X=T.inst,re=X.destroy;if(re!==void 0){X.destroy=void 0,$=p;var ge=b,Ne=re;try{Ne()}catch(Ze){Or($,ge,Ze)}}}T=T.next}while(T!==F)}}catch(Ze){Or(p,p.return,Ze)}}function s4(d){var p=d.updateQueue;if(p!==null){var b=d.stateNode;try{K5(p,b)}catch(T){Or(d,d.return,T)}}}function l4(d,p,b){b.props=up(d.type,d.memoizedProps),b.state=d.memoizedState;try{b.componentWillUnmount()}catch(T){Or(d,p,T)}}function Ib(d,p){try{var b=d.ref;if(b!==null){switch(d.tag){case 26:case 27:case 5:var T=d.stateNode;break;case 30:T=d.stateNode;break;default:T=d.stateNode}typeof b=="function"?d.refCleanup=b(T):b.current=T}}catch($){Or(d,p,$)}}function ac(d,p){var b=d.ref,T=d.refCleanup;if(b!==null)if(typeof T=="function")try{T()}catch($){Or(d,p,$)}finally{d.refCleanup=null,d=d.alternate,d!=null&&(d.refCleanup=null)}else if(typeof b=="function")try{b(null)}catch($){Or(d,p,$)}else b.current=null}function c4(d){var p=d.type,b=d.memoizedProps,T=d.stateNode;try{e:switch(p){case"button":case"input":case"select":case"textarea":b.autoFocus&&T.focus();break e;case"img":b.src?T.src=b.src:b.srcSet&&(T.srcset=b.srcSet)}}catch($){Or(d,d.return,$)}}function xM(d,p,b){try{var T=d.stateNode;zge(T,d.type,b,p),T[Xt]=p}catch($){Or(d,d.return,$)}}function u4(d){return d.tag===5||d.tag===3||d.tag===26||d.tag===27&&Pd(d.type)||d.tag===4}function SM(d){e:for(;;){for(;d.sibling===null;){if(d.return===null||u4(d.return))return null;d=d.return}for(d.sibling.return=d.return,d=d.sibling;d.tag!==5&&d.tag!==6&&d.tag!==18;){if(d.tag===27&&Pd(d.type)||d.flags&2||d.child===null||d.tag===4)continue e;d.child.return=d,d=d.child}if(!(d.flags&2))return d.stateNode}}function wM(d,p,b){var T=d.tag;if(T===5||T===6)d=d.stateNode,p?(b.nodeType===9?b.body:b.nodeName==="HTML"?b.ownerDocument.body:b).insertBefore(d,p):(p=b.nodeType===9?b.body:b.nodeName==="HTML"?b.ownerDocument.body:b,p.appendChild(d),b=b._reactRootContainer,b!=null||p.onclick!==null||(p.onclick=XC));else if(T!==4&&(T===27&&Pd(d.type)&&(b=d.stateNode,p=null),d=d.child,d!==null))for(wM(d,p,b),d=d.sibling;d!==null;)wM(d,p,b),d=d.sibling}function BC(d,p,b){var T=d.tag;if(T===5||T===6)d=d.stateNode,p?b.insertBefore(d,p):b.appendChild(d);else if(T!==4&&(T===27&&Pd(d.type)&&(b=d.stateNode),d=d.child,d!==null))for(BC(d,p,b),d=d.sibling;d!==null;)BC(d,p,b),d=d.sibling}function d4(d){var p=d.stateNode,b=d.memoizedProps;try{for(var T=d.type,$=p.attributes;$.length;)p.removeAttributeNode($[0]);mi(p,T,b),p[Ut]=d,p[Xt]=b}catch(F){Or(d,d.return,F)}}var du=!1,xo=!1,CM=!1,f4=typeof WeakSet=="function"?WeakSet:Set,Zo=null;function Sge(d,p){if(d=d.containerInfo,WM=o1,d=C5(d),SA(d)){if("selectionStart"in d)var b={start:d.selectionStart,end:d.selectionEnd};else e:{b=(b=d.ownerDocument)&&b.defaultView||window;var T=b.getSelection&&b.getSelection();if(T&&T.rangeCount!==0){b=T.anchorNode;var $=T.anchorOffset,F=T.focusNode;T=T.focusOffset;try{b.nodeType,F.nodeType}catch{b=null;break e}var X=0,re=-1,ge=-1,Ne=0,Ze=0,ot=d,Fe=null;t:for(;;){for(var ze;ot!==b||$!==0&&ot.nodeType!==3||(re=X+$),ot!==F||T!==0&&ot.nodeType!==3||(ge=X+T),ot.nodeType===3&&(X+=ot.nodeValue.length),(ze=ot.firstChild)!==null;)Fe=ot,ot=ze;for(;;){if(ot===d)break t;if(Fe===b&&++Ne===$&&(re=X),Fe===F&&++Ze===T&&(ge=X),(ze=ot.nextSibling)!==null)break;ot=Fe,Fe=ot.parentNode}ot=ze}b=re===-1||ge===-1?null:{start:re,end:ge}}else b=null}b=b||{start:0,end:0}}else b=null;for(KM={focusedElem:d,selectionRange:b},o1=!1,Zo=p;Zo!==null;)if(p=Zo,d=p.child,(p.subtreeFlags&1024)!==0&&d!==null)d.return=p,Zo=d;else for(;Zo!==null;){switch(p=Zo,F=p.alternate,d=p.flags,p.tag){case 0:break;case 11:case 15:break;case 1:if((d&1024)!==0&&F!==null){d=void 0,b=p,$=F.memoizedProps,F=F.memoizedState,T=b.stateNode;try{var fn=up(b.type,$,b.elementType===b.type);d=T.getSnapshotBeforeUpdate(fn,F),T.__reactInternalSnapshotBeforeUpdate=d}catch(nn){Or(b,b.return,nn)}}break;case 3:if((d&1024)!==0){if(d=p.stateNode.containerInfo,b=d.nodeType,b===9)XM(d);else if(b===1)switch(d.nodeName){case"HEAD":case"HTML":case"BODY":XM(d);break;default:d.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((d&1024)!==0)throw Error(r(163))}if(d=p.sibling,d!==null){d.return=p.return,Zo=d;break}Zo=p.return}}function p4(d,p,b){var T=b.flags;switch(b.tag){case 0:case 11:case 15:Sd(d,b),T&4&&Ob(5,b);break;case 1:if(Sd(d,b),T&4)if(d=b.stateNode,p===null)try{d.componentDidMount()}catch(X){Or(b,b.return,X)}else{var $=up(b.type,p.memoizedProps);p=p.memoizedState;try{d.componentDidUpdate($,p,d.__reactInternalSnapshotBeforeUpdate)}catch(X){Or(b,b.return,X)}}T&64&&s4(b),T&512&&Ib(b,b.return);break;case 3:if(Sd(d,b),T&64&&(d=b.updateQueue,d!==null)){if(p=null,b.child!==null)switch(b.child.tag){case 27:case 5:p=b.child.stateNode;break;case 1:p=b.child.stateNode}try{K5(d,p)}catch(X){Or(b,b.return,X)}}break;case 27:p===null&&T&4&&d4(b);case 26:case 5:Sd(d,b),p===null&&T&4&&c4(b),T&512&&Ib(b,b.return);break;case 12:Sd(d,b);break;case 13:Sd(d,b),T&4&&g4(d,b),T&64&&(d=b.memoizedState,d!==null&&(d=d.dehydrated,d!==null&&(b=Mge.bind(null,b),Kge(d,b))));break;case 22:if(T=b.memoizedState!==null||du,!T){p=p!==null&&p.memoizedState!==null||xo,$=du;var F=xo;du=T,(xo=p)&&!F?wd(d,b,(b.subtreeFlags&8772)!==0):Sd(d,b),du=$,xo=F}break;case 30:break;default:Sd(d,b)}}function h4(d){var p=d.alternate;p!==null&&(d.alternate=null,h4(p)),d.child=null,d.deletions=null,d.sibling=null,d.tag===5&&(p=d.stateNode,p!==null&&vo(p)),d.stateNode=null,d.return=null,d.dependencies=null,d.memoizedProps=null,d.memoizedState=null,d.pendingProps=null,d.stateNode=null,d.updateQueue=null}var Gr=null,fa=!1;function fu(d,p,b){for(b=b.child;b!==null;)m4(d,p,b),b=b.sibling}function m4(d,p,b){if(rt&&typeof rt.onCommitFiberUnmount=="function")try{rt.onCommitFiberUnmount(We,b)}catch{}switch(b.tag){case 26:xo||ac(b,p),fu(d,p,b),b.memoizedState?b.memoizedState.count--:b.stateNode&&(b=b.stateNode,b.parentNode.removeChild(b));break;case 27:xo||ac(b,p);var T=Gr,$=fa;Pd(b.type)&&(Gr=b.stateNode,fa=!1),fu(d,p,b),Nb(b.stateNode),Gr=T,fa=$;break;case 5:xo||ac(b,p);case 6:if(T=Gr,$=fa,Gr=null,fu(d,p,b),Gr=T,fa=$,Gr!==null)if(fa)try{(Gr.nodeType===9?Gr.body:Gr.nodeName==="HTML"?Gr.ownerDocument.body:Gr).removeChild(b.stateNode)}catch(F){Or(b,p,F)}else try{Gr.removeChild(b.stateNode)}catch(F){Or(b,p,F)}break;case 18:Gr!==null&&(fa?(d=Gr,r3(d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d,b.stateNode),Ub(d)):r3(Gr,b.stateNode));break;case 4:T=Gr,$=fa,Gr=b.stateNode.containerInfo,fa=!0,fu(d,p,b),Gr=T,fa=$;break;case 0:case 11:case 14:case 15:xo||xd(2,b,p),xo||xd(4,b,p),fu(d,p,b);break;case 1:xo||(ac(b,p),T=b.stateNode,typeof T.componentWillUnmount=="function"&&l4(b,p,T)),fu(d,p,b);break;case 21:fu(d,p,b);break;case 22:xo=(T=xo)||b.memoizedState!==null,fu(d,p,b),xo=T;break;default:fu(d,p,b)}}function g4(d,p){if(p.memoizedState===null&&(d=p.alternate,d!==null&&(d=d.memoizedState,d!==null&&(d=d.dehydrated,d!==null))))try{Ub(d)}catch(b){Or(p,p.return,b)}}function wge(d){switch(d.tag){case 13:case 19:var p=d.stateNode;return p===null&&(p=d.stateNode=new f4),p;case 22:return d=d.stateNode,p=d._retryCache,p===null&&(p=d._retryCache=new f4),p;default:throw Error(r(435,d.tag))}}function EM(d,p){var b=wge(d);p.forEach(function(T){var $=Rge.bind(null,d,T);b.has(T)||(b.add(T),T.then($,$))})}function $a(d,p){var b=p.deletions;if(b!==null)for(var T=0;T<b.length;T++){var $=b[T],F=d,X=p,re=X;e:for(;re!==null;){switch(re.tag){case 27:if(Pd(re.type)){Gr=re.stateNode,fa=!1;break e}break;case 5:Gr=re.stateNode,fa=!1;break e;case 3:case 4:Gr=re.stateNode.containerInfo,fa=!0;break e}re=re.return}if(Gr===null)throw Error(r(160));m4(F,X,$),Gr=null,fa=!1,F=$.alternate,F!==null&&(F.return=null),$.return=null}if(p.subtreeFlags&13878)for(p=p.child;p!==null;)y4(p,d),p=p.sibling}var pl=null;function y4(d,p){var b=d.alternate,T=d.flags;switch(d.tag){case 0:case 11:case 14:case 15:$a(p,d),Na(d),T&4&&(xd(3,d,d.return),Ob(3,d),xd(5,d,d.return));break;case 1:$a(p,d),Na(d),T&512&&(xo||b===null||ac(b,b.return)),T&64&&du&&(d=d.updateQueue,d!==null&&(T=d.callbacks,T!==null&&(b=d.shared.hiddenCallbacks,d.shared.hiddenCallbacks=b===null?T:b.concat(T))));break;case 26:var $=pl;if($a(p,d),Na(d),T&512&&(xo||b===null||ac(b,b.return)),T&4){var F=b!==null?b.memoizedState:null;if(T=d.memoizedState,b===null)if(T===null)if(d.stateNode===null){e:{T=d.type,b=d.memoizedProps,$=$.ownerDocument||$;t:switch(T){case"title":F=$.getElementsByTagName("title")[0],(!F||F[Ii]||F[Ut]||F.namespaceURI==="http://www.w3.org/2000/svg"||F.hasAttribute("itemprop"))&&(F=$.createElement(T),$.head.insertBefore(F,$.querySelector("head > title"))),mi(F,T,b),F[Ut]=d,He(F),T=F;break e;case"link":var X=d3("link","href",$).get(T+(b.href||""));if(X){for(var re=0;re<X.length;re++)if(F=X[re],F.getAttribute("href")===(b.href==null||b.href===""?null:b.href)&&F.getAttribute("rel")===(b.rel==null?null:b.rel)&&F.getAttribute("title")===(b.title==null?null:b.title)&&F.getAttribute("crossorigin")===(b.crossOrigin==null?null:b.crossOrigin)){X.splice(re,1);break t}}F=$.createElement(T),mi(F,T,b),$.head.appendChild(F);break;case"meta":if(X=d3("meta","content",$).get(T+(b.content||""))){for(re=0;re<X.length;re++)if(F=X[re],F.getAttribute("content")===(b.content==null?null:""+b.content)&&F.getAttribute("name")===(b.name==null?null:b.name)&&F.getAttribute("property")===(b.property==null?null:b.property)&&F.getAttribute("http-equiv")===(b.httpEquiv==null?null:b.httpEquiv)&&F.getAttribute("charset")===(b.charSet==null?null:b.charSet)){X.splice(re,1);break t}}F=$.createElement(T),mi(F,T,b),$.head.appendChild(F);break;default:throw Error(r(468,T))}F[Ut]=d,He(F),T=F}d.stateNode=T}else f3($,d.type,d.stateNode);else d.stateNode=u3($,T,d.memoizedProps);else F!==T?(F===null?b.stateNode!==null&&(b=b.stateNode,b.parentNode.removeChild(b)):F.count--,T===null?f3($,d.type,d.stateNode):u3($,T,d.memoizedProps)):T===null&&d.stateNode!==null&&xM(d,d.memoizedProps,b.memoizedProps)}break;case 27:$a(p,d),Na(d),T&512&&(xo||b===null||ac(b,b.return)),b!==null&&T&4&&xM(d,d.memoizedProps,b.memoizedProps);break;case 5:if($a(p,d),Na(d),T&512&&(xo||b===null||ac(b,b.return)),d.flags&32){$=d.stateNode;try{om($,"")}catch(ze){Or(d,d.return,ze)}}T&4&&d.stateNode!=null&&($=d.memoizedProps,xM(d,$,b!==null?b.memoizedProps:$)),T&1024&&(CM=!0);break;case 6:if($a(p,d),Na(d),T&4){if(d.stateNode===null)throw Error(r(162));T=d.memoizedProps,b=d.stateNode;try{b.nodeValue=T}catch(ze){Or(d,d.return,ze)}}break;case 3:if(t1=null,$=pl,pl=ZC(p.containerInfo),$a(p,d),pl=$,Na(d),T&4&&b!==null&&b.memoizedState.isDehydrated)try{Ub(p.containerInfo)}catch(ze){Or(d,d.return,ze)}CM&&(CM=!1,v4(d));break;case 4:T=pl,pl=ZC(d.stateNode.containerInfo),$a(p,d),Na(d),pl=T;break;case 12:$a(p,d),Na(d);break;case 13:$a(p,d),Na(d),d.child.flags&8192&&d.memoizedState!==null!=(b!==null&&b.memoizedState!==null)&&(MM=Re()),T&4&&(T=d.updateQueue,T!==null&&(d.updateQueue=null,EM(d,T)));break;case 22:$=d.memoizedState!==null;var ge=b!==null&&b.memoizedState!==null,Ne=du,Ze=xo;if(du=Ne||$,xo=Ze||ge,$a(p,d),xo=Ze,du=Ne,Na(d),T&8192)e:for(p=d.stateNode,p._visibility=$?p._visibility&-2:p._visibility|1,$&&(b===null||ge||du||xo||dp(d)),b=null,p=d;;){if(p.tag===5||p.tag===26){if(b===null){ge=b=p;try{if(F=ge.stateNode,$)X=F.style,typeof X.setProperty=="function"?X.setProperty("display","none","important"):X.display="none";else{re=ge.stateNode;var ot=ge.memoizedProps.style,Fe=ot!=null&&ot.hasOwnProperty("display")?ot.display:null;re.style.display=Fe==null||typeof Fe=="boolean"?"":(""+Fe).trim()}}catch(ze){Or(ge,ge.return,ze)}}}else if(p.tag===6){if(b===null){ge=p;try{ge.stateNode.nodeValue=$?"":ge.memoizedProps}catch(ze){Or(ge,ge.return,ze)}}}else if((p.tag!==22&&p.tag!==23||p.memoizedState===null||p===d)&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===d)break e;for(;p.sibling===null;){if(p.return===null||p.return===d)break e;b===p&&(b=null),p=p.return}b===p&&(b=null),p.sibling.return=p.return,p=p.sibling}T&4&&(T=d.updateQueue,T!==null&&(b=T.retryQueue,b!==null&&(T.retryQueue=null,EM(d,b))));break;case 19:$a(p,d),Na(d),T&4&&(T=d.updateQueue,T!==null&&(d.updateQueue=null,EM(d,T)));break;case 30:break;case 21:break;default:$a(p,d),Na(d)}}function Na(d){var p=d.flags;if(p&2){try{for(var b,T=d.return;T!==null;){if(u4(T)){b=T;break}T=T.return}if(b==null)throw Error(r(160));switch(b.tag){case 27:var $=b.stateNode,F=SM(d);BC(d,F,$);break;case 5:var X=b.stateNode;b.flags&32&&(om(X,""),b.flags&=-33);var re=SM(d);BC(d,re,X);break;case 3:case 4:var ge=b.stateNode.containerInfo,Ne=SM(d);wM(d,Ne,ge);break;default:throw Error(r(161))}}catch(Ze){Or(d,d.return,Ze)}d.flags&=-3}p&4096&&(d.flags&=-4097)}function v4(d){if(d.subtreeFlags&1024)for(d=d.child;d!==null;){var p=d;v4(p),p.tag===5&&p.flags&1024&&p.stateNode.reset(),d=d.sibling}}function Sd(d,p){if(p.subtreeFlags&8772)for(p=p.child;p!==null;)p4(d,p.alternate,p),p=p.sibling}function dp(d){for(d=d.child;d!==null;){var p=d;switch(p.tag){case 0:case 11:case 14:case 15:xd(4,p,p.return),dp(p);break;case 1:ac(p,p.return);var b=p.stateNode;typeof b.componentWillUnmount=="function"&&l4(p,p.return,b),dp(p);break;case 27:Nb(p.stateNode);case 26:case 5:ac(p,p.return),dp(p);break;case 22:p.memoizedState===null&&dp(p);break;case 30:dp(p);break;default:dp(p)}d=d.sibling}}function wd(d,p,b){for(b=b&&(p.subtreeFlags&8772)!==0,p=p.child;p!==null;){var T=p.alternate,$=d,F=p,X=F.flags;switch(F.tag){case 0:case 11:case 15:wd($,F,b),Ob(4,F);break;case 1:if(wd($,F,b),T=F,$=T.stateNode,typeof $.componentDidMount=="function")try{$.componentDidMount()}catch(Ne){Or(T,T.return,Ne)}if(T=F,$=T.updateQueue,$!==null){var re=T.stateNode;try{var ge=$.shared.hiddenCallbacks;if(ge!==null)for($.shared.hiddenCallbacks=null,$=0;$<ge.length;$++)W5(ge[$],re)}catch(Ne){Or(T,T.return,Ne)}}b&&X&64&&s4(F),Ib(F,F.return);break;case 27:d4(F);case 26:case 5:wd($,F,b),b&&T===null&&X&4&&c4(F),Ib(F,F.return);break;case 12:wd($,F,b);break;case 13:wd($,F,b),b&&X&4&&g4($,F);break;case 22:F.memoizedState===null&&wd($,F,b),Ib(F,F.return);break;case 30:break;default:wd($,F,b)}p=p.sibling}}function TM(d,p){var b=null;d!==null&&d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(b=d.memoizedState.cachePool.pool),d=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(d=p.memoizedState.cachePool.pool),d!==b&&(d!=null&&d.refCount++,b!=null&&fb(b))}function OM(d,p){d=null,p.alternate!==null&&(d=p.alternate.memoizedState.cache),p=p.memoizedState.cache,p!==d&&(p.refCount++,d!=null&&fb(d))}function sc(d,p,b,T){if(p.subtreeFlags&10256)for(p=p.child;p!==null;)b4(d,p,b,T),p=p.sibling}function b4(d,p,b,T){var $=p.flags;switch(p.tag){case 0:case 11:case 15:sc(d,p,b,T),$&2048&&Ob(9,p);break;case 1:sc(d,p,b,T);break;case 3:sc(d,p,b,T),$&2048&&(d=null,p.alternate!==null&&(d=p.alternate.memoizedState.cache),p=p.memoizedState.cache,p!==d&&(p.refCount++,d!=null&&fb(d)));break;case 12:if($&2048){sc(d,p,b,T),d=p.stateNode;try{var F=p.memoizedProps,X=F.id,re=F.onPostCommit;typeof re=="function"&&re(X,p.alternate===null?"mount":"update",d.passiveEffectDuration,-0)}catch(ge){Or(p,p.return,ge)}}else sc(d,p,b,T);break;case 13:sc(d,p,b,T);break;case 23:break;case 22:F=p.stateNode,X=p.alternate,p.memoizedState!==null?F._visibility&2?sc(d,p,b,T):Pb(d,p):F._visibility&2?sc(d,p,b,T):(F._visibility|=2,Cm(d,p,b,T,(p.subtreeFlags&10256)!==0)),$&2048&&TM(X,p);break;case 24:sc(d,p,b,T),$&2048&&OM(p.alternate,p);break;default:sc(d,p,b,T)}}function Cm(d,p,b,T,$){for($=$&&(p.subtreeFlags&10256)!==0,p=p.child;p!==null;){var F=d,X=p,re=b,ge=T,Ne=X.flags;switch(X.tag){case 0:case 11:case 15:Cm(F,X,re,ge,$),Ob(8,X);break;case 23:break;case 22:var Ze=X.stateNode;X.memoizedState!==null?Ze._visibility&2?Cm(F,X,re,ge,$):Pb(F,X):(Ze._visibility|=2,Cm(F,X,re,ge,$)),$&&Ne&2048&&TM(X.alternate,X);break;case 24:Cm(F,X,re,ge,$),$&&Ne&2048&&OM(X.alternate,X);break;default:Cm(F,X,re,ge,$)}p=p.sibling}}function Pb(d,p){if(p.subtreeFlags&10256)for(p=p.child;p!==null;){var b=d,T=p,$=T.flags;switch(T.tag){case 22:Pb(b,T),$&2048&&TM(T.alternate,T);break;case 24:Pb(b,T),$&2048&&OM(T.alternate,T);break;default:Pb(b,T)}p=p.sibling}}var Ab=8192;function Em(d){if(d.subtreeFlags&Ab)for(d=d.child;d!==null;)x4(d),d=d.sibling}function x4(d){switch(d.tag){case 26:Em(d),d.flags&Ab&&d.memoizedState!==null&&sye(pl,d.memoizedState,d.memoizedProps);break;case 5:Em(d);break;case 3:case 4:var p=pl;pl=ZC(d.stateNode.containerInfo),Em(d),pl=p;break;case 22:d.memoizedState===null&&(p=d.alternate,p!==null&&p.memoizedState!==null?(p=Ab,Ab=16777216,Em(d),Ab=p):Em(d));break;default:Em(d)}}function S4(d){var p=d.alternate;if(p!==null&&(d=p.child,d!==null)){p.child=null;do p=d.sibling,d.sibling=null,d=p;while(d!==null)}}function Mb(d){var p=d.deletions;if((d.flags&16)!==0){if(p!==null)for(var b=0;b<p.length;b++){var T=p[b];Zo=T,C4(T,d)}S4(d)}if(d.subtreeFlags&10256)for(d=d.child;d!==null;)w4(d),d=d.sibling}function w4(d){switch(d.tag){case 0:case 11:case 15:Mb(d),d.flags&2048&&xd(9,d,d.return);break;case 3:Mb(d);break;case 12:Mb(d);break;case 22:var p=d.stateNode;d.memoizedState!==null&&p._visibility&2&&(d.return===null||d.return.tag!==13)?(p._visibility&=-3,zC(d)):Mb(d);break;default:Mb(d)}}function zC(d){var p=d.deletions;if((d.flags&16)!==0){if(p!==null)for(var b=0;b<p.length;b++){var T=p[b];Zo=T,C4(T,d)}S4(d)}for(d=d.child;d!==null;){switch(p=d,p.tag){case 0:case 11:case 15:xd(8,p,p.return),zC(p);break;case 22:b=p.stateNode,b._visibility&2&&(b._visibility&=-3,zC(p));break;default:zC(p)}d=d.sibling}}function C4(d,p){for(;Zo!==null;){var b=Zo;switch(b.tag){case 0:case 11:case 15:xd(8,b,p);break;case 23:case 22:if(b.memoizedState!==null&&b.memoizedState.cachePool!==null){var T=b.memoizedState.cachePool.pool;T!=null&&T.refCount++}break;case 24:fb(b.memoizedState.cache)}if(T=b.child,T!==null)T.return=b,Zo=T;else e:for(b=d;Zo!==null;){T=Zo;var $=T.sibling,F=T.return;if(h4(T),T===b){Zo=null;break e}if($!==null){$.return=F,Zo=$;break e}Zo=F}}}var Cge={getCacheForType:function(d){var p=Pi($o),b=p.data.get(d);return b===void 0&&(b=d(),p.data.set(d,b)),b}},Ege=typeof WeakMap=="function"?WeakMap:Map,mr=0,Dr=null,Ln=null,qn=0,gr=0,La=null,Cd=!1,Tm=!1,IM=!1,pu=0,ao=0,Ed=0,fp=0,PM=0,ws=0,Om=0,Rb=null,pa=null,AM=!1,MM=0,VC=1/0,HC=null,Td=null,hi=0,Od=null,Im=null,Pm=0,RM=0,DM=null,E4=null,Db=0,kM=null;function Fa(){if((mr&2)!==0&&qn!==0)return qn&-qn;if(L.T!==null){var d=mm;return d!==0?d:BM()}return un()}function T4(){ws===0&&(ws=(qn&536870912)===0||rr?kn():536870912);var d=Ss.current;return d!==null&&(d.flags|=32),ws}function ja(d,p,b){(d===Dr&&(gr===2||gr===9)||d.cancelPendingCommit!==null)&&(Am(d,0),Id(d,qn,ws,!1)),Bn(d,b),((mr&2)===0||d!==Dr)&&(d===Dr&&((mr&2)===0&&(fp|=b),ao===4&&Id(d,qn,ws,!1)),lc(d))}function O4(d,p,b){if((mr&6)!==0)throw Error(r(327));var T=!b&&(p&124)===0&&(p&d.expiredLanes)===0||bt(d,p),$=T?Ige(d,p):NM(d,p,!0),F=T;do{if($===0){Tm&&!T&&Id(d,p,0,!1);break}else{if(b=d.current.alternate,F&&!Tge(b)){$=NM(d,p,!1),F=!1;continue}if($===2){if(F=p,d.errorRecoveryDisabledLanes&F)var X=0;else X=d.pendingLanes&-536870913,X=X!==0?X:X&536870912?536870912:0;if(X!==0){p=X;e:{var re=d;$=Rb;var ge=re.current.memoizedState.isDehydrated;if(ge&&(Am(re,X).flags|=256),X=NM(re,X,!1),X!==2){if(IM&&!ge){re.errorRecoveryDisabledLanes|=F,fp|=F,$=4;break e}F=pa,pa=$,F!==null&&(pa===null?pa=F:pa.push.apply(pa,F))}$=X}if(F=!1,$!==2)continue}}if($===1){Am(d,0),Id(d,p,0,!0);break}e:{switch(T=d,F=$,F){case 0:case 1:throw Error(r(345));case 4:if((p&4194048)!==p)break;case 6:Id(T,p,ws,!Cd);break e;case 2:pa=null;break;case 3:case 5:break;default:throw Error(r(329))}if((p&62914560)===p&&($=MM+300-Re(),10<$)){if(Id(T,p,ws,!Cd),vt(T,0,!0)!==0)break e;T.timeoutHandle=t3(I4.bind(null,T,b,pa,HC,AM,p,ws,fp,Om,Cd,F,2,-0,0),$);break e}I4(T,b,pa,HC,AM,p,ws,fp,Om,Cd,F,0,-0,0)}}break}while(!0);lc(d)}function I4(d,p,b,T,$,F,X,re,ge,Ne,Ze,ot,Fe,ze){if(d.timeoutHandle=-1,ot=p.subtreeFlags,(ot&8192||(ot&16785408)===16785408)&&(jb={stylesheets:null,count:0,unsuspend:aye},x4(p),ot=lye(),ot!==null)){d.cancelPendingCommit=ot(_4.bind(null,d,p,F,b,T,$,X,re,ge,Ze,1,Fe,ze)),Id(d,F,X,!Ne);return}_4(d,p,F,b,T,$,X,re,ge)}function Tge(d){for(var p=d;;){var b=p.tag;if((b===0||b===11||b===15)&&p.flags&16384&&(b=p.updateQueue,b!==null&&(b=b.stores,b!==null)))for(var T=0;T<b.length;T++){var $=b[T],F=$.getSnapshot;$=$.value;try{if(!ka(F(),$))return!1}catch{return!1}}if(b=p.child,p.subtreeFlags&16384&&b!==null)b.return=p,p=b;else{if(p===d)break;for(;p.sibling===null;){if(p.return===null||p.return===d)return!0;p=p.return}p.sibling.return=p.return,p=p.sibling}}return!0}function Id(d,p,b,T){p&=~PM,p&=~fp,d.suspendedLanes|=p,d.pingedLanes&=~p,T&&(d.warmLanes|=p),T=d.expirationTimes;for(var $=p;0<$;){var F=31-Be($),X=1<<F;T[F]=-1,$&=~X}b!==0&&To(d,b,p)}function UC(){return(mr&6)===0?(kb(0),!1):!0}function _M(){if(Ln!==null){if(gr===0)var d=Ln.return;else d=Ln,iu=ap=null,XA(d),Sm=null,Cb=0,d=Ln;for(;d!==null;)a4(d.alternate,d),d=d.return;Ln=null}}function Am(d,p){var b=d.timeoutHandle;b!==-1&&(d.timeoutHandle=-1,Hge(b)),b=d.cancelPendingCommit,b!==null&&(d.cancelPendingCommit=null,b()),_M(),Dr=d,Ln=b=nu(d.current,null),qn=p,gr=0,La=null,Cd=!1,Tm=bt(d,p),IM=!1,Om=ws=PM=fp=Ed=ao=0,pa=Rb=null,AM=!1,(p&8)!==0&&(p|=p&32);var T=d.entangledLanes;if(T!==0)for(d=d.entanglements,T&=p;0<T;){var $=31-Be(T),F=1<<$;p|=d[$],T&=~F}return pu=p,fC(),b}function P4(d,p){Rn=null,L.H=RC,p===hb||p===SC?(p=G5(),gr=3):p===V5?(p=G5(),gr=4):gr=p===qU?8:p!==null&&typeof p=="object"&&typeof p.then=="function"?6:1,La=p,Ln===null&&(ao=1,NC(d,ys(p,d.current)))}function A4(){var d=L.H;return L.H=RC,d===null?RC:d}function M4(){var d=L.A;return L.A=Cge,d}function $M(){ao=4,Cd||(qn&4194048)!==qn&&Ss.current!==null||(Tm=!0),(Ed&134217727)===0&&(fp&134217727)===0||Dr===null||Id(Dr,qn,ws,!1)}function NM(d,p,b){var T=mr;mr|=2;var $=A4(),F=M4();(Dr!==d||qn!==p)&&(HC=null,Am(d,p)),p=!1;var X=ao;e:do try{if(gr!==0&&Ln!==null){var re=Ln,ge=La;switch(gr){case 8:_M(),X=6;break e;case 3:case 2:case 9:case 6:Ss.current===null&&(p=!0);var Ne=gr;if(gr=0,La=null,Mm(d,re,ge,Ne),b&&Tm){X=0;break e}break;default:Ne=gr,gr=0,La=null,Mm(d,re,ge,Ne)}}Oge(),X=ao;break}catch(Ze){P4(d,Ze)}while(!0);return p&&d.shellSuspendCounter++,iu=ap=null,mr=T,L.H=$,L.A=F,Ln===null&&(Dr=null,qn=0,fC()),X}function Oge(){for(;Ln!==null;)R4(Ln)}function Ige(d,p){var b=mr;mr|=2;var T=A4(),$=M4();Dr!==d||qn!==p?(HC=null,VC=Re()+500,Am(d,p)):Tm=bt(d,p);e:do try{if(gr!==0&&Ln!==null){p=Ln;var F=La;t:switch(gr){case 1:gr=0,La=null,Mm(d,p,F,1);break;case 2:case 9:if(H5(F)){gr=0,La=null,D4(p);break}p=function(){gr!==2&&gr!==9||Dr!==d||(gr=7),lc(d)},F.then(p,p);break e;case 3:gr=7;break e;case 4:gr=5;break e;case 7:H5(F)?(gr=0,La=null,D4(p)):(gr=0,La=null,Mm(d,p,F,7));break;case 5:var X=null;switch(Ln.tag){case 26:X=Ln.memoizedState;case 5:case 27:var re=Ln;if(!X||p3(X)){gr=0,La=null;var ge=re.sibling;if(ge!==null)Ln=ge;else{var Ne=re.return;Ne!==null?(Ln=Ne,GC(Ne)):Ln=null}break t}}gr=0,La=null,Mm(d,p,F,5);break;case 6:gr=0,La=null,Mm(d,p,F,6);break;case 8:_M(),ao=6;break e;default:throw Error(r(462))}}Pge();break}catch(Ze){P4(d,Ze)}while(!0);return iu=ap=null,L.H=T,L.A=$,mr=b,Ln!==null?0:(Dr=null,qn=0,fC(),ao)}function Pge(){for(;Ln!==null&&!Ee();)R4(Ln)}function R4(d){var p=o4(d.alternate,d,pu);d.memoizedProps=d.pendingProps,p===null?GC(d):Ln=p}function D4(d){var p=d,b=p.alternate;switch(p.tag){case 15:case 0:p=JU(b,p,p.pendingProps,p.type,void 0,qn);break;case 11:p=JU(b,p,p.pendingProps,p.type.render,p.ref,qn);break;case 5:XA(p);default:a4(b,p),p=Ln=k5(p,pu),p=o4(b,p,pu)}d.memoizedProps=d.pendingProps,p===null?GC(d):Ln=p}function Mm(d,p,b,T){iu=ap=null,XA(p),Sm=null,Cb=0;var $=p.return;try{if(yge(d,$,p,b,qn)){ao=1,NC(d,ys(b,d.current)),Ln=null;return}}catch(F){if($!==null)throw Ln=$,F;ao=1,NC(d,ys(b,d.current)),Ln=null;return}p.flags&32768?(rr||T===1?d=!0:Tm||(qn&536870912)!==0?d=!1:(Cd=d=!0,(T===2||T===9||T===3||T===6)&&(T=Ss.current,T!==null&&T.tag===13&&(T.flags|=16384))),k4(p,d)):GC(p)}function GC(d){var p=d;do{if((p.flags&32768)!==0){k4(p,Cd);return}d=p.return;var b=bge(p.alternate,p,pu);if(b!==null){Ln=b;return}if(p=p.sibling,p!==null){Ln=p;return}Ln=p=d}while(p!==null);ao===0&&(ao=5)}function k4(d,p){do{var b=xge(d.alternate,d);if(b!==null){b.flags&=32767,Ln=b;return}if(b=d.return,b!==null&&(b.flags|=32768,b.subtreeFlags=0,b.deletions=null),!p&&(d=d.sibling,d!==null)){Ln=d;return}Ln=d=b}while(d!==null);ao=6,Ln=null}function _4(d,p,b,T,$,F,X,re,ge){d.cancelPendingCommit=null;do qC();while(hi!==0);if((mr&6)!==0)throw Error(r(327));if(p!==null){if(p===d.current)throw Error(r(177));if(F=p.lanes|p.childLanes,F|=OA,yo(d,b,F,X,re,ge),d===Dr&&(Ln=Dr=null,qn=0),Im=p,Od=d,Pm=b,RM=F,DM=$,E4=T,(p.subtreeFlags&10256)!==0||(p.flags&10256)!==0?(d.callbackNode=null,d.callbackPriority=0,Dge(Ie,function(){return j4(),null})):(d.callbackNode=null,d.callbackPriority=0),T=(p.flags&13878)!==0,(p.subtreeFlags&13878)!==0||T){T=L.T,L.T=null,$=V.p,V.p=2,X=mr,mr|=4;try{Sge(d,p,b)}finally{mr=X,V.p=$,L.T=T}}hi=1,$4(),N4(),L4()}}function $4(){if(hi===1){hi=0;var d=Od,p=Im,b=(p.flags&13878)!==0;if((p.subtreeFlags&13878)!==0||b){b=L.T,L.T=null;var T=V.p;V.p=2;var $=mr;mr|=4;try{y4(p,d);var F=KM,X=C5(d.containerInfo),re=F.focusedElem,ge=F.selectionRange;if(X!==re&&re&&re.ownerDocument&&w5(re.ownerDocument.documentElement,re)){if(ge!==null&&SA(re)){var Ne=ge.start,Ze=ge.end;if(Ze===void 0&&(Ze=Ne),"selectionStart"in re)re.selectionStart=Ne,re.selectionEnd=Math.min(Ze,re.value.length);else{var ot=re.ownerDocument||document,Fe=ot&&ot.defaultView||window;if(Fe.getSelection){var ze=Fe.getSelection(),fn=re.textContent.length,nn=Math.min(ge.start,fn),Sr=ge.end===void 0?nn:Math.min(ge.end,fn);!ze.extend&&nn>Sr&&(X=Sr,Sr=nn,nn=X);var Ae=S5(re,nn),we=S5(re,Sr);if(Ae&&we&&(ze.rangeCount!==1||ze.anchorNode!==Ae.node||ze.anchorOffset!==Ae.offset||ze.focusNode!==we.node||ze.focusOffset!==we.offset)){var _e=ot.createRange();_e.setStart(Ae.node,Ae.offset),ze.removeAllRanges(),nn>Sr?(ze.addRange(_e),ze.extend(we.node,we.offset)):(_e.setEnd(we.node,we.offset),ze.addRange(_e))}}}}for(ot=[],ze=re;ze=ze.parentNode;)ze.nodeType===1&&ot.push({element:ze,left:ze.scrollLeft,top:ze.scrollTop});for(typeof re.focus=="function"&&re.focus(),re=0;re<ot.length;re++){var tt=ot[re];tt.element.scrollLeft=tt.left,tt.element.scrollTop=tt.top}}o1=!!WM,KM=WM=null}finally{mr=$,V.p=T,L.T=b}}d.current=p,hi=2}}function N4(){if(hi===2){hi=0;var d=Od,p=Im,b=(p.flags&8772)!==0;if((p.subtreeFlags&8772)!==0||b){b=L.T,L.T=null;var T=V.p;V.p=2;var $=mr;mr|=4;try{p4(d,p.alternate,p)}finally{mr=$,V.p=T,L.T=b}}hi=3}}function L4(){if(hi===4||hi===3){hi=0,xe();var d=Od,p=Im,b=Pm,T=E4;(p.subtreeFlags&10256)!==0||(p.flags&10256)!==0?hi=5:(hi=0,Im=Od=null,F4(d,d.pendingLanes));var $=d.pendingLanes;if($===0&&(Td=null),Kt(b),p=p.stateNode,rt&&typeof rt.onCommitFiberRoot=="function")try{rt.onCommitFiberRoot(We,p,void 0,(p.current.flags&128)===128)}catch{}if(T!==null){p=L.T,$=V.p,V.p=2,L.T=null;try{for(var F=d.onRecoverableError,X=0;X<T.length;X++){var re=T[X];F(re.value,{componentStack:re.stack})}}finally{L.T=p,V.p=$}}(Pm&3)!==0&&qC(),lc(d),$=d.pendingLanes,(b&4194090)!==0&&($&42)!==0?d===kM?Db++:(Db=0,kM=d):Db=0,kb(0)}}function F4(d,p){(d.pooledCacheLanes&=p)===0&&(p=d.pooledCache,p!=null&&(d.pooledCache=null,fb(p)))}function qC(d){return $4(),N4(),L4(),j4()}function j4(){if(hi!==5)return!1;var d=Od,p=RM;RM=0;var b=Kt(Pm),T=L.T,$=V.p;try{V.p=32>b?32:b,L.T=null,b=DM,DM=null;var F=Od,X=Pm;if(hi=0,Im=Od=null,Pm=0,(mr&6)!==0)throw Error(r(331));var re=mr;if(mr|=4,w4(F.current),b4(F,F.current,X,b),mr=re,kb(0,!1),rt&&typeof rt.onPostCommitFiberRoot=="function")try{rt.onPostCommitFiberRoot(We,F)}catch{}return!0}finally{V.p=$,L.T=T,F4(d,p)}}function B4(d,p,b){p=ys(b,p),p=dM(d.stateNode,p,2),d=gd(d,p,2),d!==null&&(Bn(d,2),lc(d))}function Or(d,p,b){if(d.tag===3)B4(d,d,b);else for(;p!==null;){if(p.tag===3){B4(p,d,b);break}else if(p.tag===1){var T=p.stateNode;if(typeof p.type.getDerivedStateFromError=="function"||typeof T.componentDidCatch=="function"&&(Td===null||!Td.has(T))){d=ys(b,d),b=UU(2),T=gd(p,b,2),T!==null&&(GU(b,T,p,d),Bn(T,2),lc(T));break}}p=p.return}}function LM(d,p,b){var T=d.pingCache;if(T===null){T=d.pingCache=new Ege;var $=new Set;T.set(p,$)}else $=T.get(p),$===void 0&&($=new Set,T.set(p,$));$.has(b)||(IM=!0,$.add(b),d=Age.bind(null,d,p,b),p.then(d,d))}function Age(d,p,b){var T=d.pingCache;T!==null&&T.delete(p),d.pingedLanes|=d.suspendedLanes&b,d.warmLanes&=~b,Dr===d&&(qn&b)===b&&(ao===4||ao===3&&(qn&62914560)===qn&&300>Re()-MM?(mr&2)===0&&Am(d,0):PM|=b,Om===qn&&(Om=0)),lc(d)}function z4(d,p){p===0&&(p=Rr()),d=dm(d,p),d!==null&&(Bn(d,p),lc(d))}function Mge(d){var p=d.memoizedState,b=0;p!==null&&(b=p.retryLane),z4(d,b)}function Rge(d,p){var b=0;switch(d.tag){case 13:var T=d.stateNode,$=d.memoizedState;$!==null&&(b=$.retryLane);break;case 19:T=d.stateNode;break;case 22:T=d.stateNode._retryCache;break;default:throw Error(r(314))}T!==null&&T.delete(p),z4(d,b)}function Dge(d,p){return ue(d,p)}var WC=null,Rm=null,FM=!1,KC=!1,jM=!1,pp=0;function lc(d){d!==Rm&&d.next===null&&(Rm===null?WC=Rm=d:Rm=Rm.next=d),KC=!0,FM||(FM=!0,_ge())}function kb(d,p){if(!jM&&KC){jM=!0;do for(var b=!1,T=WC;T!==null;){if(d!==0){var $=T.pendingLanes;if($===0)var F=0;else{var X=T.suspendedLanes,re=T.pingedLanes;F=(1<<31-Be(42|d)+1)-1,F&=$&~(X&~re),F=F&201326741?F&201326741|1:F?F|2:0}F!==0&&(b=!0,G4(T,F))}else F=qn,F=vt(T,T===Dr?F:0,T.cancelPendingCommit!==null||T.timeoutHandle!==-1),(F&3)===0||bt(T,F)||(b=!0,G4(T,F));T=T.next}while(b);jM=!1}}function kge(){V4()}function V4(){KC=FM=!1;var d=0;pp!==0&&(Vge()&&(d=pp),pp=0);for(var p=Re(),b=null,T=WC;T!==null;){var $=T.next,F=H4(T,p);F===0?(T.next=null,b===null?WC=$:b.next=$,$===null&&(Rm=b)):(b=T,(d!==0||(F&3)!==0)&&(KC=!0)),T=$}kb(d)}function H4(d,p){for(var b=d.suspendedLanes,T=d.pingedLanes,$=d.expirationTimes,F=d.pendingLanes&-62914561;0<F;){var X=31-Be(F),re=1<<X,ge=$[X];ge===-1?((re&b)===0||(re&T)!==0)&&($[X]=vn(re,p)):ge<=p&&(d.expiredLanes|=re),F&=~re}if(p=Dr,b=qn,b=vt(d,d===p?b:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),T=d.callbackNode,b===0||d===p&&(gr===2||gr===9)||d.cancelPendingCommit!==null)return T!==null&&T!==null&&pe(T),d.callbackNode=null,d.callbackPriority=0;if((b&3)===0||bt(d,b)){if(p=b&-b,p===d.callbackPriority)return p;switch(T!==null&&pe(T),Kt(b)){case 2:case 8:b=ve;break;case 32:b=Ie;break;case 268435456:b=Te;break;default:b=Ie}return T=U4.bind(null,d),b=ue(b,T),d.callbackPriority=p,d.callbackNode=b,p}return T!==null&&T!==null&&pe(T),d.callbackPriority=2,d.callbackNode=null,2}function U4(d,p){if(hi!==0&&hi!==5)return d.callbackNode=null,d.callbackPriority=0,null;var b=d.callbackNode;if(qC()&&d.callbackNode!==b)return null;var T=qn;return T=vt(d,d===Dr?T:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),T===0?null:(O4(d,T,p),H4(d,Re()),d.callbackNode!=null&&d.callbackNode===b?U4.bind(null,d):null)}function G4(d,p){if(qC())return null;O4(d,p,!0)}function _ge(){Uge(function(){(mr&6)!==0?ue(Pe,kge):V4()})}function BM(){return pp===0&&(pp=kn()),pp}function q4(d){return d==null||typeof d=="symbol"||typeof d=="boolean"?null:typeof d=="function"?d:iC(""+d)}function W4(d,p){var b=p.ownerDocument.createElement("input");return b.name=p.name,b.value=p.value,d.id&&b.setAttribute("form",d.id),p.parentNode.insertBefore(b,p),d=new FormData(d),b.parentNode.removeChild(b),d}function $ge(d,p,b,T,$){if(p==="submit"&&b&&b.stateNode===$){var F=q4(($[Xt]||null).action),X=T.submitter;X&&(p=(p=X[Xt]||null)?q4(p.formAction):X.getAttribute("formAction"),p!==null&&(F=p,X=null));var re=new cC("action","action",null,T,$);d.push({event:re,listeners:[{instance:null,listener:function(){if(T.defaultPrevented){if(pp!==0){var ge=X?W4($,X):new FormData($);aM(b,{pending:!0,data:ge,method:$.method,action:F},null,ge)}}else typeof F=="function"&&(re.preventDefault(),ge=X?W4($,X):new FormData($),aM(b,{pending:!0,data:ge,method:$.method,action:F},F,ge))},currentTarget:$}]})}}for(var zM=0;zM<TA.length;zM++){var VM=TA[zM],Nge=VM.toLowerCase(),Lge=VM[0].toUpperCase()+VM.slice(1);fl(Nge,"on"+Lge)}fl(O5,"onAnimationEnd"),fl(I5,"onAnimationIteration"),fl(P5,"onAnimationStart"),fl("dblclick","onDoubleClick"),fl("focusin","onFocus"),fl("focusout","onBlur"),fl(ege,"onTransitionRun"),fl(tge,"onTransitionStart"),fl(nge,"onTransitionCancel"),fl(A5,"onTransitionEnd"),Gt("onMouseEnter",["mouseout","mouseover"]),Gt("onMouseLeave",["mouseout","mouseover"]),Gt("onPointerEnter",["pointerout","pointerover"]),Gt("onPointerLeave",["pointerout","pointerover"]),hn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),hn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),hn("onBeforeInput",["compositionend","keypress","textInput","paste"]),hn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),hn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),hn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _b="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Fge=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(_b));function K4(d,p){p=(p&4)!==0;for(var b=0;b<d.length;b++){var T=d[b],$=T.event;T=T.listeners;e:{var F=void 0;if(p)for(var X=T.length-1;0<=X;X--){var re=T[X],ge=re.instance,Ne=re.currentTarget;if(re=re.listener,ge!==F&&$.isPropagationStopped())break e;F=re,$.currentTarget=Ne;try{F($)}catch(Ze){$C(Ze)}$.currentTarget=null,F=ge}else for(X=0;X<T.length;X++){if(re=T[X],ge=re.instance,Ne=re.currentTarget,re=re.listener,ge!==F&&$.isPropagationStopped())break e;F=re,$.currentTarget=Ne;try{F($)}catch(Ze){$C(Ze)}$.currentTarget=null,F=ge}}}}function Fn(d,p){var b=p[Xo];b===void 0&&(b=p[Xo]=new Set);var T=d+"__bubble";b.has(T)||(Y4(p,d,2,!1),b.add(T))}function HM(d,p,b){var T=0;p&&(T|=4),Y4(b,d,T,p)}var YC="_reactListening"+Math.random().toString(36).slice(2);function UM(d){if(!d[YC]){d[YC]=!0,Ye.forEach(function(b){b!=="selectionchange"&&(Fge.has(b)||HM(b,!1,d),HM(b,!0,d))});var p=d.nodeType===9?d:d.ownerDocument;p===null||p[YC]||(p[YC]=!0,HM("selectionchange",!1,p))}}function Y4(d,p,b,T){switch(b3(p)){case 2:var $=dye;break;case 8:$=fye;break;default:$=oR}b=$.bind(null,p,b,d),$=void 0,!fA||p!=="touchstart"&&p!=="touchmove"&&p!=="wheel"||($=!0),T?$!==void 0?d.addEventListener(p,b,{capture:!0,passive:$}):d.addEventListener(p,b,!0):$!==void 0?d.addEventListener(p,b,{passive:$}):d.addEventListener(p,b,!1)}function GM(d,p,b,T,$){var F=T;if((p&1)===0&&(p&2)===0&&T!==null)e:for(;;){if(T===null)return;var X=T.tag;if(X===3||X===4){var re=T.stateNode.containerInfo;if(re===$)break;if(X===4)for(X=T.return;X!==null;){var ge=X.tag;if((ge===3||ge===4)&&X.stateNode.containerInfo===$)return;X=X.return}for(;re!==null;){if(X=Fr(re),X===null)return;if(ge=X.tag,ge===5||ge===6||ge===26||ge===27){T=F=X;continue e}re=re.parentNode}}T=T.return}n5(function(){var Ne=F,Ze=uA(b),ot=[];e:{var Fe=M5.get(d);if(Fe!==void 0){var ze=cC,fn=d;switch(d){case"keypress":if(sC(b)===0)break e;case"keydown":case"keyup":ze=Dme;break;case"focusin":fn="focus",ze=gA;break;case"focusout":fn="blur",ze=gA;break;case"beforeblur":case"afterblur":ze=gA;break;case"click":if(b.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ze=i5;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ze=xme;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ze=$me;break;case O5:case I5:case P5:ze=Cme;break;case A5:ze=Lme;break;case"scroll":case"scrollend":ze=vme;break;case"wheel":ze=jme;break;case"copy":case"cut":case"paste":ze=Tme;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ze=s5;break;case"toggle":case"beforetoggle":ze=zme}var nn=(p&4)!==0,Sr=!nn&&(d==="scroll"||d==="scrollend"),Ae=nn?Fe!==null?Fe+"Capture":null:Fe;nn=[];for(var we=Ne,_e;we!==null;){var tt=we;if(_e=tt.stateNode,tt=tt.tag,tt!==5&&tt!==26&&tt!==27||_e===null||Ae===null||(tt=Zv(we,Ae),tt!=null&&nn.push($b(we,tt,_e))),Sr)break;we=we.return}0<nn.length&&(Fe=new ze(Fe,fn,null,b,Ze),ot.push({event:Fe,listeners:nn}))}}if((p&7)===0){e:{if(Fe=d==="mouseover"||d==="pointerover",ze=d==="mouseout"||d==="pointerout",Fe&&b!==cA&&(fn=b.relatedTarget||b.fromElement)&&(Fr(fn)||fn[Vn]))break e;if((ze||Fe)&&(Fe=Ze.window===Ze?Ze:(Fe=Ze.ownerDocument)?Fe.defaultView||Fe.parentWindow:window,ze?(fn=b.relatedTarget||b.toElement,ze=Ne,fn=fn?Fr(fn):null,fn!==null&&(Sr=i(fn),nn=fn.tag,fn!==Sr||nn!==5&&nn!==27&&nn!==6)&&(fn=null)):(ze=null,fn=Ne),ze!==fn)){if(nn=i5,tt="onMouseLeave",Ae="onMouseEnter",we="mouse",(d==="pointerout"||d==="pointerover")&&(nn=s5,tt="onPointerLeave",Ae="onPointerEnter",we="pointer"),Sr=ze==null?Fe:ul(ze),_e=fn==null?Fe:ul(fn),Fe=new nn(tt,we+"leave",ze,b,Ze),Fe.target=Sr,Fe.relatedTarget=_e,tt=null,Fr(Ze)===Ne&&(nn=new nn(Ae,we+"enter",fn,b,Ze),nn.target=_e,nn.relatedTarget=Sr,tt=nn),Sr=tt,ze&&fn)t:{for(nn=ze,Ae=fn,we=0,_e=nn;_e;_e=Dm(_e))we++;for(_e=0,tt=Ae;tt;tt=Dm(tt))_e++;for(;0<we-_e;)nn=Dm(nn),we--;for(;0<_e-we;)Ae=Dm(Ae),_e--;for(;we--;){if(nn===Ae||Ae!==null&&nn===Ae.alternate)break t;nn=Dm(nn),Ae=Dm(Ae)}nn=null}else nn=null;ze!==null&&Q4(ot,Fe,ze,nn,!1),fn!==null&&Sr!==null&&Q4(ot,Sr,fn,nn,!0)}}e:{if(Fe=Ne?ul(Ne):window,ze=Fe.nodeName&&Fe.nodeName.toLowerCase(),ze==="select"||ze==="input"&&Fe.type==="file")var Bt=m5;else if(p5(Fe))if(g5)Bt=Xme;else{Bt=Yme;var _n=Kme}else ze=Fe.nodeName,!ze||ze.toLowerCase()!=="input"||Fe.type!=="checkbox"&&Fe.type!=="radio"?Ne&&lA(Ne.elementType)&&(Bt=m5):Bt=Qme;if(Bt&&(Bt=Bt(d,Ne))){h5(ot,Bt,b,Ze);break e}_n&&_n(d,Fe,Ne),d==="focusout"&&Ne&&Fe.type==="number"&&Ne.memoizedProps.value!=null&&sA(Fe,"number",Fe.value)}switch(_n=Ne?ul(Ne):window,d){case"focusin":(p5(_n)||_n.contentEditable==="true")&&(lm=_n,wA=Ne,sb=null);break;case"focusout":sb=wA=lm=null;break;case"mousedown":CA=!0;break;case"contextmenu":case"mouseup":case"dragend":CA=!1,E5(ot,b,Ze);break;case"selectionchange":if(Zme)break;case"keydown":case"keyup":E5(ot,b,Ze)}var qt;if(vA)e:{switch(d){case"compositionstart":var an="onCompositionStart";break e;case"compositionend":an="onCompositionEnd";break e;case"compositionupdate":an="onCompositionUpdate";break e}an=void 0}else sm?d5(d,b)&&(an="onCompositionEnd"):d==="keydown"&&b.keyCode===229&&(an="onCompositionStart");an&&(l5&&b.locale!=="ko"&&(sm||an!=="onCompositionStart"?an==="onCompositionEnd"&&sm&&(qt=r5()):(fd=Ze,pA="value"in fd?fd.value:fd.textContent,sm=!0)),_n=QC(Ne,an),0<_n.length&&(an=new a5(an,d,null,b,Ze),ot.push({event:an,listeners:_n}),qt?an.data=qt:(qt=f5(b),qt!==null&&(an.data=qt)))),(qt=Hme?Ume(d,b):Gme(d,b))&&(an=QC(Ne,"onBeforeInput"),0<an.length&&(_n=new a5("onBeforeInput","beforeinput",null,b,Ze),ot.push({event:_n,listeners:an}),_n.data=qt)),$ge(ot,d,Ne,b,Ze)}K4(ot,p)})}function $b(d,p,b){return{instance:d,listener:p,currentTarget:b}}function QC(d,p){for(var b=p+"Capture",T=[];d!==null;){var $=d,F=$.stateNode;if($=$.tag,$!==5&&$!==26&&$!==27||F===null||($=Zv(d,b),$!=null&&T.unshift($b(d,$,F)),$=Zv(d,p),$!=null&&T.push($b(d,$,F))),d.tag===3)return T;d=d.return}return[]}function Dm(d){if(d===null)return null;do d=d.return;while(d&&d.tag!==5&&d.tag!==27);return d||null}function Q4(d,p,b,T,$){for(var F=p._reactName,X=[];b!==null&&b!==T;){var re=b,ge=re.alternate,Ne=re.stateNode;if(re=re.tag,ge!==null&&ge===T)break;re!==5&&re!==26&&re!==27||Ne===null||(ge=Ne,$?(Ne=Zv(b,F),Ne!=null&&X.unshift($b(b,Ne,ge))):$||(Ne=Zv(b,F),Ne!=null&&X.push($b(b,Ne,ge)))),b=b.return}X.length!==0&&d.push({event:p,listeners:X})}var jge=/\r\n?/g,Bge=/\u0000|\uFFFD/g;function X4(d){return(typeof d=="string"?d:""+d).replace(jge,`
+`+b.stack}}function ms(d){switch(typeof d){case"bigint":case"boolean":case"number":case"string":case"undefined":return d;case"object":return d;default:return""}}function KH(d){var p=d.type;return(d=d.nodeName)&&d.toLowerCase()==="input"&&(p==="checkbox"||p==="radio")}function pme(d){var p=KH(d)?"checked":"value",b=Object.getOwnPropertyDescriptor(d.constructor.prototype,p),T=""+d[p];if(!d.hasOwnProperty(p)&&typeof b<"u"&&typeof b.get=="function"&&typeof b.set=="function"){var $=b.get,F=b.set;return Object.defineProperty(d,p,{configurable:!0,get:function(){return $.call(this)},set:function(X){T=""+X,F.call(this,X)}}),Object.defineProperty(d,p,{enumerable:b.enumerable}),{getValue:function(){return T},setValue:function(X){T=""+X},stopTracking:function(){d._valueTracker=null,delete d[p]}}}}function rC(d){d._valueTracker||(d._valueTracker=pme(d))}function YH(d){if(!d)return!1;var p=d._valueTracker;if(!p)return!0;var b=p.getValue(),T="";return d&&(T=KH(d)?d.checked?"true":"false":d.value),d=T,d!==b?(p.setValue(d),!0):!1}function oC(d){if(d=d||(typeof document<"u"?document:void 0),typeof d>"u")return null;try{return d.activeElement||d.body}catch{return d.body}}var hme=/[\n"\\]/g;function gs(d){return d.replace(hme,function(p){return"\\"+p.charCodeAt(0).toString(16)+" "})}function aA(d,p,b,T,$,F,X,re){d.name="",X!=null&&typeof X!="function"&&typeof X!="symbol"&&typeof X!="boolean"?d.type=X:d.removeAttribute("type"),p!=null?X==="number"?(p===0&&d.value===""||d.value!=p)&&(d.value=""+ms(p)):d.value!==""+ms(p)&&(d.value=""+ms(p)):X!=="submit"&&X!=="reset"||d.removeAttribute("value"),p!=null?sA(d,X,ms(p)):b!=null?sA(d,X,ms(b)):T!=null&&d.removeAttribute("value"),$==null&&F!=null&&(d.defaultChecked=!!F),$!=null&&(d.checked=$&&typeof $!="function"&&typeof $!="symbol"),re!=null&&typeof re!="function"&&typeof re!="symbol"&&typeof re!="boolean"?d.name=""+ms(re):d.removeAttribute("name")}function QH(d,p,b,T,$,F,X,re){if(F!=null&&typeof F!="function"&&typeof F!="symbol"&&typeof F!="boolean"&&(d.type=F),p!=null||b!=null){if(!(F!=="submit"&&F!=="reset"||p!=null))return;b=b!=null?""+ms(b):"",p=p!=null?""+ms(p):b,re||p===d.value||(d.value=p),d.defaultValue=p}T=T??$,T=typeof T!="function"&&typeof T!="symbol"&&!!T,d.checked=re?d.checked:!!T,d.defaultChecked=!!T,X!=null&&typeof X!="function"&&typeof X!="symbol"&&typeof X!="boolean"&&(d.name=X)}function sA(d,p,b){p==="number"&&oC(d.ownerDocument)===d||d.defaultValue===""+b||(d.defaultValue=""+b)}function rm(d,p,b,T){if(d=d.options,p){p={};for(var $=0;$<b.length;$++)p["$"+b[$]]=!0;for(b=0;b<d.length;b++)$=p.hasOwnProperty("$"+d[b].value),d[b].selected!==$&&(d[b].selected=$),$&&T&&(d[b].defaultSelected=!0)}else{for(b=""+ms(b),p=null,$=0;$<d.length;$++){if(d[$].value===b){d[$].selected=!0,T&&(d[$].defaultSelected=!0);return}p!==null||d[$].disabled||(p=d[$])}p!==null&&(p.selected=!0)}}function XH(d,p,b){if(p!=null&&(p=""+ms(p),p!==d.value&&(d.value=p),b==null)){d.defaultValue!==p&&(d.defaultValue=p);return}d.defaultValue=b!=null?""+ms(b):""}function JH(d,p,b,T){if(p==null){if(T!=null){if(b!=null)throw Error(r(92));if(j(T)){if(1<T.length)throw Error(r(93));T=T[0]}b=T}b==null&&(b=""),p=b}b=ms(p),d.defaultValue=b,T=d.textContent,T===b&&T!==""&&T!==null&&(d.value=T)}function om(d,p){if(p){var b=d.firstChild;if(b&&b===d.lastChild&&b.nodeType===3){b.nodeValue=p;return}}d.textContent=p}var mme=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function ZH(d,p,b){var T=p.indexOf("--")===0;b==null||typeof b=="boolean"||b===""?T?d.setProperty(p,""):p==="float"?d.cssFloat="":d[p]="":T?d.setProperty(p,b):typeof b!="number"||b===0||mme.has(p)?p==="float"?d.cssFloat=b:d[p]=(""+b).trim():d[p]=b+"px"}function e5(d,p,b){if(p!=null&&typeof p!="object")throw Error(r(62));if(d=d.style,b!=null){for(var T in b)!b.hasOwnProperty(T)||p!=null&&p.hasOwnProperty(T)||(T.indexOf("--")===0?d.setProperty(T,""):T==="float"?d.cssFloat="":d[T]="");for(var $ in p)T=p[$],p.hasOwnProperty($)&&b[$]!==T&&ZH(d,$,T)}else for(var F in p)p.hasOwnProperty(F)&&ZH(d,F,p[F])}function lA(d){if(d.indexOf("-")===-1)return!1;switch(d){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var gme=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),yme=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function iC(d){return yme.test(""+d)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":d}var cA=null;function uA(d){return d=d.target||d.srcElement||window,d.correspondingUseElement&&(d=d.correspondingUseElement),d.nodeType===3?d.parentNode:d}var im=null,am=null;function t5(d){var p=zi(d);if(p&&(d=p.stateNode)){var b=d[Xt]||null;e:switch(d=p.stateNode,p.type){case"input":if(aA(d,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name),p=b.name,b.type==="radio"&&p!=null){for(b=d;b.parentNode;)b=b.parentNode;for(b=b.querySelectorAll('input[name="'+gs(""+p)+'"][type="radio"]'),p=0;p<b.length;p++){var T=b[p];if(T!==d&&T.form===d.form){var $=T[Xt]||null;if(!$)throw Error(r(90));aA(T,$.value,$.defaultValue,$.defaultValue,$.checked,$.defaultChecked,$.type,$.name)}}for(p=0;p<b.length;p++)T=b[p],T.form===d.form&&YH(T)}break e;case"textarea":XH(d,b.value,b.defaultValue);break e;case"select":p=b.value,p!=null&&rm(d,!!b.multiple,p,!1)}}}var dA=!1;function n5(d,p,b){if(dA)return d(p,b);dA=!0;try{var T=d(p);return T}finally{if(dA=!1,(im!==null||am!==null)&&(UC(),im&&(p=im,d=am,am=im=null,t5(p),d)))for(p=0;p<d.length;p++)t5(d[p])}}function Zv(d,p){var b=d.stateNode;if(b===null)return null;var T=b[Xt]||null;if(T===null)return null;b=T[p];e:switch(p){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(T=!T.disabled)||(d=d.type,T=!(d==="button"||d==="input"||d==="select"||d==="textarea")),d=!T;break e;default:d=!1}if(d)return null;if(b&&typeof b!="function")throw Error(r(231,p,typeof b));return b}var tu=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),fA=!1;if(tu)try{var eb={};Object.defineProperty(eb,"passive",{get:function(){fA=!0}}),window.addEventListener("test",eb,eb),window.removeEventListener("test",eb,eb)}catch{fA=!1}var fd=null,pA=null,aC=null;function r5(){if(aC)return aC;var d,p=pA,b=p.length,T,$="value"in fd?fd.value:fd.textContent,F=$.length;for(d=0;d<b&&p[d]===$[d];d++);var X=b-d;for(T=1;T<=X&&p[b-T]===$[F-T];T++);return aC=$.slice(d,1<T?1-T:void 0)}function sC(d){var p=d.keyCode;return"charCode"in d?(d=d.charCode,d===0&&p===13&&(d=13)):d=p,d===10&&(d=13),32<=d||d===13?d:0}function lC(){return!0}function o5(){return!1}function ua(d){function p(b,T,$,F,X){this._reactName=b,this._targetInst=$,this.type=T,this.nativeEvent=F,this.target=X,this.currentTarget=null;for(var re in d)d.hasOwnProperty(re)&&(b=d[re],this[re]=b?b(F):F[re]);return this.isDefaultPrevented=(F.defaultPrevented!=null?F.defaultPrevented:F.returnValue===!1)?lC:o5,this.isPropagationStopped=o5,this}return u(p.prototype,{preventDefault:function(){this.defaultPrevented=!0;var b=this.nativeEvent;b&&(b.preventDefault?b.preventDefault():typeof b.returnValue!="unknown"&&(b.returnValue=!1),this.isDefaultPrevented=lC)},stopPropagation:function(){var b=this.nativeEvent;b&&(b.stopPropagation?b.stopPropagation():typeof b.cancelBubble!="unknown"&&(b.cancelBubble=!0),this.isPropagationStopped=lC)},persist:function(){},isPersistent:lC}),p}var Jf={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(d){return d.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},cC=ua(Jf),tb=u({},Jf,{view:0,detail:0}),vme=ua(tb),hA,mA,nb,uC=u({},tb,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:yA,button:0,buttons:0,relatedTarget:function(d){return d.relatedTarget===void 0?d.fromElement===d.srcElement?d.toElement:d.fromElement:d.relatedTarget},movementX:function(d){return"movementX"in d?d.movementX:(d!==nb&&(nb&&d.type==="mousemove"?(hA=d.screenX-nb.screenX,mA=d.screenY-nb.screenY):mA=hA=0,nb=d),hA)},movementY:function(d){return"movementY"in d?d.movementY:mA}}),i5=ua(uC),bme=u({},uC,{dataTransfer:0}),xme=ua(bme),Sme=u({},tb,{relatedTarget:0}),gA=ua(Sme),wme=u({},Jf,{animationName:0,elapsedTime:0,pseudoElement:0}),Cme=ua(wme),Eme=u({},Jf,{clipboardData:function(d){return"clipboardData"in d?d.clipboardData:window.clipboardData}}),Tme=ua(Eme),Ome=u({},Jf,{data:0}),a5=ua(Ome),Ime={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Pme={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Ame={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Mme(d){var p=this.nativeEvent;return p.getModifierState?p.getModifierState(d):(d=Ame[d])?!!p[d]:!1}function yA(){return Mme}var Rme=u({},tb,{key:function(d){if(d.key){var p=Ime[d.key]||d.key;if(p!=="Unidentified")return p}return d.type==="keypress"?(d=sC(d),d===13?"Enter":String.fromCharCode(d)):d.type==="keydown"||d.type==="keyup"?Pme[d.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:yA,charCode:function(d){return d.type==="keypress"?sC(d):0},keyCode:function(d){return d.type==="keydown"||d.type==="keyup"?d.keyCode:0},which:function(d){return d.type==="keypress"?sC(d):d.type==="keydown"||d.type==="keyup"?d.keyCode:0}}),Dme=ua(Rme),kme=u({},uC,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),s5=ua(kme),_me=u({},tb,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:yA}),$me=ua(_me),Nme=u({},Jf,{propertyName:0,elapsedTime:0,pseudoElement:0}),Lme=ua(Nme),Fme=u({},uC,{deltaX:function(d){return"deltaX"in d?d.deltaX:"wheelDeltaX"in d?-d.wheelDeltaX:0},deltaY:function(d){return"deltaY"in d?d.deltaY:"wheelDeltaY"in d?-d.wheelDeltaY:"wheelDelta"in d?-d.wheelDelta:0},deltaZ:0,deltaMode:0}),jme=ua(Fme),Bme=u({},Jf,{newState:0,oldState:0}),zme=ua(Bme),Vme=[9,13,27,32],vA=tu&&"CompositionEvent"in window,rb=null;tu&&"documentMode"in document&&(rb=document.documentMode);var Hme=tu&&"TextEvent"in window&&!rb,l5=tu&&(!vA||rb&&8<rb&&11>=rb),c5=" ",u5=!1;function d5(d,p){switch(d){case"keyup":return Vme.indexOf(p.keyCode)!==-1;case"keydown":return p.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function f5(d){return d=d.detail,typeof d=="object"&&"data"in d?d.data:null}var sm=!1;function Ume(d,p){switch(d){case"compositionend":return f5(p);case"keypress":return p.which!==32?null:(u5=!0,c5);case"textInput":return d=p.data,d===c5&&u5?null:d;default:return null}}function Gme(d,p){if(sm)return d==="compositionend"||!vA&&d5(d,p)?(d=r5(),aC=pA=fd=null,sm=!1,d):null;switch(d){case"paste":return null;case"keypress":if(!(p.ctrlKey||p.altKey||p.metaKey)||p.ctrlKey&&p.altKey){if(p.char&&1<p.char.length)return p.char;if(p.which)return String.fromCharCode(p.which)}return null;case"compositionend":return l5&&p.locale!=="ko"?null:p.data;default:return null}}var qme={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function p5(d){var p=d&&d.nodeName&&d.nodeName.toLowerCase();return p==="input"?!!qme[d.type]:p==="textarea"}function h5(d,p,b,T){im?am?am.push(T):am=[T]:im=T,p=QC(p,"onChange"),0<p.length&&(b=new cC("onChange","change",null,b,T),d.push({event:b,listeners:p}))}var ob=null,ib=null;function Wme(d){K4(d,0)}function dC(d){var p=ul(d);if(YH(p))return d}function m5(d,p){if(d==="change")return p}var g5=!1;if(tu){var bA;if(tu){var xA="oninput"in document;if(!xA){var y5=document.createElement("div");y5.setAttribute("oninput","return;"),xA=typeof y5.oninput=="function"}bA=xA}else bA=!1;g5=bA&&(!document.documentMode||9<document.documentMode)}function v5(){ob&&(ob.detachEvent("onpropertychange",b5),ib=ob=null)}function b5(d){if(d.propertyName==="value"&&dC(ib)){var p=[];h5(p,ib,d,uA(d)),n5(Wme,p)}}function Kme(d,p,b){d==="focusin"?(v5(),ob=p,ib=b,ob.attachEvent("onpropertychange",b5)):d==="focusout"&&v5()}function Yme(d){if(d==="selectionchange"||d==="keyup"||d==="keydown")return dC(ib)}function Qme(d,p){if(d==="click")return dC(p)}function Xme(d,p){if(d==="input"||d==="change")return dC(p)}function Jme(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var ka=typeof Object.is=="function"?Object.is:Jme;function ab(d,p){if(ka(d,p))return!0;if(typeof d!="object"||d===null||typeof p!="object"||p===null)return!1;var b=Object.keys(d),T=Object.keys(p);if(b.length!==T.length)return!1;for(T=0;T<b.length;T++){var $=b[T];if(!oe.call(p,$)||!ka(d[$],p[$]))return!1}return!0}function x5(d){for(;d&&d.firstChild;)d=d.firstChild;return d}function S5(d,p){var b=x5(d);d=0;for(var T;b;){if(b.nodeType===3){if(T=d+b.textContent.length,d<=p&&T>=p)return{node:b,offset:p-d};d=T}e:{for(;b;){if(b.nextSibling){b=b.nextSibling;break e}b=b.parentNode}b=void 0}b=x5(b)}}function w5(d,p){return d&&p?d===p?!0:d&&d.nodeType===3?!1:p&&p.nodeType===3?w5(d,p.parentNode):"contains"in d?d.contains(p):d.compareDocumentPosition?!!(d.compareDocumentPosition(p)&16):!1:!1}function C5(d){d=d!=null&&d.ownerDocument!=null&&d.ownerDocument.defaultView!=null?d.ownerDocument.defaultView:window;for(var p=oC(d.document);p instanceof d.HTMLIFrameElement;){try{var b=typeof p.contentWindow.location.href=="string"}catch{b=!1}if(b)d=p.contentWindow;else break;p=oC(d.document)}return p}function SA(d){var p=d&&d.nodeName&&d.nodeName.toLowerCase();return p&&(p==="input"&&(d.type==="text"||d.type==="search"||d.type==="tel"||d.type==="url"||d.type==="password")||p==="textarea"||d.contentEditable==="true")}var Zme=tu&&"documentMode"in document&&11>=document.documentMode,lm=null,wA=null,sb=null,CA=!1;function E5(d,p,b){var T=b.window===b?b.document:b.nodeType===9?b:b.ownerDocument;CA||lm==null||lm!==oC(T)||(T=lm,"selectionStart"in T&&SA(T)?T={start:T.selectionStart,end:T.selectionEnd}:(T=(T.ownerDocument&&T.ownerDocument.defaultView||window).getSelection(),T={anchorNode:T.anchorNode,anchorOffset:T.anchorOffset,focusNode:T.focusNode,focusOffset:T.focusOffset}),sb&&ab(sb,T)||(sb=T,T=QC(wA,"onSelect"),0<T.length&&(p=new cC("onSelect","select",null,p,b),d.push({event:p,listeners:T}),p.target=lm)))}function Zf(d,p){var b={};return b[d.toLowerCase()]=p.toLowerCase(),b["Webkit"+d]="webkit"+p,b["Moz"+d]="moz"+p,b}var cm={animationend:Zf("Animation","AnimationEnd"),animationiteration:Zf("Animation","AnimationIteration"),animationstart:Zf("Animation","AnimationStart"),transitionrun:Zf("Transition","TransitionRun"),transitionstart:Zf("Transition","TransitionStart"),transitioncancel:Zf("Transition","TransitionCancel"),transitionend:Zf("Transition","TransitionEnd")},EA={},T5={};tu&&(T5=document.createElement("div").style,"AnimationEvent"in window||(delete cm.animationend.animation,delete cm.animationiteration.animation,delete cm.animationstart.animation),"TransitionEvent"in window||delete cm.transitionend.transition);function ep(d){if(EA[d])return EA[d];if(!cm[d])return d;var p=cm[d],b;for(b in p)if(p.hasOwnProperty(b)&&b in T5)return EA[d]=p[b];return d}var O5=ep("animationend"),I5=ep("animationiteration"),P5=ep("animationstart"),ege=ep("transitionrun"),tge=ep("transitionstart"),nge=ep("transitioncancel"),A5=ep("transitionend"),M5=new Map,TA="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");TA.push("scrollEnd");function fl(d,p){M5.set(d,p),hn(p,[d])}var R5=new WeakMap;function ys(d,p){if(typeof d=="object"&&d!==null){var b=R5.get(d);return b!==void 0?b:(p={value:d,source:p,stack:WH(p)},R5.set(d,p),p)}return{value:d,source:p,stack:WH(p)}}var vs=[],um=0,OA=0;function fC(){for(var d=um,p=OA=um=0;p<d;){var b=vs[p];vs[p++]=null;var T=vs[p];vs[p++]=null;var $=vs[p];vs[p++]=null;var F=vs[p];if(vs[p++]=null,T!==null&&$!==null){var X=T.pending;X===null?$.next=$:($.next=X.next,X.next=$),T.pending=$}F!==0&&D5(b,$,F)}}function pC(d,p,b,T){vs[um++]=d,vs[um++]=p,vs[um++]=b,vs[um++]=T,OA|=T,d.lanes|=T,d=d.alternate,d!==null&&(d.lanes|=T)}function IA(d,p,b,T){return pC(d,p,b,T),hC(d)}function dm(d,p){return pC(d,null,null,p),hC(d)}function D5(d,p,b){d.lanes|=b;var T=d.alternate;T!==null&&(T.lanes|=b);for(var $=!1,F=d.return;F!==null;)F.childLanes|=b,T=F.alternate,T!==null&&(T.childLanes|=b),F.tag===22&&(d=F.stateNode,d===null||d._visibility&1||($=!0)),d=F,F=F.return;return d.tag===3?(F=d.stateNode,$&&p!==null&&($=31-Be(b),d=F.hiddenUpdates,T=d[$],T===null?d[$]=[p]:T.push(p),p.lane=b|536870912),F):null}function hC(d){if(50<Db)throw Db=0,kM=null,Error(r(185));for(var p=d.return;p!==null;)d=p,p=d.return;return d.tag===3?d.stateNode:null}var fm={};function rge(d,p,b,T){this.tag=d,this.key=b,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=p,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=T,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _a(d,p,b,T){return new rge(d,p,b,T)}function PA(d){return d=d.prototype,!(!d||!d.isReactComponent)}function nu(d,p){var b=d.alternate;return b===null?(b=_a(d.tag,p,d.key,d.mode),b.elementType=d.elementType,b.type=d.type,b.stateNode=d.stateNode,b.alternate=d,d.alternate=b):(b.pendingProps=p,b.type=d.type,b.flags=0,b.subtreeFlags=0,b.deletions=null),b.flags=d.flags&65011712,b.childLanes=d.childLanes,b.lanes=d.lanes,b.child=d.child,b.memoizedProps=d.memoizedProps,b.memoizedState=d.memoizedState,b.updateQueue=d.updateQueue,p=d.dependencies,b.dependencies=p===null?null:{lanes:p.lanes,firstContext:p.firstContext},b.sibling=d.sibling,b.index=d.index,b.ref=d.ref,b.refCleanup=d.refCleanup,b}function k5(d,p){d.flags&=65011714;var b=d.alternate;return b===null?(d.childLanes=0,d.lanes=p,d.child=null,d.subtreeFlags=0,d.memoizedProps=null,d.memoizedState=null,d.updateQueue=null,d.dependencies=null,d.stateNode=null):(d.childLanes=b.childLanes,d.lanes=b.lanes,d.child=b.child,d.subtreeFlags=0,d.deletions=null,d.memoizedProps=b.memoizedProps,d.memoizedState=b.memoizedState,d.updateQueue=b.updateQueue,d.type=b.type,p=b.dependencies,d.dependencies=p===null?null:{lanes:p.lanes,firstContext:p.firstContext}),d}function mC(d,p,b,T,$,F){var X=0;if(T=d,typeof d=="function")PA(d)&&(X=1);else if(typeof d=="string")X=iye(d,b,ie.current)?26:d==="html"||d==="head"||d==="body"?27:5;else e:switch(d){case M:return d=_a(31,b,p,$),d.elementType=M,d.lanes=F,d;case g:return tp(b.children,$,F,p);case y:X=8,$|=24;break;case v:return d=_a(12,b,p,$|2),d.elementType=v,d.lanes=F,d;case O:return d=_a(13,b,p,$),d.elementType=O,d.lanes=F,d;case P:return d=_a(19,b,p,$),d.elementType=P,d.lanes=F,d;default:if(typeof d=="object"&&d!==null)switch(d.$$typeof){case w:case E:X=10;break e;case C:X=9;break e;case I:X=11;break e;case R:X=14;break e;case D:X=16,T=null;break e}X=29,b=Error(r(130,d===null?"null":typeof d,"")),T=null}return p=_a(X,b,p,$),p.elementType=d,p.type=T,p.lanes=F,p}function tp(d,p,b,T){return d=_a(7,d,T,p),d.lanes=b,d}function AA(d,p,b){return d=_a(6,d,null,p),d.lanes=b,d}function MA(d,p,b){return p=_a(4,d.children!==null?d.children:[],d.key,p),p.lanes=b,p.stateNode={containerInfo:d.containerInfo,pendingChildren:null,implementation:d.implementation},p}var pm=[],hm=0,gC=null,yC=0,bs=[],xs=0,np=null,ru=1,ou="";function rp(d,p){pm[hm++]=yC,pm[hm++]=gC,gC=d,yC=p}function _5(d,p,b){bs[xs++]=ru,bs[xs++]=ou,bs[xs++]=np,np=d;var T=ru;d=ou;var $=32-Be(T)-1;T&=~(1<<$),b+=1;var F=32-Be(p)+$;if(30<F){var X=$-$%5;F=(T&(1<<X)-1).toString(32),T>>=X,$-=X,ru=1<<32-Be(p)+$|b<<$|T,ou=F+d}else ru=1<<F|b<<$|T,ou=d}function RA(d){d.return!==null&&(rp(d,1),_5(d,1,0))}function DA(d){for(;d===gC;)gC=pm[--hm],pm[hm]=null,yC=pm[--hm],pm[hm]=null;for(;d===np;)np=bs[--xs],bs[xs]=null,ou=bs[--xs],bs[xs]=null,ru=bs[--xs],bs[xs]=null}var Ui=null,io=null,rr=!1,op=null,oc=!1,kA=Error(r(519));function ip(d){var p=Error(r(418,""));throw ub(ys(p,d)),kA}function $5(d){var p=d.stateNode,b=d.type,T=d.memoizedProps;switch(p[Ut]=d,p[Xt]=T,b){case"dialog":Fn("cancel",p),Fn("close",p);break;case"iframe":case"object":case"embed":Fn("load",p);break;case"video":case"audio":for(b=0;b<_b.length;b++)Fn(_b[b],p);break;case"source":Fn("error",p);break;case"img":case"image":case"link":Fn("error",p),Fn("load",p);break;case"details":Fn("toggle",p);break;case"input":Fn("invalid",p),QH(p,T.value,T.defaultValue,T.checked,T.defaultChecked,T.type,T.name,!0),rC(p);break;case"select":Fn("invalid",p);break;case"textarea":Fn("invalid",p),JH(p,T.value,T.defaultValue,T.children),rC(p)}b=T.children,typeof b!="string"&&typeof b!="number"&&typeof b!="bigint"||p.textContent===""+b||T.suppressHydrationWarning===!0||J4(p.textContent,b)?(T.popover!=null&&(Fn("beforetoggle",p),Fn("toggle",p)),T.onScroll!=null&&Fn("scroll",p),T.onScrollEnd!=null&&Fn("scrollend",p),T.onClick!=null&&(p.onclick=XC),p=!0):p=!1,p||ip(d)}function N5(d){for(Ui=d.return;Ui;)switch(Ui.tag){case 5:case 13:oc=!1;return;case 27:case 3:oc=!0;return;default:Ui=Ui.return}}function lb(d){if(d!==Ui)return!1;if(!rr)return N5(d),rr=!0,!1;var p=d.tag,b;if((b=p!==3&&p!==27)&&((b=p===5)&&(b=d.type,b=!(b!=="form"&&b!=="button")||YM(d.type,d.memoizedProps)),b=!b),b&&io&&ip(d),N5(d),p===13){if(d=d.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(r(317));e:{for(d=d.nextSibling,p=0;d;){if(d.nodeType===8)if(b=d.data,b==="/$"){if(p===0){io=hl(d.nextSibling);break e}p--}else b!=="$"&&b!=="$!"&&b!=="$?"||p++;d=d.nextSibling}io=null}}else p===27?(p=io,Pd(d.type)?(d=ZM,ZM=null,io=d):io=p):io=Ui?hl(d.stateNode.nextSibling):null;return!0}function cb(){io=Ui=null,rr=!1}function L5(){var d=op;return d!==null&&(pa===null?pa=d:pa.push.apply(pa,d),op=null),d}function ub(d){op===null?op=[d]:op.push(d)}var _A=q(null),ap=null,iu=null;function pd(d,p,b){Z(_A,p._currentValue),p._currentValue=b}function au(d){d._currentValue=_A.current,Y(_A)}function $A(d,p,b){for(;d!==null;){var T=d.alternate;if((d.childLanes&p)!==p?(d.childLanes|=p,T!==null&&(T.childLanes|=p)):T!==null&&(T.childLanes&p)!==p&&(T.childLanes|=p),d===b)break;d=d.return}}function NA(d,p,b,T){var $=d.child;for($!==null&&($.return=d);$!==null;){var F=$.dependencies;if(F!==null){var X=$.child;F=F.firstContext;e:for(;F!==null;){var re=F;F=$;for(var ge=0;ge<p.length;ge++)if(re.context===p[ge]){F.lanes|=b,re=F.alternate,re!==null&&(re.lanes|=b),$A(F.return,b,d),T||(X=null);break e}F=re.next}}else if($.tag===18){if(X=$.return,X===null)throw Error(r(341));X.lanes|=b,F=X.alternate,F!==null&&(F.lanes|=b),$A(X,b,d),X=null}else X=$.child;if(X!==null)X.return=$;else for(X=$;X!==null;){if(X===d){X=null;break}if($=X.sibling,$!==null){$.return=X.return,X=$;break}X=X.return}$=X}}function db(d,p,b,T){d=null;for(var $=p,F=!1;$!==null;){if(!F){if(($.flags&524288)!==0)F=!0;else if(($.flags&262144)!==0)break}if($.tag===10){var X=$.alternate;if(X===null)throw Error(r(387));if(X=X.memoizedProps,X!==null){var re=$.type;ka($.pendingProps.value,X.value)||(d!==null?d.push(re):d=[re])}}else if($===ye.current){if(X=$.alternate,X===null)throw Error(r(387));X.memoizedState.memoizedState!==$.memoizedState.memoizedState&&(d!==null?d.push(Bb):d=[Bb])}$=$.return}d!==null&&NA(p,d,b,T),p.flags|=262144}function vC(d){for(d=d.firstContext;d!==null;){if(!ka(d.context._currentValue,d.memoizedValue))return!0;d=d.next}return!1}function sp(d){ap=d,iu=null,d=d.dependencies,d!==null&&(d.firstContext=null)}function Pi(d){return F5(ap,d)}function bC(d,p){return ap===null&&sp(d),F5(d,p)}function F5(d,p){var b=p._currentValue;if(p={context:p,memoizedValue:b,next:null},iu===null){if(d===null)throw Error(r(308));iu=p,d.dependencies={lanes:0,firstContext:p},d.flags|=524288}else iu=iu.next=p;return b}var oge=typeof AbortController<"u"?AbortController:function(){var d=[],p=this.signal={aborted:!1,addEventListener:function(b,T){d.push(T)}};this.abort=function(){p.aborted=!0,d.forEach(function(b){return b()})}},ige=e.unstable_scheduleCallback,age=e.unstable_NormalPriority,$o={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function LA(){return{controller:new oge,data:new Map,refCount:0}}function fb(d){d.refCount--,d.refCount===0&&ige(age,function(){d.controller.abort()})}var pb=null,FA=0,mm=0,gm=null;function sge(d,p){if(pb===null){var b=pb=[];FA=0,mm=BM(),gm={status:"pending",value:void 0,then:function(T){b.push(T)}}}return FA++,p.then(j5,j5),p}function j5(){if(--FA===0&&pb!==null){gm!==null&&(gm.status="fulfilled");var d=pb;pb=null,mm=0,gm=null;for(var p=0;p<d.length;p++)(0,d[p])()}}function lge(d,p){var b=[],T={status:"pending",value:null,reason:null,then:function($){b.push($)}};return d.then(function(){T.status="fulfilled",T.value=p;for(var $=0;$<b.length;$++)(0,b[$])(p)},function($){for(T.status="rejected",T.reason=$,$=0;$<b.length;$++)(0,b[$])(void 0)}),T}var B5=L.S;L.S=function(d,p){typeof p=="object"&&p!==null&&typeof p.then=="function"&&sge(d,p),B5!==null&&B5(d,p)};var lp=q(null);function jA(){var d=lp.current;return d!==null?d:Dr.pooledCache}function xC(d,p){p===null?Z(lp,lp.current):Z(lp,p.pool)}function z5(){var d=jA();return d===null?null:{parent:$o._currentValue,pool:d}}var hb=Error(r(460)),V5=Error(r(474)),SC=Error(r(542)),BA={then:function(){}};function H5(d){return d=d.status,d==="fulfilled"||d==="rejected"}function wC(){}function U5(d,p,b){switch(b=d[b],b===void 0?d.push(p):b!==p&&(p.then(wC,wC),p=b),p.status){case"fulfilled":return p.value;case"rejected":throw d=p.reason,q5(d),d;default:if(typeof p.status=="string")p.then(wC,wC);else{if(d=Dr,d!==null&&100<d.shellSuspendCounter)throw Error(r(482));d=p,d.status="pending",d.then(function(T){if(p.status==="pending"){var $=p;$.status="fulfilled",$.value=T}},function(T){if(p.status==="pending"){var $=p;$.status="rejected",$.reason=T}})}switch(p.status){case"fulfilled":return p.value;case"rejected":throw d=p.reason,q5(d),d}throw mb=p,hb}}var mb=null;function G5(){if(mb===null)throw Error(r(459));var d=mb;return mb=null,d}function q5(d){if(d===hb||d===SC)throw Error(r(483))}var hd=!1;function zA(d){d.updateQueue={baseState:d.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function VA(d,p){d=d.updateQueue,p.updateQueue===d&&(p.updateQueue={baseState:d.baseState,firstBaseUpdate:d.firstBaseUpdate,lastBaseUpdate:d.lastBaseUpdate,shared:d.shared,callbacks:null})}function md(d){return{lane:d,tag:0,payload:null,callback:null,next:null}}function gd(d,p,b){var T=d.updateQueue;if(T===null)return null;if(T=T.shared,(mr&2)!==0){var $=T.pending;return $===null?p.next=p:(p.next=$.next,$.next=p),T.pending=p,p=hC(d),D5(d,null,b),p}return pC(d,T,p,b),hC(d)}function gb(d,p,b){if(p=p.updateQueue,p!==null&&(p=p.shared,(b&4194048)!==0)){var T=p.lanes;T&=d.pendingLanes,b|=T,p.lanes=b,oo(d,b)}}function HA(d,p){var b=d.updateQueue,T=d.alternate;if(T!==null&&(T=T.updateQueue,b===T)){var $=null,F=null;if(b=b.firstBaseUpdate,b!==null){do{var X={lane:b.lane,tag:b.tag,payload:b.payload,callback:null,next:null};F===null?$=F=X:F=F.next=X,b=b.next}while(b!==null);F===null?$=F=p:F=F.next=p}else $=F=p;b={baseState:T.baseState,firstBaseUpdate:$,lastBaseUpdate:F,shared:T.shared,callbacks:T.callbacks},d.updateQueue=b;return}d=b.lastBaseUpdate,d===null?b.firstBaseUpdate=p:d.next=p,b.lastBaseUpdate=p}var UA=!1;function yb(){if(UA){var d=gm;if(d!==null)throw d}}function vb(d,p,b,T){UA=!1;var $=d.updateQueue;hd=!1;var F=$.firstBaseUpdate,X=$.lastBaseUpdate,re=$.shared.pending;if(re!==null){$.shared.pending=null;var ge=re,Ne=ge.next;ge.next=null,X===null?F=Ne:X.next=Ne,X=ge;var Ze=d.alternate;Ze!==null&&(Ze=Ze.updateQueue,re=Ze.lastBaseUpdate,re!==X&&(re===null?Ze.firstBaseUpdate=Ne:re.next=Ne,Ze.lastBaseUpdate=ge))}if(F!==null){var ot=$.baseState;X=0,Ze=Ne=ge=null,re=F;do{var Fe=re.lane&-536870913,ze=Fe!==re.lane;if(ze?(qn&Fe)===Fe:(T&Fe)===Fe){Fe!==0&&Fe===mm&&(UA=!0),Ze!==null&&(Ze=Ze.next={lane:0,tag:re.tag,payload:re.payload,callback:null,next:null});e:{var fn=d,nn=re;Fe=p;var Sr=b;switch(nn.tag){case 1:if(fn=nn.payload,typeof fn=="function"){ot=fn.call(Sr,ot,Fe);break e}ot=fn;break e;case 3:fn.flags=fn.flags&-65537|128;case 0:if(fn=nn.payload,Fe=typeof fn=="function"?fn.call(Sr,ot,Fe):fn,Fe==null)break e;ot=u({},ot,Fe);break e;case 2:hd=!0}}Fe=re.callback,Fe!==null&&(d.flags|=64,ze&&(d.flags|=8192),ze=$.callbacks,ze===null?$.callbacks=[Fe]:ze.push(Fe))}else ze={lane:Fe,tag:re.tag,payload:re.payload,callback:re.callback,next:null},Ze===null?(Ne=Ze=ze,ge=ot):Ze=Ze.next=ze,X|=Fe;if(re=re.next,re===null){if(re=$.shared.pending,re===null)break;ze=re,re=ze.next,ze.next=null,$.lastBaseUpdate=ze,$.shared.pending=null}}while(!0);Ze===null&&(ge=ot),$.baseState=ge,$.firstBaseUpdate=Ne,$.lastBaseUpdate=Ze,F===null&&($.shared.lanes=0),Ed|=X,d.lanes=X,d.memoizedState=ot}}function W5(d,p){if(typeof d!="function")throw Error(r(191,d));d.call(p)}function K5(d,p){var b=d.callbacks;if(b!==null)for(d.callbacks=null,d=0;d<b.length;d++)W5(b[d],p)}var ym=q(null),CC=q(0);function Y5(d,p){d=pu,Z(CC,d),Z(ym,p),pu=d|p.baseLanes}function GA(){Z(CC,pu),Z(ym,ym.current)}function qA(){pu=CC.current,Y(ym),Y(CC)}var yd=0,Rn=null,br=null,Oo=null,EC=!1,vm=!1,cp=!1,TC=0,bb=0,bm=null,cge=0;function bo(){throw Error(r(321))}function WA(d,p){if(p===null)return!1;for(var b=0;b<p.length&&b<d.length;b++)if(!ka(d[b],p[b]))return!1;return!0}function KA(d,p,b,T,$,F){return yd=F,Rn=p,p.memoizedState=null,p.updateQueue=null,p.lanes=0,L.H=d===null||d.memoizedState===null?DU:kU,cp=!1,F=b(T,$),cp=!1,vm&&(F=X5(p,b,T,$)),Q5(d),F}function Q5(d){L.H=RC;var p=br!==null&&br.next!==null;if(yd=0,Oo=br=Rn=null,EC=!1,bb=0,bm=null,p)throw Error(r(300));d===null||Jo||(d=d.dependencies,d!==null&&vC(d)&&(Jo=!0))}function X5(d,p,b,T){Rn=d;var $=0;do{if(vm&&(bm=null),bb=0,vm=!1,25<=$)throw Error(r(301));if($+=1,Oo=br=null,d.updateQueue!=null){var F=d.updateQueue;F.lastEffect=null,F.events=null,F.stores=null,F.memoCache!=null&&(F.memoCache.index=0)}L.H=gge,F=p(b,T)}while(vm);return F}function uge(){var d=L.H,p=d.useState()[0];return p=typeof p.then=="function"?xb(p):p,d=d.useState()[0],(br!==null?br.memoizedState:null)!==d&&(Rn.flags|=1024),p}function YA(){var d=TC!==0;return TC=0,d}function QA(d,p,b){p.updateQueue=d.updateQueue,p.flags&=-2053,d.lanes&=~b}function XA(d){if(EC){for(d=d.memoizedState;d!==null;){var p=d.queue;p!==null&&(p.pending=null),d=d.next}EC=!1}yd=0,Oo=br=Rn=null,vm=!1,bb=TC=0,bm=null}function da(){var d={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Oo===null?Rn.memoizedState=Oo=d:Oo=Oo.next=d,Oo}function Io(){if(br===null){var d=Rn.alternate;d=d!==null?d.memoizedState:null}else d=br.next;var p=Oo===null?Rn.memoizedState:Oo.next;if(p!==null)Oo=p,br=d;else{if(d===null)throw Rn.alternate===null?Error(r(467)):Error(r(310));br=d,d={memoizedState:br.memoizedState,baseState:br.baseState,baseQueue:br.baseQueue,queue:br.queue,next:null},Oo===null?Rn.memoizedState=Oo=d:Oo=Oo.next=d}return Oo}function JA(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function xb(d){var p=bb;return bb+=1,bm===null&&(bm=[]),d=U5(bm,d,p),p=Rn,(Oo===null?p.memoizedState:Oo.next)===null&&(p=p.alternate,L.H=p===null||p.memoizedState===null?DU:kU),d}function OC(d){if(d!==null&&typeof d=="object"){if(typeof d.then=="function")return xb(d);if(d.$$typeof===E)return Pi(d)}throw Error(r(438,String(d)))}function ZA(d){var p=null,b=Rn.updateQueue;if(b!==null&&(p=b.memoCache),p==null){var T=Rn.alternate;T!==null&&(T=T.updateQueue,T!==null&&(T=T.memoCache,T!=null&&(p={data:T.data.map(function($){return $.slice()}),index:0})))}if(p==null&&(p={data:[],index:0}),b===null&&(b=JA(),Rn.updateQueue=b),b.memoCache=p,b=p.data[p.index],b===void 0)for(b=p.data[p.index]=Array(d),T=0;T<d;T++)b[T]=A;return p.index++,b}function su(d,p){return typeof p=="function"?p(d):p}function IC(d){var p=Io();return eM(p,br,d)}function eM(d,p,b){var T=d.queue;if(T===null)throw Error(r(311));T.lastRenderedReducer=b;var $=d.baseQueue,F=T.pending;if(F!==null){if($!==null){var X=$.next;$.next=F.next,F.next=X}p.baseQueue=$=F,T.pending=null}if(F=d.baseState,$===null)d.memoizedState=F;else{p=$.next;var re=X=null,ge=null,Ne=p,Ze=!1;do{var ot=Ne.lane&-536870913;if(ot!==Ne.lane?(qn&ot)===ot:(yd&ot)===ot){var Fe=Ne.revertLane;if(Fe===0)ge!==null&&(ge=ge.next={lane:0,revertLane:0,action:Ne.action,hasEagerState:Ne.hasEagerState,eagerState:Ne.eagerState,next:null}),ot===mm&&(Ze=!0);else if((yd&Fe)===Fe){Ne=Ne.next,Fe===mm&&(Ze=!0);continue}else ot={lane:0,revertLane:Ne.revertLane,action:Ne.action,hasEagerState:Ne.hasEagerState,eagerState:Ne.eagerState,next:null},ge===null?(re=ge=ot,X=F):ge=ge.next=ot,Rn.lanes|=Fe,Ed|=Fe;ot=Ne.action,cp&&b(F,ot),F=Ne.hasEagerState?Ne.eagerState:b(F,ot)}else Fe={lane:ot,revertLane:Ne.revertLane,action:Ne.action,hasEagerState:Ne.hasEagerState,eagerState:Ne.eagerState,next:null},ge===null?(re=ge=Fe,X=F):ge=ge.next=Fe,Rn.lanes|=ot,Ed|=ot;Ne=Ne.next}while(Ne!==null&&Ne!==p);if(ge===null?X=F:ge.next=re,!ka(F,d.memoizedState)&&(Jo=!0,Ze&&(b=gm,b!==null)))throw b;d.memoizedState=F,d.baseState=X,d.baseQueue=ge,T.lastRenderedState=F}return $===null&&(T.lanes=0),[d.memoizedState,T.dispatch]}function tM(d){var p=Io(),b=p.queue;if(b===null)throw Error(r(311));b.lastRenderedReducer=d;var T=b.dispatch,$=b.pending,F=p.memoizedState;if($!==null){b.pending=null;var X=$=$.next;do F=d(F,X.action),X=X.next;while(X!==$);ka(F,p.memoizedState)||(Jo=!0),p.memoizedState=F,p.baseQueue===null&&(p.baseState=F),b.lastRenderedState=F}return[F,T]}function J5(d,p,b){var T=Rn,$=Io(),F=rr;if(F){if(b===void 0)throw Error(r(407));b=b()}else b=p();var X=!ka((br||$).memoizedState,b);X&&($.memoizedState=b,Jo=!0),$=$.queue;var re=tU.bind(null,T,$,d);if(Sb(2048,8,re,[d]),$.getSnapshot!==p||X||Oo!==null&&Oo.memoizedState.tag&1){if(T.flags|=2048,xm(9,PC(),eU.bind(null,T,$,b,p),null),Dr===null)throw Error(r(349));F||(yd&124)!==0||Z5(T,p,b)}return b}function Z5(d,p,b){d.flags|=16384,d={getSnapshot:p,value:b},p=Rn.updateQueue,p===null?(p=JA(),Rn.updateQueue=p,p.stores=[d]):(b=p.stores,b===null?p.stores=[d]:b.push(d))}function eU(d,p,b,T){p.value=b,p.getSnapshot=T,nU(p)&&rU(d)}function tU(d,p,b){return b(function(){nU(p)&&rU(d)})}function nU(d){var p=d.getSnapshot;d=d.value;try{var b=p();return!ka(d,b)}catch{return!0}}function rU(d){var p=dm(d,2);p!==null&&ja(p,d,2)}function nM(d){var p=da();if(typeof d=="function"){var b=d;if(d=b(),cp){ut(!0);try{b()}finally{ut(!1)}}}return p.memoizedState=p.baseState=d,p.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:su,lastRenderedState:d},p}function oU(d,p,b,T){return d.baseState=b,eM(d,br,typeof T=="function"?T:su)}function dge(d,p,b,T,$){if(MC(d))throw Error(r(485));if(d=p.action,d!==null){var F={payload:$,action:d,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(X){F.listeners.push(X)}};L.T!==null?b(!0):F.isTransition=!1,T(F),b=p.pending,b===null?(F.next=p.pending=F,iU(p,F)):(F.next=b.next,p.pending=b.next=F)}}function iU(d,p){var b=p.action,T=p.payload,$=d.state;if(p.isTransition){var F=L.T,X={};L.T=X;try{var re=b($,T),ge=L.S;ge!==null&&ge(X,re),aU(d,p,re)}catch(Ne){rM(d,p,Ne)}finally{L.T=F}}else try{F=b($,T),aU(d,p,F)}catch(Ne){rM(d,p,Ne)}}function aU(d,p,b){b!==null&&typeof b=="object"&&typeof b.then=="function"?b.then(function(T){sU(d,p,T)},function(T){return rM(d,p,T)}):sU(d,p,b)}function sU(d,p,b){p.status="fulfilled",p.value=b,lU(p),d.state=b,p=d.pending,p!==null&&(b=p.next,b===p?d.pending=null:(b=b.next,p.next=b,iU(d,b)))}function rM(d,p,b){var T=d.pending;if(d.pending=null,T!==null){T=T.next;do p.status="rejected",p.reason=b,lU(p),p=p.next;while(p!==T)}d.action=null}function lU(d){d=d.listeners;for(var p=0;p<d.length;p++)(0,d[p])()}function cU(d,p){return p}function uU(d,p){if(rr){var b=Dr.formState;if(b!==null){e:{var T=Rn;if(rr){if(io){t:{for(var $=io,F=oc;$.nodeType!==8;){if(!F){$=null;break t}if($=hl($.nextSibling),$===null){$=null;break t}}F=$.data,$=F==="F!"||F==="F"?$:null}if($){io=hl($.nextSibling),T=$.data==="F!";break e}}ip(T)}T=!1}T&&(p=b[0])}}return b=da(),b.memoizedState=b.baseState=p,T={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cU,lastRenderedState:p},b.queue=T,b=AU.bind(null,Rn,T),T.dispatch=b,T=nM(!1),F=lM.bind(null,Rn,!1,T.queue),T=da(),$={state:p,dispatch:null,action:d,pending:null},T.queue=$,b=dge.bind(null,Rn,$,F,b),$.dispatch=b,T.memoizedState=d,[p,b,!1]}function dU(d){var p=Io();return fU(p,br,d)}function fU(d,p,b){if(p=eM(d,p,cU)[0],d=IC(su)[0],typeof p=="object"&&p!==null&&typeof p.then=="function")try{var T=xb(p)}catch(X){throw X===hb?SC:X}else T=p;p=Io();var $=p.queue,F=$.dispatch;return b!==p.memoizedState&&(Rn.flags|=2048,xm(9,PC(),fge.bind(null,$,b),null)),[T,F,d]}function fge(d,p){d.action=p}function pU(d){var p=Io(),b=br;if(b!==null)return fU(p,b,d);Io(),p=p.memoizedState,b=Io();var T=b.queue.dispatch;return b.memoizedState=d,[p,T,!1]}function xm(d,p,b,T){return d={tag:d,create:b,deps:T,inst:p,next:null},p=Rn.updateQueue,p===null&&(p=JA(),Rn.updateQueue=p),b=p.lastEffect,b===null?p.lastEffect=d.next=d:(T=b.next,b.next=d,d.next=T,p.lastEffect=d),d}function PC(){return{destroy:void 0,resource:void 0}}function hU(){return Io().memoizedState}function AC(d,p,b,T){var $=da();T=T===void 0?null:T,Rn.flags|=d,$.memoizedState=xm(1|p,PC(),b,T)}function Sb(d,p,b,T){var $=Io();T=T===void 0?null:T;var F=$.memoizedState.inst;br!==null&&T!==null&&WA(T,br.memoizedState.deps)?$.memoizedState=xm(p,F,b,T):(Rn.flags|=d,$.memoizedState=xm(1|p,F,b,T))}function mU(d,p){AC(8390656,8,d,p)}function gU(d,p){Sb(2048,8,d,p)}function yU(d,p){return Sb(4,2,d,p)}function vU(d,p){return Sb(4,4,d,p)}function bU(d,p){if(typeof p=="function"){d=d();var b=p(d);return function(){typeof b=="function"?b():p(null)}}if(p!=null)return d=d(),p.current=d,function(){p.current=null}}function xU(d,p,b){b=b!=null?b.concat([d]):null,Sb(4,4,bU.bind(null,p,d),b)}function oM(){}function SU(d,p){var b=Io();p=p===void 0?null:p;var T=b.memoizedState;return p!==null&&WA(p,T[1])?T[0]:(b.memoizedState=[d,p],d)}function wU(d,p){var b=Io();p=p===void 0?null:p;var T=b.memoizedState;if(p!==null&&WA(p,T[1]))return T[0];if(T=d(),cp){ut(!0);try{d()}finally{ut(!1)}}return b.memoizedState=[T,p],T}function iM(d,p,b){return b===void 0||(yd&1073741824)!==0?d.memoizedState=p:(d.memoizedState=b,d=T4(),Rn.lanes|=d,Ed|=d,b)}function CU(d,p,b,T){return ka(b,p)?b:ym.current!==null?(d=iM(d,b,T),ka(d,p)||(Jo=!0),d):(yd&42)===0?(Jo=!0,d.memoizedState=b):(d=T4(),Rn.lanes|=d,Ed|=d,p)}function EU(d,p,b,T,$){var F=V.p;V.p=F!==0&&8>F?F:8;var X=L.T,re={};L.T=re,lM(d,!1,p,b);try{var ge=$(),Ne=L.S;if(Ne!==null&&Ne(re,ge),ge!==null&&typeof ge=="object"&&typeof ge.then=="function"){var Ze=lge(ge,T);wb(d,p,Ze,Fa(d))}else wb(d,p,T,Fa(d))}catch(ot){wb(d,p,{then:function(){},status:"rejected",reason:ot},Fa())}finally{V.p=F,L.T=X}}function pge(){}function aM(d,p,b,T){if(d.tag!==5)throw Error(r(476));var $=TU(d).queue;EU(d,$,p,W,b===null?pge:function(){return OU(d),b(T)})}function TU(d){var p=d.memoizedState;if(p!==null)return p;p={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:su,lastRenderedState:W},next:null};var b={};return p.next={memoizedState:b,baseState:b,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:su,lastRenderedState:b},next:null},d.memoizedState=p,d=d.alternate,d!==null&&(d.memoizedState=p),p}function OU(d){var p=TU(d).next.queue;wb(d,p,{},Fa())}function sM(){return Pi(Bb)}function IU(){return Io().memoizedState}function PU(){return Io().memoizedState}function hge(d){for(var p=d.return;p!==null;){switch(p.tag){case 24:case 3:var b=Fa();d=md(b);var T=gd(p,d,b);T!==null&&(ja(T,p,b),gb(T,p,b)),p={cache:LA()},d.payload=p;return}p=p.return}}function mge(d,p,b){var T=Fa();b={lane:T,revertLane:0,action:b,hasEagerState:!1,eagerState:null,next:null},MC(d)?MU(p,b):(b=IA(d,p,b,T),b!==null&&(ja(b,d,T),RU(b,p,T)))}function AU(d,p,b){var T=Fa();wb(d,p,b,T)}function wb(d,p,b,T){var $={lane:T,revertLane:0,action:b,hasEagerState:!1,eagerState:null,next:null};if(MC(d))MU(p,$);else{var F=d.alternate;if(d.lanes===0&&(F===null||F.lanes===0)&&(F=p.lastRenderedReducer,F!==null))try{var X=p.lastRenderedState,re=F(X,b);if($.hasEagerState=!0,$.eagerState=re,ka(re,X))return pC(d,p,$,0),Dr===null&&fC(),!1}catch{}finally{}if(b=IA(d,p,$,T),b!==null)return ja(b,d,T),RU(b,p,T),!0}return!1}function lM(d,p,b,T){if(T={lane:2,revertLane:BM(),action:T,hasEagerState:!1,eagerState:null,next:null},MC(d)){if(p)throw Error(r(479))}else p=IA(d,b,T,2),p!==null&&ja(p,d,2)}function MC(d){var p=d.alternate;return d===Rn||p!==null&&p===Rn}function MU(d,p){vm=EC=!0;var b=d.pending;b===null?p.next=p:(p.next=b.next,b.next=p),d.pending=p}function RU(d,p,b){if((b&4194048)!==0){var T=p.lanes;T&=d.pendingLanes,b|=T,p.lanes=b,oo(d,b)}}var RC={readContext:Pi,use:OC,useCallback:bo,useContext:bo,useEffect:bo,useImperativeHandle:bo,useLayoutEffect:bo,useInsertionEffect:bo,useMemo:bo,useReducer:bo,useRef:bo,useState:bo,useDebugValue:bo,useDeferredValue:bo,useTransition:bo,useSyncExternalStore:bo,useId:bo,useHostTransitionStatus:bo,useFormState:bo,useActionState:bo,useOptimistic:bo,useMemoCache:bo,useCacheRefresh:bo},DU={readContext:Pi,use:OC,useCallback:function(d,p){return da().memoizedState=[d,p===void 0?null:p],d},useContext:Pi,useEffect:mU,useImperativeHandle:function(d,p,b){b=b!=null?b.concat([d]):null,AC(4194308,4,bU.bind(null,p,d),b)},useLayoutEffect:function(d,p){return AC(4194308,4,d,p)},useInsertionEffect:function(d,p){AC(4,2,d,p)},useMemo:function(d,p){var b=da();p=p===void 0?null:p;var T=d();if(cp){ut(!0);try{d()}finally{ut(!1)}}return b.memoizedState=[T,p],T},useReducer:function(d,p,b){var T=da();if(b!==void 0){var $=b(p);if(cp){ut(!0);try{b(p)}finally{ut(!1)}}}else $=p;return T.memoizedState=T.baseState=$,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:d,lastRenderedState:$},T.queue=d,d=d.dispatch=mge.bind(null,Rn,d),[T.memoizedState,d]},useRef:function(d){var p=da();return d={current:d},p.memoizedState=d},useState:function(d){d=nM(d);var p=d.queue,b=AU.bind(null,Rn,p);return p.dispatch=b,[d.memoizedState,b]},useDebugValue:oM,useDeferredValue:function(d,p){var b=da();return iM(b,d,p)},useTransition:function(){var d=nM(!1);return d=EU.bind(null,Rn,d.queue,!0,!1),da().memoizedState=d,[!1,d]},useSyncExternalStore:function(d,p,b){var T=Rn,$=da();if(rr){if(b===void 0)throw Error(r(407));b=b()}else{if(b=p(),Dr===null)throw Error(r(349));(qn&124)!==0||Z5(T,p,b)}$.memoizedState=b;var F={value:b,getSnapshot:p};return $.queue=F,mU(tU.bind(null,T,F,d),[d]),T.flags|=2048,xm(9,PC(),eU.bind(null,T,F,b,p),null),b},useId:function(){var d=da(),p=Dr.identifierPrefix;if(rr){var b=ou,T=ru;b=(T&~(1<<32-Be(T)-1)).toString(32)+b,p="«"+p+"R"+b,b=TC++,0<b&&(p+="H"+b.toString(32)),p+="»"}else b=cge++,p="«"+p+"r"+b.toString(32)+"»";return d.memoizedState=p},useHostTransitionStatus:sM,useFormState:uU,useActionState:uU,useOptimistic:function(d){var p=da();p.memoizedState=p.baseState=d;var b={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return p.queue=b,p=lM.bind(null,Rn,!0,b),b.dispatch=p,[d,p]},useMemoCache:ZA,useCacheRefresh:function(){return da().memoizedState=hge.bind(null,Rn)}},kU={readContext:Pi,use:OC,useCallback:SU,useContext:Pi,useEffect:gU,useImperativeHandle:xU,useInsertionEffect:yU,useLayoutEffect:vU,useMemo:wU,useReducer:IC,useRef:hU,useState:function(){return IC(su)},useDebugValue:oM,useDeferredValue:function(d,p){var b=Io();return CU(b,br.memoizedState,d,p)},useTransition:function(){var d=IC(su)[0],p=Io().memoizedState;return[typeof d=="boolean"?d:xb(d),p]},useSyncExternalStore:J5,useId:IU,useHostTransitionStatus:sM,useFormState:dU,useActionState:dU,useOptimistic:function(d,p){var b=Io();return oU(b,br,d,p)},useMemoCache:ZA,useCacheRefresh:PU},gge={readContext:Pi,use:OC,useCallback:SU,useContext:Pi,useEffect:gU,useImperativeHandle:xU,useInsertionEffect:yU,useLayoutEffect:vU,useMemo:wU,useReducer:tM,useRef:hU,useState:function(){return tM(su)},useDebugValue:oM,useDeferredValue:function(d,p){var b=Io();return br===null?iM(b,d,p):CU(b,br.memoizedState,d,p)},useTransition:function(){var d=tM(su)[0],p=Io().memoizedState;return[typeof d=="boolean"?d:xb(d),p]},useSyncExternalStore:J5,useId:IU,useHostTransitionStatus:sM,useFormState:pU,useActionState:pU,useOptimistic:function(d,p){var b=Io();return br!==null?oU(b,br,d,p):(b.baseState=d,[d,b.queue.dispatch])},useMemoCache:ZA,useCacheRefresh:PU},Sm=null,Cb=0;function DC(d){var p=Cb;return Cb+=1,Sm===null&&(Sm=[]),U5(Sm,d,p)}function Eb(d,p){p=p.props.ref,d.ref=p!==void 0?p:null}function kC(d,p){throw p.$$typeof===f?Error(r(525)):(d=Object.prototype.toString.call(p),Error(r(31,d==="[object Object]"?"object with keys {"+Object.keys(p).join(", ")+"}":d)))}function _U(d){var p=d._init;return p(d._payload)}function $U(d){function p(Ae,we){if(d){var _e=Ae.deletions;_e===null?(Ae.deletions=[we],Ae.flags|=16):_e.push(we)}}function b(Ae,we){if(!d)return null;for(;we!==null;)p(Ae,we),we=we.sibling;return null}function T(Ae){for(var we=new Map;Ae!==null;)Ae.key!==null?we.set(Ae.key,Ae):we.set(Ae.index,Ae),Ae=Ae.sibling;return we}function $(Ae,we){return Ae=nu(Ae,we),Ae.index=0,Ae.sibling=null,Ae}function F(Ae,we,_e){return Ae.index=_e,d?(_e=Ae.alternate,_e!==null?(_e=_e.index,_e<we?(Ae.flags|=67108866,we):_e):(Ae.flags|=67108866,we)):(Ae.flags|=1048576,we)}function X(Ae){return d&&Ae.alternate===null&&(Ae.flags|=67108866),Ae}function re(Ae,we,_e,tt){return we===null||we.tag!==6?(we=AA(_e,Ae.mode,tt),we.return=Ae,we):(we=$(we,_e),we.return=Ae,we)}function ge(Ae,we,_e,tt){var Bt=_e.type;return Bt===g?Ze(Ae,we,_e.props.children,tt,_e.key):we!==null&&(we.elementType===Bt||typeof Bt=="object"&&Bt!==null&&Bt.$$typeof===D&&_U(Bt)===we.type)?(we=$(we,_e.props),Eb(we,_e),we.return=Ae,we):(we=mC(_e.type,_e.key,_e.props,null,Ae.mode,tt),Eb(we,_e),we.return=Ae,we)}function Ne(Ae,we,_e,tt){return we===null||we.tag!==4||we.stateNode.containerInfo!==_e.containerInfo||we.stateNode.implementation!==_e.implementation?(we=MA(_e,Ae.mode,tt),we.return=Ae,we):(we=$(we,_e.children||[]),we.return=Ae,we)}function Ze(Ae,we,_e,tt,Bt){return we===null||we.tag!==7?(we=tp(_e,Ae.mode,tt,Bt),we.return=Ae,we):(we=$(we,_e),we.return=Ae,we)}function ot(Ae,we,_e){if(typeof we=="string"&&we!==""||typeof we=="number"||typeof we=="bigint")return we=AA(""+we,Ae.mode,_e),we.return=Ae,we;if(typeof we=="object"&&we!==null){switch(we.$$typeof){case h:return _e=mC(we.type,we.key,we.props,null,Ae.mode,_e),Eb(_e,we),_e.return=Ae,_e;case m:return we=MA(we,Ae.mode,_e),we.return=Ae,we;case D:var tt=we._init;return we=tt(we._payload),ot(Ae,we,_e)}if(j(we)||N(we))return we=tp(we,Ae.mode,_e,null),we.return=Ae,we;if(typeof we.then=="function")return ot(Ae,DC(we),_e);if(we.$$typeof===E)return ot(Ae,bC(Ae,we),_e);kC(Ae,we)}return null}function Fe(Ae,we,_e,tt){var Bt=we!==null?we.key:null;if(typeof _e=="string"&&_e!==""||typeof _e=="number"||typeof _e=="bigint")return Bt!==null?null:re(Ae,we,""+_e,tt);if(typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case h:return _e.key===Bt?ge(Ae,we,_e,tt):null;case m:return _e.key===Bt?Ne(Ae,we,_e,tt):null;case D:return Bt=_e._init,_e=Bt(_e._payload),Fe(Ae,we,_e,tt)}if(j(_e)||N(_e))return Bt!==null?null:Ze(Ae,we,_e,tt,null);if(typeof _e.then=="function")return Fe(Ae,we,DC(_e),tt);if(_e.$$typeof===E)return Fe(Ae,we,bC(Ae,_e),tt);kC(Ae,_e)}return null}function ze(Ae,we,_e,tt,Bt){if(typeof tt=="string"&&tt!==""||typeof tt=="number"||typeof tt=="bigint")return Ae=Ae.get(_e)||null,re(we,Ae,""+tt,Bt);if(typeof tt=="object"&&tt!==null){switch(tt.$$typeof){case h:return Ae=Ae.get(tt.key===null?_e:tt.key)||null,ge(we,Ae,tt,Bt);case m:return Ae=Ae.get(tt.key===null?_e:tt.key)||null,Ne(we,Ae,tt,Bt);case D:var _n=tt._init;return tt=_n(tt._payload),ze(Ae,we,_e,tt,Bt)}if(j(tt)||N(tt))return Ae=Ae.get(_e)||null,Ze(we,Ae,tt,Bt,null);if(typeof tt.then=="function")return ze(Ae,we,_e,DC(tt),Bt);if(tt.$$typeof===E)return ze(Ae,we,_e,bC(we,tt),Bt);kC(we,tt)}return null}function fn(Ae,we,_e,tt){for(var Bt=null,_n=null,qt=we,an=we=0,ei=null;qt!==null&&an<_e.length;an++){qt.index>an?(ei=qt,qt=null):ei=qt.sibling;var Jn=Fe(Ae,qt,_e[an],tt);if(Jn===null){qt===null&&(qt=ei);break}d&&qt&&Jn.alternate===null&&p(Ae,qt),we=F(Jn,we,an),_n===null?Bt=Jn:_n.sibling=Jn,_n=Jn,qt=ei}if(an===_e.length)return b(Ae,qt),rr&&rp(Ae,an),Bt;if(qt===null){for(;an<_e.length;an++)qt=ot(Ae,_e[an],tt),qt!==null&&(we=F(qt,we,an),_n===null?Bt=qt:_n.sibling=qt,_n=qt);return rr&&rp(Ae,an),Bt}for(qt=T(qt);an<_e.length;an++)ei=ze(qt,Ae,an,_e[an],tt),ei!==null&&(d&&ei.alternate!==null&&qt.delete(ei.key===null?an:ei.key),we=F(ei,we,an),_n===null?Bt=ei:_n.sibling=ei,_n=ei);return d&&qt.forEach(function(kd){return p(Ae,kd)}),rr&&rp(Ae,an),Bt}function nn(Ae,we,_e,tt){if(_e==null)throw Error(r(151));for(var Bt=null,_n=null,qt=we,an=we=0,ei=null,Jn=_e.next();qt!==null&&!Jn.done;an++,Jn=_e.next()){qt.index>an?(ei=qt,qt=null):ei=qt.sibling;var kd=Fe(Ae,qt,Jn.value,tt);if(kd===null){qt===null&&(qt=ei);break}d&&qt&&kd.alternate===null&&p(Ae,qt),we=F(kd,we,an),_n===null?Bt=kd:_n.sibling=kd,_n=kd,qt=ei}if(Jn.done)return b(Ae,qt),rr&&rp(Ae,an),Bt;if(qt===null){for(;!Jn.done;an++,Jn=_e.next())Jn=ot(Ae,Jn.value,tt),Jn!==null&&(we=F(Jn,we,an),_n===null?Bt=Jn:_n.sibling=Jn,_n=Jn);return rr&&rp(Ae,an),Bt}for(qt=T(qt);!Jn.done;an++,Jn=_e.next())Jn=ze(qt,Ae,an,Jn.value,tt),Jn!==null&&(d&&Jn.alternate!==null&&qt.delete(Jn.key===null?an:Jn.key),we=F(Jn,we,an),_n===null?Bt=Jn:_n.sibling=Jn,_n=Jn);return d&&qt.forEach(function(yye){return p(Ae,yye)}),rr&&rp(Ae,an),Bt}function Sr(Ae,we,_e,tt){if(typeof _e=="object"&&_e!==null&&_e.type===g&&_e.key===null&&(_e=_e.props.children),typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case h:e:{for(var Bt=_e.key;we!==null;){if(we.key===Bt){if(Bt=_e.type,Bt===g){if(we.tag===7){b(Ae,we.sibling),tt=$(we,_e.props.children),tt.return=Ae,Ae=tt;break e}}else if(we.elementType===Bt||typeof Bt=="object"&&Bt!==null&&Bt.$$typeof===D&&_U(Bt)===we.type){b(Ae,we.sibling),tt=$(we,_e.props),Eb(tt,_e),tt.return=Ae,Ae=tt;break e}b(Ae,we);break}else p(Ae,we);we=we.sibling}_e.type===g?(tt=tp(_e.props.children,Ae.mode,tt,_e.key),tt.return=Ae,Ae=tt):(tt=mC(_e.type,_e.key,_e.props,null,Ae.mode,tt),Eb(tt,_e),tt.return=Ae,Ae=tt)}return X(Ae);case m:e:{for(Bt=_e.key;we!==null;){if(we.key===Bt)if(we.tag===4&&we.stateNode.containerInfo===_e.containerInfo&&we.stateNode.implementation===_e.implementation){b(Ae,we.sibling),tt=$(we,_e.children||[]),tt.return=Ae,Ae=tt;break e}else{b(Ae,we);break}else p(Ae,we);we=we.sibling}tt=MA(_e,Ae.mode,tt),tt.return=Ae,Ae=tt}return X(Ae);case D:return Bt=_e._init,_e=Bt(_e._payload),Sr(Ae,we,_e,tt)}if(j(_e))return fn(Ae,we,_e,tt);if(N(_e)){if(Bt=N(_e),typeof Bt!="function")throw Error(r(150));return _e=Bt.call(_e),nn(Ae,we,_e,tt)}if(typeof _e.then=="function")return Sr(Ae,we,DC(_e),tt);if(_e.$$typeof===E)return Sr(Ae,we,bC(Ae,_e),tt);kC(Ae,_e)}return typeof _e=="string"&&_e!==""||typeof _e=="number"||typeof _e=="bigint"?(_e=""+_e,we!==null&&we.tag===6?(b(Ae,we.sibling),tt=$(we,_e),tt.return=Ae,Ae=tt):(b(Ae,we),tt=AA(_e,Ae.mode,tt),tt.return=Ae,Ae=tt),X(Ae)):b(Ae,we)}return function(Ae,we,_e,tt){try{Cb=0;var Bt=Sr(Ae,we,_e,tt);return Sm=null,Bt}catch(qt){if(qt===hb||qt===SC)throw qt;var _n=_a(29,qt,null,Ae.mode);return _n.lanes=tt,_n.return=Ae,_n}finally{}}}var wm=$U(!0),NU=$U(!1),Ss=q(null),ic=null;function vd(d){var p=d.alternate;Z(No,No.current&1),Z(Ss,d),ic===null&&(p===null||ym.current!==null||p.memoizedState!==null)&&(ic=d)}function LU(d){if(d.tag===22){if(Z(No,No.current),Z(Ss,d),ic===null){var p=d.alternate;p!==null&&p.memoizedState!==null&&(ic=d)}}else bd()}function bd(){Z(No,No.current),Z(Ss,Ss.current)}function lu(d){Y(Ss),ic===d&&(ic=null),Y(No)}var No=q(0);function _C(d){for(var p=d;p!==null;){if(p.tag===13){var b=p.memoizedState;if(b!==null&&(b=b.dehydrated,b===null||b.data==="$?"||JM(b)))return p}else if(p.tag===19&&p.memoizedProps.revealOrder!==void 0){if((p.flags&128)!==0)return p}else if(p.child!==null){p.child.return=p,p=p.child;continue}if(p===d)break;for(;p.sibling===null;){if(p.return===null||p.return===d)return null;p=p.return}p.sibling.return=p.return,p=p.sibling}return null}function cM(d,p,b,T){p=d.memoizedState,b=b(T,p),b=b==null?p:u({},p,b),d.memoizedState=b,d.lanes===0&&(d.updateQueue.baseState=b)}var uM={enqueueSetState:function(d,p,b){d=d._reactInternals;var T=Fa(),$=md(T);$.payload=p,b!=null&&($.callback=b),p=gd(d,$,T),p!==null&&(ja(p,d,T),gb(p,d,T))},enqueueReplaceState:function(d,p,b){d=d._reactInternals;var T=Fa(),$=md(T);$.tag=1,$.payload=p,b!=null&&($.callback=b),p=gd(d,$,T),p!==null&&(ja(p,d,T),gb(p,d,T))},enqueueForceUpdate:function(d,p){d=d._reactInternals;var b=Fa(),T=md(b);T.tag=2,p!=null&&(T.callback=p),p=gd(d,T,b),p!==null&&(ja(p,d,b),gb(p,d,b))}};function FU(d,p,b,T,$,F,X){return d=d.stateNode,typeof d.shouldComponentUpdate=="function"?d.shouldComponentUpdate(T,F,X):p.prototype&&p.prototype.isPureReactComponent?!ab(b,T)||!ab($,F):!0}function jU(d,p,b,T){d=p.state,typeof p.componentWillReceiveProps=="function"&&p.componentWillReceiveProps(b,T),typeof p.UNSAFE_componentWillReceiveProps=="function"&&p.UNSAFE_componentWillReceiveProps(b,T),p.state!==d&&uM.enqueueReplaceState(p,p.state,null)}function up(d,p){var b=p;if("ref"in p){b={};for(var T in p)T!=="ref"&&(b[T]=p[T])}if(d=d.defaultProps){b===p&&(b=u({},b));for(var $ in d)b[$]===void 0&&(b[$]=d[$])}return b}var $C=typeof reportError=="function"?reportError:function(d){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var p=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof d=="object"&&d!==null&&typeof d.message=="string"?String(d.message):String(d),error:d});if(!window.dispatchEvent(p))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",d);return}console.error(d)};function BU(d){$C(d)}function zU(d){console.error(d)}function VU(d){$C(d)}function NC(d,p){try{var b=d.onUncaughtError;b(p.value,{componentStack:p.stack})}catch(T){setTimeout(function(){throw T})}}function HU(d,p,b){try{var T=d.onCaughtError;T(b.value,{componentStack:b.stack,errorBoundary:p.tag===1?p.stateNode:null})}catch($){setTimeout(function(){throw $})}}function dM(d,p,b){return b=md(b),b.tag=3,b.payload={element:null},b.callback=function(){NC(d,p)},b}function UU(d){return d=md(d),d.tag=3,d}function GU(d,p,b,T){var $=b.type.getDerivedStateFromError;if(typeof $=="function"){var F=T.value;d.payload=function(){return $(F)},d.callback=function(){HU(p,b,T)}}var X=b.stateNode;X!==null&&typeof X.componentDidCatch=="function"&&(d.callback=function(){HU(p,b,T),typeof $!="function"&&(Td===null?Td=new Set([this]):Td.add(this));var re=T.stack;this.componentDidCatch(T.value,{componentStack:re!==null?re:""})})}function yge(d,p,b,T,$){if(b.flags|=32768,T!==null&&typeof T=="object"&&typeof T.then=="function"){if(p=b.alternate,p!==null&&db(p,b,$,!0),b=Ss.current,b!==null){switch(b.tag){case 13:return ic===null?$M():b.alternate===null&&ao===0&&(ao=3),b.flags&=-257,b.flags|=65536,b.lanes=$,T===BA?b.flags|=16384:(p=b.updateQueue,p===null?b.updateQueue=new Set([T]):p.add(T),LM(d,T,$)),!1;case 22:return b.flags|=65536,T===BA?b.flags|=16384:(p=b.updateQueue,p===null?(p={transitions:null,markerInstances:null,retryQueue:new Set([T])},b.updateQueue=p):(b=p.retryQueue,b===null?p.retryQueue=new Set([T]):b.add(T)),LM(d,T,$)),!1}throw Error(r(435,b.tag))}return LM(d,T,$),$M(),!1}if(rr)return p=Ss.current,p!==null?((p.flags&65536)===0&&(p.flags|=256),p.flags|=65536,p.lanes=$,T!==kA&&(d=Error(r(422),{cause:T}),ub(ys(d,b)))):(T!==kA&&(p=Error(r(423),{cause:T}),ub(ys(p,b))),d=d.current.alternate,d.flags|=65536,$&=-$,d.lanes|=$,T=ys(T,b),$=dM(d.stateNode,T,$),HA(d,$),ao!==4&&(ao=2)),!1;var F=Error(r(520),{cause:T});if(F=ys(F,b),Rb===null?Rb=[F]:Rb.push(F),ao!==4&&(ao=2),p===null)return!0;T=ys(T,b),b=p;do{switch(b.tag){case 3:return b.flags|=65536,d=$&-$,b.lanes|=d,d=dM(b.stateNode,T,d),HA(b,d),!1;case 1:if(p=b.type,F=b.stateNode,(b.flags&128)===0&&(typeof p.getDerivedStateFromError=="function"||F!==null&&typeof F.componentDidCatch=="function"&&(Td===null||!Td.has(F))))return b.flags|=65536,$&=-$,b.lanes|=$,$=UU($),GU($,d,b,T),HA(b,$),!1}b=b.return}while(b!==null);return!1}var qU=Error(r(461)),Jo=!1;function pi(d,p,b,T){p.child=d===null?NU(p,null,b,T):wm(p,d.child,b,T)}function WU(d,p,b,T,$){b=b.render;var F=p.ref;if("ref"in T){var X={};for(var re in T)re!=="ref"&&(X[re]=T[re])}else X=T;return sp(p),T=KA(d,p,b,X,F,$),re=YA(),d!==null&&!Jo?(QA(d,p,$),cu(d,p,$)):(rr&&re&&RA(p),p.flags|=1,pi(d,p,T,$),p.child)}function KU(d,p,b,T,$){if(d===null){var F=b.type;return typeof F=="function"&&!PA(F)&&F.defaultProps===void 0&&b.compare===null?(p.tag=15,p.type=F,YU(d,p,F,T,$)):(d=mC(b.type,null,T,p,p.mode,$),d.ref=p.ref,d.return=p,p.child=d)}if(F=d.child,!bM(d,$)){var X=F.memoizedProps;if(b=b.compare,b=b!==null?b:ab,b(X,T)&&d.ref===p.ref)return cu(d,p,$)}return p.flags|=1,d=nu(F,T),d.ref=p.ref,d.return=p,p.child=d}function YU(d,p,b,T,$){if(d!==null){var F=d.memoizedProps;if(ab(F,T)&&d.ref===p.ref)if(Jo=!1,p.pendingProps=T=F,bM(d,$))(d.flags&131072)!==0&&(Jo=!0);else return p.lanes=d.lanes,cu(d,p,$)}return fM(d,p,b,T,$)}function QU(d,p,b){var T=p.pendingProps,$=T.children,F=d!==null?d.memoizedState:null;if(T.mode==="hidden"){if((p.flags&128)!==0){if(T=F!==null?F.baseLanes|b:b,d!==null){for($=p.child=d.child,F=0;$!==null;)F=F|$.lanes|$.childLanes,$=$.sibling;p.childLanes=F&~T}else p.childLanes=0,p.child=null;return XU(d,p,T,b)}if((b&536870912)!==0)p.memoizedState={baseLanes:0,cachePool:null},d!==null&&xC(p,F!==null?F.cachePool:null),F!==null?Y5(p,F):GA(),LU(p);else return p.lanes=p.childLanes=536870912,XU(d,p,F!==null?F.baseLanes|b:b,b)}else F!==null?(xC(p,F.cachePool),Y5(p,F),bd(),p.memoizedState=null):(d!==null&&xC(p,null),GA(),bd());return pi(d,p,$,b),p.child}function XU(d,p,b,T){var $=jA();return $=$===null?null:{parent:$o._currentValue,pool:$},p.memoizedState={baseLanes:b,cachePool:$},d!==null&&xC(p,null),GA(),LU(p),d!==null&&db(d,p,T,!0),null}function LC(d,p){var b=p.ref;if(b===null)d!==null&&d.ref!==null&&(p.flags|=4194816);else{if(typeof b!="function"&&typeof b!="object")throw Error(r(284));(d===null||d.ref!==b)&&(p.flags|=4194816)}}function fM(d,p,b,T,$){return sp(p),b=KA(d,p,b,T,void 0,$),T=YA(),d!==null&&!Jo?(QA(d,p,$),cu(d,p,$)):(rr&&T&&RA(p),p.flags|=1,pi(d,p,b,$),p.child)}function JU(d,p,b,T,$,F){return sp(p),p.updateQueue=null,b=X5(p,T,b,$),Q5(d),T=YA(),d!==null&&!Jo?(QA(d,p,F),cu(d,p,F)):(rr&&T&&RA(p),p.flags|=1,pi(d,p,b,F),p.child)}function ZU(d,p,b,T,$){if(sp(p),p.stateNode===null){var F=fm,X=b.contextType;typeof X=="object"&&X!==null&&(F=Pi(X)),F=new b(T,F),p.memoizedState=F.state!==null&&F.state!==void 0?F.state:null,F.updater=uM,p.stateNode=F,F._reactInternals=p,F=p.stateNode,F.props=T,F.state=p.memoizedState,F.refs={},zA(p),X=b.contextType,F.context=typeof X=="object"&&X!==null?Pi(X):fm,F.state=p.memoizedState,X=b.getDerivedStateFromProps,typeof X=="function"&&(cM(p,b,X,T),F.state=p.memoizedState),typeof b.getDerivedStateFromProps=="function"||typeof F.getSnapshotBeforeUpdate=="function"||typeof F.UNSAFE_componentWillMount!="function"&&typeof F.componentWillMount!="function"||(X=F.state,typeof F.componentWillMount=="function"&&F.componentWillMount(),typeof F.UNSAFE_componentWillMount=="function"&&F.UNSAFE_componentWillMount(),X!==F.state&&uM.enqueueReplaceState(F,F.state,null),vb(p,T,F,$),yb(),F.state=p.memoizedState),typeof F.componentDidMount=="function"&&(p.flags|=4194308),T=!0}else if(d===null){F=p.stateNode;var re=p.memoizedProps,ge=up(b,re);F.props=ge;var Ne=F.context,Ze=b.contextType;X=fm,typeof Ze=="object"&&Ze!==null&&(X=Pi(Ze));var ot=b.getDerivedStateFromProps;Ze=typeof ot=="function"||typeof F.getSnapshotBeforeUpdate=="function",re=p.pendingProps!==re,Ze||typeof F.UNSAFE_componentWillReceiveProps!="function"&&typeof F.componentWillReceiveProps!="function"||(re||Ne!==X)&&jU(p,F,T,X),hd=!1;var Fe=p.memoizedState;F.state=Fe,vb(p,T,F,$),yb(),Ne=p.memoizedState,re||Fe!==Ne||hd?(typeof ot=="function"&&(cM(p,b,ot,T),Ne=p.memoizedState),(ge=hd||FU(p,b,ge,T,Fe,Ne,X))?(Ze||typeof F.UNSAFE_componentWillMount!="function"&&typeof F.componentWillMount!="function"||(typeof F.componentWillMount=="function"&&F.componentWillMount(),typeof F.UNSAFE_componentWillMount=="function"&&F.UNSAFE_componentWillMount()),typeof F.componentDidMount=="function"&&(p.flags|=4194308)):(typeof F.componentDidMount=="function"&&(p.flags|=4194308),p.memoizedProps=T,p.memoizedState=Ne),F.props=T,F.state=Ne,F.context=X,T=ge):(typeof F.componentDidMount=="function"&&(p.flags|=4194308),T=!1)}else{F=p.stateNode,VA(d,p),X=p.memoizedProps,Ze=up(b,X),F.props=Ze,ot=p.pendingProps,Fe=F.context,Ne=b.contextType,ge=fm,typeof Ne=="object"&&Ne!==null&&(ge=Pi(Ne)),re=b.getDerivedStateFromProps,(Ne=typeof re=="function"||typeof F.getSnapshotBeforeUpdate=="function")||typeof F.UNSAFE_componentWillReceiveProps!="function"&&typeof F.componentWillReceiveProps!="function"||(X!==ot||Fe!==ge)&&jU(p,F,T,ge),hd=!1,Fe=p.memoizedState,F.state=Fe,vb(p,T,F,$),yb();var ze=p.memoizedState;X!==ot||Fe!==ze||hd||d!==null&&d.dependencies!==null&&vC(d.dependencies)?(typeof re=="function"&&(cM(p,b,re,T),ze=p.memoizedState),(Ze=hd||FU(p,b,Ze,T,Fe,ze,ge)||d!==null&&d.dependencies!==null&&vC(d.dependencies))?(Ne||typeof F.UNSAFE_componentWillUpdate!="function"&&typeof F.componentWillUpdate!="function"||(typeof F.componentWillUpdate=="function"&&F.componentWillUpdate(T,ze,ge),typeof F.UNSAFE_componentWillUpdate=="function"&&F.UNSAFE_componentWillUpdate(T,ze,ge)),typeof F.componentDidUpdate=="function"&&(p.flags|=4),typeof F.getSnapshotBeforeUpdate=="function"&&(p.flags|=1024)):(typeof F.componentDidUpdate!="function"||X===d.memoizedProps&&Fe===d.memoizedState||(p.flags|=4),typeof F.getSnapshotBeforeUpdate!="function"||X===d.memoizedProps&&Fe===d.memoizedState||(p.flags|=1024),p.memoizedProps=T,p.memoizedState=ze),F.props=T,F.state=ze,F.context=ge,T=Ze):(typeof F.componentDidUpdate!="function"||X===d.memoizedProps&&Fe===d.memoizedState||(p.flags|=4),typeof F.getSnapshotBeforeUpdate!="function"||X===d.memoizedProps&&Fe===d.memoizedState||(p.flags|=1024),T=!1)}return F=T,LC(d,p),T=(p.flags&128)!==0,F||T?(F=p.stateNode,b=T&&typeof b.getDerivedStateFromError!="function"?null:F.render(),p.flags|=1,d!==null&&T?(p.child=wm(p,d.child,null,$),p.child=wm(p,null,b,$)):pi(d,p,b,$),p.memoizedState=F.state,d=p.child):d=cu(d,p,$),d}function e4(d,p,b,T){return cb(),p.flags|=256,pi(d,p,b,T),p.child}var pM={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function hM(d){return{baseLanes:d,cachePool:z5()}}function mM(d,p,b){return d=d!==null?d.childLanes&~b:0,p&&(d|=ws),d}function t4(d,p,b){var T=p.pendingProps,$=!1,F=(p.flags&128)!==0,X;if((X=F)||(X=d!==null&&d.memoizedState===null?!1:(No.current&2)!==0),X&&($=!0,p.flags&=-129),X=(p.flags&32)!==0,p.flags&=-33,d===null){if(rr){if($?vd(p):bd(),rr){var re=io,ge;if(ge=re){e:{for(ge=re,re=oc;ge.nodeType!==8;){if(!re){re=null;break e}if(ge=hl(ge.nextSibling),ge===null){re=null;break e}}re=ge}re!==null?(p.memoizedState={dehydrated:re,treeContext:np!==null?{id:ru,overflow:ou}:null,retryLane:536870912,hydrationErrors:null},ge=_a(18,null,null,0),ge.stateNode=re,ge.return=p,p.child=ge,Ui=p,io=null,ge=!0):ge=!1}ge||ip(p)}if(re=p.memoizedState,re!==null&&(re=re.dehydrated,re!==null))return JM(re)?p.lanes=32:p.lanes=536870912,null;lu(p)}return re=T.children,T=T.fallback,$?(bd(),$=p.mode,re=FC({mode:"hidden",children:re},$),T=tp(T,$,b,null),re.return=p,T.return=p,re.sibling=T,p.child=re,$=p.child,$.memoizedState=hM(b),$.childLanes=mM(d,X,b),p.memoizedState=pM,T):(vd(p),gM(p,re))}if(ge=d.memoizedState,ge!==null&&(re=ge.dehydrated,re!==null)){if(F)p.flags&256?(vd(p),p.flags&=-257,p=yM(d,p,b)):p.memoizedState!==null?(bd(),p.child=d.child,p.flags|=128,p=null):(bd(),$=T.fallback,re=p.mode,T=FC({mode:"visible",children:T.children},re),$=tp($,re,b,null),$.flags|=2,T.return=p,$.return=p,T.sibling=$,p.child=T,wm(p,d.child,null,b),T=p.child,T.memoizedState=hM(b),T.childLanes=mM(d,X,b),p.memoizedState=pM,p=$);else if(vd(p),JM(re)){if(X=re.nextSibling&&re.nextSibling.dataset,X)var Ne=X.dgst;X=Ne,T=Error(r(419)),T.stack="",T.digest=X,ub({value:T,source:null,stack:null}),p=yM(d,p,b)}else if(Jo||db(d,p,b,!1),X=(b&d.childLanes)!==0,Jo||X){if(X=Dr,X!==null&&(T=b&-b,T=(T&42)!==0?1:Oi(T),T=(T&(X.suspendedLanes|b))!==0?0:T,T!==0&&T!==ge.retryLane))throw ge.retryLane=T,dm(d,T),ja(X,d,T),qU;re.data==="$?"||$M(),p=yM(d,p,b)}else re.data==="$?"?(p.flags|=192,p.child=d.child,p=null):(d=ge.treeContext,io=hl(re.nextSibling),Ui=p,rr=!0,op=null,oc=!1,d!==null&&(bs[xs++]=ru,bs[xs++]=ou,bs[xs++]=np,ru=d.id,ou=d.overflow,np=p),p=gM(p,T.children),p.flags|=4096);return p}return $?(bd(),$=T.fallback,re=p.mode,ge=d.child,Ne=ge.sibling,T=nu(ge,{mode:"hidden",children:T.children}),T.subtreeFlags=ge.subtreeFlags&65011712,Ne!==null?$=nu(Ne,$):($=tp($,re,b,null),$.flags|=2),$.return=p,T.return=p,T.sibling=$,p.child=T,T=$,$=p.child,re=d.child.memoizedState,re===null?re=hM(b):(ge=re.cachePool,ge!==null?(Ne=$o._currentValue,ge=ge.parent!==Ne?{parent:Ne,pool:Ne}:ge):ge=z5(),re={baseLanes:re.baseLanes|b,cachePool:ge}),$.memoizedState=re,$.childLanes=mM(d,X,b),p.memoizedState=pM,T):(vd(p),b=d.child,d=b.sibling,b=nu(b,{mode:"visible",children:T.children}),b.return=p,b.sibling=null,d!==null&&(X=p.deletions,X===null?(p.deletions=[d],p.flags|=16):X.push(d)),p.child=b,p.memoizedState=null,b)}function gM(d,p){return p=FC({mode:"visible",children:p},d.mode),p.return=d,d.child=p}function FC(d,p){return d=_a(22,d,null,p),d.lanes=0,d.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},d}function yM(d,p,b){return wm(p,d.child,null,b),d=gM(p,p.pendingProps.children),d.flags|=2,p.memoizedState=null,d}function n4(d,p,b){d.lanes|=p;var T=d.alternate;T!==null&&(T.lanes|=p),$A(d.return,p,b)}function vM(d,p,b,T,$){var F=d.memoizedState;F===null?d.memoizedState={isBackwards:p,rendering:null,renderingStartTime:0,last:T,tail:b,tailMode:$}:(F.isBackwards=p,F.rendering=null,F.renderingStartTime=0,F.last=T,F.tail=b,F.tailMode=$)}function r4(d,p,b){var T=p.pendingProps,$=T.revealOrder,F=T.tail;if(pi(d,p,T.children,b),T=No.current,(T&2)!==0)T=T&1|2,p.flags|=128;else{if(d!==null&&(d.flags&128)!==0)e:for(d=p.child;d!==null;){if(d.tag===13)d.memoizedState!==null&&n4(d,b,p);else if(d.tag===19)n4(d,b,p);else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===p)break e;for(;d.sibling===null;){if(d.return===null||d.return===p)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}T&=1}switch(Z(No,T),$){case"forwards":for(b=p.child,$=null;b!==null;)d=b.alternate,d!==null&&_C(d)===null&&($=b),b=b.sibling;b=$,b===null?($=p.child,p.child=null):($=b.sibling,b.sibling=null),vM(p,!1,$,b,F);break;case"backwards":for(b=null,$=p.child,p.child=null;$!==null;){if(d=$.alternate,d!==null&&_C(d)===null){p.child=$;break}d=$.sibling,$.sibling=b,b=$,$=d}vM(p,!0,b,null,F);break;case"together":vM(p,!1,null,null,void 0);break;default:p.memoizedState=null}return p.child}function cu(d,p,b){if(d!==null&&(p.dependencies=d.dependencies),Ed|=p.lanes,(b&p.childLanes)===0)if(d!==null){if(db(d,p,b,!1),(b&p.childLanes)===0)return null}else return null;if(d!==null&&p.child!==d.child)throw Error(r(153));if(p.child!==null){for(d=p.child,b=nu(d,d.pendingProps),p.child=b,b.return=p;d.sibling!==null;)d=d.sibling,b=b.sibling=nu(d,d.pendingProps),b.return=p;b.sibling=null}return p.child}function bM(d,p){return(d.lanes&p)!==0?!0:(d=d.dependencies,!!(d!==null&&vC(d)))}function vge(d,p,b){switch(p.tag){case 3:Se(p,p.stateNode.containerInfo),pd(p,$o,d.memoizedState.cache),cb();break;case 27:case 5:le(p);break;case 4:Se(p,p.stateNode.containerInfo);break;case 10:pd(p,p.type,p.memoizedProps.value);break;case 13:var T=p.memoizedState;if(T!==null)return T.dehydrated!==null?(vd(p),p.flags|=128,null):(b&p.child.childLanes)!==0?t4(d,p,b):(vd(p),d=cu(d,p,b),d!==null?d.sibling:null);vd(p);break;case 19:var $=(d.flags&128)!==0;if(T=(b&p.childLanes)!==0,T||(db(d,p,b,!1),T=(b&p.childLanes)!==0),$){if(T)return r4(d,p,b);p.flags|=128}if($=p.memoizedState,$!==null&&($.rendering=null,$.tail=null,$.lastEffect=null),Z(No,No.current),T)break;return null;case 22:case 23:return p.lanes=0,QU(d,p,b);case 24:pd(p,$o,d.memoizedState.cache)}return cu(d,p,b)}function o4(d,p,b){if(d!==null)if(d.memoizedProps!==p.pendingProps)Jo=!0;else{if(!bM(d,b)&&(p.flags&128)===0)return Jo=!1,vge(d,p,b);Jo=(d.flags&131072)!==0}else Jo=!1,rr&&(p.flags&1048576)!==0&&_5(p,yC,p.index);switch(p.lanes=0,p.tag){case 16:e:{d=p.pendingProps;var T=p.elementType,$=T._init;if(T=$(T._payload),p.type=T,typeof T=="function")PA(T)?(d=up(T,d),p.tag=1,p=ZU(null,p,T,d,b)):(p.tag=0,p=fM(null,p,T,d,b));else{if(T!=null){if($=T.$$typeof,$===I){p.tag=11,p=WU(null,p,T,d,b);break e}else if($===R){p.tag=14,p=KU(null,p,T,d,b);break e}}throw p=H(T)||T,Error(r(306,p,""))}}return p;case 0:return fM(d,p,p.type,p.pendingProps,b);case 1:return T=p.type,$=up(T,p.pendingProps),ZU(d,p,T,$,b);case 3:e:{if(Se(p,p.stateNode.containerInfo),d===null)throw Error(r(387));T=p.pendingProps;var F=p.memoizedState;$=F.element,VA(d,p),vb(p,T,null,b);var X=p.memoizedState;if(T=X.cache,pd(p,$o,T),T!==F.cache&&NA(p,[$o],b,!0),yb(),T=X.element,F.isDehydrated)if(F={element:T,isDehydrated:!1,cache:X.cache},p.updateQueue.baseState=F,p.memoizedState=F,p.flags&256){p=e4(d,p,T,b);break e}else if(T!==$){$=ys(Error(r(424)),p),ub($),p=e4(d,p,T,b);break e}else{switch(d=p.stateNode.containerInfo,d.nodeType){case 9:d=d.body;break;default:d=d.nodeName==="HTML"?d.ownerDocument.body:d}for(io=hl(d.firstChild),Ui=p,rr=!0,op=null,oc=!0,b=NU(p,null,T,b),p.child=b;b;)b.flags=b.flags&-3|4096,b=b.sibling}else{if(cb(),T===$){p=cu(d,p,b);break e}pi(d,p,T,b)}p=p.child}return p;case 26:return LC(d,p),d===null?(b=l3(p.type,null,p.pendingProps,null))?p.memoizedState=b:rr||(b=p.type,d=p.pendingProps,T=JC(ce.current).createElement(b),T[Ut]=p,T[Xt]=d,mi(T,b,d),He(T),p.stateNode=T):p.memoizedState=l3(p.type,d.memoizedProps,p.pendingProps,d.memoizedState),null;case 27:return le(p),d===null&&rr&&(T=p.stateNode=i3(p.type,p.pendingProps,ce.current),Ui=p,oc=!0,$=io,Pd(p.type)?(ZM=$,io=hl(T.firstChild)):io=$),pi(d,p,p.pendingProps.children,b),LC(d,p),d===null&&(p.flags|=4194304),p.child;case 5:return d===null&&rr&&(($=T=io)&&(T=qge(T,p.type,p.pendingProps,oc),T!==null?(p.stateNode=T,Ui=p,io=hl(T.firstChild),oc=!1,$=!0):$=!1),$||ip(p)),le(p),$=p.type,F=p.pendingProps,X=d!==null?d.memoizedProps:null,T=F.children,YM($,F)?T=null:X!==null&&YM($,X)&&(p.flags|=32),p.memoizedState!==null&&($=KA(d,p,uge,null,null,b),Bb._currentValue=$),LC(d,p),pi(d,p,T,b),p.child;case 6:return d===null&&rr&&((d=b=io)&&(b=Wge(b,p.pendingProps,oc),b!==null?(p.stateNode=b,Ui=p,io=null,d=!0):d=!1),d||ip(p)),null;case 13:return t4(d,p,b);case 4:return Se(p,p.stateNode.containerInfo),T=p.pendingProps,d===null?p.child=wm(p,null,T,b):pi(d,p,T,b),p.child;case 11:return WU(d,p,p.type,p.pendingProps,b);case 7:return pi(d,p,p.pendingProps,b),p.child;case 8:return pi(d,p,p.pendingProps.children,b),p.child;case 12:return pi(d,p,p.pendingProps.children,b),p.child;case 10:return T=p.pendingProps,pd(p,p.type,T.value),pi(d,p,T.children,b),p.child;case 9:return $=p.type._context,T=p.pendingProps.children,sp(p),$=Pi($),T=T($),p.flags|=1,pi(d,p,T,b),p.child;case 14:return KU(d,p,p.type,p.pendingProps,b);case 15:return YU(d,p,p.type,p.pendingProps,b);case 19:return r4(d,p,b);case 31:return T=p.pendingProps,b=p.mode,T={mode:T.mode,children:T.children},d===null?(b=FC(T,b),b.ref=p.ref,p.child=b,b.return=p,p=b):(b=nu(d.child,T),b.ref=p.ref,p.child=b,b.return=p,p=b),p;case 22:return QU(d,p,b);case 24:return sp(p),T=Pi($o),d===null?($=jA(),$===null&&($=Dr,F=LA(),$.pooledCache=F,F.refCount++,F!==null&&($.pooledCacheLanes|=b),$=F),p.memoizedState={parent:T,cache:$},zA(p),pd(p,$o,$)):((d.lanes&b)!==0&&(VA(d,p),vb(p,null,null,b),yb()),$=d.memoizedState,F=p.memoizedState,$.parent!==T?($={parent:T,cache:T},p.memoizedState=$,p.lanes===0&&(p.memoizedState=p.updateQueue.baseState=$),pd(p,$o,T)):(T=F.cache,pd(p,$o,T),T!==$.cache&&NA(p,[$o],b,!0))),pi(d,p,p.pendingProps.children,b),p.child;case 29:throw p.pendingProps}throw Error(r(156,p.tag))}function uu(d){d.flags|=4}function i4(d,p){if(p.type!=="stylesheet"||(p.state.loading&4)!==0)d.flags&=-16777217;else if(d.flags|=16777216,!p3(p)){if(p=Ss.current,p!==null&&((qn&4194048)===qn?ic!==null:(qn&62914560)!==qn&&(qn&536870912)===0||p!==ic))throw mb=BA,V5;d.flags|=8192}}function jC(d,p){p!==null&&(d.flags|=4),d.flags&16384&&(p=d.tag!==22?Rr():536870912,d.lanes|=p,Om|=p)}function Tb(d,p){if(!rr)switch(d.tailMode){case"hidden":p=d.tail;for(var b=null;p!==null;)p.alternate!==null&&(b=p),p=p.sibling;b===null?d.tail=null:b.sibling=null;break;case"collapsed":b=d.tail;for(var T=null;b!==null;)b.alternate!==null&&(T=b),b=b.sibling;T===null?p||d.tail===null?d.tail=null:d.tail.sibling=null:T.sibling=null}}function Zr(d){var p=d.alternate!==null&&d.alternate.child===d.child,b=0,T=0;if(p)for(var $=d.child;$!==null;)b|=$.lanes|$.childLanes,T|=$.subtreeFlags&65011712,T|=$.flags&65011712,$.return=d,$=$.sibling;else for($=d.child;$!==null;)b|=$.lanes|$.childLanes,T|=$.subtreeFlags,T|=$.flags,$.return=d,$=$.sibling;return d.subtreeFlags|=T,d.childLanes=b,p}function bge(d,p,b){var T=p.pendingProps;switch(DA(p),p.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Zr(p),null;case 1:return Zr(p),null;case 3:return b=p.stateNode,T=null,d!==null&&(T=d.memoizedState.cache),p.memoizedState.cache!==T&&(p.flags|=2048),au($o),ne(),b.pendingContext&&(b.context=b.pendingContext,b.pendingContext=null),(d===null||d.child===null)&&(lb(p)?uu(p):d===null||d.memoizedState.isDehydrated&&(p.flags&256)===0||(p.flags|=1024,L5())),Zr(p),null;case 26:return b=p.memoizedState,d===null?(uu(p),b!==null?(Zr(p),i4(p,b)):(Zr(p),p.flags&=-16777217)):b?b!==d.memoizedState?(uu(p),Zr(p),i4(p,b)):(Zr(p),p.flags&=-16777217):(d.memoizedProps!==T&&uu(p),Zr(p),p.flags&=-16777217),null;case 27:de(p),b=ce.current;var $=p.type;if(d!==null&&p.stateNode!=null)d.memoizedProps!==T&&uu(p);else{if(!T){if(p.stateNode===null)throw Error(r(166));return Zr(p),null}d=ie.current,lb(p)?$5(p):(d=i3($,T,b),p.stateNode=d,uu(p))}return Zr(p),null;case 5:if(de(p),b=p.type,d!==null&&p.stateNode!=null)d.memoizedProps!==T&&uu(p);else{if(!T){if(p.stateNode===null)throw Error(r(166));return Zr(p),null}if(d=ie.current,lb(p))$5(p);else{switch($=JC(ce.current),d){case 1:d=$.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:d=$.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":d=$.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":d=$.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":d=$.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof T.is=="string"?$.createElement("select",{is:T.is}):$.createElement("select"),T.multiple?d.multiple=!0:T.size&&(d.size=T.size);break;default:d=typeof T.is=="string"?$.createElement(b,{is:T.is}):$.createElement(b)}}d[Ut]=p,d[Xt]=T;e:for($=p.child;$!==null;){if($.tag===5||$.tag===6)d.appendChild($.stateNode);else if($.tag!==4&&$.tag!==27&&$.child!==null){$.child.return=$,$=$.child;continue}if($===p)break e;for(;$.sibling===null;){if($.return===null||$.return===p)break e;$=$.return}$.sibling.return=$.return,$=$.sibling}p.stateNode=d;e:switch(mi(d,b,T),b){case"button":case"input":case"select":case"textarea":d=!!T.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&uu(p)}}return Zr(p),p.flags&=-16777217,null;case 6:if(d&&p.stateNode!=null)d.memoizedProps!==T&&uu(p);else{if(typeof T!="string"&&p.stateNode===null)throw Error(r(166));if(d=ce.current,lb(p)){if(d=p.stateNode,b=p.memoizedProps,T=null,$=Ui,$!==null)switch($.tag){case 27:case 5:T=$.memoizedProps}d[Ut]=p,d=!!(d.nodeValue===b||T!==null&&T.suppressHydrationWarning===!0||J4(d.nodeValue,b)),d||ip(p)}else d=JC(d).createTextNode(T),d[Ut]=p,p.stateNode=d}return Zr(p),null;case 13:if(T=p.memoizedState,d===null||d.memoizedState!==null&&d.memoizedState.dehydrated!==null){if($=lb(p),T!==null&&T.dehydrated!==null){if(d===null){if(!$)throw Error(r(318));if($=p.memoizedState,$=$!==null?$.dehydrated:null,!$)throw Error(r(317));$[Ut]=p}else cb(),(p.flags&128)===0&&(p.memoizedState=null),p.flags|=4;Zr(p),$=!1}else $=L5(),d!==null&&d.memoizedState!==null&&(d.memoizedState.hydrationErrors=$),$=!0;if(!$)return p.flags&256?(lu(p),p):(lu(p),null)}if(lu(p),(p.flags&128)!==0)return p.lanes=b,p;if(b=T!==null,d=d!==null&&d.memoizedState!==null,b){T=p.child,$=null,T.alternate!==null&&T.alternate.memoizedState!==null&&T.alternate.memoizedState.cachePool!==null&&($=T.alternate.memoizedState.cachePool.pool);var F=null;T.memoizedState!==null&&T.memoizedState.cachePool!==null&&(F=T.memoizedState.cachePool.pool),F!==$&&(T.flags|=2048)}return b!==d&&b&&(p.child.flags|=8192),jC(p,p.updateQueue),Zr(p),null;case 4:return ne(),d===null&&UM(p.stateNode.containerInfo),Zr(p),null;case 10:return au(p.type),Zr(p),null;case 19:if(Y(No),$=p.memoizedState,$===null)return Zr(p),null;if(T=(p.flags&128)!==0,F=$.rendering,F===null)if(T)Tb($,!1);else{if(ao!==0||d!==null&&(d.flags&128)!==0)for(d=p.child;d!==null;){if(F=_C(d),F!==null){for(p.flags|=128,Tb($,!1),d=F.updateQueue,p.updateQueue=d,jC(p,d),p.subtreeFlags=0,d=b,b=p.child;b!==null;)k5(b,d),b=b.sibling;return Z(No,No.current&1|2),p.child}d=d.sibling}$.tail!==null&&Re()>VC&&(p.flags|=128,T=!0,Tb($,!1),p.lanes=4194304)}else{if(!T)if(d=_C(F),d!==null){if(p.flags|=128,T=!0,d=d.updateQueue,p.updateQueue=d,jC(p,d),Tb($,!0),$.tail===null&&$.tailMode==="hidden"&&!F.alternate&&!rr)return Zr(p),null}else 2*Re()-$.renderingStartTime>VC&&b!==536870912&&(p.flags|=128,T=!0,Tb($,!1),p.lanes=4194304);$.isBackwards?(F.sibling=p.child,p.child=F):(d=$.last,d!==null?d.sibling=F:p.child=F,$.last=F)}return $.tail!==null?(p=$.tail,$.rendering=p,$.tail=p.sibling,$.renderingStartTime=Re(),p.sibling=null,d=No.current,Z(No,T?d&1|2:d&1),p):(Zr(p),null);case 22:case 23:return lu(p),qA(),T=p.memoizedState!==null,d!==null?d.memoizedState!==null!==T&&(p.flags|=8192):T&&(p.flags|=8192),T?(b&536870912)!==0&&(p.flags&128)===0&&(Zr(p),p.subtreeFlags&6&&(p.flags|=8192)):Zr(p),b=p.updateQueue,b!==null&&jC(p,b.retryQueue),b=null,d!==null&&d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(b=d.memoizedState.cachePool.pool),T=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(T=p.memoizedState.cachePool.pool),T!==b&&(p.flags|=2048),d!==null&&Y(lp),null;case 24:return b=null,d!==null&&(b=d.memoizedState.cache),p.memoizedState.cache!==b&&(p.flags|=2048),au($o),Zr(p),null;case 25:return null;case 30:return null}throw Error(r(156,p.tag))}function xge(d,p){switch(DA(p),p.tag){case 1:return d=p.flags,d&65536?(p.flags=d&-65537|128,p):null;case 3:return au($o),ne(),d=p.flags,(d&65536)!==0&&(d&128)===0?(p.flags=d&-65537|128,p):null;case 26:case 27:case 5:return de(p),null;case 13:if(lu(p),d=p.memoizedState,d!==null&&d.dehydrated!==null){if(p.alternate===null)throw Error(r(340));cb()}return d=p.flags,d&65536?(p.flags=d&-65537|128,p):null;case 19:return Y(No),null;case 4:return ne(),null;case 10:return au(p.type),null;case 22:case 23:return lu(p),qA(),d!==null&&Y(lp),d=p.flags,d&65536?(p.flags=d&-65537|128,p):null;case 24:return au($o),null;case 25:return null;default:return null}}function a4(d,p){switch(DA(p),p.tag){case 3:au($o),ne();break;case 26:case 27:case 5:de(p);break;case 4:ne();break;case 13:lu(p);break;case 19:Y(No);break;case 10:au(p.type);break;case 22:case 23:lu(p),qA(),d!==null&&Y(lp);break;case 24:au($o)}}function Ob(d,p){try{var b=p.updateQueue,T=b!==null?b.lastEffect:null;if(T!==null){var $=T.next;b=$;do{if((b.tag&d)===d){T=void 0;var F=b.create,X=b.inst;T=F(),X.destroy=T}b=b.next}while(b!==$)}}catch(re){Or(p,p.return,re)}}function xd(d,p,b){try{var T=p.updateQueue,$=T!==null?T.lastEffect:null;if($!==null){var F=$.next;T=F;do{if((T.tag&d)===d){var X=T.inst,re=X.destroy;if(re!==void 0){X.destroy=void 0,$=p;var ge=b,Ne=re;try{Ne()}catch(Ze){Or($,ge,Ze)}}}T=T.next}while(T!==F)}}catch(Ze){Or(p,p.return,Ze)}}function s4(d){var p=d.updateQueue;if(p!==null){var b=d.stateNode;try{K5(p,b)}catch(T){Or(d,d.return,T)}}}function l4(d,p,b){b.props=up(d.type,d.memoizedProps),b.state=d.memoizedState;try{b.componentWillUnmount()}catch(T){Or(d,p,T)}}function Ib(d,p){try{var b=d.ref;if(b!==null){switch(d.tag){case 26:case 27:case 5:var T=d.stateNode;break;case 30:T=d.stateNode;break;default:T=d.stateNode}typeof b=="function"?d.refCleanup=b(T):b.current=T}}catch($){Or(d,p,$)}}function ac(d,p){var b=d.ref,T=d.refCleanup;if(b!==null)if(typeof T=="function")try{T()}catch($){Or(d,p,$)}finally{d.refCleanup=null,d=d.alternate,d!=null&&(d.refCleanup=null)}else if(typeof b=="function")try{b(null)}catch($){Or(d,p,$)}else b.current=null}function c4(d){var p=d.type,b=d.memoizedProps,T=d.stateNode;try{e:switch(p){case"button":case"input":case"select":case"textarea":b.autoFocus&&T.focus();break e;case"img":b.src?T.src=b.src:b.srcSet&&(T.srcset=b.srcSet)}}catch($){Or(d,d.return,$)}}function xM(d,p,b){try{var T=d.stateNode;zge(T,d.type,b,p),T[Xt]=p}catch($){Or(d,d.return,$)}}function u4(d){return d.tag===5||d.tag===3||d.tag===26||d.tag===27&&Pd(d.type)||d.tag===4}function SM(d){e:for(;;){for(;d.sibling===null;){if(d.return===null||u4(d.return))return null;d=d.return}for(d.sibling.return=d.return,d=d.sibling;d.tag!==5&&d.tag!==6&&d.tag!==18;){if(d.tag===27&&Pd(d.type)||d.flags&2||d.child===null||d.tag===4)continue e;d.child.return=d,d=d.child}if(!(d.flags&2))return d.stateNode}}function wM(d,p,b){var T=d.tag;if(T===5||T===6)d=d.stateNode,p?(b.nodeType===9?b.body:b.nodeName==="HTML"?b.ownerDocument.body:b).insertBefore(d,p):(p=b.nodeType===9?b.body:b.nodeName==="HTML"?b.ownerDocument.body:b,p.appendChild(d),b=b._reactRootContainer,b!=null||p.onclick!==null||(p.onclick=XC));else if(T!==4&&(T===27&&Pd(d.type)&&(b=d.stateNode,p=null),d=d.child,d!==null))for(wM(d,p,b),d=d.sibling;d!==null;)wM(d,p,b),d=d.sibling}function BC(d,p,b){var T=d.tag;if(T===5||T===6)d=d.stateNode,p?b.insertBefore(d,p):b.appendChild(d);else if(T!==4&&(T===27&&Pd(d.type)&&(b=d.stateNode),d=d.child,d!==null))for(BC(d,p,b),d=d.sibling;d!==null;)BC(d,p,b),d=d.sibling}function d4(d){var p=d.stateNode,b=d.memoizedProps;try{for(var T=d.type,$=p.attributes;$.length;)p.removeAttributeNode($[0]);mi(p,T,b),p[Ut]=d,p[Xt]=b}catch(F){Or(d,d.return,F)}}var du=!1,xo=!1,CM=!1,f4=typeof WeakSet=="function"?WeakSet:Set,Zo=null;function Sge(d,p){if(d=d.containerInfo,WM=o1,d=C5(d),SA(d)){if("selectionStart"in d)var b={start:d.selectionStart,end:d.selectionEnd};else e:{b=(b=d.ownerDocument)&&b.defaultView||window;var T=b.getSelection&&b.getSelection();if(T&&T.rangeCount!==0){b=T.anchorNode;var $=T.anchorOffset,F=T.focusNode;T=T.focusOffset;try{b.nodeType,F.nodeType}catch{b=null;break e}var X=0,re=-1,ge=-1,Ne=0,Ze=0,ot=d,Fe=null;t:for(;;){for(var ze;ot!==b||$!==0&&ot.nodeType!==3||(re=X+$),ot!==F||T!==0&&ot.nodeType!==3||(ge=X+T),ot.nodeType===3&&(X+=ot.nodeValue.length),(ze=ot.firstChild)!==null;)Fe=ot,ot=ze;for(;;){if(ot===d)break t;if(Fe===b&&++Ne===$&&(re=X),Fe===F&&++Ze===T&&(ge=X),(ze=ot.nextSibling)!==null)break;ot=Fe,Fe=ot.parentNode}ot=ze}b=re===-1||ge===-1?null:{start:re,end:ge}}else b=null}b=b||{start:0,end:0}}else b=null;for(KM={focusedElem:d,selectionRange:b},o1=!1,Zo=p;Zo!==null;)if(p=Zo,d=p.child,(p.subtreeFlags&1024)!==0&&d!==null)d.return=p,Zo=d;else for(;Zo!==null;){switch(p=Zo,F=p.alternate,d=p.flags,p.tag){case 0:break;case 11:case 15:break;case 1:if((d&1024)!==0&&F!==null){d=void 0,b=p,$=F.memoizedProps,F=F.memoizedState,T=b.stateNode;try{var fn=up(b.type,$,b.elementType===b.type);d=T.getSnapshotBeforeUpdate(fn,F),T.__reactInternalSnapshotBeforeUpdate=d}catch(nn){Or(b,b.return,nn)}}break;case 3:if((d&1024)!==0){if(d=p.stateNode.containerInfo,b=d.nodeType,b===9)XM(d);else if(b===1)switch(d.nodeName){case"HEAD":case"HTML":case"BODY":XM(d);break;default:d.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((d&1024)!==0)throw Error(r(163))}if(d=p.sibling,d!==null){d.return=p.return,Zo=d;break}Zo=p.return}}function p4(d,p,b){var T=b.flags;switch(b.tag){case 0:case 11:case 15:Sd(d,b),T&4&&Ob(5,b);break;case 1:if(Sd(d,b),T&4)if(d=b.stateNode,p===null)try{d.componentDidMount()}catch(X){Or(b,b.return,X)}else{var $=up(b.type,p.memoizedProps);p=p.memoizedState;try{d.componentDidUpdate($,p,d.__reactInternalSnapshotBeforeUpdate)}catch(X){Or(b,b.return,X)}}T&64&&s4(b),T&512&&Ib(b,b.return);break;case 3:if(Sd(d,b),T&64&&(d=b.updateQueue,d!==null)){if(p=null,b.child!==null)switch(b.child.tag){case 27:case 5:p=b.child.stateNode;break;case 1:p=b.child.stateNode}try{K5(d,p)}catch(X){Or(b,b.return,X)}}break;case 27:p===null&&T&4&&d4(b);case 26:case 5:Sd(d,b),p===null&&T&4&&c4(b),T&512&&Ib(b,b.return);break;case 12:Sd(d,b);break;case 13:Sd(d,b),T&4&&g4(d,b),T&64&&(d=b.memoizedState,d!==null&&(d=d.dehydrated,d!==null&&(b=Mge.bind(null,b),Kge(d,b))));break;case 22:if(T=b.memoizedState!==null||du,!T){p=p!==null&&p.memoizedState!==null||xo,$=du;var F=xo;du=T,(xo=p)&&!F?wd(d,b,(b.subtreeFlags&8772)!==0):Sd(d,b),du=$,xo=F}break;case 30:break;default:Sd(d,b)}}function h4(d){var p=d.alternate;p!==null&&(d.alternate=null,h4(p)),d.child=null,d.deletions=null,d.sibling=null,d.tag===5&&(p=d.stateNode,p!==null&&vo(p)),d.stateNode=null,d.return=null,d.dependencies=null,d.memoizedProps=null,d.memoizedState=null,d.pendingProps=null,d.stateNode=null,d.updateQueue=null}var Gr=null,fa=!1;function fu(d,p,b){for(b=b.child;b!==null;)m4(d,p,b),b=b.sibling}function m4(d,p,b){if(rt&&typeof rt.onCommitFiberUnmount=="function")try{rt.onCommitFiberUnmount(We,b)}catch{}switch(b.tag){case 26:xo||ac(b,p),fu(d,p,b),b.memoizedState?b.memoizedState.count--:b.stateNode&&(b=b.stateNode,b.parentNode.removeChild(b));break;case 27:xo||ac(b,p);var T=Gr,$=fa;Pd(b.type)&&(Gr=b.stateNode,fa=!1),fu(d,p,b),Nb(b.stateNode),Gr=T,fa=$;break;case 5:xo||ac(b,p);case 6:if(T=Gr,$=fa,Gr=null,fu(d,p,b),Gr=T,fa=$,Gr!==null)if(fa)try{(Gr.nodeType===9?Gr.body:Gr.nodeName==="HTML"?Gr.ownerDocument.body:Gr).removeChild(b.stateNode)}catch(F){Or(b,p,F)}else try{Gr.removeChild(b.stateNode)}catch(F){Or(b,p,F)}break;case 18:Gr!==null&&(fa?(d=Gr,r3(d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d,b.stateNode),Ub(d)):r3(Gr,b.stateNode));break;case 4:T=Gr,$=fa,Gr=b.stateNode.containerInfo,fa=!0,fu(d,p,b),Gr=T,fa=$;break;case 0:case 11:case 14:case 15:xo||xd(2,b,p),xo||xd(4,b,p),fu(d,p,b);break;case 1:xo||(ac(b,p),T=b.stateNode,typeof T.componentWillUnmount=="function"&&l4(b,p,T)),fu(d,p,b);break;case 21:fu(d,p,b);break;case 22:xo=(T=xo)||b.memoizedState!==null,fu(d,p,b),xo=T;break;default:fu(d,p,b)}}function g4(d,p){if(p.memoizedState===null&&(d=p.alternate,d!==null&&(d=d.memoizedState,d!==null&&(d=d.dehydrated,d!==null))))try{Ub(d)}catch(b){Or(p,p.return,b)}}function wge(d){switch(d.tag){case 13:case 19:var p=d.stateNode;return p===null&&(p=d.stateNode=new f4),p;case 22:return d=d.stateNode,p=d._retryCache,p===null&&(p=d._retryCache=new f4),p;default:throw Error(r(435,d.tag))}}function EM(d,p){var b=wge(d);p.forEach(function(T){var $=Rge.bind(null,d,T);b.has(T)||(b.add(T),T.then($,$))})}function $a(d,p){var b=p.deletions;if(b!==null)for(var T=0;T<b.length;T++){var $=b[T],F=d,X=p,re=X;e:for(;re!==null;){switch(re.tag){case 27:if(Pd(re.type)){Gr=re.stateNode,fa=!1;break e}break;case 5:Gr=re.stateNode,fa=!1;break e;case 3:case 4:Gr=re.stateNode.containerInfo,fa=!0;break e}re=re.return}if(Gr===null)throw Error(r(160));m4(F,X,$),Gr=null,fa=!1,F=$.alternate,F!==null&&(F.return=null),$.return=null}if(p.subtreeFlags&13878)for(p=p.child;p!==null;)y4(p,d),p=p.sibling}var pl=null;function y4(d,p){var b=d.alternate,T=d.flags;switch(d.tag){case 0:case 11:case 14:case 15:$a(p,d),Na(d),T&4&&(xd(3,d,d.return),Ob(3,d),xd(5,d,d.return));break;case 1:$a(p,d),Na(d),T&512&&(xo||b===null||ac(b,b.return)),T&64&&du&&(d=d.updateQueue,d!==null&&(T=d.callbacks,T!==null&&(b=d.shared.hiddenCallbacks,d.shared.hiddenCallbacks=b===null?T:b.concat(T))));break;case 26:var $=pl;if($a(p,d),Na(d),T&512&&(xo||b===null||ac(b,b.return)),T&4){var F=b!==null?b.memoizedState:null;if(T=d.memoizedState,b===null)if(T===null)if(d.stateNode===null){e:{T=d.type,b=d.memoizedProps,$=$.ownerDocument||$;t:switch(T){case"title":F=$.getElementsByTagName("title")[0],(!F||F[Ii]||F[Ut]||F.namespaceURI==="http://www.w3.org/2000/svg"||F.hasAttribute("itemprop"))&&(F=$.createElement(T),$.head.insertBefore(F,$.querySelector("head > title"))),mi(F,T,b),F[Ut]=d,He(F),T=F;break e;case"link":var X=d3("link","href",$).get(T+(b.href||""));if(X){for(var re=0;re<X.length;re++)if(F=X[re],F.getAttribute("href")===(b.href==null||b.href===""?null:b.href)&&F.getAttribute("rel")===(b.rel==null?null:b.rel)&&F.getAttribute("title")===(b.title==null?null:b.title)&&F.getAttribute("crossorigin")===(b.crossOrigin==null?null:b.crossOrigin)){X.splice(re,1);break t}}F=$.createElement(T),mi(F,T,b),$.head.appendChild(F);break;case"meta":if(X=d3("meta","content",$).get(T+(b.content||""))){for(re=0;re<X.length;re++)if(F=X[re],F.getAttribute("content")===(b.content==null?null:""+b.content)&&F.getAttribute("name")===(b.name==null?null:b.name)&&F.getAttribute("property")===(b.property==null?null:b.property)&&F.getAttribute("http-equiv")===(b.httpEquiv==null?null:b.httpEquiv)&&F.getAttribute("charset")===(b.charSet==null?null:b.charSet)){X.splice(re,1);break t}}F=$.createElement(T),mi(F,T,b),$.head.appendChild(F);break;default:throw Error(r(468,T))}F[Ut]=d,He(F),T=F}d.stateNode=T}else f3($,d.type,d.stateNode);else d.stateNode=u3($,T,d.memoizedProps);else F!==T?(F===null?b.stateNode!==null&&(b=b.stateNode,b.parentNode.removeChild(b)):F.count--,T===null?f3($,d.type,d.stateNode):u3($,T,d.memoizedProps)):T===null&&d.stateNode!==null&&xM(d,d.memoizedProps,b.memoizedProps)}break;case 27:$a(p,d),Na(d),T&512&&(xo||b===null||ac(b,b.return)),b!==null&&T&4&&xM(d,d.memoizedProps,b.memoizedProps);break;case 5:if($a(p,d),Na(d),T&512&&(xo||b===null||ac(b,b.return)),d.flags&32){$=d.stateNode;try{om($,"")}catch(ze){Or(d,d.return,ze)}}T&4&&d.stateNode!=null&&($=d.memoizedProps,xM(d,$,b!==null?b.memoizedProps:$)),T&1024&&(CM=!0);break;case 6:if($a(p,d),Na(d),T&4){if(d.stateNode===null)throw Error(r(162));T=d.memoizedProps,b=d.stateNode;try{b.nodeValue=T}catch(ze){Or(d,d.return,ze)}}break;case 3:if(t1=null,$=pl,pl=ZC(p.containerInfo),$a(p,d),pl=$,Na(d),T&4&&b!==null&&b.memoizedState.isDehydrated)try{Ub(p.containerInfo)}catch(ze){Or(d,d.return,ze)}CM&&(CM=!1,v4(d));break;case 4:T=pl,pl=ZC(d.stateNode.containerInfo),$a(p,d),Na(d),pl=T;break;case 12:$a(p,d),Na(d);break;case 13:$a(p,d),Na(d),d.child.flags&8192&&d.memoizedState!==null!=(b!==null&&b.memoizedState!==null)&&(MM=Re()),T&4&&(T=d.updateQueue,T!==null&&(d.updateQueue=null,EM(d,T)));break;case 22:$=d.memoizedState!==null;var ge=b!==null&&b.memoizedState!==null,Ne=du,Ze=xo;if(du=Ne||$,xo=Ze||ge,$a(p,d),xo=Ze,du=Ne,Na(d),T&8192)e:for(p=d.stateNode,p._visibility=$?p._visibility&-2:p._visibility|1,$&&(b===null||ge||du||xo||dp(d)),b=null,p=d;;){if(p.tag===5||p.tag===26){if(b===null){ge=b=p;try{if(F=ge.stateNode,$)X=F.style,typeof X.setProperty=="function"?X.setProperty("display","none","important"):X.display="none";else{re=ge.stateNode;var ot=ge.memoizedProps.style,Fe=ot!=null&&ot.hasOwnProperty("display")?ot.display:null;re.style.display=Fe==null||typeof Fe=="boolean"?"":(""+Fe).trim()}}catch(ze){Or(ge,ge.return,ze)}}}else if(p.tag===6){if(b===null){ge=p;try{ge.stateNode.nodeValue=$?"":ge.memoizedProps}catch(ze){Or(ge,ge.return,ze)}}}else if((p.tag!==22&&p.tag!==23||p.memoizedState===null||p===d)&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===d)break e;for(;p.sibling===null;){if(p.return===null||p.return===d)break e;b===p&&(b=null),p=p.return}b===p&&(b=null),p.sibling.return=p.return,p=p.sibling}T&4&&(T=d.updateQueue,T!==null&&(b=T.retryQueue,b!==null&&(T.retryQueue=null,EM(d,b))));break;case 19:$a(p,d),Na(d),T&4&&(T=d.updateQueue,T!==null&&(d.updateQueue=null,EM(d,T)));break;case 30:break;case 21:break;default:$a(p,d),Na(d)}}function Na(d){var p=d.flags;if(p&2){try{for(var b,T=d.return;T!==null;){if(u4(T)){b=T;break}T=T.return}if(b==null)throw Error(r(160));switch(b.tag){case 27:var $=b.stateNode,F=SM(d);BC(d,F,$);break;case 5:var X=b.stateNode;b.flags&32&&(om(X,""),b.flags&=-33);var re=SM(d);BC(d,re,X);break;case 3:case 4:var ge=b.stateNode.containerInfo,Ne=SM(d);wM(d,Ne,ge);break;default:throw Error(r(161))}}catch(Ze){Or(d,d.return,Ze)}d.flags&=-3}p&4096&&(d.flags&=-4097)}function v4(d){if(d.subtreeFlags&1024)for(d=d.child;d!==null;){var p=d;v4(p),p.tag===5&&p.flags&1024&&p.stateNode.reset(),d=d.sibling}}function Sd(d,p){if(p.subtreeFlags&8772)for(p=p.child;p!==null;)p4(d,p.alternate,p),p=p.sibling}function dp(d){for(d=d.child;d!==null;){var p=d;switch(p.tag){case 0:case 11:case 14:case 15:xd(4,p,p.return),dp(p);break;case 1:ac(p,p.return);var b=p.stateNode;typeof b.componentWillUnmount=="function"&&l4(p,p.return,b),dp(p);break;case 27:Nb(p.stateNode);case 26:case 5:ac(p,p.return),dp(p);break;case 22:p.memoizedState===null&&dp(p);break;case 30:dp(p);break;default:dp(p)}d=d.sibling}}function wd(d,p,b){for(b=b&&(p.subtreeFlags&8772)!==0,p=p.child;p!==null;){var T=p.alternate,$=d,F=p,X=F.flags;switch(F.tag){case 0:case 11:case 15:wd($,F,b),Ob(4,F);break;case 1:if(wd($,F,b),T=F,$=T.stateNode,typeof $.componentDidMount=="function")try{$.componentDidMount()}catch(Ne){Or(T,T.return,Ne)}if(T=F,$=T.updateQueue,$!==null){var re=T.stateNode;try{var ge=$.shared.hiddenCallbacks;if(ge!==null)for($.shared.hiddenCallbacks=null,$=0;$<ge.length;$++)W5(ge[$],re)}catch(Ne){Or(T,T.return,Ne)}}b&&X&64&&s4(F),Ib(F,F.return);break;case 27:d4(F);case 26:case 5:wd($,F,b),b&&T===null&&X&4&&c4(F),Ib(F,F.return);break;case 12:wd($,F,b);break;case 13:wd($,F,b),b&&X&4&&g4($,F);break;case 22:F.memoizedState===null&&wd($,F,b),Ib(F,F.return);break;case 30:break;default:wd($,F,b)}p=p.sibling}}function TM(d,p){var b=null;d!==null&&d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(b=d.memoizedState.cachePool.pool),d=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(d=p.memoizedState.cachePool.pool),d!==b&&(d!=null&&d.refCount++,b!=null&&fb(b))}function OM(d,p){d=null,p.alternate!==null&&(d=p.alternate.memoizedState.cache),p=p.memoizedState.cache,p!==d&&(p.refCount++,d!=null&&fb(d))}function sc(d,p,b,T){if(p.subtreeFlags&10256)for(p=p.child;p!==null;)b4(d,p,b,T),p=p.sibling}function b4(d,p,b,T){var $=p.flags;switch(p.tag){case 0:case 11:case 15:sc(d,p,b,T),$&2048&&Ob(9,p);break;case 1:sc(d,p,b,T);break;case 3:sc(d,p,b,T),$&2048&&(d=null,p.alternate!==null&&(d=p.alternate.memoizedState.cache),p=p.memoizedState.cache,p!==d&&(p.refCount++,d!=null&&fb(d)));break;case 12:if($&2048){sc(d,p,b,T),d=p.stateNode;try{var F=p.memoizedProps,X=F.id,re=F.onPostCommit;typeof re=="function"&&re(X,p.alternate===null?"mount":"update",d.passiveEffectDuration,-0)}catch(ge){Or(p,p.return,ge)}}else sc(d,p,b,T);break;case 13:sc(d,p,b,T);break;case 23:break;case 22:F=p.stateNode,X=p.alternate,p.memoizedState!==null?F._visibility&2?sc(d,p,b,T):Pb(d,p):F._visibility&2?sc(d,p,b,T):(F._visibility|=2,Cm(d,p,b,T,(p.subtreeFlags&10256)!==0)),$&2048&&TM(X,p);break;case 24:sc(d,p,b,T),$&2048&&OM(p.alternate,p);break;default:sc(d,p,b,T)}}function Cm(d,p,b,T,$){for($=$&&(p.subtreeFlags&10256)!==0,p=p.child;p!==null;){var F=d,X=p,re=b,ge=T,Ne=X.flags;switch(X.tag){case 0:case 11:case 15:Cm(F,X,re,ge,$),Ob(8,X);break;case 23:break;case 22:var Ze=X.stateNode;X.memoizedState!==null?Ze._visibility&2?Cm(F,X,re,ge,$):Pb(F,X):(Ze._visibility|=2,Cm(F,X,re,ge,$)),$&&Ne&2048&&TM(X.alternate,X);break;case 24:Cm(F,X,re,ge,$),$&&Ne&2048&&OM(X.alternate,X);break;default:Cm(F,X,re,ge,$)}p=p.sibling}}function Pb(d,p){if(p.subtreeFlags&10256)for(p=p.child;p!==null;){var b=d,T=p,$=T.flags;switch(T.tag){case 22:Pb(b,T),$&2048&&TM(T.alternate,T);break;case 24:Pb(b,T),$&2048&&OM(T.alternate,T);break;default:Pb(b,T)}p=p.sibling}}var Ab=8192;function Em(d){if(d.subtreeFlags&Ab)for(d=d.child;d!==null;)x4(d),d=d.sibling}function x4(d){switch(d.tag){case 26:Em(d),d.flags&Ab&&d.memoizedState!==null&&sye(pl,d.memoizedState,d.memoizedProps);break;case 5:Em(d);break;case 3:case 4:var p=pl;pl=ZC(d.stateNode.containerInfo),Em(d),pl=p;break;case 22:d.memoizedState===null&&(p=d.alternate,p!==null&&p.memoizedState!==null?(p=Ab,Ab=16777216,Em(d),Ab=p):Em(d));break;default:Em(d)}}function S4(d){var p=d.alternate;if(p!==null&&(d=p.child,d!==null)){p.child=null;do p=d.sibling,d.sibling=null,d=p;while(d!==null)}}function Mb(d){var p=d.deletions;if((d.flags&16)!==0){if(p!==null)for(var b=0;b<p.length;b++){var T=p[b];Zo=T,C4(T,d)}S4(d)}if(d.subtreeFlags&10256)for(d=d.child;d!==null;)w4(d),d=d.sibling}function w4(d){switch(d.tag){case 0:case 11:case 15:Mb(d),d.flags&2048&&xd(9,d,d.return);break;case 3:Mb(d);break;case 12:Mb(d);break;case 22:var p=d.stateNode;d.memoizedState!==null&&p._visibility&2&&(d.return===null||d.return.tag!==13)?(p._visibility&=-3,zC(d)):Mb(d);break;default:Mb(d)}}function zC(d){var p=d.deletions;if((d.flags&16)!==0){if(p!==null)for(var b=0;b<p.length;b++){var T=p[b];Zo=T,C4(T,d)}S4(d)}for(d=d.child;d!==null;){switch(p=d,p.tag){case 0:case 11:case 15:xd(8,p,p.return),zC(p);break;case 22:b=p.stateNode,b._visibility&2&&(b._visibility&=-3,zC(p));break;default:zC(p)}d=d.sibling}}function C4(d,p){for(;Zo!==null;){var b=Zo;switch(b.tag){case 0:case 11:case 15:xd(8,b,p);break;case 23:case 22:if(b.memoizedState!==null&&b.memoizedState.cachePool!==null){var T=b.memoizedState.cachePool.pool;T!=null&&T.refCount++}break;case 24:fb(b.memoizedState.cache)}if(T=b.child,T!==null)T.return=b,Zo=T;else e:for(b=d;Zo!==null;){T=Zo;var $=T.sibling,F=T.return;if(h4(T),T===b){Zo=null;break e}if($!==null){$.return=F,Zo=$;break e}Zo=F}}}var Cge={getCacheForType:function(d){var p=Pi($o),b=p.data.get(d);return b===void 0&&(b=d(),p.data.set(d,b)),b}},Ege=typeof WeakMap=="function"?WeakMap:Map,mr=0,Dr=null,Ln=null,qn=0,gr=0,La=null,Cd=!1,Tm=!1,IM=!1,pu=0,ao=0,Ed=0,fp=0,PM=0,ws=0,Om=0,Rb=null,pa=null,AM=!1,MM=0,VC=1/0,HC=null,Td=null,hi=0,Od=null,Im=null,Pm=0,RM=0,DM=null,E4=null,Db=0,kM=null;function Fa(){if((mr&2)!==0&&qn!==0)return qn&-qn;if(L.T!==null){var d=mm;return d!==0?d:BM()}return un()}function T4(){ws===0&&(ws=(qn&536870912)===0||rr?kn():536870912);var d=Ss.current;return d!==null&&(d.flags|=32),ws}function ja(d,p,b){(d===Dr&&(gr===2||gr===9)||d.cancelPendingCommit!==null)&&(Am(d,0),Id(d,qn,ws,!1)),Bn(d,b),((mr&2)===0||d!==Dr)&&(d===Dr&&((mr&2)===0&&(fp|=b),ao===4&&Id(d,qn,ws,!1)),lc(d))}function O4(d,p,b){if((mr&6)!==0)throw Error(r(327));var T=!b&&(p&124)===0&&(p&d.expiredLanes)===0||bt(d,p),$=T?Ige(d,p):NM(d,p,!0),F=T;do{if($===0){Tm&&!T&&Id(d,p,0,!1);break}else{if(b=d.current.alternate,F&&!Tge(b)){$=NM(d,p,!1),F=!1;continue}if($===2){if(F=p,d.errorRecoveryDisabledLanes&F)var X=0;else X=d.pendingLanes&-536870913,X=X!==0?X:X&536870912?536870912:0;if(X!==0){p=X;e:{var re=d;$=Rb;var ge=re.current.memoizedState.isDehydrated;if(ge&&(Am(re,X).flags|=256),X=NM(re,X,!1),X!==2){if(IM&&!ge){re.errorRecoveryDisabledLanes|=F,fp|=F,$=4;break e}F=pa,pa=$,F!==null&&(pa===null?pa=F:pa.push.apply(pa,F))}$=X}if(F=!1,$!==2)continue}}if($===1){Am(d,0),Id(d,p,0,!0);break}e:{switch(T=d,F=$,F){case 0:case 1:throw Error(r(345));case 4:if((p&4194048)!==p)break;case 6:Id(T,p,ws,!Cd);break e;case 2:pa=null;break;case 3:case 5:break;default:throw Error(r(329))}if((p&62914560)===p&&($=MM+300-Re(),10<$)){if(Id(T,p,ws,!Cd),vt(T,0,!0)!==0)break e;T.timeoutHandle=t3(I4.bind(null,T,b,pa,HC,AM,p,ws,fp,Om,Cd,F,2,-0,0),$);break e}I4(T,b,pa,HC,AM,p,ws,fp,Om,Cd,F,0,-0,0)}}break}while(!0);lc(d)}function I4(d,p,b,T,$,F,X,re,ge,Ne,Ze,ot,Fe,ze){if(d.timeoutHandle=-1,ot=p.subtreeFlags,(ot&8192||(ot&16785408)===16785408)&&(jb={stylesheets:null,count:0,unsuspend:aye},x4(p),ot=lye(),ot!==null)){d.cancelPendingCommit=ot(_4.bind(null,d,p,F,b,T,$,X,re,ge,Ze,1,Fe,ze)),Id(d,F,X,!Ne);return}_4(d,p,F,b,T,$,X,re,ge)}function Tge(d){for(var p=d;;){var b=p.tag;if((b===0||b===11||b===15)&&p.flags&16384&&(b=p.updateQueue,b!==null&&(b=b.stores,b!==null)))for(var T=0;T<b.length;T++){var $=b[T],F=$.getSnapshot;$=$.value;try{if(!ka(F(),$))return!1}catch{return!1}}if(b=p.child,p.subtreeFlags&16384&&b!==null)b.return=p,p=b;else{if(p===d)break;for(;p.sibling===null;){if(p.return===null||p.return===d)return!0;p=p.return}p.sibling.return=p.return,p=p.sibling}}return!0}function Id(d,p,b,T){p&=~PM,p&=~fp,d.suspendedLanes|=p,d.pingedLanes&=~p,T&&(d.warmLanes|=p),T=d.expirationTimes;for(var $=p;0<$;){var F=31-Be($),X=1<<F;T[F]=-1,$&=~X}b!==0&&To(d,b,p)}function UC(){return(mr&6)===0?(kb(0),!1):!0}function _M(){if(Ln!==null){if(gr===0)var d=Ln.return;else d=Ln,iu=ap=null,XA(d),Sm=null,Cb=0,d=Ln;for(;d!==null;)a4(d.alternate,d),d=d.return;Ln=null}}function Am(d,p){var b=d.timeoutHandle;b!==-1&&(d.timeoutHandle=-1,Hge(b)),b=d.cancelPendingCommit,b!==null&&(d.cancelPendingCommit=null,b()),_M(),Dr=d,Ln=b=nu(d.current,null),qn=p,gr=0,La=null,Cd=!1,Tm=bt(d,p),IM=!1,Om=ws=PM=fp=Ed=ao=0,pa=Rb=null,AM=!1,(p&8)!==0&&(p|=p&32);var T=d.entangledLanes;if(T!==0)for(d=d.entanglements,T&=p;0<T;){var $=31-Be(T),F=1<<$;p|=d[$],T&=~F}return pu=p,fC(),b}function P4(d,p){Rn=null,L.H=RC,p===hb||p===SC?(p=G5(),gr=3):p===V5?(p=G5(),gr=4):gr=p===qU?8:p!==null&&typeof p=="object"&&typeof p.then=="function"?6:1,La=p,Ln===null&&(ao=1,NC(d,ys(p,d.current)))}function A4(){var d=L.H;return L.H=RC,d===null?RC:d}function M4(){var d=L.A;return L.A=Cge,d}function $M(){ao=4,Cd||(qn&4194048)!==qn&&Ss.current!==null||(Tm=!0),(Ed&134217727)===0&&(fp&134217727)===0||Dr===null||Id(Dr,qn,ws,!1)}function NM(d,p,b){var T=mr;mr|=2;var $=A4(),F=M4();(Dr!==d||qn!==p)&&(HC=null,Am(d,p)),p=!1;var X=ao;e:do try{if(gr!==0&&Ln!==null){var re=Ln,ge=La;switch(gr){case 8:_M(),X=6;break e;case 3:case 2:case 9:case 6:Ss.current===null&&(p=!0);var Ne=gr;if(gr=0,La=null,Mm(d,re,ge,Ne),b&&Tm){X=0;break e}break;default:Ne=gr,gr=0,La=null,Mm(d,re,ge,Ne)}}Oge(),X=ao;break}catch(Ze){P4(d,Ze)}while(!0);return p&&d.shellSuspendCounter++,iu=ap=null,mr=T,L.H=$,L.A=F,Ln===null&&(Dr=null,qn=0,fC()),X}function Oge(){for(;Ln!==null;)R4(Ln)}function Ige(d,p){var b=mr;mr|=2;var T=A4(),$=M4();Dr!==d||qn!==p?(HC=null,VC=Re()+500,Am(d,p)):Tm=bt(d,p);e:do try{if(gr!==0&&Ln!==null){p=Ln;var F=La;t:switch(gr){case 1:gr=0,La=null,Mm(d,p,F,1);break;case 2:case 9:if(H5(F)){gr=0,La=null,D4(p);break}p=function(){gr!==2&&gr!==9||Dr!==d||(gr=7),lc(d)},F.then(p,p);break e;case 3:gr=7;break e;case 4:gr=5;break e;case 7:H5(F)?(gr=0,La=null,D4(p)):(gr=0,La=null,Mm(d,p,F,7));break;case 5:var X=null;switch(Ln.tag){case 26:X=Ln.memoizedState;case 5:case 27:var re=Ln;if(!X||p3(X)){gr=0,La=null;var ge=re.sibling;if(ge!==null)Ln=ge;else{var Ne=re.return;Ne!==null?(Ln=Ne,GC(Ne)):Ln=null}break t}}gr=0,La=null,Mm(d,p,F,5);break;case 6:gr=0,La=null,Mm(d,p,F,6);break;case 8:_M(),ao=6;break e;default:throw Error(r(462))}}Pge();break}catch(Ze){P4(d,Ze)}while(!0);return iu=ap=null,L.H=T,L.A=$,mr=b,Ln!==null?0:(Dr=null,qn=0,fC(),ao)}function Pge(){for(;Ln!==null&&!Ee();)R4(Ln)}function R4(d){var p=o4(d.alternate,d,pu);d.memoizedProps=d.pendingProps,p===null?GC(d):Ln=p}function D4(d){var p=d,b=p.alternate;switch(p.tag){case 15:case 0:p=JU(b,p,p.pendingProps,p.type,void 0,qn);break;case 11:p=JU(b,p,p.pendingProps,p.type.render,p.ref,qn);break;case 5:XA(p);default:a4(b,p),p=Ln=k5(p,pu),p=o4(b,p,pu)}d.memoizedProps=d.pendingProps,p===null?GC(d):Ln=p}function Mm(d,p,b,T){iu=ap=null,XA(p),Sm=null,Cb=0;var $=p.return;try{if(yge(d,$,p,b,qn)){ao=1,NC(d,ys(b,d.current)),Ln=null;return}}catch(F){if($!==null)throw Ln=$,F;ao=1,NC(d,ys(b,d.current)),Ln=null;return}p.flags&32768?(rr||T===1?d=!0:Tm||(qn&536870912)!==0?d=!1:(Cd=d=!0,(T===2||T===9||T===3||T===6)&&(T=Ss.current,T!==null&&T.tag===13&&(T.flags|=16384))),k4(p,d)):GC(p)}function GC(d){var p=d;do{if((p.flags&32768)!==0){k4(p,Cd);return}d=p.return;var b=bge(p.alternate,p,pu);if(b!==null){Ln=b;return}if(p=p.sibling,p!==null){Ln=p;return}Ln=p=d}while(p!==null);ao===0&&(ao=5)}function k4(d,p){do{var b=xge(d.alternate,d);if(b!==null){b.flags&=32767,Ln=b;return}if(b=d.return,b!==null&&(b.flags|=32768,b.subtreeFlags=0,b.deletions=null),!p&&(d=d.sibling,d!==null)){Ln=d;return}Ln=d=b}while(d!==null);ao=6,Ln=null}function _4(d,p,b,T,$,F,X,re,ge){d.cancelPendingCommit=null;do qC();while(hi!==0);if((mr&6)!==0)throw Error(r(327));if(p!==null){if(p===d.current)throw Error(r(177));if(F=p.lanes|p.childLanes,F|=OA,yo(d,b,F,X,re,ge),d===Dr&&(Ln=Dr=null,qn=0),Im=p,Od=d,Pm=b,RM=F,DM=$,E4=T,(p.subtreeFlags&10256)!==0||(p.flags&10256)!==0?(d.callbackNode=null,d.callbackPriority=0,Dge(Ie,function(){return j4(),null})):(d.callbackNode=null,d.callbackPriority=0),T=(p.flags&13878)!==0,(p.subtreeFlags&13878)!==0||T){T=L.T,L.T=null,$=V.p,V.p=2,X=mr,mr|=4;try{Sge(d,p,b)}finally{mr=X,V.p=$,L.T=T}}hi=1,$4(),N4(),L4()}}function $4(){if(hi===1){hi=0;var d=Od,p=Im,b=(p.flags&13878)!==0;if((p.subtreeFlags&13878)!==0||b){b=L.T,L.T=null;var T=V.p;V.p=2;var $=mr;mr|=4;try{y4(p,d);var F=KM,X=C5(d.containerInfo),re=F.focusedElem,ge=F.selectionRange;if(X!==re&&re&&re.ownerDocument&&w5(re.ownerDocument.documentElement,re)){if(ge!==null&&SA(re)){var Ne=ge.start,Ze=ge.end;if(Ze===void 0&&(Ze=Ne),"selectionStart"in re)re.selectionStart=Ne,re.selectionEnd=Math.min(Ze,re.value.length);else{var ot=re.ownerDocument||document,Fe=ot&&ot.defaultView||window;if(Fe.getSelection){var ze=Fe.getSelection(),fn=re.textContent.length,nn=Math.min(ge.start,fn),Sr=ge.end===void 0?nn:Math.min(ge.end,fn);!ze.extend&&nn>Sr&&(X=Sr,Sr=nn,nn=X);var Ae=S5(re,nn),we=S5(re,Sr);if(Ae&&we&&(ze.rangeCount!==1||ze.anchorNode!==Ae.node||ze.anchorOffset!==Ae.offset||ze.focusNode!==we.node||ze.focusOffset!==we.offset)){var _e=ot.createRange();_e.setStart(Ae.node,Ae.offset),ze.removeAllRanges(),nn>Sr?(ze.addRange(_e),ze.extend(we.node,we.offset)):(_e.setEnd(we.node,we.offset),ze.addRange(_e))}}}}for(ot=[],ze=re;ze=ze.parentNode;)ze.nodeType===1&&ot.push({element:ze,left:ze.scrollLeft,top:ze.scrollTop});for(typeof re.focus=="function"&&re.focus(),re=0;re<ot.length;re++){var tt=ot[re];tt.element.scrollLeft=tt.left,tt.element.scrollTop=tt.top}}o1=!!WM,KM=WM=null}finally{mr=$,V.p=T,L.T=b}}d.current=p,hi=2}}function N4(){if(hi===2){hi=0;var d=Od,p=Im,b=(p.flags&8772)!==0;if((p.subtreeFlags&8772)!==0||b){b=L.T,L.T=null;var T=V.p;V.p=2;var $=mr;mr|=4;try{p4(d,p.alternate,p)}finally{mr=$,V.p=T,L.T=b}}hi=3}}function L4(){if(hi===4||hi===3){hi=0,xe();var d=Od,p=Im,b=Pm,T=E4;(p.subtreeFlags&10256)!==0||(p.flags&10256)!==0?hi=5:(hi=0,Im=Od=null,F4(d,d.pendingLanes));var $=d.pendingLanes;if($===0&&(Td=null),Kt(b),p=p.stateNode,rt&&typeof rt.onCommitFiberRoot=="function")try{rt.onCommitFiberRoot(We,p,void 0,(p.current.flags&128)===128)}catch{}if(T!==null){p=L.T,$=V.p,V.p=2,L.T=null;try{for(var F=d.onRecoverableError,X=0;X<T.length;X++){var re=T[X];F(re.value,{componentStack:re.stack})}}finally{L.T=p,V.p=$}}(Pm&3)!==0&&qC(),lc(d),$=d.pendingLanes,(b&4194090)!==0&&($&42)!==0?d===kM?Db++:(Db=0,kM=d):Db=0,kb(0)}}function F4(d,p){(d.pooledCacheLanes&=p)===0&&(p=d.pooledCache,p!=null&&(d.pooledCache=null,fb(p)))}function qC(d){return $4(),N4(),L4(),j4()}function j4(){if(hi!==5)return!1;var d=Od,p=RM;RM=0;var b=Kt(Pm),T=L.T,$=V.p;try{V.p=32>b?32:b,L.T=null,b=DM,DM=null;var F=Od,X=Pm;if(hi=0,Im=Od=null,Pm=0,(mr&6)!==0)throw Error(r(331));var re=mr;if(mr|=4,w4(F.current),b4(F,F.current,X,b),mr=re,kb(0,!1),rt&&typeof rt.onPostCommitFiberRoot=="function")try{rt.onPostCommitFiberRoot(We,F)}catch{}return!0}finally{V.p=$,L.T=T,F4(d,p)}}function B4(d,p,b){p=ys(b,p),p=dM(d.stateNode,p,2),d=gd(d,p,2),d!==null&&(Bn(d,2),lc(d))}function Or(d,p,b){if(d.tag===3)B4(d,d,b);else for(;p!==null;){if(p.tag===3){B4(p,d,b);break}else if(p.tag===1){var T=p.stateNode;if(typeof p.type.getDerivedStateFromError=="function"||typeof T.componentDidCatch=="function"&&(Td===null||!Td.has(T))){d=ys(b,d),b=UU(2),T=gd(p,b,2),T!==null&&(GU(b,T,p,d),Bn(T,2),lc(T));break}}p=p.return}}function LM(d,p,b){var T=d.pingCache;if(T===null){T=d.pingCache=new Ege;var $=new Set;T.set(p,$)}else $=T.get(p),$===void 0&&($=new Set,T.set(p,$));$.has(b)||(IM=!0,$.add(b),d=Age.bind(null,d,p,b),p.then(d,d))}function Age(d,p,b){var T=d.pingCache;T!==null&&T.delete(p),d.pingedLanes|=d.suspendedLanes&b,d.warmLanes&=~b,Dr===d&&(qn&b)===b&&(ao===4||ao===3&&(qn&62914560)===qn&&300>Re()-MM?(mr&2)===0&&Am(d,0):PM|=b,Om===qn&&(Om=0)),lc(d)}function z4(d,p){p===0&&(p=Rr()),d=dm(d,p),d!==null&&(Bn(d,p),lc(d))}function Mge(d){var p=d.memoizedState,b=0;p!==null&&(b=p.retryLane),z4(d,b)}function Rge(d,p){var b=0;switch(d.tag){case 13:var T=d.stateNode,$=d.memoizedState;$!==null&&(b=$.retryLane);break;case 19:T=d.stateNode;break;case 22:T=d.stateNode._retryCache;break;default:throw Error(r(314))}T!==null&&T.delete(p),z4(d,b)}function Dge(d,p){return ue(d,p)}var WC=null,Rm=null,FM=!1,KC=!1,jM=!1,pp=0;function lc(d){d!==Rm&&d.next===null&&(Rm===null?WC=Rm=d:Rm=Rm.next=d),KC=!0,FM||(FM=!0,_ge())}function kb(d,p){if(!jM&&KC){jM=!0;do for(var b=!1,T=WC;T!==null;){if(d!==0){var $=T.pendingLanes;if($===0)var F=0;else{var X=T.suspendedLanes,re=T.pingedLanes;F=(1<<31-Be(42|d)+1)-1,F&=$&~(X&~re),F=F&201326741?F&201326741|1:F?F|2:0}F!==0&&(b=!0,G4(T,F))}else F=qn,F=vt(T,T===Dr?F:0,T.cancelPendingCommit!==null||T.timeoutHandle!==-1),(F&3)===0||bt(T,F)||(b=!0,G4(T,F));T=T.next}while(b);jM=!1}}function kge(){V4()}function V4(){KC=FM=!1;var d=0;pp!==0&&(Vge()&&(d=pp),pp=0);for(var p=Re(),b=null,T=WC;T!==null;){var $=T.next,F=H4(T,p);F===0?(T.next=null,b===null?WC=$:b.next=$,$===null&&(Rm=b)):(b=T,(d!==0||(F&3)!==0)&&(KC=!0)),T=$}kb(d)}function H4(d,p){for(var b=d.suspendedLanes,T=d.pingedLanes,$=d.expirationTimes,F=d.pendingLanes&-62914561;0<F;){var X=31-Be(F),re=1<<X,ge=$[X];ge===-1?((re&b)===0||(re&T)!==0)&&($[X]=vn(re,p)):ge<=p&&(d.expiredLanes|=re),F&=~re}if(p=Dr,b=qn,b=vt(d,d===p?b:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),T=d.callbackNode,b===0||d===p&&(gr===2||gr===9)||d.cancelPendingCommit!==null)return T!==null&&T!==null&&pe(T),d.callbackNode=null,d.callbackPriority=0;if((b&3)===0||bt(d,b)){if(p=b&-b,p===d.callbackPriority)return p;switch(T!==null&&pe(T),Kt(b)){case 2:case 8:b=ve;break;case 32:b=Ie;break;case 268435456:b=Te;break;default:b=Ie}return T=U4.bind(null,d),b=ue(b,T),d.callbackPriority=p,d.callbackNode=b,p}return T!==null&&T!==null&&pe(T),d.callbackPriority=2,d.callbackNode=null,2}function U4(d,p){if(hi!==0&&hi!==5)return d.callbackNode=null,d.callbackPriority=0,null;var b=d.callbackNode;if(qC()&&d.callbackNode!==b)return null;var T=qn;return T=vt(d,d===Dr?T:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),T===0?null:(O4(d,T,p),H4(d,Re()),d.callbackNode!=null&&d.callbackNode===b?U4.bind(null,d):null)}function G4(d,p){if(qC())return null;O4(d,p,!0)}function _ge(){Uge(function(){(mr&6)!==0?ue(Pe,kge):V4()})}function BM(){return pp===0&&(pp=kn()),pp}function q4(d){return d==null||typeof d=="symbol"||typeof d=="boolean"?null:typeof d=="function"?d:iC(""+d)}function W4(d,p){var b=p.ownerDocument.createElement("input");return b.name=p.name,b.value=p.value,d.id&&b.setAttribute("form",d.id),p.parentNode.insertBefore(b,p),d=new FormData(d),b.parentNode.removeChild(b),d}function $ge(d,p,b,T,$){if(p==="submit"&&b&&b.stateNode===$){var F=q4(($[Xt]||null).action),X=T.submitter;X&&(p=(p=X[Xt]||null)?q4(p.formAction):X.getAttribute("formAction"),p!==null&&(F=p,X=null));var re=new cC("action","action",null,T,$);d.push({event:re,listeners:[{instance:null,listener:function(){if(T.defaultPrevented){if(pp!==0){var ge=X?W4($,X):new FormData($);aM(b,{pending:!0,data:ge,method:$.method,action:F},null,ge)}}else typeof F=="function"&&(re.preventDefault(),ge=X?W4($,X):new FormData($),aM(b,{pending:!0,data:ge,method:$.method,action:F},F,ge))},currentTarget:$}]})}}for(var zM=0;zM<TA.length;zM++){var VM=TA[zM],Nge=VM.toLowerCase(),Lge=VM[0].toUpperCase()+VM.slice(1);fl(Nge,"on"+Lge)}fl(O5,"onAnimationEnd"),fl(I5,"onAnimationIteration"),fl(P5,"onAnimationStart"),fl("dblclick","onDoubleClick"),fl("focusin","onFocus"),fl("focusout","onBlur"),fl(ege,"onTransitionRun"),fl(tge,"onTransitionStart"),fl(nge,"onTransitionCancel"),fl(A5,"onTransitionEnd"),Gt("onMouseEnter",["mouseout","mouseover"]),Gt("onMouseLeave",["mouseout","mouseover"]),Gt("onPointerEnter",["pointerout","pointerover"]),Gt("onPointerLeave",["pointerout","pointerover"]),hn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),hn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),hn("onBeforeInput",["compositionend","keypress","textInput","paste"]),hn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),hn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),hn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _b="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Fge=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(_b));function K4(d,p){p=(p&4)!==0;for(var b=0;b<d.length;b++){var T=d[b],$=T.event;T=T.listeners;e:{var F=void 0;if(p)for(var X=T.length-1;0<=X;X--){var re=T[X],ge=re.instance,Ne=re.currentTarget;if(re=re.listener,ge!==F&&$.isPropagationStopped())break e;F=re,$.currentTarget=Ne;try{F($)}catch(Ze){$C(Ze)}$.currentTarget=null,F=ge}else for(X=0;X<T.length;X++){if(re=T[X],ge=re.instance,Ne=re.currentTarget,re=re.listener,ge!==F&&$.isPropagationStopped())break e;F=re,$.currentTarget=Ne;try{F($)}catch(Ze){$C(Ze)}$.currentTarget=null,F=ge}}}}function Fn(d,p){var b=p[Xo];b===void 0&&(b=p[Xo]=new Set);var T=d+"__bubble";b.has(T)||(Y4(p,d,2,!1),b.add(T))}function HM(d,p,b){var T=0;p&&(T|=4),Y4(b,d,T,p)}var YC="_reactListening"+Math.random().toString(36).slice(2);function UM(d){if(!d[YC]){d[YC]=!0,Ye.forEach(function(b){b!=="selectionchange"&&(Fge.has(b)||HM(b,!1,d),HM(b,!0,d))});var p=d.nodeType===9?d:d.ownerDocument;p===null||p[YC]||(p[YC]=!0,HM("selectionchange",!1,p))}}function Y4(d,p,b,T){switch(b3(p)){case 2:var $=dye;break;case 8:$=fye;break;default:$=oR}b=$.bind(null,p,b,d),$=void 0,!fA||p!=="touchstart"&&p!=="touchmove"&&p!=="wheel"||($=!0),T?$!==void 0?d.addEventListener(p,b,{capture:!0,passive:$}):d.addEventListener(p,b,!0):$!==void 0?d.addEventListener(p,b,{passive:$}):d.addEventListener(p,b,!1)}function GM(d,p,b,T,$){var F=T;if((p&1)===0&&(p&2)===0&&T!==null)e:for(;;){if(T===null)return;var X=T.tag;if(X===3||X===4){var re=T.stateNode.containerInfo;if(re===$)break;if(X===4)for(X=T.return;X!==null;){var ge=X.tag;if((ge===3||ge===4)&&X.stateNode.containerInfo===$)return;X=X.return}for(;re!==null;){if(X=Fr(re),X===null)return;if(ge=X.tag,ge===5||ge===6||ge===26||ge===27){T=F=X;continue e}re=re.parentNode}}T=T.return}n5(function(){var Ne=F,Ze=uA(b),ot=[];e:{var Fe=M5.get(d);if(Fe!==void 0){var ze=cC,fn=d;switch(d){case"keypress":if(sC(b)===0)break e;case"keydown":case"keyup":ze=Dme;break;case"focusin":fn="focus",ze=gA;break;case"focusout":fn="blur",ze=gA;break;case"beforeblur":case"afterblur":ze=gA;break;case"click":if(b.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ze=i5;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ze=xme;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ze=$me;break;case O5:case I5:case P5:ze=Cme;break;case A5:ze=Lme;break;case"scroll":case"scrollend":ze=vme;break;case"wheel":ze=jme;break;case"copy":case"cut":case"paste":ze=Tme;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ze=s5;break;case"toggle":case"beforetoggle":ze=zme}var nn=(p&4)!==0,Sr=!nn&&(d==="scroll"||d==="scrollend"),Ae=nn?Fe!==null?Fe+"Capture":null:Fe;nn=[];for(var we=Ne,_e;we!==null;){var tt=we;if(_e=tt.stateNode,tt=tt.tag,tt!==5&&tt!==26&&tt!==27||_e===null||Ae===null||(tt=Zv(we,Ae),tt!=null&&nn.push($b(we,tt,_e))),Sr)break;we=we.return}0<nn.length&&(Fe=new ze(Fe,fn,null,b,Ze),ot.push({event:Fe,listeners:nn}))}}if((p&7)===0){e:{if(Fe=d==="mouseover"||d==="pointerover",ze=d==="mouseout"||d==="pointerout",Fe&&b!==cA&&(fn=b.relatedTarget||b.fromElement)&&(Fr(fn)||fn[Vn]))break e;if((ze||Fe)&&(Fe=Ze.window===Ze?Ze:(Fe=Ze.ownerDocument)?Fe.defaultView||Fe.parentWindow:window,ze?(fn=b.relatedTarget||b.toElement,ze=Ne,fn=fn?Fr(fn):null,fn!==null&&(Sr=i(fn),nn=fn.tag,fn!==Sr||nn!==5&&nn!==27&&nn!==6)&&(fn=null)):(ze=null,fn=Ne),ze!==fn)){if(nn=i5,tt="onMouseLeave",Ae="onMouseEnter",we="mouse",(d==="pointerout"||d==="pointerover")&&(nn=s5,tt="onPointerLeave",Ae="onPointerEnter",we="pointer"),Sr=ze==null?Fe:ul(ze),_e=fn==null?Fe:ul(fn),Fe=new nn(tt,we+"leave",ze,b,Ze),Fe.target=Sr,Fe.relatedTarget=_e,tt=null,Fr(Ze)===Ne&&(nn=new nn(Ae,we+"enter",fn,b,Ze),nn.target=_e,nn.relatedTarget=Sr,tt=nn),Sr=tt,ze&&fn)t:{for(nn=ze,Ae=fn,we=0,_e=nn;_e;_e=Dm(_e))we++;for(_e=0,tt=Ae;tt;tt=Dm(tt))_e++;for(;0<we-_e;)nn=Dm(nn),we--;for(;0<_e-we;)Ae=Dm(Ae),_e--;for(;we--;){if(nn===Ae||Ae!==null&&nn===Ae.alternate)break t;nn=Dm(nn),Ae=Dm(Ae)}nn=null}else nn=null;ze!==null&&Q4(ot,Fe,ze,nn,!1),fn!==null&&Sr!==null&&Q4(ot,Sr,fn,nn,!0)}}e:{if(Fe=Ne?ul(Ne):window,ze=Fe.nodeName&&Fe.nodeName.toLowerCase(),ze==="select"||ze==="input"&&Fe.type==="file")var Bt=m5;else if(p5(Fe))if(g5)Bt=Xme;else{Bt=Yme;var _n=Kme}else ze=Fe.nodeName,!ze||ze.toLowerCase()!=="input"||Fe.type!=="checkbox"&&Fe.type!=="radio"?Ne&&lA(Ne.elementType)&&(Bt=m5):Bt=Qme;if(Bt&&(Bt=Bt(d,Ne))){h5(ot,Bt,b,Ze);break e}_n&&_n(d,Fe,Ne),d==="focusout"&&Ne&&Fe.type==="number"&&Ne.memoizedProps.value!=null&&sA(Fe,"number",Fe.value)}switch(_n=Ne?ul(Ne):window,d){case"focusin":(p5(_n)||_n.contentEditable==="true")&&(lm=_n,wA=Ne,sb=null);break;case"focusout":sb=wA=lm=null;break;case"mousedown":CA=!0;break;case"contextmenu":case"mouseup":case"dragend":CA=!1,E5(ot,b,Ze);break;case"selectionchange":if(Zme)break;case"keydown":case"keyup":E5(ot,b,Ze)}var qt;if(vA)e:{switch(d){case"compositionstart":var an="onCompositionStart";break e;case"compositionend":an="onCompositionEnd";break e;case"compositionupdate":an="onCompositionUpdate";break e}an=void 0}else sm?d5(d,b)&&(an="onCompositionEnd"):d==="keydown"&&b.keyCode===229&&(an="onCompositionStart");an&&(l5&&b.locale!=="ko"&&(sm||an!=="onCompositionStart"?an==="onCompositionEnd"&&sm&&(qt=r5()):(fd=Ze,pA="value"in fd?fd.value:fd.textContent,sm=!0)),_n=QC(Ne,an),0<_n.length&&(an=new a5(an,d,null,b,Ze),ot.push({event:an,listeners:_n}),qt?an.data=qt:(qt=f5(b),qt!==null&&(an.data=qt)))),(qt=Hme?Ume(d,b):Gme(d,b))&&(an=QC(Ne,"onBeforeInput"),0<an.length&&(_n=new a5("onBeforeInput","beforeinput",null,b,Ze),ot.push({event:_n,listeners:an}),_n.data=qt)),$ge(ot,d,Ne,b,Ze)}K4(ot,p)})}function $b(d,p,b){return{instance:d,listener:p,currentTarget:b}}function QC(d,p){for(var b=p+"Capture",T=[];d!==null;){var $=d,F=$.stateNode;if($=$.tag,$!==5&&$!==26&&$!==27||F===null||($=Zv(d,b),$!=null&&T.unshift($b(d,$,F)),$=Zv(d,p),$!=null&&T.push($b(d,$,F))),d.tag===3)return T;d=d.return}return[]}function Dm(d){if(d===null)return null;do d=d.return;while(d&&d.tag!==5&&d.tag!==27);return d||null}function Q4(d,p,b,T,$){for(var F=p._reactName,X=[];b!==null&&b!==T;){var re=b,ge=re.alternate,Ne=re.stateNode;if(re=re.tag,ge!==null&&ge===T)break;re!==5&&re!==26&&re!==27||Ne===null||(ge=Ne,$?(Ne=Zv(b,F),Ne!=null&&X.unshift($b(b,Ne,ge))):$||(Ne=Zv(b,F),Ne!=null&&X.push($b(b,Ne,ge)))),b=b.return}X.length!==0&&d.push({event:p,listeners:X})}var jge=/\r\n?/g,Bge=/\u0000|\uFFFD/g;function X4(d){return(typeof d=="string"?d:""+d).replace(jge,`
`).replace(Bge,"")}function J4(d,p){return p=X4(p),X4(d)===p}function XC(){}function xr(d,p,b,T,$,F){switch(b){case"children":typeof T=="string"?p==="body"||p==="textarea"&&T===""||om(d,T):(typeof T=="number"||typeof T=="bigint")&&p!=="body"&&om(d,""+T);break;case"className":Xf(d,"class",T);break;case"tabIndex":Xf(d,"tabindex",T);break;case"dir":case"role":case"viewBox":case"width":case"height":Xf(d,b,T);break;case"style":e5(d,T,F);break;case"data":if(p!=="object"){Xf(d,"data",T);break}case"src":case"href":if(T===""&&(p!=="a"||b!=="href")){d.removeAttribute(b);break}if(T==null||typeof T=="function"||typeof T=="symbol"||typeof T=="boolean"){d.removeAttribute(b);break}T=iC(""+T),d.setAttribute(b,T);break;case"action":case"formAction":if(typeof T=="function"){d.setAttribute(b,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof F=="function"&&(b==="formAction"?(p!=="input"&&xr(d,p,"name",$.name,$,null),xr(d,p,"formEncType",$.formEncType,$,null),xr(d,p,"formMethod",$.formMethod,$,null),xr(d,p,"formTarget",$.formTarget,$,null)):(xr(d,p,"encType",$.encType,$,null),xr(d,p,"method",$.method,$,null),xr(d,p,"target",$.target,$,null)));if(T==null||typeof T=="symbol"||typeof T=="boolean"){d.removeAttribute(b);break}T=iC(""+T),d.setAttribute(b,T);break;case"onClick":T!=null&&(d.onclick=XC);break;case"onScroll":T!=null&&Fn("scroll",d);break;case"onScrollEnd":T!=null&&Fn("scrollend",d);break;case"dangerouslySetInnerHTML":if(T!=null){if(typeof T!="object"||!("__html"in T))throw Error(r(61));if(b=T.__html,b!=null){if($.children!=null)throw Error(r(60));d.innerHTML=b}}break;case"multiple":d.multiple=T&&typeof T!="function"&&typeof T!="symbol";break;case"muted":d.muted=T&&typeof T!="function"&&typeof T!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(T==null||typeof T=="function"||typeof T=="boolean"||typeof T=="symbol"){d.removeAttribute("xlink:href");break}b=iC(""+T),d.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",b);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":T!=null&&typeof T!="function"&&typeof T!="symbol"?d.setAttribute(b,""+T):d.removeAttribute(b);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":T&&typeof T!="function"&&typeof T!="symbol"?d.setAttribute(b,""):d.removeAttribute(b);break;case"capture":case"download":T===!0?d.setAttribute(b,""):T!==!1&&T!=null&&typeof T!="function"&&typeof T!="symbol"?d.setAttribute(b,T):d.removeAttribute(b);break;case"cols":case"rows":case"size":case"span":T!=null&&typeof T!="function"&&typeof T!="symbol"&&!isNaN(T)&&1<=T?d.setAttribute(b,T):d.removeAttribute(b);break;case"rowSpan":case"start":T==null||typeof T=="function"||typeof T=="symbol"||isNaN(T)?d.removeAttribute(b):d.setAttribute(b,T);break;case"popover":Fn("beforetoggle",d),Fn("toggle",d),nm(d,"popover",T);break;case"xlinkActuate":ca(d,"http://www.w3.org/1999/xlink","xlink:actuate",T);break;case"xlinkArcrole":ca(d,"http://www.w3.org/1999/xlink","xlink:arcrole",T);break;case"xlinkRole":ca(d,"http://www.w3.org/1999/xlink","xlink:role",T);break;case"xlinkShow":ca(d,"http://www.w3.org/1999/xlink","xlink:show",T);break;case"xlinkTitle":ca(d,"http://www.w3.org/1999/xlink","xlink:title",T);break;case"xlinkType":ca(d,"http://www.w3.org/1999/xlink","xlink:type",T);break;case"xmlBase":ca(d,"http://www.w3.org/XML/1998/namespace","xml:base",T);break;case"xmlLang":ca(d,"http://www.w3.org/XML/1998/namespace","xml:lang",T);break;case"xmlSpace":ca(d,"http://www.w3.org/XML/1998/namespace","xml:space",T);break;case"is":nm(d,"is",T);break;case"innerText":case"textContent":break;default:(!(2<b.length)||b[0]!=="o"&&b[0]!=="O"||b[1]!=="n"&&b[1]!=="N")&&(b=gme.get(b)||b,nm(d,b,T))}}function qM(d,p,b,T,$,F){switch(b){case"style":e5(d,T,F);break;case"dangerouslySetInnerHTML":if(T!=null){if(typeof T!="object"||!("__html"in T))throw Error(r(61));if(b=T.__html,b!=null){if($.children!=null)throw Error(r(60));d.innerHTML=b}}break;case"children":typeof T=="string"?om(d,T):(typeof T=="number"||typeof T=="bigint")&&om(d,""+T);break;case"onScroll":T!=null&&Fn("scroll",d);break;case"onScrollEnd":T!=null&&Fn("scrollend",d);break;case"onClick":T!=null&&(d.onclick=XC);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!$t.hasOwnProperty(b))e:{if(b[0]==="o"&&b[1]==="n"&&($=b.endsWith("Capture"),p=b.slice(2,$?b.length-7:void 0),F=d[Xt]||null,F=F!=null?F[b]:null,typeof F=="function"&&d.removeEventListener(p,F,$),typeof T=="function")){typeof F!="function"&&F!==null&&(b in d?d[b]=null:d.hasAttribute(b)&&d.removeAttribute(b)),d.addEventListener(p,T,$);break e}b in d?d[b]=T:T===!0?d.setAttribute(b,""):nm(d,b,T)}}}function mi(d,p,b){switch(p){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Fn("error",d),Fn("load",d);var T=!1,$=!1,F;for(F in b)if(b.hasOwnProperty(F)){var X=b[F];if(X!=null)switch(F){case"src":T=!0;break;case"srcSet":$=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,p));default:xr(d,p,F,X,b,null)}}$&&xr(d,p,"srcSet",b.srcSet,b,null),T&&xr(d,p,"src",b.src,b,null);return;case"input":Fn("invalid",d);var re=F=X=$=null,ge=null,Ne=null;for(T in b)if(b.hasOwnProperty(T)){var Ze=b[T];if(Ze!=null)switch(T){case"name":$=Ze;break;case"type":X=Ze;break;case"checked":ge=Ze;break;case"defaultChecked":Ne=Ze;break;case"value":F=Ze;break;case"defaultValue":re=Ze;break;case"children":case"dangerouslySetInnerHTML":if(Ze!=null)throw Error(r(137,p));break;default:xr(d,p,T,Ze,b,null)}}QH(d,F,re,ge,Ne,X,$,!1),rC(d);return;case"select":Fn("invalid",d),T=X=F=null;for($ in b)if(b.hasOwnProperty($)&&(re=b[$],re!=null))switch($){case"value":F=re;break;case"defaultValue":X=re;break;case"multiple":T=re;default:xr(d,p,$,re,b,null)}p=F,b=X,d.multiple=!!T,p!=null?rm(d,!!T,p,!1):b!=null&&rm(d,!!T,b,!0);return;case"textarea":Fn("invalid",d),F=$=T=null;for(X in b)if(b.hasOwnProperty(X)&&(re=b[X],re!=null))switch(X){case"value":T=re;break;case"defaultValue":$=re;break;case"children":F=re;break;case"dangerouslySetInnerHTML":if(re!=null)throw Error(r(91));break;default:xr(d,p,X,re,b,null)}JH(d,T,$,F),rC(d);return;case"option":for(ge in b)if(b.hasOwnProperty(ge)&&(T=b[ge],T!=null))switch(ge){case"selected":d.selected=T&&typeof T!="function"&&typeof T!="symbol";break;default:xr(d,p,ge,T,b,null)}return;case"dialog":Fn("beforetoggle",d),Fn("toggle",d),Fn("cancel",d),Fn("close",d);break;case"iframe":case"object":Fn("load",d);break;case"video":case"audio":for(T=0;T<_b.length;T++)Fn(_b[T],d);break;case"image":Fn("error",d),Fn("load",d);break;case"details":Fn("toggle",d);break;case"embed":case"source":case"link":Fn("error",d),Fn("load",d);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Ne in b)if(b.hasOwnProperty(Ne)&&(T=b[Ne],T!=null))switch(Ne){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,p));default:xr(d,p,Ne,T,b,null)}return;default:if(lA(p)){for(Ze in b)b.hasOwnProperty(Ze)&&(T=b[Ze],T!==void 0&&qM(d,p,Ze,T,b,void 0));return}}for(re in b)b.hasOwnProperty(re)&&(T=b[re],T!=null&&xr(d,p,re,T,b,null))}function zge(d,p,b,T){switch(p){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var $=null,F=null,X=null,re=null,ge=null,Ne=null,Ze=null;for(ze in b){var ot=b[ze];if(b.hasOwnProperty(ze)&&ot!=null)switch(ze){case"checked":break;case"value":break;case"defaultValue":ge=ot;default:T.hasOwnProperty(ze)||xr(d,p,ze,null,T,ot)}}for(var Fe in T){var ze=T[Fe];if(ot=b[Fe],T.hasOwnProperty(Fe)&&(ze!=null||ot!=null))switch(Fe){case"type":F=ze;break;case"name":$=ze;break;case"checked":Ne=ze;break;case"defaultChecked":Ze=ze;break;case"value":X=ze;break;case"defaultValue":re=ze;break;case"children":case"dangerouslySetInnerHTML":if(ze!=null)throw Error(r(137,p));break;default:ze!==ot&&xr(d,p,Fe,ze,T,ot)}}aA(d,X,re,ge,Ne,Ze,F,$);return;case"select":ze=X=re=Fe=null;for(F in b)if(ge=b[F],b.hasOwnProperty(F)&&ge!=null)switch(F){case"value":break;case"multiple":ze=ge;default:T.hasOwnProperty(F)||xr(d,p,F,null,T,ge)}for($ in T)if(F=T[$],ge=b[$],T.hasOwnProperty($)&&(F!=null||ge!=null))switch($){case"value":Fe=F;break;case"defaultValue":re=F;break;case"multiple":X=F;default:F!==ge&&xr(d,p,$,F,T,ge)}p=re,b=X,T=ze,Fe!=null?rm(d,!!b,Fe,!1):!!T!=!!b&&(p!=null?rm(d,!!b,p,!0):rm(d,!!b,b?[]:"",!1));return;case"textarea":ze=Fe=null;for(re in b)if($=b[re],b.hasOwnProperty(re)&&$!=null&&!T.hasOwnProperty(re))switch(re){case"value":break;case"children":break;default:xr(d,p,re,null,T,$)}for(X in T)if($=T[X],F=b[X],T.hasOwnProperty(X)&&($!=null||F!=null))switch(X){case"value":Fe=$;break;case"defaultValue":ze=$;break;case"children":break;case"dangerouslySetInnerHTML":if($!=null)throw Error(r(91));break;default:$!==F&&xr(d,p,X,$,T,F)}XH(d,Fe,ze);return;case"option":for(var fn in b)if(Fe=b[fn],b.hasOwnProperty(fn)&&Fe!=null&&!T.hasOwnProperty(fn))switch(fn){case"selected":d.selected=!1;break;default:xr(d,p,fn,null,T,Fe)}for(ge in T)if(Fe=T[ge],ze=b[ge],T.hasOwnProperty(ge)&&Fe!==ze&&(Fe!=null||ze!=null))switch(ge){case"selected":d.selected=Fe&&typeof Fe!="function"&&typeof Fe!="symbol";break;default:xr(d,p,ge,Fe,T,ze)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var nn in b)Fe=b[nn],b.hasOwnProperty(nn)&&Fe!=null&&!T.hasOwnProperty(nn)&&xr(d,p,nn,null,T,Fe);for(Ne in T)if(Fe=T[Ne],ze=b[Ne],T.hasOwnProperty(Ne)&&Fe!==ze&&(Fe!=null||ze!=null))switch(Ne){case"children":case"dangerouslySetInnerHTML":if(Fe!=null)throw Error(r(137,p));break;default:xr(d,p,Ne,Fe,T,ze)}return;default:if(lA(p)){for(var Sr in b)Fe=b[Sr],b.hasOwnProperty(Sr)&&Fe!==void 0&&!T.hasOwnProperty(Sr)&&qM(d,p,Sr,void 0,T,Fe);for(Ze in T)Fe=T[Ze],ze=b[Ze],!T.hasOwnProperty(Ze)||Fe===ze||Fe===void 0&&ze===void 0||qM(d,p,Ze,Fe,T,ze);return}}for(var Ae in b)Fe=b[Ae],b.hasOwnProperty(Ae)&&Fe!=null&&!T.hasOwnProperty(Ae)&&xr(d,p,Ae,null,T,Fe);for(ot in T)Fe=T[ot],ze=b[ot],!T.hasOwnProperty(ot)||Fe===ze||Fe==null&&ze==null||xr(d,p,ot,Fe,T,ze)}var WM=null,KM=null;function JC(d){return d.nodeType===9?d:d.ownerDocument}function Z4(d){switch(d){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function e3(d,p){if(d===0)switch(p){case"svg":return 1;case"math":return 2;default:return 0}return d===1&&p==="foreignObject"?0:d}function YM(d,p){return d==="textarea"||d==="noscript"||typeof p.children=="string"||typeof p.children=="number"||typeof p.children=="bigint"||typeof p.dangerouslySetInnerHTML=="object"&&p.dangerouslySetInnerHTML!==null&&p.dangerouslySetInnerHTML.__html!=null}var QM=null;function Vge(){var d=window.event;return d&&d.type==="popstate"?d===QM?!1:(QM=d,!0):(QM=null,!1)}var t3=typeof setTimeout=="function"?setTimeout:void 0,Hge=typeof clearTimeout=="function"?clearTimeout:void 0,n3=typeof Promise=="function"?Promise:void 0,Uge=typeof queueMicrotask=="function"?queueMicrotask:typeof n3<"u"?function(d){return n3.resolve(null).then(d).catch(Gge)}:t3;function Gge(d){setTimeout(function(){throw d})}function Pd(d){return d==="head"}function r3(d,p){var b=p,T=0,$=0;do{var F=b.nextSibling;if(d.removeChild(b),F&&F.nodeType===8)if(b=F.data,b==="/$"){if(0<T&&8>T){b=T;var X=d.ownerDocument;if(b&1&&Nb(X.documentElement),b&2&&Nb(X.body),b&4)for(b=X.head,Nb(b),X=b.firstChild;X;){var re=X.nextSibling,ge=X.nodeName;X[Ii]||ge==="SCRIPT"||ge==="STYLE"||ge==="LINK"&&X.rel.toLowerCase()==="stylesheet"||b.removeChild(X),X=re}}if($===0){d.removeChild(F),Ub(p);return}$--}else b==="$"||b==="$?"||b==="$!"?$++:T=b.charCodeAt(0)-48;else T=0;b=F}while(b);Ub(p)}function XM(d){var p=d.firstChild;for(p&&p.nodeType===10&&(p=p.nextSibling);p;){var b=p;switch(p=p.nextSibling,b.nodeName){case"HTML":case"HEAD":case"BODY":XM(b),vo(b);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(b.rel.toLowerCase()==="stylesheet")continue}d.removeChild(b)}}function qge(d,p,b,T){for(;d.nodeType===1;){var $=b;if(d.nodeName.toLowerCase()!==p.toLowerCase()){if(!T&&(d.nodeName!=="INPUT"||d.type!=="hidden"))break}else if(T){if(!d[Ii])switch(p){case"meta":if(!d.hasAttribute("itemprop"))break;return d;case"link":if(F=d.getAttribute("rel"),F==="stylesheet"&&d.hasAttribute("data-precedence"))break;if(F!==$.rel||d.getAttribute("href")!==($.href==null||$.href===""?null:$.href)||d.getAttribute("crossorigin")!==($.crossOrigin==null?null:$.crossOrigin)||d.getAttribute("title")!==($.title==null?null:$.title))break;return d;case"style":if(d.hasAttribute("data-precedence"))break;return d;case"script":if(F=d.getAttribute("src"),(F!==($.src==null?null:$.src)||d.getAttribute("type")!==($.type==null?null:$.type)||d.getAttribute("crossorigin")!==($.crossOrigin==null?null:$.crossOrigin))&&F&&d.hasAttribute("async")&&!d.hasAttribute("itemprop"))break;return d;default:return d}}else if(p==="input"&&d.type==="hidden"){var F=$.name==null?null:""+$.name;if($.type==="hidden"&&d.getAttribute("name")===F)return d}else return d;if(d=hl(d.nextSibling),d===null)break}return null}function Wge(d,p,b){if(p==="")return null;for(;d.nodeType!==3;)if((d.nodeType!==1||d.nodeName!=="INPUT"||d.type!=="hidden")&&!b||(d=hl(d.nextSibling),d===null))return null;return d}function JM(d){return d.data==="$!"||d.data==="$?"&&d.ownerDocument.readyState==="complete"}function Kge(d,p){var b=d.ownerDocument;if(d.data!=="$?"||b.readyState==="complete")p();else{var T=function(){p(),b.removeEventListener("DOMContentLoaded",T)};b.addEventListener("DOMContentLoaded",T),d._reactRetry=T}}function hl(d){for(;d!=null;d=d.nextSibling){var p=d.nodeType;if(p===1||p===3)break;if(p===8){if(p=d.data,p==="$"||p==="$!"||p==="$?"||p==="F!"||p==="F")break;if(p==="/$")return null}}return d}var ZM=null;function o3(d){d=d.previousSibling;for(var p=0;d;){if(d.nodeType===8){var b=d.data;if(b==="$"||b==="$!"||b==="$?"){if(p===0)return d;p--}else b==="/$"&&p++}d=d.previousSibling}return null}function i3(d,p,b){switch(p=JC(b),d){case"html":if(d=p.documentElement,!d)throw Error(r(452));return d;case"head":if(d=p.head,!d)throw Error(r(453));return d;case"body":if(d=p.body,!d)throw Error(r(454));return d;default:throw Error(r(451))}}function Nb(d){for(var p=d.attributes;p.length;)d.removeAttributeNode(p[0]);vo(d)}var Cs=new Map,a3=new Set;function ZC(d){return typeof d.getRootNode=="function"?d.getRootNode():d.nodeType===9?d:d.ownerDocument}var hu=V.d;V.d={f:Yge,r:Qge,D:Xge,C:Jge,L:Zge,m:eye,X:nye,S:tye,M:rye};function Yge(){var d=hu.f(),p=UC();return d||p}function Qge(d){var p=zi(d);p!==null&&p.tag===5&&p.type==="form"?OU(p):hu.r(d)}var km=typeof document>"u"?null:document;function s3(d,p,b){var T=km;if(T&&typeof p=="string"&&p){var $=gs(p);$='link[rel="'+d+'"][href="'+$+'"]',typeof b=="string"&&($+='[crossorigin="'+b+'"]'),a3.has($)||(a3.add($),d={rel:d,crossOrigin:b,href:p},T.querySelector($)===null&&(p=T.createElement("link"),mi(p,"link",d),He(p),T.head.appendChild(p)))}}function Xge(d){hu.D(d),s3("dns-prefetch",d,null)}function Jge(d,p){hu.C(d,p),s3("preconnect",d,p)}function Zge(d,p,b){hu.L(d,p,b);var T=km;if(T&&d&&p){var $='link[rel="preload"][as="'+gs(p)+'"]';p==="image"&&b&&b.imageSrcSet?($+='[imagesrcset="'+gs(b.imageSrcSet)+'"]',typeof b.imageSizes=="string"&&($+='[imagesizes="'+gs(b.imageSizes)+'"]')):$+='[href="'+gs(d)+'"]';var F=$;switch(p){case"style":F=_m(d);break;case"script":F=$m(d)}Cs.has(F)||(d=u({rel:"preload",href:p==="image"&&b&&b.imageSrcSet?void 0:d,as:p},b),Cs.set(F,d),T.querySelector($)!==null||p==="style"&&T.querySelector(Lb(F))||p==="script"&&T.querySelector(Fb(F))||(p=T.createElement("link"),mi(p,"link",d),He(p),T.head.appendChild(p)))}}function eye(d,p){hu.m(d,p);var b=km;if(b&&d){var T=p&&typeof p.as=="string"?p.as:"script",$='link[rel="modulepreload"][as="'+gs(T)+'"][href="'+gs(d)+'"]',F=$;switch(T){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":F=$m(d)}if(!Cs.has(F)&&(d=u({rel:"modulepreload",href:d},p),Cs.set(F,d),b.querySelector($)===null)){switch(T){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(b.querySelector(Fb(F)))return}T=b.createElement("link"),mi(T,"link",d),He(T),b.head.appendChild(T)}}}function tye(d,p,b){hu.S(d,p,b);var T=km;if(T&&d){var $=dl(T).hoistableStyles,F=_m(d);p=p||"default";var X=$.get(F);if(!X){var re={loading:0,preload:null};if(X=T.querySelector(Lb(F)))re.loading=5;else{d=u({rel:"stylesheet",href:d,"data-precedence":p},b),(b=Cs.get(F))&&eR(d,b);var ge=X=T.createElement("link");He(ge),mi(ge,"link",d),ge._p=new Promise(function(Ne,Ze){ge.onload=Ne,ge.onerror=Ze}),ge.addEventListener("load",function(){re.loading|=1}),ge.addEventListener("error",function(){re.loading|=2}),re.loading|=4,e1(X,p,T)}X={type:"stylesheet",instance:X,count:1,state:re},$.set(F,X)}}}function nye(d,p){hu.X(d,p);var b=km;if(b&&d){var T=dl(b).hoistableScripts,$=$m(d),F=T.get($);F||(F=b.querySelector(Fb($)),F||(d=u({src:d,async:!0},p),(p=Cs.get($))&&tR(d,p),F=b.createElement("script"),He(F),mi(F,"link",d),b.head.appendChild(F)),F={type:"script",instance:F,count:1,state:null},T.set($,F))}}function rye(d,p){hu.M(d,p);var b=km;if(b&&d){var T=dl(b).hoistableScripts,$=$m(d),F=T.get($);F||(F=b.querySelector(Fb($)),F||(d=u({src:d,async:!0,type:"module"},p),(p=Cs.get($))&&tR(d,p),F=b.createElement("script"),He(F),mi(F,"link",d),b.head.appendChild(F)),F={type:"script",instance:F,count:1,state:null},T.set($,F))}}function l3(d,p,b,T){var $=($=ce.current)?ZC($):null;if(!$)throw Error(r(446));switch(d){case"meta":case"title":return null;case"style":return typeof b.precedence=="string"&&typeof b.href=="string"?(p=_m(b.href),b=dl($).hoistableStyles,T=b.get(p),T||(T={type:"style",instance:null,count:0,state:null},b.set(p,T)),T):{type:"void",instance:null,count:0,state:null};case"link":if(b.rel==="stylesheet"&&typeof b.href=="string"&&typeof b.precedence=="string"){d=_m(b.href);var F=dl($).hoistableStyles,X=F.get(d);if(X||($=$.ownerDocument||$,X={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},F.set(d,X),(F=$.querySelector(Lb(d)))&&!F._p&&(X.instance=F,X.state.loading=5),Cs.has(d)||(b={rel:"preload",as:"style",href:b.href,crossOrigin:b.crossOrigin,integrity:b.integrity,media:b.media,hrefLang:b.hrefLang,referrerPolicy:b.referrerPolicy},Cs.set(d,b),F||oye($,d,b,X.state))),p&&T===null)throw Error(r(528,""));return X}if(p&&T!==null)throw Error(r(529,""));return null;case"script":return p=b.async,b=b.src,typeof b=="string"&&p&&typeof p!="function"&&typeof p!="symbol"?(p=$m(b),b=dl($).hoistableScripts,T=b.get(p),T||(T={type:"script",instance:null,count:0,state:null},b.set(p,T)),T):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,d))}}function _m(d){return'href="'+gs(d)+'"'}function Lb(d){return'link[rel="stylesheet"]['+d+"]"}function c3(d){return u({},d,{"data-precedence":d.precedence,precedence:null})}function oye(d,p,b,T){d.querySelector('link[rel="preload"][as="style"]['+p+"]")?T.loading=1:(p=d.createElement("link"),T.preload=p,p.addEventListener("load",function(){return T.loading|=1}),p.addEventListener("error",function(){return T.loading|=2}),mi(p,"link",b),He(p),d.head.appendChild(p))}function $m(d){return'[src="'+gs(d)+'"]'}function Fb(d){return"script[async]"+d}function u3(d,p,b){if(p.count++,p.instance===null)switch(p.type){case"style":var T=d.querySelector('style[data-href~="'+gs(b.href)+'"]');if(T)return p.instance=T,He(T),T;var $=u({},b,{"data-href":b.href,"data-precedence":b.precedence,href:null,precedence:null});return T=(d.ownerDocument||d).createElement("style"),He(T),mi(T,"style",$),e1(T,b.precedence,d),p.instance=T;case"stylesheet":$=_m(b.href);var F=d.querySelector(Lb($));if(F)return p.state.loading|=4,p.instance=F,He(F),F;T=c3(b),($=Cs.get($))&&eR(T,$),F=(d.ownerDocument||d).createElement("link"),He(F);var X=F;return X._p=new Promise(function(re,ge){X.onload=re,X.onerror=ge}),mi(F,"link",T),p.state.loading|=4,e1(F,b.precedence,d),p.instance=F;case"script":return F=$m(b.src),($=d.querySelector(Fb(F)))?(p.instance=$,He($),$):(T=b,($=Cs.get(F))&&(T=u({},b),tR(T,$)),d=d.ownerDocument||d,$=d.createElement("script"),He($),mi($,"link",T),d.head.appendChild($),p.instance=$);case"void":return null;default:throw Error(r(443,p.type))}else p.type==="stylesheet"&&(p.state.loading&4)===0&&(T=p.instance,p.state.loading|=4,e1(T,b.precedence,d));return p.instance}function e1(d,p,b){for(var T=b.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),$=T.length?T[T.length-1]:null,F=$,X=0;X<T.length;X++){var re=T[X];if(re.dataset.precedence===p)F=re;else if(F!==$)break}F?F.parentNode.insertBefore(d,F.nextSibling):(p=b.nodeType===9?b.head:b,p.insertBefore(d,p.firstChild))}function eR(d,p){d.crossOrigin==null&&(d.crossOrigin=p.crossOrigin),d.referrerPolicy==null&&(d.referrerPolicy=p.referrerPolicy),d.title==null&&(d.title=p.title)}function tR(d,p){d.crossOrigin==null&&(d.crossOrigin=p.crossOrigin),d.referrerPolicy==null&&(d.referrerPolicy=p.referrerPolicy),d.integrity==null&&(d.integrity=p.integrity)}var t1=null;function d3(d,p,b){if(t1===null){var T=new Map,$=t1=new Map;$.set(b,T)}else $=t1,T=$.get(b),T||(T=new Map,$.set(b,T));if(T.has(d))return T;for(T.set(d,null),b=b.getElementsByTagName(d),$=0;$<b.length;$++){var F=b[$];if(!(F[Ii]||F[Ut]||d==="link"&&F.getAttribute("rel")==="stylesheet")&&F.namespaceURI!=="http://www.w3.org/2000/svg"){var X=F.getAttribute(p)||"";X=d+X;var re=T.get(X);re?re.push(F):T.set(X,[F])}}return T}function f3(d,p,b){d=d.ownerDocument||d,d.head.insertBefore(b,p==="title"?d.querySelector("head > title"):null)}function iye(d,p,b){if(b===1||p.itemProp!=null)return!1;switch(d){case"meta":case"title":return!0;case"style":if(typeof p.precedence!="string"||typeof p.href!="string"||p.href==="")break;return!0;case"link":if(typeof p.rel!="string"||typeof p.href!="string"||p.href===""||p.onLoad||p.onError)break;switch(p.rel){case"stylesheet":return d=p.disabled,typeof p.precedence=="string"&&d==null;default:return!0}case"script":if(p.async&&typeof p.async!="function"&&typeof p.async!="symbol"&&!p.onLoad&&!p.onError&&p.src&&typeof p.src=="string")return!0}return!1}function p3(d){return!(d.type==="stylesheet"&&(d.state.loading&3)===0)}var jb=null;function aye(){}function sye(d,p,b){if(jb===null)throw Error(r(475));var T=jb;if(p.type==="stylesheet"&&(typeof b.media!="string"||matchMedia(b.media).matches!==!1)&&(p.state.loading&4)===0){if(p.instance===null){var $=_m(b.href),F=d.querySelector(Lb($));if(F){d=F._p,d!==null&&typeof d=="object"&&typeof d.then=="function"&&(T.count++,T=n1.bind(T),d.then(T,T)),p.state.loading|=4,p.instance=F,He(F);return}F=d.ownerDocument||d,b=c3(b),($=Cs.get($))&&eR(b,$),F=F.createElement("link"),He(F);var X=F;X._p=new Promise(function(re,ge){X.onload=re,X.onerror=ge}),mi(F,"link",b),p.instance=F}T.stylesheets===null&&(T.stylesheets=new Map),T.stylesheets.set(p,d),(d=p.state.preload)&&(p.state.loading&3)===0&&(T.count++,p=n1.bind(T),d.addEventListener("load",p),d.addEventListener("error",p))}}function lye(){if(jb===null)throw Error(r(475));var d=jb;return d.stylesheets&&d.count===0&&nR(d,d.stylesheets),0<d.count?function(p){var b=setTimeout(function(){if(d.stylesheets&&nR(d,d.stylesheets),d.unsuspend){var T=d.unsuspend;d.unsuspend=null,T()}},6e4);return d.unsuspend=p,function(){d.unsuspend=null,clearTimeout(b)}}:null}function n1(){if(this.count--,this.count===0){if(this.stylesheets)nR(this,this.stylesheets);else if(this.unsuspend){var d=this.unsuspend;this.unsuspend=null,d()}}}var r1=null;function nR(d,p){d.stylesheets=null,d.unsuspend!==null&&(d.count++,r1=new Map,p.forEach(cye,d),r1=null,n1.call(d))}function cye(d,p){if(!(p.state.loading&4)){var b=r1.get(d);if(b)var T=b.get(null);else{b=new Map,r1.set(d,b);for(var $=d.querySelectorAll("link[data-precedence],style[data-precedence]"),F=0;F<$.length;F++){var X=$[F];(X.nodeName==="LINK"||X.getAttribute("media")!=="not all")&&(b.set(X.dataset.precedence,X),T=X)}T&&b.set(null,T)}$=p.instance,X=$.getAttribute("data-precedence"),F=b.get(X)||T,F===T&&b.set(null,$),b.set(X,$),this.count++,T=n1.bind(this),$.addEventListener("load",T),$.addEventListener("error",T),F?F.parentNode.insertBefore($,F.nextSibling):(d=d.nodeType===9?d.head:d,d.insertBefore($,d.firstChild)),p.state.loading|=4}}var Bb={$$typeof:E,Provider:null,Consumer:null,_currentValue:W,_currentValue2:W,_threadCount:0};function uye(d,p,b,T,$,F,X,re){this.tag=1,this.containerInfo=d,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=nr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=nr(0),this.hiddenUpdates=nr(null),this.identifierPrefix=T,this.onUncaughtError=$,this.onCaughtError=F,this.onRecoverableError=X,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=re,this.incompleteTransitions=new Map}function h3(d,p,b,T,$,F,X,re,ge,Ne,Ze,ot){return d=new uye(d,p,b,X,re,ge,Ne,ot),p=1,F===!0&&(p|=24),F=_a(3,null,null,p),d.current=F,F.stateNode=d,p=LA(),p.refCount++,d.pooledCache=p,p.refCount++,F.memoizedState={element:T,isDehydrated:b,cache:p},zA(F),d}function m3(d){return d?(d=fm,d):fm}function g3(d,p,b,T,$,F){$=m3($),T.context===null?T.context=$:T.pendingContext=$,T=md(p),T.payload={element:b},F=F===void 0?null:F,F!==null&&(T.callback=F),b=gd(d,T,p),b!==null&&(ja(b,d,p),gb(b,d,p))}function y3(d,p){if(d=d.memoizedState,d!==null&&d.dehydrated!==null){var b=d.retryLane;d.retryLane=b!==0&&b<p?b:p}}function rR(d,p){y3(d,p),(d=d.alternate)&&y3(d,p)}function v3(d){if(d.tag===13){var p=dm(d,67108864);p!==null&&ja(p,d,67108864),rR(d,67108864)}}var o1=!0;function dye(d,p,b,T){var $=L.T;L.T=null;var F=V.p;try{V.p=2,oR(d,p,b,T)}finally{V.p=F,L.T=$}}function fye(d,p,b,T){var $=L.T;L.T=null;var F=V.p;try{V.p=8,oR(d,p,b,T)}finally{V.p=F,L.T=$}}function oR(d,p,b,T){if(o1){var $=iR(T);if($===null)GM(d,p,T,i1,b),x3(d,T);else if(hye($,d,p,b,T))T.stopPropagation();else if(x3(d,T),p&4&&-1<pye.indexOf(d)){for(;$!==null;){var F=zi($);if(F!==null)switch(F.tag){case 3:if(F=F.stateNode,F.current.memoizedState.isDehydrated){var X=lt(F.pendingLanes);if(X!==0){var re=F;for(re.pendingLanes|=2,re.entangledLanes|=2;X;){var ge=1<<31-Be(X);re.entanglements[1]|=ge,X&=~ge}lc(F),(mr&6)===0&&(VC=Re()+500,kb(0))}}break;case 13:re=dm(F,2),re!==null&&ja(re,F,2),UC(),rR(F,2)}if(F=iR(T),F===null&&GM(d,p,T,i1,b),F===$)break;$=F}$!==null&&T.stopPropagation()}else GM(d,p,T,null,b)}}function iR(d){return d=uA(d),aR(d)}var i1=null;function aR(d){if(i1=null,d=Fr(d),d!==null){var p=i(d);if(p===null)d=null;else{var b=p.tag;if(b===13){if(d=a(p),d!==null)return d;d=null}else if(b===3){if(p.stateNode.current.memoizedState.isDehydrated)return p.tag===3?p.stateNode.containerInfo:null;d=null}else p!==d&&(d=null)}}return i1=d,null}function b3(d){switch(d){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(he()){case Pe:return 2;case ve:return 8;case Ie:case te:return 32;case Te:return 268435456;default:return 32}default:return 32}}var sR=!1,Ad=null,Md=null,Rd=null,zb=new Map,Vb=new Map,Dd=[],pye="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function x3(d,p){switch(d){case"focusin":case"focusout":Ad=null;break;case"dragenter":case"dragleave":Md=null;break;case"mouseover":case"mouseout":Rd=null;break;case"pointerover":case"pointerout":zb.delete(p.pointerId);break;case"gotpointercapture":case"lostpointercapture":Vb.delete(p.pointerId)}}function Hb(d,p,b,T,$,F){return d===null||d.nativeEvent!==F?(d={blockedOn:p,domEventName:b,eventSystemFlags:T,nativeEvent:F,targetContainers:[$]},p!==null&&(p=zi(p),p!==null&&v3(p)),d):(d.eventSystemFlags|=T,p=d.targetContainers,$!==null&&p.indexOf($)===-1&&p.push($),d)}function hye(d,p,b,T,$){switch(p){case"focusin":return Ad=Hb(Ad,d,p,b,T,$),!0;case"dragenter":return Md=Hb(Md,d,p,b,T,$),!0;case"mouseover":return Rd=Hb(Rd,d,p,b,T,$),!0;case"pointerover":var F=$.pointerId;return zb.set(F,Hb(zb.get(F)||null,d,p,b,T,$)),!0;case"gotpointercapture":return F=$.pointerId,Vb.set(F,Hb(Vb.get(F)||null,d,p,b,T,$)),!0}return!1}function S3(d){var p=Fr(d.target);if(p!==null){var b=i(p);if(b!==null){if(p=b.tag,p===13){if(p=a(b),p!==null){d.blockedOn=p,gt(d.priority,function(){if(b.tag===13){var T=Fa();T=Oi(T);var $=dm(b,T);$!==null&&ja($,b,T),rR(b,T)}});return}}else if(p===3&&b.stateNode.current.memoizedState.isDehydrated){d.blockedOn=b.tag===3?b.stateNode.containerInfo:null;return}}}d.blockedOn=null}function a1(d){if(d.blockedOn!==null)return!1;for(var p=d.targetContainers;0<p.length;){var b=iR(d.nativeEvent);if(b===null){b=d.nativeEvent;var T=new b.constructor(b.type,b);cA=T,b.target.dispatchEvent(T),cA=null}else return p=zi(b),p!==null&&v3(p),d.blockedOn=b,!1;p.shift()}return!0}function w3(d,p,b){a1(d)&&b.delete(p)}function mye(){sR=!1,Ad!==null&&a1(Ad)&&(Ad=null),Md!==null&&a1(Md)&&(Md=null),Rd!==null&&a1(Rd)&&(Rd=null),zb.forEach(w3),Vb.forEach(w3)}function s1(d,p){d.blockedOn===p&&(d.blockedOn=null,sR||(sR=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,mye)))}var l1=null;function C3(d){l1!==d&&(l1=d,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){l1===d&&(l1=null);for(var p=0;p<d.length;p+=3){var b=d[p],T=d[p+1],$=d[p+2];if(typeof T!="function"){if(aR(T||b)===null)continue;break}var F=zi(b);F!==null&&(d.splice(p,3),p-=3,aM(F,{pending:!0,data:$,method:b.method,action:T},T,$))}}))}function Ub(d){function p(ge){return s1(ge,d)}Ad!==null&&s1(Ad,d),Md!==null&&s1(Md,d),Rd!==null&&s1(Rd,d),zb.forEach(p),Vb.forEach(p);for(var b=0;b<Dd.length;b++){var T=Dd[b];T.blockedOn===d&&(T.blockedOn=null)}for(;0<Dd.length&&(b=Dd[0],b.blockedOn===null);)S3(b),b.blockedOn===null&&Dd.shift();if(b=(d.ownerDocument||d).$$reactFormReplay,b!=null)for(T=0;T<b.length;T+=3){var $=b[T],F=b[T+1],X=$[Xt]||null;if(typeof F=="function")X||C3(b);else if(X){var re=null;if(F&&F.hasAttribute("formAction")){if($=F,X=F[Xt]||null)re=X.formAction;else if(aR($)!==null)continue}else re=X.action;typeof re=="function"?b[T+1]=re:(b.splice(T,3),T-=3),C3(b)}}}function lR(d){this._internalRoot=d}c1.prototype.render=lR.prototype.render=function(d){var p=this._internalRoot;if(p===null)throw Error(r(409));var b=p.current,T=Fa();g3(b,T,d,p,null,null)},c1.prototype.unmount=lR.prototype.unmount=function(){var d=this._internalRoot;if(d!==null){this._internalRoot=null;var p=d.containerInfo;g3(d.current,2,null,d,null,null),UC(),p[Vn]=null}};function c1(d){this._internalRoot=d}c1.prototype.unstable_scheduleHydration=function(d){if(d){var p=un();d={blockedOn:null,target:d,priority:p};for(var b=0;b<Dd.length&&p!==0&&p<Dd[b].priority;b++);Dd.splice(b,0,d),b===0&&S3(d)}};var E3=t.version;if(E3!=="19.1.0")throw Error(r(527,E3,"19.1.0"));V.findDOMNode=function(d){var p=d._reactInternals;if(p===void 0)throw typeof d.render=="function"?Error(r(188)):(d=Object.keys(d).join(","),Error(r(268,d)));return d=l(p),d=d!==null?c(d):null,d=d===null?null:d.stateNode,d};var gye={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:L,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var u1=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!u1.isDisabled&&u1.supportsFiber)try{We=u1.inject(gye),rt=u1}catch{}}return b0.createRoot=function(d,p){if(!o(d))throw Error(r(299));var b=!1,T="",$=BU,F=zU,X=VU,re=null;return p!=null&&(p.unstable_strictMode===!0&&(b=!0),p.identifierPrefix!==void 0&&(T=p.identifierPrefix),p.onUncaughtError!==void 0&&($=p.onUncaughtError),p.onCaughtError!==void 0&&(F=p.onCaughtError),p.onRecoverableError!==void 0&&(X=p.onRecoverableError),p.unstable_transitionCallbacks!==void 0&&(re=p.unstable_transitionCallbacks)),p=h3(d,1,!1,null,null,b,T,$,F,X,re,null),d[Vn]=p.current,UM(d),new lR(p)},b0.hydrateRoot=function(d,p,b){if(!o(d))throw Error(r(299));var T=!1,$="",F=BU,X=zU,re=VU,ge=null,Ne=null;return b!=null&&(b.unstable_strictMode===!0&&(T=!0),b.identifierPrefix!==void 0&&($=b.identifierPrefix),b.onUncaughtError!==void 0&&(F=b.onUncaughtError),b.onCaughtError!==void 0&&(X=b.onCaughtError),b.onRecoverableError!==void 0&&(re=b.onRecoverableError),b.unstable_transitionCallbacks!==void 0&&(ge=b.unstable_transitionCallbacks),b.formState!==void 0&&(Ne=b.formState)),p=h3(d,1,!0,p,b??null,T,$,F,X,re,ge,Ne),p.context=m3(null),b=p.current,T=Fa(),T=Oi(T),$=md(T),$.callback=null,gd(b,$,T),b=T,p.current.lanes=b,Bn(p,b),lc(p),d[Vn]=p.current,UM(d),new c1(p)},b0.version="19.1.0",b0}var iJ;function Wct(){if(iJ)return u$.exports;iJ=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),u$.exports=qct(),u$.exports}var em=Wct();const Kct=()=>Q(me,{container:!0,spacing:2,children:[S(me,{size:{xs:12,sm:4},children:S(Ede,{})}),S(me,{size:{xs:12,sm:4},children:S(Gue,{})}),S(me,{size:{xs:12,sm:4},children:S(Ide,{})})]}),zw=x.createContext({}),Pde=()=>{const{data:e,isLoading:t}=DP(),{selectedCategories:n,setSelectedCategories:r}=x.useContext(zw),[o]=je(),i=a=>()=>{const s=n.indexOf(a),l=[...n];s===-1?l.push(a):l.splice(s,1),r(l)};return t?S(Er,{}):S(ai,{children:e.map(a=>{const s=`checkbox-list-label-${a.id}`;return S(Co,{disablePadding:!0,children:Q(Fl,{role:void 0,onClick:i(a),dense:!0,children:[S(nl,{children:S(qo,{edge:"start",checked:n.indexOf(a)!==-1,tabIndex:-1,disableRipple:!0,inputProps:{"aria-labelledby":s}},`category-${a.id}`)}),S(Wr,{id:s,primary:a.translatedName})]})},a.id)})})},Yct=()=>{const[e]=je();return Q(Xj,{children:[S(Zj,{expandIcon:S(Du,{}),children:e("category")}),S(Jj,{children:S(Pde,{})})]})},Qct=()=>{const[e]=je();return S("div",{"data-testid":"categories",children:Q(go,{children:[S(at,{gutterBottom:!0,variant:"h6",m:2,children:e("category")}),S(Pde,{})]})})},Ade=()=>{const{data:e,isLoading:t}=kP(),{selectedEquipment:n,setSelectedEquipment:r}=x.useContext(zw),[o]=je(),i=a=>()=>{const s=n.indexOf(a),l=[...n];s===-1?l.push(a):l.splice(s,1),r(l)};return t?S(Er,{}):S(ai,{sx:{maxHeight:"500px",overflowY:"auto"},children:e.map(a=>{const s=`checkbox-list-label-${a.id}`;return S(Co,{disablePadding:!0,children:Q(Fl,{role:void 0,onClick:i(a),dense:!0,children:[S(nl,{children:S(qo,{edge:"start",checked:n.indexOf(a)!==-1,tabIndex:-1,disableRipple:!0,inputProps:{"aria-labelledby":s}},`muscle-${a.id}`)}),S(Wr,{id:s,primary:a.translatedName})]})},a.id)})})},Xct=()=>{const[e]=je();return Q(Xj,{children:[S(Zj,{expandIcon:S(Du,{}),children:e("exercises.equipment")}),S(Jj,{children:S(Ade,{})})]})},Jct=()=>{const[e]=je();return S("div",{"data-testid":"equipment",children:Q(go,{sx:{mt:2},children:[S(at,{gutterBottom:!0,variant:"h6",m:2,children:e("exercises.equipment")}),S(Ade,{})]})})},Zct=ae(({className:e,...t})=>S(Go,{...t,classes:{popper:e}}))(({theme:e})=>({[`& .${eo.tooltip}`]:{backgroundColor:"rgb(245, 245, 245)",color:"rgba(0, 0, 0, 0.87)",boxShadow:e.shadows[1],fontSize:11}})),Ql=({primaryMuscles:e,secondaryMuscles:t,isFront:n})=>{const r=[];r.push(...e.filter(i=>i.isFront===n).map(i=>`/muscles/main/muscle-${i.id}.svg`)),r.push(...t.filter(i=>i.isFront===n).map(i=>`/muscles/secondary/muscle-${i.id}.svg`)),r.push(n?"/muscles/muscular_system_front.svg":"/muscles/muscular_system_back.svg");const o=r.map(i=>`url(${LDe}${i})`).join(", ");return S("div",{style:{height:"400px",width:"200px",backgroundImage:o,backgroundRepeat:"no-repeat"}})},Mde=()=>{const{data:e,isLoading:t}=_v(),{selectedMuscles:n,setSelectedMuscles:r}=x.useContext(zw),[o]=je(),i=a=>()=>{const s=n.indexOf(a),l=[...n];s===-1?l.push(a):l.splice(s,1),r(l)};return t?S(Er,{}):S(ai,{sx:{maxHeight:"500px",overflowY:"auto"},children:e.map(a=>{const s=`checkbox-list-label-${a.id}`;return S(Co,{disablePadding:!0,secondaryAction:S(Zct,{title:S(Ql,{primaryMuscles:[a],secondaryMuscles:[],isFront:a.isFront}),placement:"right",arrow:!0,children:S(pn,{edge:"end","aria-label":"comments",children:S(rde,{})})}),children:Q(Fl,{role:void 0,onClick:i(a),dense:!0,children:[S(nl,{children:S(qo,{edge:"start",checked:n.indexOf(a)!==-1,tabIndex:-1,disableRipple:!0,inputProps:{"aria-labelledby":s}},`muscle-${a.id}`)}),S(Wr,{id:s,primary:a.name,secondary:a.nameEn!==""?a.translatedName:""})]})},a.id)})})},eut=()=>{const[e]=je();return Q(Xj,{children:[S(Zj,{expandIcon:S(Du,{}),children:e("exercises.muscles")}),S(Jj,{children:S(Mde,{})})]})},tut=()=>{const[e]=je();return S("div",{"data-testid":"muscles",children:Q(go,{sx:{mt:2},children:[S(at,{gutterBottom:!0,variant:"h6",m:2,children:e("exercises.muscles")}),S(Mde,{})]})})};function Wy({callback:e,loadExercise:t}){const[n,r]=x.useState(null),[o,i]=x.useState(""),[a,s]=x.useState(!0),[l,c]=x.useState([]),[u,f]=je();t=t===void 0?!1:t;const h=x.useMemo(()=>tue(m=>v2e(m,f.language,a).then(g=>c(g)),200),[f.language,a]);return x.useEffect(()=>{if(o===""){c(n?[n]:[]);return}return h(o),()=>{}},[n,o,h]),Q(Tt,{children:[S(_c,{id:"exercise-name-autocomplete",getOptionLabel:m=>m.value,"data-testid":"autocomplete",filterOptions:m=>m,options:l,autoComplete:!0,includeInputInList:!0,filterSelectedOptions:!0,value:n,noOptionsText:u("noResults"),isOptionEqualToValue:(m,g)=>m.value===g.value,onChange:async(m,g)=>{c(g?[g,...l]:l),r(g),t&&g!==null&&(g.exercise=await pv(g.data.base_id)),e(g)},onInputChange:(m,g)=>{i(g)},renderInput:m=>S(dn,{...m,label:u("exercises.searchExerciseName"),fullWidth:!0,slotProps:{input:{...m.InputProps,startAdornment:Q(Tt,{children:[S(So,{position:"start",children:S(yV,{})}),m.InputProps.startAdornment]})}}}),renderOption:(m,g,y)=>Sx("li",{...m,key:`exercise-${y.index}-${g.data.id}`,"data-testid":`autocompleter-result-${g.data.base_id}`},Q(Co,{disablePadding:!0,component:"div",children:[S(nl,{children:g.data.image?S(Kl,{alt:"",src:`${wB}${g.data.image}`,variant:"rounded"}):S(Ju,{fontSize:"large"})}),S(Wr,{primary:g.value,slotProps:{primary:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},secondary:g.data.category})]}))}),f.language!==uy&&S(Mx,{children:S(os,{control:S(qo,{checked:a,onChange:(m,g)=>s(g)}),label:u("alsoSearchEnglish")})})]})}const nut=e=>{const t=e.backgroundColor||"lightgray",n=e.iconColor||"gray",r=e.height||200;return S(Zt,{sx:{backgroundColor:t,height:r},display:"flex",alignItems:"center",justifyContent:"center",children:S(Ju,{sx:{fontSize:80,color:n}})})},Rde=({exercise:e,language:t})=>{const n=t?e.getTranslation(t):e.getTranslation(new TB(bh,"en","English")),[r,o]=je();return S(ho,{sx:{width:"100%"},children:Q(TEe,{href:cn(Qt.EXERCISE_DETAIL,o.language,{id:e.id,slug:n.nameSlug}),sx:{minHeight:330},children:[e.mainImage?S($c,{component:"img",image:e.mainImage.url,sx:{height:200},alt:""}):S($c,{children:S(nut,{})}),Q(Fi,{children:[S(Go,{title:n.name,placement:"top",arrow:!0,children:S(at,{gutterBottom:!0,variant:"h6",component:"div",noWrap:!0,children:n.name})}),S(Wl,{label:e.category.translatedName,sx:{position:"absolute",top:8,left:8},color:"primary",size:"small"},e.category.id),e.equipment.map(i=>S(at,{display:"inline",mr:1,children:i.translatedName},i.id)),e.equipment.length===0&&S(at,{color:"text.secondary",display:"inline",mr:1,children:r("exercises.noEquipment")})]})]})},e.id)},rut=({exercises:e})=>{const t=Yc(),[n,r]=je();let o;return t.isSuccess&&(o=Gu(r.language,t.data)),S(me,{container:!0,spacing:1,children:e.map(i=>S(me,{sx:{display:"flex"},size:{xs:6,md:4},children:S(Rde,{exercise:i,language:o})},i.id))})},out=()=>S(me,{container:!0,spacing:1,children:[...Array(21)].map((e,t)=>S(me,{sx:{display:"flex"},size:4,children:Q(ho,{children:[S($c,{children:S(hE,{variant:"rectangular",width:250,height:150})}),S(Fi,{children:Q(Zt,{sx:{pt:.5},children:[S(hE,{width:"60%"}),S(hE,{})]})})]})},t))}),iut=({children:e})=>{const[t]=je(),[n,r]=x.useState(!1),o=i=>()=>{r(i)};return Q(Tt,{children:[S(ct,{onClick:o(!0),children:S(jst,{})}),Q(tOe,{open:n,onClose:o(!1),anchor:"right",children:[Q(Ft,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[S(at,{gutterBottom:!0,variant:"h6",m:2,children:t("filters")}),S(ct,{onClick:o(!1),children:S(cw,{})})]}),S(ji,{}),e]})]})},aut=()=>{const[e,t]=je();return Q(Zt,{marginTop:4,padding:4,sx:{width:"100%",backgroundColor:"#ebebeb",textAlign:"center"},children:[S(at,{gutterBottom:!0,variant:"h4",component:"div",children:e("exercises.missingExercise")}),S(at,{gutterBottom:!0,variant:"body1",component:"div",children:e("exercises.missingExerciseDescription")}),S(Ro,{to:cn(Qt.EXERCISE_CONTRIBUTE,t.language),children:e("exercises.contributeExercise")})]})},sut=()=>{const e=ade(),[t,n]=je(),r=id(),{selectedCategories:o,selectedEquipment:i,selectedMuscles:a}=x.useContext(zw),s=Tf("(max-width:600px)"),[l,c]=J.useState(1),u=(v,w)=>{c(w),window.scrollTo({top:0,behavior:"smooth"})},f=x.useMemo(()=>{let v=e.data||[];return o.length>0&&(v=v.filter(w=>o.some(C=>w.category.id===C.id))),i.length>0&&(v=v.filter(w=>w.equipment.some(C=>i.some(E=>E.id===C.id)))),a.length>0&&(v=v.filter(w=>w.muscles.some(C=>a.some(E=>E.id===C.id)))),v},[e.data,o,i,a]),h=21,m=Math.ceil(f.length/h),g=f.slice((l-1)*h,l*h),y=v=>{v&&r(cn(Qt.EXERCISE_DETAIL,n.language,{id:v.data.base_id}))};return S(Uu,{maxWidth:"lg",children:Q(me,{container:!0,spacing:2,mt:2,children:[S(me,{size:{xs:10,sm:6},children:S(at,{gutterBottom:!0,variant:"h3",component:"div",children:t("exercises.exercises")})}),s?Q(Tt,{children:[S(me,{size:{xs:2,sm:6},children:S(ct,{variant:"contained",onClick:()=>r(cn(Qt.EXERCISE_CONTRIBUTE,n.language)),children:S(Ko,{})})}),S(me,{flexGrow:1,size:{sm:6},children:S(Wy,{callback:y})}),S(me,{display:"flex",justifyContent:"center",alignItems:"center",size:{xs:2,sm:6},children:Q(iut,{children:[S(Yct,{}),S(Xct,{}),S(eut,{})]})})]}):Q(Tt,{children:[S(me,{size:{xs:12,sm:3},children:S(Wy,{callback:y})}),S(me,{size:{xs:12,sm:3},children:S(ct,{variant:"contained",startIcon:S(Ko,{}),onClick:()=>r(cn(Qt.EXERCISE_CONTRIBUTE,n.language)),children:t("exercises.contributeExercise")})})]}),!s&&S(me,{size:{xs:12,sm:3},children:Q(me,{container:!0,spacing:1,children:[S(me,{size:{xs:6,sm:12},children:S(Qct,{})}),S(me,{size:{xs:6,sm:12},children:S(Jct,{})}),S(me,{size:12,children:S(tut,{})})]})}),Q(me,{size:{xs:12,sm:9},children:[e.isLoading?S(out,{}):Q(Tt,{children:[S(rut,{exercises:g}),S(Ft,{spacing:2,alignItems:"center",sx:{mt:2},children:S(yPe,{count:m,color:"primary",page:l,onChange:u})})]}),S(aut,{})]})]})})},aJ=()=>{const[e,t]=x.useState([]),[n,r]=x.useState([]),[o,i]=J.useState([]);return S(zw.Provider,{value:{selectedEquipment:e,setSelectedEquipment:t,selectedMuscles:n,setSelectedMuscles:r,selectedCategories:o,setSelectedCategories:i},children:S(sut,{})})};function Dde(e){const{t}=je();return Q(ct,{size:"small",component:"a",href:e.href,children:[S(kst,{fontSize:"inherit"}),e.backToTitle??t("goBack")]})}const ds=e=>{const t=S(Dde,{href:e.backToUrl,backToTitle:e.backToTitle});return Q(Uu,{maxWidth:"lg",children:[Q(me,{container:!0,spacing:2,children:[S(me,{sx:{mb:2},size:8,children:Q(Ft,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[Q(Ft,{alignItems:"start",children:[S(at,{variant:"h3",children:e.title}),e.subTitle&&S(at,{variant:"h6",children:e.subTitle}),e.backToUrl&&t]}),e.optionsMenu]})}),S(me,{size:{xs:12,sm:8},children:e.mainContent}),S(me,{size:{xs:12,sm:4},children:e.sideBar})]}),e.fab]})},Vw=e=>{const t=S(Dde,{href:e.backToUrl,backToTitle:e.backToTitle});return S(Uu,{maxWidth:e.maxWidth,children:Q(me,{container:!0,spacing:2,children:[S(me,{sx:{mb:2},size:12,children:Q(Ft,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[Q(Ft,{alignItems:"start",children:[S(at,{variant:"h3",children:e.title}),e.backToUrl&&t]}),e.optionsMenu]})}),S(me,{size:12,children:e.children})]})})};function kde(e){return yr({queryKey:[fv,JSON.stringify(e||{})],queryFn:()=>SNe(e)})}const lut=()=>{const e=Mt();return Dt({mutationFn:t=>CNe(t),onSuccess:()=>e.invalidateQueries({queryKey:[fv]})})},cut=e=>{const t=Mt();return Dt({mutationFn:n=>ENe(n),onSuccess:()=>{t.invalidateQueries({queryKey:[dv,e]}),t.invalidateQueries({queryKey:[fv]})}})},uut=e=>{const t=Mt();return Dt({mutationFn:n=>TNe(n),onSuccess:()=>{t.invalidateQueries({queryKey:[dv,e]}),t.invalidateQueries({queryKey:[fv]})}})};function _de(e){return yr({queryKey:[dv,e],queryFn:()=>wNe(e)})}const dut=()=>{const e=Mt();return Dt({mutationFn:t=>PNe(t),onError:t=>{console.log(t)},onSuccess:()=>{e.invalidateQueries({queryKey:[dv]}),e.invalidateQueries({queryKey:[fv]})}})},$de=()=>{const e=Mt();return Dt({mutationFn:t=>INe(t),onSuccess:()=>{e.invalidateQueries({queryKey:[dv]}),e.invalidateQueries({queryKey:[fv]})}})},fut=()=>{const e=Mt();return Dt({mutationFn:t=>ONe(t),onSuccess:()=>e.invalidateQueries({queryKey:[dv]})})},Nde=x.createContext(void 0);function tn(){const e=x.useContext(Nde);if(e===void 0)throw new Error(["MUI X: Could not find the Data Grid context.","It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.","This can also happen if you are bundling multiple versions of the Data Grid."].join(`
`));return e}const Lde=x.createContext(void 0),yt=()=>{const e=x.useContext(Lde);if(!e)throw new Error("MUI X: useGridRootProps should only be used inside the DataGrid, DataGridPro or DataGridPremium component.");return e},Fde=parseInt(x.version,10),Vt=e=>{if(Fde>=19){const t=n=>e(n,n.ref??null);return t.displayName=e.displayName??e.name,t}return x.forwardRef(e)};var xO=Symbol("NOT_FOUND");function put(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function hut(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function mut(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var sJ=e=>Array.isArray(e)?e:[e];function gut(e){const t=Array.isArray(e[0])?e[0]:e;return mut(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function yut(e,t){const n=[],{length:r}=e;for(let o=0;o<r;o++)n.push(e[o].apply(null,t));return n}function vut(e){let t;return{get(n){return t&&e(t.key,n)?t.value:xO},put(n,r){t={key:n,value:r}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function but(e,t){let n=[];function r(s){const l=n.findIndex(c=>t(s,c.key));if(l>-1){const c=n[l];return l>0&&(n.splice(l,1),n.unshift(c)),c.value}return xO}function o(s,l){r(s)===xO&&(n.unshift({key:s,value:l}),n.length>e&&n.pop())}function i(){return n}function a(){n=[]}return{get:r,put:o,getEntries:i,clear:a}}var xut=(e,t)=>e===t;function Sut(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;const{length:o}=n;for(let i=0;i<o;i++)if(!e(n[i],r[i]))return!1;return!0}}function jde(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:r=xut,maxSize:o=1,resultEqualityCheck:i}=n,a=Sut(r);let s=0;const l=o<=1?vut(a):but(o,a);function c(){let u=l.get(arguments);if(u===xO){if(u=e.apply(null,arguments),s++,i){const h=l.getEntries().find(m=>i(m.value,u));h&&(u=h.value,s!==0&&s--)}l.put(arguments,u)}return u}return c.clearCache=()=>{l.clear(),c.resetResultsCount()},c.resultsCount=()=>s,c.resetResultsCount=()=>{s=0},c}var wut=class{constructor(t){this.value=t}deref(){return this.value}},Cut=typeof WeakRef<"u"?WeakRef:wut,Eut=0,lJ=1;function Z1(){return{s:Eut,v:void 0,o:null,p:null}}function Bde(e,t={}){let n=Z1();const{resultEqualityCheck:r}=t;let o,i=0;function a(){var f;let s=n;const{length:l}=arguments;for(let h=0,m=l;h<m;h++){const g=arguments[h];if(typeof g=="function"||typeof g=="object"&&g!==null){let y=s.o;y===null&&(s.o=y=new WeakMap);const v=y.get(g);v===void 0?(s=Z1(),y.set(g,s)):s=v}else{let y=s.p;y===null&&(s.p=y=new Map);const v=y.get(g);v===void 0?(s=Z1(),y.set(g,s)):s=v}}const c=s;let u;if(s.s===lJ)u=s.v;else if(u=e.apply(null,arguments),i++,r){const h=((f=o==null?void 0:o.deref)==null?void 0:f.call(o))??o;h!=null&&r(h,u)&&(u=h,i!==0&&i--),o=typeof u=="object"&&u!==null||typeof u=="function"?new Cut(u):u}return c.s=lJ,c.v=u,u}return a.clearCache=()=>{n=Z1(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function zde(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...o)=>{let i=0,a=0,s,l={},c=o.pop();typeof c=="object"&&(l=c,c=o.pop()),put(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);const u={...n,...l},{memoize:f,memoizeOptions:h=[],argsMemoize:m=Bde,argsMemoizeOptions:g=[]}=u,y=sJ(h),v=sJ(g),w=gut(o),C=f(function(){return i++,c.apply(null,arguments)},...y),E=m(function(){a++;const O=yut(w,arguments);return s=C.apply(null,O),s},...v);return Object.assign(E,{resultFunc:c,memoizedResultFunc:C,dependencies:w,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>s,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:f,argsMemoize:m})};return Object.assign(r,{withTypes:()=>r}),r}var Tut=zde(Bde),Out=Object.assign((e,t=Tut)=>{hut(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(i=>e[i]);return t(r,(...i)=>i.reduce((a,s,l)=>(a[n[l]]=s,a),{}))},{withTypes:()=>Out});const Iut=Object.is;function Vde(e,t){if(e===t)return!0;if(!(e instanceof Object)||!(t instanceof Object))return!1;let n=0,r=0;for(const o in e)if(n+=1,!Iut(e[o],t[o])||!(o in t))return!1;for(const o in t)r+=1;return n===r}var p$={exports:{}},h$={};/**
* @license React
@@ -468,7 +468,7 @@ return result$$;`.replaceAll("$$",String(wJ)));return wJ+=1,(s,l)=>i(o,s,l)},lfe
`));Al(e)!==ne&&(n.debug("Setting selection model"),e.current.setState(de=>z({},de,{rowSelection:t.rowSelection?ne:hx})))},[e,n,t.rowSelection,t.signature,u]),v=x.useCallback(ne=>Uw(e).has(ne),[e]),w=x.useCallback(ne=>{if(t.rowSelection===!1||c&&!c(e.current.getRowParams(ne)))return!1;const le=Cc(e,ne);return!((le==null?void 0:le.type)==="footer"||(le==null?void 0:le.type)==="pinnedRow")},[e,t.rowSelection,c]),C=x.useCallback(()=>Cfe(e),[e]),E=x.useCallback((ne,le=!0,de=!1)=>{var oe,ue,pe,Ee,xe,Re;if(e.current.isRowSelectable(ne))if(a.current=ne,de){n.debug(`Setting selection for row ${ne}`);const he={type:"include",ids:new Set},Pe=ve=>{he.ids.add(ve)};le&&(Pe(ne),o&&S0(e,f,ne,((oe=t.rowSelectionPropagation)==null?void 0:oe.descendants)??!1,((ue=t.rowSelectionPropagation)==null?void 0:ue.parents)??!1,Pe)),e.current.setRowSelectionModel(he)}else{n.debug(`Toggling selection for row ${ne}`);const he=Al(e),Pe={type:he.type,ids:new Set(he.ids)},ve=Jd(Pe);ve.unselect(ne);const Ie=De=>{ve.select(De)},te=De=>{ve.unselect(De)};le?(Ie(ne),o&&S0(e,f,ne,((pe=t.rowSelectionPropagation)==null?void 0:pe.descendants)??!1,((Ee=t.rowSelectionPropagation)==null?void 0:Ee.parents)??!1,Ie)):o&&AJ(e,f,ne,((xe=t.rowSelectionPropagation)==null?void 0:xe.descendants)??!1,((Re=t.rowSelectionPropagation)==null?void 0:Re.parents)??!1,te),(Pe.type==="include"&&Pe.ids.size<2||u)&&e.current.setRowSelectionModel(Pe)}},[e,n,o,f,(Y=t.rowSelectionPropagation)==null?void 0:Y.descendants,(Z=t.rowSelectionPropagation)==null?void 0:Z.parents,u]),I=x.useCallback((ne,le=!0,de=!1)=>{var xe,Re,he,Pe,ve,Ie;if(n.debug("Setting selection for several rows"),t.rowSelection===!1)return;const oe=new Set;for(let te=0;te<ne.length;te+=1){const Te=ne[te];e.current.isRowSelectable(Te)&&oe.add(Te)}const ue=Al(e);let pe;if(de){if(pe={type:"include",ids:oe},le){const te=Jd(pe);if(o){const Te=De=>{te.select(De)};for(const De of oe)S0(e,f,De,((xe=t.rowSelectionPropagation)==null?void 0:xe.descendants)??!1,((Re=t.rowSelectionPropagation)==null?void 0:Re.parents)??!1,Te)}}else pe.ids=new Set;if(ue.type===pe.type&&pe.ids.size===ue.ids.size&&Array.from(pe.ids).every(te=>ue.ids.has(te)))return}else{pe={type:ue.type,ids:new Set(ue.ids)};const te=Jd(pe),Te=Ve=>{te.select(Ve)},De=Ve=>{te.unselect(Ve)};for(const Ve of oe)le?(te.select(Ve),o&&S0(e,f,Ve,((he=t.rowSelectionPropagation)==null?void 0:he.descendants)??!1,((Pe=t.rowSelectionPropagation)==null?void 0:Pe.parents)??!1,Te)):(De(Ve),o&&AJ(e,f,Ve,((ve=t.rowSelectionPropagation)==null?void 0:ve.descendants)??!1,((Ie=t.rowSelectionPropagation)==null?void 0:Ie.parents)??!1,De))}(pe.type==="include"&&pe.ids.size<2||u)&&e.current.setRowSelectionModel(pe)},[n,o,u,e,f,(ie=t.rowSelectionPropagation)==null?void 0:ie.descendants,(se=t.rowSelectionPropagation)==null?void 0:se.parents,t.rowSelection]),O=x.useCallback(ne=>{var ue,pe;if(!h||!o||ne.ids.size===0&&ne.type==="include")return ne;const le={type:ne.type,ids:new Set(ne.ids)},de=Jd(le),oe=Ee=>{de.select(Ee)};for(const Ee of ne.ids)S0(e,f,Ee,((ue=t.rowSelectionPropagation)==null?void 0:ue.descendants)??!1,((pe=t.rowSelectionPropagation)==null?void 0:pe.parents)??!1,oe,de);return le},[e,f,(ce=t.rowSelectionPropagation)==null?void 0:ce.descendants,(ye=t.rowSelectionPropagation)==null?void 0:ye.parents,h,o]),P=x.useCallback(({startId:ne,endId:le},de=!0,oe=!1)=>{if(!e.current.getRow(ne)||!e.current.getRow(le))return;n.debug(`Expanding selection from row ${ne} to row ${le}`);const ue=Hg(e),pe=ue.indexOf(ne),Ee=ue.indexOf(le),[xe,Re]=pe>Ee?[Ee,pe]:[pe,Ee],he=ue.slice(xe,Re+1);e.current.selectRows(he,de,oe)},[e,n]),R={selectRow:E,setRowSelectionModel:y,getSelectedRows:C,isRowSelected:v,isRowSelectable:w},D={selectRows:I,selectRowRange:P,getPropagatedRowSelectionModel:O};yn(e,R,"public"),yn(e,D,t.signature===Vl.DataGrid?"private":"public");const M=x.useRef(!0),A=x.useCallback((ne=!1)=>{var he,Pe;if(M.current)return;const le=Al(e),de=Us(e),oe=Uv(e),ue=ve=>t.filterMode==="server"?!de[ve]:!de[ve]||oe[ve]===!1,pe={type:le.type,ids:new Set(le.ids)},Ee=Jd(pe);let xe=!1;for(const ve of le.ids){if(ue(ve)){if(t.keepNonExistentRowsSelected)continue;Ee.unselect(ve),xe=!0;continue}if(!((he=t.rowSelectionPropagation)!=null&&he.parents))continue;const Ie=f[ve];if((Ie==null?void 0:Ie.type)==="group"){if(Ie.isAutoGenerated){Ee.unselect(ve),xe=!0;continue}Ie.children.every(Te=>oe[Te]===!1)||(Ee.unselect(ve),xe=!0)}}const Re=h&&((Pe=t.rowSelectionPropagation)==null?void 0:Pe.parents)&&(pe.ids.size>0||pe.type==="exclude");if(xe||Re&&!ne)if(Re)if(pe.type==="exclude"){const ve=g(),Ie=[];for(let te=0;te<ve.length;te+=1){const Te=ve[te];(t.keepNonExistentRowsSelected||!ue(Te))&&Ee.has(Te)&&Ie.push(Te)}e.current.selectRows(Ie,!0,!0)}else e.current.selectRows(Array.from(pe.ids),!0,!0);else e.current.setRowSelectionModel(pe)},[e,h,(Se=t.rowSelectionPropagation)==null?void 0:Se.parents,t.keepNonExistentRowsSelected,t.filterMode,f,g]),_=x.useCallback((ne,le)=>{const de=le.metaKey||le.ctrlKey,oe=!s&&!de&&!kgt(le),ue=!u||oe,pe=e.current.isRowSelected(ne),Re=UP(e)>1&&ue||!pe;e.current.selectRow(ne,Re,ue)},[e,u,s]),N=x.useCallback((ne,le)=>{var ue;if(l)return;const de=(ue=le.target.closest(`.${ee.cell}`))==null?void 0:ue.getAttribute("data-field");if(de===Gv.field||de===zP)return;if(de){const pe=e.current.getColumn(de);if((pe==null?void 0:pe.type)===jP)return}Cc(e,ne.id).type!=="pinnedRow"&&(le.shiftKey&&u?m(ne.id):_(ne.id,le))},[l,u,e,m,_]),B=x.useCallback((ne,le)=>{var de;u&&le.shiftKey&&((de=window.getSelection())==null||de.removeAllRanges())},[u]),H=x.useCallback((ne,le)=>{u&&le.nativeEvent.shiftKey?m(ne.id):e.current.selectRow(ne.id,ne.value,!u)},[e,m,u]),j=x.useCallback(ne=>{const le=jo(e),de=vfe(e),oe=le.items.length>0||((de==null?void 0:de.length)||0)>0;!t.isRowSelectable&&!t.checkboxSelectionVisibleOnly&&o&&!oe?e.current.setRowSelectionModel({type:ne?"exclude":"include",ids:new Set}):e.current.selectRows(g(),ne)},[e,o,g,t.checkboxSelectionVisibleOnly,t.isRowSelectable]),L=x.useCallback(ne=>{j(ne.value)},[j]),V=x.useCallback((ne,le)=>{if(e.current.getCellMode(ne.id,ne.field)!==Qn.Edit&&!Jw(le)){if(IO(le.key)&&le.shiftKey){const de=va(e);if(de&&de.id!==ne.id){le.preventDefault();const oe=e.current.isRowSelected(de.id);if(!u){e.current.selectRow(de.id,!oe,!0);return}const ue=e.current.getRowIndexRelativeToVisibleRows(de.id),pe=e.current.getRowIndexRelativeToVisibleRows(ne.id);let Ee,xe;ue>pe?oe?(Ee=pe,xe=ue-1):(Ee=pe,xe=ue):oe?(Ee=ue+1,xe=pe):(Ee=ue,xe=pe);const Re=bf(e),he=[];for(let Pe=Ee;Pe<=xe;Pe+=1)he.push(Re.rows[Pe].id);e.current.selectRows(he,!oe);return}}if(le.key===" "&&le.shiftKey){le.preventDefault(),_(ne.id,le);return}String.fromCharCode(le.keyCode)==="A"&&(le.ctrlKey||le.metaKey)&&(le.preventDefault(),j(!0))}},[e,u,_,j]),W=Je(()=>{if(!t.rowSelection){e.current.setRowSelectionModel(hx);return}if(i===void 0)return;if(!o||!h||i.type==="include"&&i.ids.size===0){e.current.setRowSelectionModel(i);return}const ne=e.current.getPropagatedRowSelectionModel(i);if(ne.type!==i.type||ne.ids.size!==i.ids.size||!Array.from(i.ids).every(le=>ne.ids.has(le))){e.current.setRowSelectionModel(ne);return}e.current.setRowSelectionModel(i)});At(e,"sortedRowsSet",r(()=>A(!0))),At(e,"filteredRowsSet",r(()=>A())),At(e,"rowClick",r(N)),At(e,"rowSelectionCheckboxChange",r(H)),At(e,"headerSelectionCheckboxChange",L),At(e,"cellMouseDown",r(B)),At(e,"cellKeyDown",r(V)),x.useEffect(()=>{W()},[e,i,t.rowSelection,W]);const K=i!=null;x.useEffect(()=>{if(K||!t.rowSelection||typeof w!="function")return;const ne=Al(e);if(ne.type!=="include")return;const le=new Set;for(const de of ne.ids)w(de)&&le.add(de);le.size<ne.ids.size&&e.current.setRowSelectionModel({type:ne.type,ids:le})},[e,w,K,t.rowSelection]),x.useEffect(()=>{if(!t.rowSelection||K)return;const ne=Al(e);!u&&(ne.type==="include"&&ne.ids.size>1||ne.type==="exclude")&&e.current.setRowSelectionModel(hx)},[e,u,s,K,t.rowSelection]),x.useEffect(()=>{r(A)},[A,r]),x.useEffect(()=>{M.current&&(M.current=!1)},[])},s0t=e=>{const{classes:t}=e;return x.useMemo(()=>Me({cellCheckbox:["cellCheckbox"],columnHeaderCheckbox:["columnHeaderCheckbox"]},Cn,t),[t])},l0t=(e,t)=>{const n={classes:t.classes},r=s0t(n),o=x.useCallback(i=>{const a=z({},Gv,{cellClassName:r.cellCheckbox,headerClassName:r.columnHeaderCheckbox,headerName:e.current.getLocaleText("checkboxSelectionHeaderName")}),s=t.checkboxSelection,l=i.lookup[wu]!=null;return s&&!l?(i.lookup[wu]=a,i.orderedFields=[wu,...i.orderedFields]):!s&&l?(delete i.lookup[wu],i.orderedFields=i.orderedFields.filter(c=>c!==wu)):s&&l&&(i.lookup[wu]=z({},a,i.lookup[wu])),i},[e,r,t.checkboxSelection]);Hr(e,"hydrateColumns",o)},c0t=(e,t)=>{var r,o;const n=t.sortModel??((o=(r=t.initialState)==null?void 0:r.sorting)==null?void 0:o.sortModel)??[];return z({},e,{sorting:{sortModel:Jde(n,t.disableMultipleColumnsSorting),sortedRows:[]}})},u0t=(e,t)=>{var O,P;const n=Qo(e,"useGridSorting");e.current.registerControlState({stateId:"sortModel",propModel:t.sortModel,propOnChange:t.onSortModelChange,stateSelector:Ns,changeEvent:"sortModelChange"});const r=x.useCallback((R,D)=>{const M=Ns(e),A=M.findIndex(N=>N.field===R);let _=[...M];return A>-1?(D==null?void 0:D.sort)==null?_.splice(A,1):_.splice(A,1,D):_=[...M,D],_},[e]),o=x.useCallback((R,D)=>{const A=Ns(e).find(_=>_.field===R.field);if(A){const _=D===void 0?bJ(R.sortingOrder??t.sortingOrder,A.sort):D;return _===void 0?void 0:z({},A,{sort:_})}return{field:R.field,sort:D===void 0?bJ(R.sortingOrder??t.sortingOrder):D}},[e,t.sortingOrder]),i=x.useCallback((R,D)=>D==null||D.sortable===!1||t.disableColumnSorting?R:(D.sortingOrder||t.sortingOrder).some(A=>!!A)?[...R,"columnMenuSortItem"]:R,[t.sortingOrder,t.disableColumnSorting]),a=x.useCallback(()=>{e.current.setState(R=>{if(t.sortingMode==="server")return n.debug("Skipping sorting rows as sortingMode = server"),z({},R,{sorting:z({},R.sorting,{sortedRows:KV(Si(e),ii,!1)})});const D=Ns(e),M=ydt(D,e),A=e.current.applyStrategyProcessor("sorting",{sortRowList:M});return z({},R,{sorting:z({},R.sorting,{sortedRows:A})})}),e.current.publishEvent("sortedRowsSet")},[e,n,t.sortingMode]),s=x.useCallback(R=>{Ns(e)!==R&&(n.debug("Setting sort model"),e.current.setState(vJ(R,t.disableMultipleColumnsSorting)),e.current.applySorting())},[e,n,t.disableMultipleColumnsSorting]),l=x.useCallback((R,D,M)=>{const A=e.current.getColumn(R),_=o(A,D);let N;!M||t.disableMultipleColumnsSorting?N=(_==null?void 0:_.sort)==null?[]:[_]:N=r(A.field,_),e.current.setSortModel(N)},[e,r,o,t.disableMultipleColumnsSorting]),c=x.useCallback(()=>Ns(e),[e]),u=x.useCallback(()=>YV(e).map(D=>D.model),[e]),f=x.useCallback(()=>Hv(e),[e]),h=x.useCallback(R=>e.current.getSortedRowIds()[R],[e]);yn(e,{getSortModel:c,getSortedRows:u,getSortedRowIds:f,getRowIdFromRowIndex:h,setSortModel:s,sortColumn:l,applySorting:a},"public");const g=x.useCallback((R,D)=>{var _,N;const M=Ns(e);return!D.exportOnlyDirtyModels||t.sortModel!=null||((N=(_=t.initialState)==null?void 0:_.sorting)==null?void 0:N.sortModel)!=null||M.length>0?z({},R,{sorting:{sortModel:M}}):R},[e,t.sortModel,(P=(O=t.initialState)==null?void 0:O.sorting)==null?void 0:P.sortModel]),y=x.useCallback((R,D)=>{var A;const M=(A=D.stateToRestore.sorting)==null?void 0:A.sortModel;return M==null?R:(e.current.setState(vJ(M,t.disableMultipleColumnsSorting)),z({},R,{callbacks:[...R.callbacks,e.current.applySorting]}))},[e,t.disableMultipleColumnsSorting]),v=x.useCallback(R=>{const D=Si(e),M=D[ii],A=R.sortRowList?R.sortRowList(M.children.map(_=>D[_])):[...M.children];return M.footerId!=null&&A.push(M.footerId),A},[e]);Hr(e,"exportState",g),Hr(e,"restoreState",y),kS(e,kh,"sorting",v);const w=x.useCallback(({field:R,colDef:D},M)=>{if(!D.sortable||t.disableColumnSorting)return;const A=M.shiftKey||M.metaKey||M.ctrlKey;l(R,void 0,A)},[l,t.disableColumnSorting]),C=x.useCallback(({field:R,colDef:D},M)=>{!D.sortable||t.disableColumnSorting||M.key==="Enter"&&!M.ctrlKey&&!M.metaKey&&l(R,void 0,M.shiftKey)},[l,t.disableColumnSorting]),E=x.useCallback(()=>{const R=Ns(e),D=ld(e);if(R.length>0){const M=R.filter(A=>D[A.field]);M.length<R.length&&e.current.setSortModel(M)}},[e]),I=x.useCallback(R=>{R==="sorting"&&e.current.applySorting()},[e]);Hr(e,"columnMenu",i),At(e,"columnHeaderClick",w),At(e,"columnHeaderKeyDown",C),At(e,"rowsSet",e.current.applySorting),At(e,"columnsChange",E),At(e,"activeStrategyProcessorChange",I),Yw(()=>{e.current.applySorting()}),In(()=>{t.sortModel!==void 0&&e.current.setSortModel(t.sortModel)},[e,t.sortModel])};function dZ(e){const{containerSize:t,scrollPosition:n,elementSize:r,elementOffset:o}=e,i=o+r;if(r>t)return o;if(i-t>n)return i-t;if(o<n)return o}const d0t=(e,t)=>{const n=vr(),r=Qo(e,"useGridScroll"),o=e.current.columnHeadersContainerRef,i=e.current.virtualScrollerRef,a=Ge(e,Qf),s=x.useCallback(f=>{var w;const h=dr(e),m=Hw(e),g=t.listView?[Xy(e)]:Yr(e);if(!(f.rowIndex==null)&&m===0||g.length===0)return!1;r.debug(`Scrolling to cell at row ${f.rowIndex}, col: ${f.colIndex} `);let v={};if(f.colIndex!==void 0){const C=Yf(e);let E;if(typeof f.rowIndex<"u"){const I=(w=a[f.rowIndex])==null?void 0:w.id,O=e.current.unstable_getCellColSpanInfo(I,f.colIndex);O&&!O.spannedByColSpan&&(E=O.cellProps.width)}typeof E>"u"&&(E=g[f.colIndex].computedWidth),v.left=dZ({containerSize:h.viewportOuterSize.width,scrollPosition:Math.abs(i.current.scrollLeft),elementSize:E,elementOffset:C[f.colIndex]})}if(f.rowIndex!==void 0){const C=Qw(e),E=_ft(e),I=Mfe(e),O=t.pagination?f.rowIndex-E*I:f.rowIndex,P=C.positions[O+1]?C.positions[O+1]-C.positions[O]:C.currentPageTotalHeight-C.positions[O];v.top=dZ({containerSize:h.viewportInnerSize.height,scrollPosition:i.current.scrollTop,elementSize:P,elementOffset:C.positions[O]})}return v=e.current.unstable_applyPipeProcessors("scrollToIndexes",v,f),typeof v.left!==void 0||typeof v.top!==void 0?(e.current.scroll(v),!0):!1},[r,e,i,t.pagination,a,t.listView]),l=x.useCallback(f=>{if(i.current&&f.left!==void 0&&o.current){const h=n?-1:1;o.current.scrollLeft=f.left,i.current.scrollLeft=h*f.left,r.debug(`Scrolling left: ${f.left}`)}i.current&&f.top!==void 0&&(i.current.scrollTop=f.top,r.debug(`Scrolling top: ${f.top}`)),r.debug("Scrolling, updating container, and viewport")},[i,n,o,r]),c=x.useCallback(()=>i!=null&&i.current?{top:i.current.scrollTop,left:i.current.scrollLeft}:{top:0,left:0},[i]);yn(e,{scroll:l,scrollToIndexes:s,getScrollPosition:c},"public")};function f0t(e,t){sr(e,"columnHeaderClick",t.onColumnHeaderClick),sr(e,"columnHeaderContextMenu",t.onColumnHeaderContextMenu),sr(e,"columnHeaderDoubleClick",t.onColumnHeaderDoubleClick),sr(e,"columnHeaderOver",t.onColumnHeaderOver),sr(e,"columnHeaderOut",t.onColumnHeaderOut),sr(e,"columnHeaderEnter",t.onColumnHeaderEnter),sr(e,"columnHeaderLeave",t.onColumnHeaderLeave),sr(e,"cellClick",t.onCellClick),sr(e,"cellDoubleClick",t.onCellDoubleClick),sr(e,"cellKeyDown",t.onCellKeyDown),sr(e,"preferencePanelClose",t.onPreferencePanelClose),sr(e,"preferencePanelOpen",t.onPreferencePanelOpen),sr(e,"menuOpen",t.onMenuOpen),sr(e,"menuClose",t.onMenuClose),sr(e,"rowDoubleClick",t.onRowDoubleClick),sr(e,"rowClick",t.onRowClick),sr(e,"stateChange",t.onStateChange)}function p0t(e,t=166){let n,r;const o=()=>{n=void 0,e(...r)};function i(...a){r=a,n===void 0&&(n=setTimeout(o,t))}return i.clear=()=>{clearTimeout(n),n=void 0},i}const lj={autoHeight:!1,autoPageSize:!1,autosizeOnMount:!1,checkboxSelection:!1,checkboxSelectionVisibleOnly:!1,clipboardCopyCellDelimiter:" ",columnBufferPx:150,columnHeaderHeight:56,disableAutosize:!1,disableColumnFilter:!1,disableColumnMenu:!1,disableColumnReorder:!1,disableColumnResize:!1,disableColumnSelector:!1,disableColumnSorting:!1,disableDensitySelector:!1,disableEval:!1,disableMultipleColumnsFiltering:!1,disableMultipleColumnsSorting:!1,disableMultipleRowSelection:!1,disableRowSelectionOnClick:!1,disableVirtualization:!1,editMode:zc.Cell,filterDebounceMs:150,filterMode:"client",hideFooter:!1,hideFooterPagination:!1,hideFooterRowCount:!1,hideFooterSelectedRowCount:!1,ignoreDiacritics:!1,ignoreValueFormatterDuringExport:!1,keepColumnPositionIfDraggedOutside:!1,keepNonExistentRowsSelected:!1,loading:!1,logger:console,logLevel:"error",pageSizeOptions:[25,50,100],pagination:!1,paginationMode:"client",resizeThrottleMs:60,rowBufferPx:150,rowHeight:52,rows:[],rowSelection:!0,rowSpacingType:"margin",rowSpanning:!1,showCellVerticalBorder:!1,showColumnVerticalBorder:!1,showToolbar:!1,sortingMode:"client",sortingOrder:["asc","desc",null],throttleRowsMs:0,virtualizeColumnsWithAutoRowHeight:!1},fg={width:0,height:0},h0t={isReady:!1,root:fg,viewportOuterSize:fg,viewportInnerSize:fg,contentSize:fg,minimumSize:fg,hasScrollX:!1,hasScrollY:!1,scrollbarSize:0,headerHeight:0,groupHeaderHeight:0,headerFilterHeight:0,rowWidth:0,rowHeight:0,columnsTotalWidth:0,leftPinnedWidth:0,rightPinnedWidth:0,headersTotalHeight:0,topContainerHeight:0,bottomContainerHeight:0},m0t=(e,t,n)=>{const r=h0t,o=Fv(n);return z({},e,{dimensions:z({},r,gpe(t,n,o,Vv(n)))})},mpe=Pt(Yr,Yf,(e,t)=>{const n=e.length;return n===0?0:Og(t[n-1]+e[n-1].computedWidth,1)});function g0t(e,t){const n=Qo(e,"useResizeContainer"),r=x.useRef(!1),o=x.useRef(fg),i=Ge(e,Vv),a=Ge(e,Fv),s=Ge(e,mpe),l=x.useRef(!0),{rowHeight:c,headerHeight:u,groupHeaderHeight:f,headerFilterHeight:h,headersTotalHeight:m,leftPinnedWidth:g,rightPinnedWidth:y}=gpe(t,e,a,i),v=x.useCallback(()=>dr(e),[e]),w=x.useCallback(A=>{e.current.setState(_=>z({},_,{dimensions:A})),e.current.rootElementRef.current&&fZ(e.current.rootElementRef.current,dr(e))},[e]),C=x.useCallback(()=>{const A=dr(e);if(!A.isReady)return 0;const _=bf(e);if(t.getRowHeight){const B=Xw(e),H=B.lastRowIndex-B.firstRowIndex;return Math.min(H-1,_.rows.length)}const N=Math.floor(A.viewportInnerSize.height/c);return Math.min(N,_.rows.length)},[e,t.getRowHeight,c]),E=x.useCallback(()=>{var Z,ie;if(l.current)return;const A=y0t(e.current.mainElementRef.current,t.scrollbarSize),_=Qw(e),N=m+_.pinnedTopRowsTotalHeight,B=_.pinnedBottomRowsTotalHeight,H={width:s,height:Og(_.currentPageTotalHeight,1)};let j,L,V=!1,W=!1;if(t.autoHeight)W=!1,V=Math.round(s)>Math.round(o.current.width),j={width:o.current.width,height:N+B+H.height},L={width:Math.max(0,j.width-(W?A:0)),height:Math.max(0,j.height-(V?A:0))};else{j={width:o.current.width,height:o.current.height},L={width:Math.max(0,j.width),height:Math.max(0,j.height-N-B)};const se=H,ce=L,ye=se.width>ce.width,Se=se.height>ce.height;(ye||Se)&&(W=Se,V=se.width+(W?A:0)>ce.width,V&&(W=se.height+A>ce.height)),W&&(L.width-=A),V&&(L.height-=A)}const K=Math.max(j.width,s+(W?A:0)),G={width:s,height:N+H.height+B},q={isReady:!0,root:o.current,viewportOuterSize:j,viewportInnerSize:L,contentSize:H,minimumSize:G,hasScrollX:V,hasScrollY:W,scrollbarSize:A,headerHeight:u,groupHeaderHeight:f,headerFilterHeight:h,rowWidth:K,rowHeight:c,columnsTotalWidth:s,leftPinnedWidth:g,rightPinnedWidth:y,headersTotalHeight:m,topContainerHeight:N,bottomContainerHeight:B},Y=e.current.state.dimensions;Js(Y,q)||(w(q),v0t(q.viewportInnerSize,Y.viewportInnerSize)||e.current.publishEvent("viewportInnerSizeChange",q.viewportInnerSize),(ie=(Z=e.current).updateRenderContext)==null||ie.call(Z))},[e,w,t.scrollbarSize,t.autoHeight,c,u,f,h,s,m,g,y]),I=Je(E),O=x.useMemo(()=>t.resizeThrottleMs>0?p0t(()=>{I(),e.current.publishEvent("debouncedResize",o.current)},t.resizeThrottleMs):void 0,[e,t.resizeThrottleMs,I]);x.useEffect(()=>O==null?void 0:O.clear,[O]);const P={getRootDimensions:v},R={updateDimensions:E,getViewportPageSize:C};In(E,[E]),yn(e,P,"public"),yn(e,R,"private");const D=x.useCallback(A=>{fZ(A,dr(e))},[e]),M=x.useCallback(A=>{if(o.current=A,A.height===0&&!r.current&&!t.autoHeight&&!TO&&(n.error(["The parent DOM element of the Data Grid has an empty height.","Please make sure that this element has an intrinsic height.","The grid displays with a height of 0px.","","More details: https://mui.com/r/x-data-grid-no-dimensions."].join(`
`)),r.current=!0),A.width===0&&!r.current&&!TO&&(n.error(["The parent DOM element of the Data Grid has an empty width.","Please make sure that this element has an intrinsic width.","The grid displays with a width of 0px.","","More details: https://mui.com/r/x-data-grid-no-dimensions."].join(`
`)),r.current=!0),l.current||!O){l.current=!1,E();return}O()},[E,t.autoHeight,O,n]);sr(e,"rootMount",D),sr(e,"resize",M),sr(e,"debouncedResize",t.onResize)}function fZ(e,t){const n=(r,o)=>e.style.setProperty(r,o);n("--DataGrid-hasScrollX",`${Number(t.hasScrollX)}`),n("--DataGrid-hasScrollY",`${Number(t.hasScrollY)}`),n("--DataGrid-scrollbarSize",`${t.scrollbarSize}px`),n("--DataGrid-rowWidth",`${t.rowWidth}px`),n("--DataGrid-columnsTotalWidth",`${t.columnsTotalWidth}px`),n("--DataGrid-leftPinnedWidth",`${t.leftPinnedWidth}px`),n("--DataGrid-rightPinnedWidth",`${t.rightPinnedWidth}px`),n("--DataGrid-headerHeight",`${t.headerHeight}px`),n("--DataGrid-headersTotalHeight",`${t.headersTotalHeight}px`),n("--DataGrid-topContainerHeight",`${t.topContainerHeight}px`),n("--DataGrid-bottomContainerHeight",`${t.bottomContainerHeight}px`),n("--height",`${t.rowHeight}px`)}function gpe(e,t,n,r){const o=hfe(e.rowHeight,lj.rowHeight);return{rowHeight:Math.floor(o*n),headerHeight:Math.floor(e.columnHeaderHeight*n),groupHeaderHeight:Math.floor((e.columnGroupHeaderHeight??e.columnHeaderHeight)*n),headerFilterHeight:Math.floor((e.headerFilterHeight??e.columnHeaderHeight)*n),columnsTotalWidth:mpe(t),headersTotalHeight:rH(t,e),leftPinnedWidth:r.left.reduce((i,a)=>i+a.computedWidth,0),rightPinnedWidth:r.right.reduce((i,a)=>i+a.computedWidth,0)}}const pZ=new WeakMap;function y0t(e,t){if(t!==void 0)return t;if(e===null)return 0;const n=pZ.get(e);if(n!==void 0)return n;const o=Mr(e).createElement("div");o.style.width="99px",o.style.height="99px",o.style.position="absolute",o.style.overflow="scroll",o.className="scrollDiv",e.appendChild(o);const i=o.offsetWidth-o.clientWidth;return e.removeChild(o),pZ.set(e,i),i}function v0t(e,t){return e.width===t.width&&e.height===t.height}const b0t=typeof globalThis.ResizeObserver<"u"?globalThis.ResizeObserver:class{observe(){}unobserve(){}disconnect(){}},x0t=(e,t,n)=>{n.current.caches.rowsMeta={heights:new Map};const r=VV(n),o=Hw(n),i=Gw(n),a=Math.min(i.enabled?i.paginationModel.pageSize:o,o);return z({},e,{rowsMeta:{currentPageTotalHeight:a*r,positions:Array.from({length:a},(s,l)=>l*r),pinnedTopRowsTotalHeight:0,pinnedBottomRowsTotalHeight:0}})},S0t=(e,t)=>{const{getRowHeight:n,getRowSpacing:r,getEstimatedRowHeight:o}=t,i=e.current.caches.rowsMeta.heights,a=x.useRef(-1),s=x.useRef(!1),l=x.useRef(!1),c=Ge(e,Fv),u=oH(e),f=Ge(e,Bv),h=Ge(e,VV),m=A=>{let _=i.get(A);return _===void 0&&(_={content:h,spacingTop:0,spacingBottom:0,detail:0,autoHeight:!1,needsFirstMeasurement:!0},i.set(A,_)),_},g=x.useCallback(A=>{const _=dr(e).rowHeight,N=e.current.getRowHeightEntry(A.id);if(!n)N.content=_,N.needsFirstMeasurement=!1;else{const B=n(z({},A,{densityFactor:c}));if(B==="auto"){if(N.needsFirstMeasurement){const H=o?o(z({},A,{densityFactor:c})):_;N.content=H??_}s.current=!0,N.autoHeight=!0}else N.content=hfe(B,_),N.needsFirstMeasurement=!1,N.autoHeight=!1}if(r){const B=e.current.getRowIndexRelativeToVisibleRows(A.id),H=r(z({},A,{isFirstVisible:B===0,isLastVisible:B===u.rows.length-1,indexRelativeToCurrentPage:B}));N.spacingTop=H.top??0,N.spacingBottom=H.bottom??0}else N.spacingTop=0,N.spacingBottom=0;return e.current.unstable_applyPipeProcessors("rowHeight",N,A),N},[e,u.rows,n,o,h,r,c]),y=x.useCallback(()=>{s.current=!1;const A=f.top.reduce((L,V)=>{const W=g(V);return L+W.content+W.spacingTop+W.spacingBottom+W.detail},0),_=f.bottom.reduce((L,V)=>{const W=g(V);return L+W.content+W.spacingTop+W.spacingBottom+W.detail},0),N=[],B=u.rows.reduce((L,V)=>{N.push(L);const W=g(V),K=W.content+W.spacingTop+W.spacingBottom+W.detail;return L+K},0);s.current||(a.current=1/0);const H=A!==e.current.state.rowsMeta.pinnedTopRowsTotalHeight||_!==e.current.state.rowsMeta.pinnedBottomRowsTotalHeight||B!==e.current.state.rowsMeta.currentPageTotalHeight,j={currentPageTotalHeight:B,positions:N,pinnedTopRowsTotalHeight:A,pinnedBottomRowsTotalHeight:_};e.current.setState(L=>z({},L,{rowsMeta:j})),H&&e.current.updateDimensions(),l.current=!0},[e,f,u.rows,g]),v=A=>{var _;return((_=i.get(A))==null?void 0:_.content)??h},w=(A,_)=>{const N=e.current.getRowHeightEntry(A),B=N.content!==_;N.needsFirstMeasurement=!1,N.content=_,l.current&&(l.current=!B)},C=A=>{var _;return((_=i.get(A))==null?void 0:_.autoHeight)??!1},E=()=>a.current,I=A=>{s.current&&A>a.current&&(a.current=A)},O=()=>{i.clear(),y()},P=Xl(()=>new b0t(A=>{var _;for(let N=0;N<A.length;N+=1){const B=A[N],H=B.borderBoxSize&&B.borderBoxSize.length>0?B.borderBoxSize[0].blockSize:B.contentRect.height,j=B.target.__mui_id;if(((_=Hfe(e))==null?void 0:_.id)===j&&H===0)return;e.current.unstable_storeRowHeightMeasurement(j,H)}l.current||e.current.requestPipeProcessorsApplication("rowHeight")})).current,R=(A,_)=>(A.__mui_id=_,P.observe(A),()=>P.unobserve(A));dH(e,"rowHeight",y),In(()=>{y()},[y]);const D={unstable_getRowHeight:v,unstable_setLastMeasuredRowIndex:I,unstable_storeRowHeightMeasurement:w,resetRowHeights:O},M={hydrateRowsMeta:y,observeRowHeight:R,rowHasAutoHeight:C,getRowHeightEntry:m,getLastMeasuredRowIndex:E};yn(e,D,"public"),yn(e,M,"private")},w0t=e=>{const t=x.useCallback((o={})=>e.current.unstable_applyPipeProcessors("exportState",{},o),[e]),n=x.useCallback(o=>{e.current.unstable_applyPipeProcessors("restoreState",{callbacks:[]},{stateToRestore:o}).callbacks.forEach(a=>{a()})},[e]);yn(e,{exportState:t,restoreState:n},"public")},C0t=e=>{const t=x.useRef({}),n=(s,l)=>{var c;return(c=t.current[s])==null?void 0:c[l]},r=()=>{t.current={}},o=x.useCallback(({rowId:s,minFirstColumn:l,maxLastColumn:c,columns:u})=>{for(let f=l;f<c;f+=1){const h=E0t({apiRef:e,lookup:t.current,columnIndex:f,rowId:s,minFirstColumnIndex:l,maxLastColumnIndex:c,columns:u});h.colSpan>1&&(f+=h.colSpan-1)}},[e]),i={unstable_getCellColSpanInfo:n},a={resetColSpan:r,calculateColSpan:o};yn(e,i,"public"),yn(e,a,"private"),At(e,"columnOrderChange",r)};function E0t(e){const{apiRef:t,lookup:n,columnIndex:r,rowId:o,minFirstColumnIndex:i,maxLastColumnIndex:a,columns:s}=e,l=s.length,c=s[r],u=t.current.getRow(o),f=t.current.getRowValue(u,c),h=typeof c.colSpan=="function"?c.colSpan(f,u,c,t):c.colSpan;if(!h||h===1)return C$(n,o,r,{spannedByColSpan:!1,cellProps:{colSpan:1,width:c.computedWidth}}),{colSpan:1};let m=c.computedWidth;for(let g=1;g<h;g+=1){const y=r+g;if(y>=i&&y<a){const v=s[y];m+=v.computedWidth,C$(n,o,r+g,{spannedByColSpan:!0,rightVisibleCellIndex:Math.min(r+h,l-1),leftVisibleCellIndex:r})}C$(n,o,r,{spannedByColSpan:!1,cellProps:{colSpan:h,width:m}})}return{colSpan:h}}function C$(e,t,n,r){e[t]||(e[t]={}),e[t][n]=r}const ype=(e,t,n)=>{if(rfe(e)){if(n[e.field]!==void 0)throw new Error(["MUI X: columnGroupingModel contains duplicated field",`column field ${e.field} occurs two times in the grouping model:`,`- ${n[e.field].join(" > ")}`,`- ${t.join(" > ")}`].join(`
-`));n[e.field]=t;return}const{groupId:r,children:o}=e;o.forEach(i=>{ype(i,[...t,r],n)})},cj=e=>{if(!e)return{};const t={};return e.forEach(n=>{ype(n,[],t)}),t},uj=(e,t,n)=>{const r=l=>t[l]??[],o=[],i=Math.max(...e.map(l=>r(l).length)),a=(l,c,u)=>Js(r(l).slice(0,u+1),r(c).slice(0,u+1)),s=(l,c)=>!!(n!=null&&n.left&&n.left.includes(l)&&!n.left.includes(c)||n!=null&&n.right&&!n.right.includes(l)&&n.right.includes(c));for(let l=0;l<i;l+=1){const c=e.reduce((u,f)=>{const h=r(f)[l]??null;if(u.length===0)return[{columnFields:[f],groupId:h}];const m=u[u.length-1],g=m.columnFields[m.columnFields.length-1];return m.groupId!==h||!a(g,f,l)||s(g,f)?[...u,{columnFields:[f],groupId:h}]:[...u.slice(0,u.length-1),{columnFields:[...m.columnFields,f],groupId:h}]},[]);o.push(c)}return o},T0t=["groupId","children"],fH=e=>{let t={};return e.forEach(n=>{if(rfe(n))return;const{groupId:r,children:o}=n,i=$e(n,T0t);if(!r)throw new Error("MUI X: An element of the columnGroupingModel does not have either `field` or `groupId`.");const a=z({},i,{groupId:r}),s=fH(o);if(s[r]!==void 0||t[r]!==void 0)throw new Error(`MUI X: The groupId ${r} is used multiple times in the columnGroupingModel.`);t=z({},t,s,{[r]:a})}),z({},t)},O0t=(e,t,n)=>{if(!t.columnGroupingModel)return e;const r=Rc(n),o=zv(n),i=fH(t.columnGroupingModel??[]),a=cj(t.columnGroupingModel??[]),s=uj(r,a,n.current.state.pinnedColumns??{}),l=o.length===0?0:Math.max(...o.map(c=>{var u;return((u=a[c])==null?void 0:u.length)??0}));return z({},e,{columnGrouping:{lookup:i,unwrappedGroupingModel:a,headerStructure:s,maxDepth:l}})},I0t=(e,t)=>{const n=x.useCallback(s=>Nfe(e)[s]??[],[e]),r=x.useCallback(()=>Lfe(e),[e]);yn(e,{getColumnGroupPath:n,getAllGroupDetails:r},"public");const i=x.useCallback(()=>{const s=cj(t.columnGroupingModel??[]);e.current.setState(l=>{var h;const c=((h=l.columns)==null?void 0:h.orderedFields)??[],u=l.pinnedColumns??{},f=uj(c,s,u);return z({},l,{columnGrouping:z({},l.columnGrouping,{headerStructure:f})})})},[e,t.columnGroupingModel]),a=x.useCallback(s=>{var y,v;const l=((v=(y=e.current).getPinnedColumns)==null?void 0:v.call(y))??{},c=Rc(e),u=zv(e),f=fH(s??[]),h=cj(s??[]),m=uj(c,h,l),g=u.length===0?0:Math.max(...u.map(w=>{var C;return((C=h[w])==null?void 0:C.length)??0}));e.current.setState(w=>z({},w,{columnGrouping:{lookup:f,unwrappedGroupingModel:h,headerStructure:m,maxDepth:g}}))},[e]);At(e,"columnIndexChange",i),At(e,"columnsChange",()=>{a(t.columnGroupingModel)}),At(e,"columnVisibilityModelChange",()=>{a(t.columnGroupingModel)}),x.useEffect(()=>{a(t.columnGroupingModel)},[a,t.columnGroupingModel])};function P0t(){let e,t;const n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n}function hZ(e,t){if(t!==void 0&&e.changedTouches){for(let n=0;n<e.changedTouches.length;n+=1){const r=e.changedTouches[n];if(r.identifier===t)return{x:r.clientX,y:r.clientY}}return!1}return{x:e.clientX,y:e.clientY}}function mZ(e,t,n,r){let o=e;return r==="Right"?o+=t-n.left:o+=n.right-t,o}function A0t(e,t,n){return n==="Left"?e-t.left:t.right-e}function M0t(e){return e==="Right"?"Left":"Right"}function R0t(e,t){const n=e.classList.contains(ee["columnSeparator--sideRight"])?"Right":"Left";return t?M0t(n):n}function gZ(e){e.preventDefault(),e.stopImmediatePropagation()}function D0t(e){const t=x.useRef(void 0),n=()=>zfe(e),r=Ge(e,n);return x.useEffect(()=>{t.current&&r===!1&&(t.current.resolve(),t.current=void 0)}),()=>{if(!t.current){if(n()===!1)return Promise.resolve();t.current=P0t()}return t.current}}function k0t(e,t){if(e.length<4)return e;const n=e.slice();n.sort((s,l)=>s-l);const r=n[Math.floor(n.length*.25)],o=n[Math.floor(n.length*.75)-1],i=o-r,a=i<5?5:i*t;return n.filter(s=>s>r-a&&s<o+a)}function _0t(e,t,n){const r={},o=e.current.rootElementRef.current;return o.classList.add(ee.autosizing),n.forEach(i=>{const s=Hmt(e.current,i.field).map(g=>g.getBoundingClientRect().width??0),l=t.includeOutliers?s:k0t(s,t.outliersFactor);if(t.includeHeaders){const g=Vmt(e.current,i.field);if(g){const y=g.querySelector(`.${ee.columnHeaderTitle}`),v=g.querySelector(`.${ee.columnHeaderTitleContainerContent}`),w=g.querySelector(`.${ee.iconButtonContainer}`),C=g.querySelector(`.${ee.menuIcon}`),E=y??v,I=window.getComputedStyle(g,null),O=parseInt(I.paddingLeft,10)+parseInt(I.paddingRight,10),R=E.scrollWidth+1+O+((w==null?void 0:w.clientWidth)??0)+((C==null?void 0:C.clientWidth)??0);l.push(R)}}const c=i.minWidth!==-1/0&&i.minWidth!==void 0,u=i.maxWidth!==1/0&&i.maxWidth!==void 0,f=c?i.minWidth:0,h=u?i.maxWidth:1/0,m=l.length===0?0:Math.max(...l);r[i.field]=Za(m,f,h)}),o.classList.remove(ee.autosizing),r}const $0t=e=>z({},e,{columnResize:{resizingColumnField:""}});function N0t(){return{colDef:void 0,initialColWidth:0,initialTotalWidth:0,previousMouseClickEvent:void 0,columnHeaderElement:void 0,headerFilterElement:void 0,groupHeaderElements:[],cellElements:[],leftPinnedCellsAfter:[],rightPinnedCellsBefore:[],fillerLeft:void 0,fillerRight:void 0,leftPinnedHeadersAfter:[],rightPinnedHeadersBefore:[]}}const L0t=(e,t)=>{const n=vr(),r=Qo(e,"useGridColumnResize"),o=Xl(N0t).current,i=x.useRef(null),a=x.useRef(null),s=ko(),l=x.useRef(void 0),c=M=>{var j,L;r.debug(`Updating width to ${M} for col ${o.colDef.field}`);const A=o.columnHeaderElement.offsetWidth,_=M-A,N=M-o.initialColWidth;if(N>0){const V=o.initialTotalWidth+N;(L=(j=e.current.rootElementRef)==null?void 0:j.current)==null||L.style.setProperty("--DataGrid-rowWidth",`${V}px`)}o.colDef.computedWidth=M,o.colDef.width=M,o.colDef.flex=0,o.columnHeaderElement.style.width=`${M}px`;const B=o.headerFilterElement;B&&(B.style.width=`${M}px`),o.groupHeaderElements.forEach(V=>{const W=V;let K;W.getAttribute("aria-colspan")==="1"?K=`${M}px`:K=`${W.offsetWidth+_}px`,W.style.width=K}),o.cellElements.forEach(V=>{const W=V;let K;W.getAttribute("aria-colspan")==="1"?K=`${M}px`:K=`${W.offsetWidth+_}px`,W.style.setProperty("--width",K)});const H=e.current.unstable_applyPipeProcessors("isColumnPinned",!1,o.colDef.field);H===qd.LEFT&&(ag(o.fillerLeft,"width",_),o.leftPinnedCellsAfter.forEach(V=>{ag(V,"left",_)}),o.leftPinnedHeadersAfter.forEach(V=>{ag(V,"left",_)})),H===qd.RIGHT&&(ag(o.fillerRight,"width",_),o.rightPinnedCellsBefore.forEach(V=>{ag(V,"right",_)}),o.rightPinnedHeadersBefore.forEach(V=>{ag(V,"right",_)}))},u=M=>{if(w(),o.previousMouseClickEvent){const A=o.previousMouseClickEvent,_=A.timeStamp,N=A.clientX,B=A.clientY;if(M.timeStamp-_<300&&M.clientX===N&&M.clientY===B){o.previousMouseClickEvent=void 0,e.current.publishEvent("columnResizeStop",null,M);return}}if(o.colDef){e.current.setColumnWidth(o.colDef.field,o.colDef.width),r.debug(`Updating col ${o.colDef.field} with new width: ${o.colDef.width}`);const A=Hl(e);o.groupHeaderElements.forEach(_=>{const N=$mt(_),B=_,j=`${N.reduce((L,V)=>A.columnVisibilityModel[V]!==!1?L+A.lookup[V].computedWidth:L,0)}px`;B.style.width=j})}s.start(0,()=>{e.current.publishEvent("columnResizeStop",null,M)})},f=(M,A,_)=>{var j;const N=e.current.rootElementRef.current;o.initialColWidth=M.computedWidth,o.initialTotalWidth=e.current.getRootDimensions().rowWidth,o.colDef=M,o.columnHeaderElement=_mt(e.current.columnHeadersContainerRef.current,M.field);const B=N.querySelector(`.${ee.headerFilterRow} [data-field="${cd(M.field)}"]`);B&&(o.headerFilterElement=B),o.groupHeaderElements=Nmt((j=e.current.columnHeadersContainerRef)==null?void 0:j.current,M.field),o.cellElements=Lmt(o.columnHeaderElement,e.current),o.fillerLeft=VJ(e.current,n?"filler--pinnedRight":"filler--pinnedLeft"),o.fillerRight=VJ(e.current,n?"filler--pinnedLeft":"filler--pinnedRight");const H=e.current.unstable_applyPipeProcessors("isColumnPinned",!1,o.colDef.field);o.leftPinnedCellsAfter=H!==qd.LEFT?[]:Fmt(e.current,o.columnHeaderElement,n),o.rightPinnedCellsBefore=H!==qd.RIGHT?[]:jmt(e.current,o.columnHeaderElement,n),o.leftPinnedHeadersAfter=H!==qd.LEFT?[]:Bmt(e.current,o.columnHeaderElement,n),o.rightPinnedHeadersBefore=H!==qd.RIGHT?[]:zmt(e.current,o.columnHeaderElement,n),a.current=R0t(A,n),i.current=A0t(_,o.columnHeaderElement.getBoundingClientRect(),a.current)},h=Je(u),m=Je(M=>{if(M.buttons===0){h(M);return}let A=mZ(i.current,M.clientX,o.columnHeaderElement.getBoundingClientRect(),a.current);A=Za(A,o.colDef.minWidth,o.colDef.maxWidth),c(A);const _={element:o.columnHeaderElement,colDef:o.colDef,width:A};e.current.publishEvent("columnResize",_,M)}),g=Je(M=>{hZ(M,l.current)&&u(M)}),y=Je(M=>{const A=hZ(M,l.current);if(!A)return;if(M.type==="mousemove"&&M.buttons===0){g(M);return}let _=mZ(i.current,A.x,o.columnHeaderElement.getBoundingClientRect(),a.current);_=Za(_,o.colDef.minWidth,o.colDef.maxWidth),c(_);const N={element:o.columnHeaderElement,colDef:o.colDef,width:_};e.current.publishEvent("columnResize",N,M)}),v=Je(M=>{const A=OO(M.target,ee["columnSeparator--resizable"]);if(!A)return;const _=M.changedTouches[0];_!=null&&(l.current=_.identifier);const N=OO(M.target,ee.columnHeader),B=kmt(N),H=e.current.getColumn(B);r.debug(`Start Resize on col ${H.field}`),e.current.publishEvent("columnResizeStart",{field:B},M),f(H,A,_.clientX);const j=Mr(M.currentTarget);j.addEventListener("touchmove",y),j.addEventListener("touchend",g)}),w=x.useCallback(()=>{const M=Mr(e.current.rootElementRef.current);M.body.style.removeProperty("cursor"),M.removeEventListener("mousemove",m),M.removeEventListener("mouseup",h),M.removeEventListener("touchmove",y),M.removeEventListener("touchend",g),setTimeout(()=>{M.removeEventListener("click",gZ,!0)},100),o.columnHeaderElement&&(o.columnHeaderElement.style.pointerEvents="unset")},[e,o,m,h,y,g]),C=x.useCallback(({field:M})=>{e.current.setState(A=>z({},A,{columnResize:z({},A.columnResize,{resizingColumnField:M})}))},[e]),E=x.useCallback(()=>{e.current.setState(M=>z({},M,{columnResize:z({},M.columnResize,{resizingColumnField:""})}))},[e]),I=Je(({colDef:M},A)=>{if(A.button!==0||!A.currentTarget.classList.contains(ee["columnSeparator--resizable"]))return;A.preventDefault(),r.debug(`Start Resize on col ${M.field}`),e.current.publishEvent("columnResizeStart",{field:M.field},A),f(M,A.currentTarget,A.clientX);const _=Mr(e.current.rootElementRef.current);_.body.style.cursor="col-resize",o.previousMouseClickEvent=A.nativeEvent,_.addEventListener("mousemove",m),_.addEventListener("mouseup",h),_.addEventListener("click",gZ,!0)}),O=Je((M,A)=>{if(t.disableAutosize||A.button!==0)return;const _=e.current.state.columns.lookup[M.field];_.resizable!==!1&&e.current.autosizeColumns(z({},t.autosizeOptions,{disableColumnVirtualization:!1,columns:[_.field]}))}),P=D0t(e),R=x.useRef(!1),D=x.useCallback(async M=>{var H;if(!((H=e.current.rootElementRef)==null?void 0:H.current)||R.current)return;R.current=!0;const _=Hl(e),N=z({},yht,M,{columns:(M==null?void 0:M.columns)??_.orderedFields});N.columns=N.columns.filter(j=>_.columnVisibilityModel[j]!==!1);const B=N.columns.map(j=>e.current.state.columns.lookup[j]);try{!t.disableVirtualization&&N.disableColumnVirtualization&&(e.current.unstable_setColumnVirtualization(!1),await P());const j=_0t(e,N,B),L=B.map(V=>z({},V,{width:j[V.field],computedWidth:j[V.field],flex:0}));if(N.expand){const W=_.orderedFields.map(Y=>_.lookup[Y]).filter(Y=>_.columnVisibilityModel[Y.field]!==!1).reduce((Y,Z)=>Y+(j[Z.field]??Z.computedWidth??Z.width),0),q=e.current.getRootDimensions().viewportInnerSize.width-W;if(q>0){const Y=q/(L.length||1);L.forEach(Z=>{Z.width+=Y,Z.computedWidth+=Y})}}e.current.updateColumns(L),L.forEach((V,W)=>{if(V.width!==B[W].width){const K=V.width;e.current.publishEvent("columnWidthChange",{element:e.current.getColumnHeaderElement(V.field),colDef:V,width:K})}})}finally{t.disableVirtualization||e.current.unstable_setColumnVirtualization(!0),R.current=!1}},[e,P,t.disableVirtualization]);x.useEffect(()=>w,[w]),Nj(()=>{t.autosizeOnMount&&Promise.resolve().then(()=>{e.current.autosizeColumns(t.autosizeOptions)})}),Bfe(e,()=>{var M;return(M=e.current.columnHeadersContainerRef)==null?void 0:M.current},"touchstart",v,{passive:!0}),yn(e,{autosizeColumns:D},"public"),At(e,"columnResizeStop",E),At(e,"columnResizeStart",C),At(e,"columnSeparatorMouseDown",I),At(e,"columnSeparatorDoubleClick",O),sr(e,"columnResize",t.onColumnResize),sr(e,"columnWidthChange",t.onColumnWidthChange)};function ag(e,t,n){e&&(e.style[t]=`${parseInt(e.style[t],10)+n}px`)}function F0t(e,t){return e.firstRowIndex>=t.firstRowIndex&&e.lastRowIndex<=t.lastRowIndex?null:e.firstRowIndex>=t.firstRowIndex&&e.lastRowIndex>t.lastRowIndex?{firstRowIndex:t.lastRowIndex,lastRowIndex:e.lastRowIndex}:e.firstRowIndex<t.firstRowIndex&&e.lastRowIndex<=t.lastRowIndex?{firstRowIndex:e.firstRowIndex,lastRowIndex:t.firstRowIndex-1}:e}function yZ(e){return e.firstRowIndex!==0||e.lastRowIndex!==0}const E$=(e,t,n)=>{if(!e)return null;let r=e[t.field];const o=t.rowSpanValueGetter??t.valueGetter;return o&&(r=o(r,e,t,n)),r},Ig={spannedCells:{},hiddenCells:{},hiddenCellOriginMap:{}},MO={firstRowIndex:0,lastRowIndex:0},j0t=new Set([wu,"__reorder__",zP]),vZ=20,vpe=(e,t,n,r,o,i,a)=>{const s=i?{}:z({},e.current.state.rowSpanning.spannedCells),l=i?{}:z({},e.current.state.rowSpanning.hiddenCells),c=i?{}:z({},e.current.state.rowSpanning.hiddenCellOriginMap);return i&&(a=MO),t.forEach(u=>{var f;if(!j0t.has(u.field)){for(let h=o.firstRowIndex;h<o.lastRowIndex;h+=1){const m=n[h];if((f=l[m.id])!=null&&f[u.field])continue;const g=E$(m.model,u,e);if(g==null)continue;let y=m.id,v=h,w=0;const C=[];if(h===o.firstRowIndex){let I=h-1,O=n[I];for(;I>=r.firstRowIndex&&O&&E$(O.model,u,e)===g;){const P=n[I+1];l[P.id]?l[P.id][u.field]=!0:l[P.id]={[u.field]:!0},C.push(h),w+=1,y=O.id,v=I,I-=1,O=n[I]}}C.forEach(I=>{c[I]?c[I][u.field]=v:c[I]={[u.field]:v}});let E=h+1;for(;E<=r.lastRowIndex&&n[E]&&E$(n[E].model,u,e)===g;){const I=n[E];l[I.id]?l[I.id][u.field]=!0:l[I.id]={[u.field]:!0},c[E]?c[E][u.field]=v:c[E]={[u.field]:v},E+=1,w+=1}w>0&&(s[y]?s[y][u.field]=w+1:s[y]={[u.field]:w+1})}a={firstRowIndex:Math.min(a.firstRowIndex,o.firstRowIndex),lastRowIndex:Math.max(a.lastRowIndex,o.lastRowIndex)}}}),{spannedCells:s,hiddenCells:l,hiddenCellOriginMap:c,processedRange:a}},bpe=(e,t)=>{const n=Gp(t).length;if(e.pagination){const r=Mfe(t);let o=vZ;return r>0&&(o=r-1),{firstRowIndex:0,lastRowIndex:Math.min(o,n)}}return{firstRowIndex:0,lastRowIndex:Math.min(vZ,n)}},B0t=(e,t,n)=>{var g;if(!t.rowSpanning)return z({},e,{rowSpanning:Ig});const r=e.rows.dataRowIds||[],o=e.columns.orderedFields||[],i=e.rows.dataRowIdToModelLookup,a=e.columns.lookup,s=!!e.filter.filterModel.items.length||!!((g=e.filter.filterModel.quickFilterValues)!=null&&g.length);if(!r.length||!o.length||!i||!a||s)return z({},e,{rowSpanning:Ig});const l=bpe(t,n),c=r.map(y=>({id:y,model:i[y]})),u=o.map(y=>a[y]),{spannedCells:f,hiddenCells:h,hiddenCellOriginMap:m}=vpe(n,u,c,l,l,!0,MO);return z({},e,{rowSpanning:{spannedCells:f,hiddenCells:h,hiddenCellOriginMap:m}})},z0t=(e,t)=>{const n=Xl(()=>e.current.state.rowSpanning!==Ig?bpe(t,e):MO),r=x.useCallback((i,a=!1)=>{const{range:s,rows:l}=bf(e,{pagination:t.pagination,paginationMode:t.paginationMode});if(s===null||!yZ(i))return;a&&(n.current=MO);const c=F0t({firstRowIndex:i.firstRowIndex,lastRowIndex:Math.min(i.lastRowIndex,s.lastRowIndex+1)},n.current);if(c===null)return;const u=Yr(e),{spannedCells:f,hiddenCells:h,hiddenCellOriginMap:m,processedRange:g}=vpe(e,u,l,s,c,a,n.current);n.current=g;const y=Object.keys(f).length,v=Object.keys(h).length,w=Object.keys(e.current.state.rowSpanning.spannedCells).length,C=Object.keys(e.current.state.rowSpanning.hiddenCells).length;!(a||y!==w||v!==C)||y===0&&w===0||e.current.setState(O=>z({},O,{rowSpanning:{spannedCells:f,hiddenCells:h,hiddenCellOriginMap:m}}))},[e,n,t.pagination,t.paginationMode]),o=x.useCallback(()=>{const i=Xw(e);yZ(i)&&r(i,!0)},[e,r]);At(e,"renderedRowsIntervalChange",Xd(t.rowSpanning,r)),At(e,"sortedRowsSet",Xd(t.rowSpanning,o)),At(e,"paginationModelChange",Xd(t.rowSpanning,o)),At(e,"filteredRowsSet",Xd(t.rowSpanning,o)),At(e,"columnsChange",Xd(t.rowSpanning,o)),x.useEffect(()=>{t.rowSpanning?e.current.state.rowSpanning===Ig&&o():e.current.state.rowSpanning!==Ig&&e.current.setState(i=>z({},i,{rowSpanning:Ig}))},[e,o,t.rowSpanning])},V0t=(e,t,n)=>z({},e,{listViewColumn:t.listViewColumn?z({},t.listViewColumn,{computedWidth:dj(n)}):void 0});function H0t(e,t){const n=()=>{e.current.setState(i=>i.listViewColumn?z({},i,{listViewColumn:z({},i.listViewColumn,{computedWidth:dj(e)})}):i)},r=x.useRef(null);At(e,"viewportInnerSizeChange",i=>{r.current!==i.width&&(r.current=i.width,n())}),At(e,"columnVisibilityModelChange",n),In(()=>{const i=t.listViewColumn;i&&e.current.setState(a=>z({},a,{listViewColumn:z({},i,{computedWidth:dj(e)})}))},[e,t.listViewColumn]),x.useEffect(()=>{t.listView&&t.listViewColumn},[t.listView,t.listViewColumn])}function dj(e){return dr(e).viewportInnerSize.width}const U0t=Pt(jo,Ns,ri,(e,t,n)=>({groupKeys:[],paginationModel:n,sortModel:t,filterModel:e,start:n.page*n.pageSize,end:n.page*n.pageSize+n.pageSize-1}));let T$=function(e){return e.Default="set-new-rows",e.LazyLoading="replace-row-range",e}({});class fj{constructor(t){this.chunkSize=void 0,this.getCacheKeys=n=>{if(this.chunkSize<1||typeof n.start!="number")return[n];const r=[];for(let o=n.start;o<n.end;o+=this.chunkSize){const i=Math.min(o+this.chunkSize-1,n.end);r.push(z({},n,{start:o,end:i}))}return r},this.splitResponse=(n,r)=>{const o=this.getCacheKeys(n),i=new Map;return o.forEach(a=>{var c,u,f,h;const s=a.end===n.end,l=z({},r,{pageInfo:z({},r.pageInfo,{hasNextPage:((c=r.pageInfo)==null?void 0:c.hasNextPage)!==void 0&&!s?!0:(u=r.pageInfo)==null?void 0:u.hasNextPage,nextCursor:((f=r.pageInfo)==null?void 0:f.nextCursor)!==void 0&&!s?r.rows[a.end+1].id:(h=r.pageInfo)==null?void 0:h.nextCursor}),rows:typeof a.start!="number"||typeof n.start!="number"?r.rows:r.rows.slice(a.start-n.start,a.end-n.start+1)});i.set(a,l)}),i},this.chunkSize=t}}fj.mergeResponses=e=>e.length===1?e[0]:e.reduce((t,n)=>({rows:[...t.rows,...n.rows],rowCount:n.rowCount,pageInfo:n.pageInfo}),{rows:[],rowCount:0,pageInfo:{}});const G0t={clear:()=>{},get:()=>{},set:()=>{}};function bZ(e,t={}){return e===null?G0t:e??new Sht(t)}const q0t=(e,t,n={})=>{var O,P;const r=x.useCallback(()=>{e.current.setStrategyAvailability(Zd.DataSource,T$.Default,t.dataSource?()=>!0:()=>!1)},[e,t.dataSource]),[o,i]=x.useState(!1),a=Ge(e,ri),s=x.useRef(0),l=t.onDataSourceError,c=Xl(()=>{const R=t.pageSizeOptions.map(M=>typeof M=="number"?M:M.value).sort((M,A)=>M-A),D=Math.min(a.pageSize,R[0]);return new fj(D)}).current,[u,f]=x.useState(()=>bZ(t.dataSourceCache,n.cacheOptions)),h=x.useCallback(async(R,D)=>{var H,j,L;const M=(H=t.dataSource)==null?void 0:H.getRows;if(!M)return;if(R&&R!==ii&&t.signature!=="DataGrid"){(j=n.fetchRowChildren)==null||j.call(n,[R]);return}(L=n.clearDataSourceState)==null||L.call(n);const A=z({},U0t(e),e.current.unstable_applyPipeProcessors("getRowsParams",{}),D),N=c.getCacheKeys(A).map(V=>u.get(V));if(N.every(V=>V!==void 0)){e.current.applyStrategyProcessor("dataSourceRowsUpdate",{response:fj.mergeResponses(N),fetchParams:A});return}(o||e.current.getRowsCount()===0)&&e.current.setLoading(!0);const B=s.current+1;s.current=B;try{const V=await M(A);c.splitResponse(A,V).forEach((K,G)=>u.set(G,K)),s.current===B&&e.current.applyStrategyProcessor("dataSourceRowsUpdate",{response:V,fetchParams:A})}catch(V){s.current===B&&(e.current.applyStrategyProcessor("dataSourceRowsUpdate",{error:V,fetchParams:A}),typeof l=="function"&&l(new wht({message:V==null?void 0:V.message,params:A,cause:V})))}finally{o&&s.current===B&&e.current.setLoading(!1)}},[c,u,e,o,(O=t.dataSource)==null?void 0:O.getRows,l,n,t.signature]),m=x.useCallback(()=>{i(e.current.getActiveStrategy(Zd.DataSource)===T$.Default)},[e]),g=x.useCallback(R=>{if("error"in R){e.current.setRows([]);return}const{response:D}=R;D.rowCount!==void 0&&e.current.setRowCount(D.rowCount),e.current.setRows(D.rows),e.current.unstable_applyPipeProcessors("processDataSourceRows",{params:R.fetchParams,response:D},!0)},[e]),y=(P=t.dataSource)==null?void 0:P.updateRow,v=n.handleEditRow,w=x.useCallback(async R=>{if(y)try{const D=await y(R);return typeof v=="function"?(v(R,D),D):(e.current.updateNestedRows([D],[]),D&&!Js(D,R.previousRow)&&e.current.dataSource.cache.clear(),D)}catch(D){throw typeof l=="function"&&l(new Cht({message:D==null?void 0:D.message,params:R,cause:D})),D}},[e,y,l,v]),C={dataSource:{fetchRows:h,cache:u,editRow:w}},E=x.useMemo(()=>$h(h,0),[h]),I=x.useRef(!0);return x.useEffect(()=>{if(I.current){I.current=!1;return}if(t.dataSourceCache===void 0)return;const R=bZ(t.dataSourceCache,n.cacheOptions);f(D=>D!==R?R:D)},[t.dataSourceCache,n.cacheOptions]),x.useEffect(()=>{t.dataSource&&(e.current.dataSource.cache.clear(),e.current.dataSource.fetchRows())},[e,t.dataSource]),{api:{public:C},debouncedFetchRows:E,strategyProcessor:{strategyName:T$.Default,group:"dataSourceRowsUpdate",processor:g},setStrategyAvailability:r,cacheChunkManager:c,cache:u,events:{strategyAvailabilityChange:m,sortModelChange:Xd(o,()=>E()),filterModelChange:Xd(o,()=>E()),paginationModelChange:Xd(o,()=>E())}}},W0t=(e,t)=>{const{api:n,strategyProcessor:r,events:o,setStrategyAvailability:i}=q0t(e,t);yn(e,n.public,"public"),kS(e,r.strategyName,r.group,r.processor),Object.entries(o).forEach(([a,s])=>{At(e,a,s)}),x.useEffect(()=>{i()},[i])},K0t=(e,t)=>{ubt(e,t),l0t(e,t),r0t(e),Lo(lbt,e,t),Lo(i0t,e,t),Lo(vbt,e,t),Lo(Jbt,e,t),Lo(Bbt,e,t),Lo(Qbt,e,t),Lo(kbt,e,t),Lo(c0t,e,t),Lo(Vbt,e,t),Lo(Abt,e,t),Lo(B0t,e,t),Lo(xbt,e,t),Lo($0t,e,t),Lo(gbt,e,t),Lo(O0t,e,t),Lo(Rpt,e,t),Lo(m0t,e,t),Lo(x0t,e,t),Lo(V0t,e,t),Lbt(e,t),a0t(e,t),bbt(e,t),Zbt(e,t),z0t(e,t),o0t(e,t),C0t(e),I0t(e,t),Xbt(e,t),_bt(e,t),Hbt(e,t),Dbt(e,t),u0t(e,t),Sbt(e,t),L0t(e,t),zbt(e,t),S0t(e,t),d0t(e,t),ybt(e),Cbt(e,t),Pbt(e,t),mbt(e,t),g0t(e,t),f0t(e,t),w0t(e),Dpt(e,t),H0t(e,t),W0t(e,t)},Y0t=e=>{const{classes:t,headerAlign:n,isDragging:r,isLastColumn:o,showLeftBorder:i,showRightBorder:a,groupId:s,pinnedPosition:l}=e,c={root:["columnHeader",n==="left"&&"columnHeader--alignLeft",n==="center"&&"columnHeader--alignCenter",n==="right"&&"columnHeader--alignRight",r&&"columnHeader--moving",a&&"columnHeader--withRightBorder",i&&"columnHeader--withLeftBorder","withBorderColor",s===null?"columnHeader--emptyGroup":"columnHeader--filledGroup",l===On.LEFT&&"columnHeader--pinnedLeft",l===On.RIGHT&&"columnHeader--pinnedRight",o&&"columnHeader--last"],draggableContainer:["columnHeaderDraggableContainer"],titleContainer:["columnHeaderTitleContainer","withBorderColor"],titleContainerContent:["columnHeaderTitleContainerContent"]};return Me(c,Cn,t)};function Q0t(e){var W;const{groupId:t,width:n,depth:r,maxDepth:o,fields:i,height:a,colIndex:s,hasFocus:l,tabIndex:c,isLastColumn:u,pinnedPosition:f,pinnedOffset:h}=e,m=yt(),g=vr(),y=x.useRef(null),v=tn(),w=Ge(v,Lfe),C=t?w[t]:{},{headerName:E=t??"",description:I="",headerAlign:O=void 0}=C;let P;const R=t&&((W=w[t])==null?void 0:W.renderHeaderGroup),D=x.useMemo(()=>({groupId:t,headerName:E,description:I,depth:r,maxDepth:o,fields:i,colIndex:s,isLastColumn:u}),[t,E,I,r,o,i,s,u]);t&&R&&(P=R(D));const M=z({},e,{classes:m.classes,headerAlign:O,depth:r,isDragging:!1}),A=E??t,_=bn(),N=t===null?`empty-group-cell-${_}`:t,B=Y0t(M);x.useLayoutEffect(()=>{if(l){const G=y.current.querySelector('[tabindex="0"]')||y.current;G==null||G.focus()}},[v,l]);const H=x.useCallback(K=>G=>{Jw(G)||v.current.publishEvent(K,D,G)},[v,D]),j=x.useMemo(()=>({onKeyDown:H("columnGroupHeaderKeyDown"),onFocus:H("columnGroupHeaderFocus"),onBlur:H("columnGroupHeaderBlur")}),[H]),L=typeof C.headerClassName=="function"?C.headerClassName(D):C.headerClassName,V=x.useMemo(()=>YP(z({},e.style),g,f,h),[f,h,e.style,g]);return k.jsx(ope,z({ref:y,classes:B,columnMenuOpen:!1,colIndex:s,height:a,isResizing:!1,sortDirection:null,hasFocus:!1,tabIndex:c,isDraggable:!1,headerComponent:P,headerClassName:L,description:I,elementId:N,width:n,columnMenuIconButton:null,columnTitleIconButtons:null,resizable:!1,label:A,"aria-colspan":i.length,"data-fields":`|-${i.join("-|-")}-|`,style:V},j))}const xZ=ae("div",{name:"MuiDataGrid",slot:"ColumnHeaderRow"})({display:"flex"}),X0t=e=>{const{visibleColumns:t,sortColumnLookup:n,filterColumnLookup:r,columnHeaderTabIndexState:o,columnGroupHeaderTabIndexState:i,columnHeaderFocus:a,columnGroupHeaderFocus:s,headerGroupingMaxDepth:l,columnMenuState:c,columnVisibility:u,columnGroupsHeaderStructure:f,hasOtherElementInTabSequence:h}=e,[m,g]=x.useState(""),[y,v]=x.useState(""),w=fs(),C=yt(),E=Ge(w,Nfe),I=Ge(w,Yf),O=Ge(w,Mpt),P=Ge(w,Vv),R=Ge(w,ld),D=Ufe(I,O,P.left.length),M=Ge(w,NP),A=Ge(w,qde),_=Ge(w,Vut),N=Ge(w,Hut),B=Ge(w,Wde),H=x.useCallback(ce=>v(ce.field),[]),j=x.useCallback(()=>v(""),[]),L=x.useCallback(ce=>g(ce.field),[]),V=x.useCallback(()=>g(""),[]),W=x.useMemo(()=>P.left.length?{firstColumnIndex:0,lastColumnIndex:P.left.length}:null,[P.left.length]),K=x.useMemo(()=>P.right.length?{firstColumnIndex:t.length-P.right.length,lastColumnIndex:t.length}:null,[P.right.length,t.length]);At(w,"columnResizeStart",H),At(w,"columnResizeStop",j),At(w,"columnHeaderDragStart",L),At(w,"columnHeaderDragEnd",V);const G=ce=>{const{renderContext:ye=O}=ce||{},Se=ye.firstColumnIndex,ne=ye.lastColumnIndex;return{renderedColumns:t.slice(Se,ne),firstColumnToRender:Se,lastColumnToRender:ne}},q=(ce,ye,Se,ne=!1)=>{const le=(ce==null?void 0:ce.position)===On.RIGHT,de=(ce==null?void 0:ce.position)===void 0,oe=P.right.length>0&&le||P.right.length===0&&de,ue=D-Se;return k.jsxs(x.Fragment,{children:[de&&k.jsx("div",{role:"presentation",style:{width:ue}}),ye,de&&k.jsx("div",{role:"presentation",className:fe(ee.filler,ne&&ee["filler--borderBottom"])}),oe&&k.jsx(uH,{header:!0,pinnedRight:le,borderBottom:ne,borderTop:!1})]})},Y=(ce,ye={})=>{const{renderedColumns:Se,firstColumnToRender:ne}=G(ce),le=[];for(let de=0;de<Se.length;de+=1){const oe=Se[de],ue=ne+de,pe=ue===0,Ee=o!==null&&o.field===oe.field||pe&&!h?0:-1,xe=a!==null&&a.field===oe.field,Re=c.open&&c.field===oe.field,he=ce==null?void 0:ce.position,Pe=px(he,oe.computedWidth,ue,I,M,B),ve=he===On.RIGHT?Se[de-1]:Se[de+1],Ie=ve?a!==null&&a.field===ve.field:!1,te=ue+1===I.length-P.right.length,Te=de,De=Se.length,Ve=AO(he,Te),We=PO(he,Te,De,C.showColumnVerticalBorder,A);le.push(k.jsx(ngt,z({},n[oe.field],{columnMenuOpen:Re,filterItemsCounter:r[oe.field]&&r[oe.field].length,headerHeight:_,isDragging:oe.field===m,colDef:oe,colIndex:ue,isResizing:y===oe.field,isLast:ue===I.length-1,hasFocus:xe,tabIndex:Ee,pinnedPosition:he,pinnedOffset:Pe,isLastUnpinned:te,isSiblingFocused:Ie,showLeftBorder:Ve,showRightBorder:We},ye),oe.field))}return q(ce,le,0)},Z=()=>k.jsxs(xZ,{role:"row","aria-rowindex":l+1,ownerState:C,className:ee["row--borderBottom"],style:{height:_},children:[W&&Y({position:On.LEFT,renderContext:W},{disableReorder:!0}),Y({renderContext:O}),K&&Y({position:On.RIGHT,renderContext:K},{disableReorder:!0,separatorSide:lH.Left})]}),ie=({depth:ce,params:ye})=>{var De,Ve;const Se=G(ye);if(Se.renderedColumns.length===0)return null;const{firstColumnToRender:ne,lastColumnToRender:le}=Se,de=f[ce],oe=t[ne].field,ue=((De=E[oe])==null?void 0:De[ce])??null,pe=de.findIndex(({groupId:We,columnFields:rt})=>We===ue&&rt.includes(oe)),Ee=t[le-1].field,xe=((Ve=E[Ee])==null?void 0:Ve[ce])??null,Re=de.findIndex(({groupId:We,columnFields:rt})=>We===xe&&rt.includes(Ee)),he=de.slice(pe,Re+1).map(We=>z({},We,{columnFields:We.columnFields.filter(rt=>u[rt]!==!1)})).filter(We=>We.columnFields.length>0),Pe=he[0].columnFields.indexOf(oe),Ie=he[0].columnFields.slice(0,Pe).reduce((We,rt)=>{const ut=R[rt];return We+(ut.computedWidth??0)},0);let te=ne;const Te=he.map(({groupId:We,columnFields:rt},ut)=>{const Be=s!==null&&s.depth===ce&&rt.includes(s.field),et=i!==null&&i.depth===ce&&rt.includes(i.field)?0:-1,Le={width:rt.reduce((lt,vt)=>lt+R[vt].computedWidth,0),fields:rt,colIndex:te},It=ye.position,Lt=px(It,Le.width,te,I,M,B);te+=rt.length;let nt=ut;return It===On.LEFT&&(nt=te-1),k.jsx(Q0t,{groupId:We,width:Le.width,fields:Le.fields,colIndex:Le.colIndex,depth:ce,isLastColumn:ut===he.length-1,maxDepth:l,height:N,hasFocus:Be,tabIndex:et,pinnedPosition:It,pinnedOffset:Lt,showLeftBorder:AO(It,nt),showRightBorder:PO(It,nt,he.length,C.showColumnVerticalBorder,A)},ut)});return q(ye,Te,Ie)};return{renderContext:O,leftRenderContext:W,rightRenderContext:K,pinnedColumns:P,visibleColumns:t,columnPositions:I,getFillers:q,getColumnHeadersRow:Z,getColumnsToRender:G,getColumnGroupHeadersRows:()=>{if(l===0)return null;const ce=[];for(let ye=0;ye<l;ye+=1)ce.push(k.jsxs(xZ,{role:"row","aria-rowindex":ye+1,ownerState:C,style:{height:N},children:[W&&ie({depth:ye,params:{position:On.LEFT,renderContext:W,maxLastColumn:W.lastColumnIndex}}),ie({depth:ye,params:{renderContext:O}}),K&&ie({depth:ye,params:{position:On.RIGHT,renderContext:K,maxLastColumn:K.lastColumnIndex}})]},ye));return ce},getPinnedCellOffset:px,isDragging:!!m,getInnerProps:()=>({role:"rowgroup"})}},J0t=["className"],Z0t=e=>{const{classes:t}=e;return Me({root:["columnHeaders"]},Cn,t)},ext=Nn("div",{name:"MuiDataGrid",slot:"ColumnHeaders"})({display:"flex",flexDirection:"column",borderTopLeftRadius:"var(--unstable_DataGrid-radius)",borderTopRightRadius:"var(--unstable_DataGrid-radius)"}),txt=Vt(function(t,n){const{className:r}=t,o=$e(t,J0t),i=yt(),a=Z0t(i);return k.jsx(ext,z({className:fe(a.root,r),ownerState:i},o,{role:"presentation",ref:n}))}),nxt=["className","visibleColumns","sortColumnLookup","filterColumnLookup","columnHeaderTabIndexState","columnGroupHeaderTabIndexState","columnHeaderFocus","columnGroupHeaderFocus","headerGroupingMaxDepth","columnMenuState","columnVisibility","columnGroupsHeaderStructure","hasOtherElementInTabSequence"],rxt=Vt(function(t,n){const{visibleColumns:r,sortColumnLookup:o,filterColumnLookup:i,columnHeaderTabIndexState:a,columnGroupHeaderTabIndexState:s,columnHeaderFocus:l,columnGroupHeaderFocus:c,headerGroupingMaxDepth:u,columnMenuState:f,columnVisibility:h,columnGroupsHeaderStructure:m,hasOtherElementInTabSequence:g}=t,y=$e(t,nxt),{getInnerProps:v,getColumnHeadersRow:w,getColumnGroupHeadersRows:C}=X0t({visibleColumns:r,sortColumnLookup:o,filterColumnLookup:i,columnHeaderTabIndexState:a,columnGroupHeaderTabIndexState:s,columnHeaderFocus:l,columnGroupHeaderFocus:c,headerGroupingMaxDepth:u,columnMenuState:f,columnVisibility:h,columnGroupsHeaderStructure:m,hasOtherElementInTabSequence:g});return k.jsxs(txt,z({},y,v(),{ref:n,children:[C(),w()]}))}),oxt=ad(rxt);function ixt(e){return null}function axt(e){return null}const sxt=Vt(function(t,n){const o=tn().current.getLocaleText("noResultsOverlayLabel");return k.jsx(QP,z({},t,{ref:n,children:o}))}),lxt=new TextEncoder;let $E=2*1024,mx=new ArrayBuffer($E),O$=new Uint8Array(mx),Cp=new Int32Array(mx);const cxt=uxt;function uxt(e){const t=e.length*2;t>$E&&($E=t+(4-t%4),mx=new ArrayBuffer($E),O$=new Uint8Array(mx),Cp=new Int32Array(mx));const n=lxt.encodeInto(e,O$).written,r=0,o=n|0;let i=0,a=(r+o|0)+374761393|0;if(o<16)for(;(i+3|0)<o;i=i+4|0)a=Math.imul(Sl(a+Math.imul(Cp[i]|0,3266489917)|0,17)|0,668265263);else{let s=r+606290984|0,l=r+2246822519|0,c=r,u=r-2654435761|0;for(;(i+15|0)<o;i=i+16|0)s=Math.imul(Sl(s+Math.imul(Cp[i+0|0]|0,2246822519)|0,13)|0,2654435761),l=Math.imul(Sl(l+Math.imul(Cp[i+4|0]|0,2246822519)|0,13)|0,2654435761),c=Math.imul(Sl(c+Math.imul(Cp[i+8|0]|0,2246822519)|0,13)|0,2654435761),u=Math.imul(Sl(u+Math.imul(Cp[i+12|0]|0,2246822519)|0,13)|0,2654435761);for(a=(((Sl(s,1)|0+Sl(l,7)|0)+Sl(c,12)|0)+Sl(u,18)|0)+o|0;(i+3|0)<o;i=i+4|0)a=Math.imul(Sl(a+Math.imul(Cp[i]|0,3266489917)|0,17)|0,668265263)}for(;i<o;i=i+1|0)a=Math.imul(Sl(a+Math.imul(O$[i]|0,374761393)|0,11)|0,2654435761);return a=Math.imul(a^a>>>15,2246822519),a=Math.imul(a^a>>>13,3266489917),((a^a>>>16)>>>0).toString()}function Sl(e,t){return e<<t|e>>>32-t}function dxt(e){const t=new WeakSet;return JSON.stringify(e,(n,r)=>{if(r!==null&&typeof r=="object"){if(t.has(r))return null;t.add(r)}return r})}function fxt(){const e=Lr();return x.useMemo(()=>{const t=cxt(dxt(e)),n=pxt(e);return{id:t,variables:n}},[e])}function pxt(e){var g,y,v,w,C,E;const t=mxt(e),n=e.palette.DataGrid,r=(n==null?void 0:n.bg)??(e.vars||e).palette.background.default,o=(n==null?void 0:n.headerBg)??r,i=(n==null?void 0:n.pinnedBg)??r,a=e.vars?`rgba(${e.vars.palette.background.defaultChannel} / ${e.vars.palette.action.disabledOpacity})`:Nt(e.palette.background.default,e.palette.action.disabledOpacity),s=e.palette.mode==="dark"?`color-mix(in srgb, ${(e.vars||e).palette.background.paper} 95%, #fff)`:(e.vars||e).palette.background.paper,l=e.vars?`rgb(${e.vars.palette.primary.mainChannel})`:e.palette.primary.main,c=hxt(e),u=((y=(g=e.vars)==null?void 0:g.font)==null?void 0:y.body2)??I$(e.typography.body2),f=((w=(v=e.vars)==null?void 0:v.font)==null?void 0:w.caption)??I$(e.typography.caption),h=((E=(C=e.vars)==null?void 0:C.font)==null?void 0:E.body1)??I$(e.typography.body1),m=Ct.keys;return{[m.spacingUnit]:e.vars?e.vars.spacing??e.spacing(1):e.spacing(1),[m.colors.border.base]:t,[m.colors.background.base]:r,[m.colors.background.overlay]:s,[m.colors.background.backdrop]:a,[m.colors.foreground.base]:(e.vars||e).palette.text.primary,[m.colors.foreground.muted]:(e.vars||e).palette.text.secondary,[m.colors.foreground.accent]:(e.vars||e).palette.primary.dark,[m.colors.foreground.disabled]:(e.vars||e).palette.text.disabled,[m.colors.foreground.error]:(e.vars||e).palette.error.dark,[m.colors.interactive.hover]:(e.vars||e).palette.action.hover,[m.colors.interactive.hoverOpacity]:(e.vars||e).palette.action.hoverOpacity,[m.colors.interactive.focus]:SZ((e.vars||e).palette.primary.main),[m.colors.interactive.focusOpacity]:(e.vars||e).palette.action.focusOpacity,[m.colors.interactive.disabled]:SZ((e.vars||e).palette.action.disabled),[m.colors.interactive.disabledOpacity]:(e.vars||e).palette.action.disabledOpacity,[m.colors.interactive.selected]:l,[m.colors.interactive.selectedOpacity]:(e.vars||e).palette.action.selectedOpacity,[m.header.background.base]:o,[m.cell.background.pinned]:i,[m.radius.base]:c,[m.typography.fontFamily.base]:e.typography.fontFamily,[m.typography.fontWeight.light]:e.typography.fontWeightLight,[m.typography.fontWeight.regular]:e.typography.fontWeightRegular,[m.typography.fontWeight.medium]:e.typography.fontWeightMedium,[m.typography.fontWeight.bold]:e.typography.fontWeightBold,[m.typography.font.body]:u,[m.typography.font.small]:f,[m.typography.font.large]:h,[m.transitions.easing.easeIn]:e.transitions.easing.easeIn,[m.transitions.easing.easeOut]:e.transitions.easing.easeOut,[m.transitions.easing.easeInOut]:e.transitions.easing.easeInOut,[m.transitions.duration.short]:`${e.transitions.duration.shorter}ms`,[m.transitions.duration.base]:`${e.transitions.duration.short}ms`,[m.transitions.duration.long]:`${e.transitions.duration.standard}ms`,[m.shadows.base]:(e.vars||e).shadows[2],[m.shadows.overlay]:(e.vars||e).shadows[8],[m.zIndex.panel]:(e.vars||e).zIndex.modal,[m.zIndex.menu]:(e.vars||e).zIndex.modal}}function hxt(e){return e.vars?e.vars.shape.borderRadius:typeof e.shape.borderRadius=="number"?`${e.shape.borderRadius}px`:e.shape.borderRadius}function mxt(e){return e.vars?e.vars.palette.TableCell.border:e.palette.mode==="light"?Vu(Nt(e.palette.divider,1),.88):zu(Nt(e.palette.divider,1),.68)}function gxt(e,t){return`rgba(from ${e} r g b / ${t})`}function SZ(e){return gxt(e,1)}function I$(e){return`${e.fontWeight} ${e.fontSize} / ${e.lineHeight} ${e.fontFamily}`}const yxt=["id","label","labelId","material","disabled","slotProps","onChange","onKeyDown","onOpen","onClose","size","style","fullWidth"],vxt=["onRowsPerPageChange","material","disabled"],bxt=["material"],xxt=["autoFocus","label","fullWidth","slotProps","className","material"],Sxt=["material"],wxt=["material"],Cxt=["material"],Ext=["material"],Txt=["material"],Oxt=["material"],Ixt=["material"],Pxt=["material"],Axt=["material","label","className"],Mxt=["material"],Rxt=["inert","iconStart","iconEnd","children","material"],Dxt=["slotProps","material"],kxt=["id","multiple","freeSolo","options","getOptionLabel","isOptionEqualToValue","value","onChange","label","placeholder","slotProps","material"],_xt=["key"],$xt=["inputProps","InputProps","InputLabelProps"],Nxt=["slotProps","material"],Lxt=["ref","open","children","className","clickAwayTouchEvent","clickAwayMouseEvent","flip","focusTrap","onExited","onClickAway","onDidShow","onDidHide","id","target","transition","placement","material"],Fxt=["native"],wZ=ae(So)(({theme:e})=>({[`&.${TN.positionEnd} .${bN.sizeSmall}`]:{marginRight:e.spacing(-.75)}})),xpe=ae(os,{shouldForwardProp:e=>e!=="fullWidth"})(({theme:e})=>({gap:e.spacing(.5),margin:0,overflow:"hidden",[`& .${hg.label}`]:{fontSize:e.typography.pxToRem(14),overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},variants:[{props:{fullWidth:!0},style:{width:"100%"}}]})),CZ=ae(nTe,{shouldForwardProp:e=>e!=="density"})(({theme:e})=>({variants:[{props:{density:"compact"},style:{padding:e.spacing(.5)}}]})),jxt=ae(Wr)({[`& .${Np.primary}`]:{overflowX:"clip",textOverflow:"ellipsis",maxWidth:"300px"}}),Bxt=Vt(function(t,n){const{id:r,label:o,labelId:i,material:a,disabled:s,slotProps:l,onChange:c,onKeyDown:u,onOpen:f,onClose:h,size:m,style:g,fullWidth:y}=t,v=$e(t,yxt),w={PaperProps:{onKeyDown:u}};return h&&(w.onClose=h),k.jsxs(Fh,{size:m,fullWidth:y,style:g,disabled:s,ref:n,children:[k.jsx(jh,{id:i,htmlFor:r,shrink:!0,variant:"outlined",children:o}),k.jsx(Lf,z({id:r,labelId:i,label:o,displayEmpty:!0,onChange:c},v,{variant:"outlined",notched:!0,inputProps:l==null?void 0:l.htmlInput,onOpen:f,MenuProps:w,size:m},a))]})}),zxt=ae(Lne)(({theme:e})=>({[`& .${th.selectLabel}`]:{display:"none",[e.breakpoints.up("sm")]:{display:"block"}},[`& .${th.input}`]:{display:"none",[e.breakpoints.up("sm")]:{display:"inline-flex"}}})),Vxt=Vt(function(t,n){const{onRowsPerPageChange:r,material:o,disabled:i}=t,a=$e(t,vxt),s=x.useMemo(()=>{if(i)return{backIconButtonProps:{disabled:!0},nextIconButtonProps:{disabled:!0}}},[i]),l=tn(),c=yt(),{estimatedRowCount:u}=c;return k.jsx(zxt,z({component:"div",onRowsPerPageChange:Je(f=>{r==null||r(Number(f.target.value))}),labelRowsPerPage:l.current.getLocaleText("paginationRowsPerPage"),labelDisplayedRows:f=>l.current.getLocaleText("paginationDisplayedRows")(z({},f,{estimated:u})),getItemAriaLabel:l.current.getLocaleText("paginationItemAriaLabel")},s,a,o,{ref:n}))}),Hxt=Vt(function(t,n){const{material:r}=t,o=$e(t,bxt);return k.jsx(iEe,z({},o,r,{ref:n}))}),Uxt=Vt(function(t,n){const{autoFocus:r,label:o,fullWidth:i,slotProps:a,className:s,material:l}=t,c=$e(t,xxt),u=x.useRef(null),f=en(u,n),h=x.useRef(null);return x.useEffect(()=>{var m;if(r){const g=(m=u.current)==null?void 0:m.querySelector("input");g==null||g.focus({preventScroll:!0})}else r===!1&&h.current&&h.current.stop({})},[r]),o?k.jsx(xpe,{className:s,control:k.jsx(CZ,z({},c,l,{inputProps:a==null?void 0:a.htmlInput,ref:f,touchRippleRef:h})),label:o,fullWidth:i}):k.jsx(CZ,z({},c,l,{className:fe(s,l==null?void 0:l.className),inputProps:a==null?void 0:a.htmlInput,ref:f,touchRippleRef:h}))}),Gxt=Vt(function(t,n){const{material:r}=t,o=$e(t,Sxt);return k.jsx(nw,z({},o,r,{ref:n}))}),qxt=Vt(function(t,n){const{material:r}=t,o=$e(t,wxt);return k.jsx(ji,z({},o,r,{ref:n}))}),Wxt=Vt(function(t,n){const{material:r}=t,o=$e(t,Cxt);return k.jsx(Cne,z({},o,r,{ref:n}))}),Kxt=Vt(function(t,n){const{material:r}=t,o=$e(t,Ext);return k.jsx(ct,z({},o,r,{ref:n}))}),Yxt=Vt(function(t,n){const{material:r}=t,o=$e(t,Txt);return k.jsx(Wl,z({},o,r,{ref:n}))}),Qxt=Vt(function(t,n){const{material:r}=t,o=$e(t,Oxt);return k.jsx(pn,z({},o,r,{ref:n}))}),Xxt=Vt(function(t,n){const{material:r}=t,o=$e(t,Ixt);return k.jsx(Go,z({},o,r,{ref:n}))}),Jxt=Vt(function(t,n){const{material:r}=t,o=$e(t,Pxt);return k.jsx(hE,z({},o,r,{ref:n}))}),Zxt=Vt(function(t,n){const{material:r,label:o,className:i}=t,a=$e(t,Axt);return o?k.jsx(xpe,{className:i,control:k.jsx(qo,z({},a,r,{ref:n})),label:o}):k.jsx(qo,z({},a,r,{className:i,ref:n}))}),eSt=Vt(function(t,n){const{material:r}=t,o=$e(t,Mxt);return k.jsx(uI,z({},o,r,{ref:n}))});function tSt(e){const{inert:t,iconStart:n,iconEnd:r,children:o,material:i}=e,a=$e(e,Rxt);return t&&(a.disableRipple=!0),x.createElement(Jt,z({},a,i),[n&&k.jsx(nl,{children:n},"1"),k.jsx(jxt,{children:o},"2"),r&&k.jsx(nl,{children:r},"3")])}function nSt(e){const{slotProps:t,material:n}=e,r=$e(e,Dxt);return k.jsx(dn,z({variant:"outlined"},r,n,{inputProps:t==null?void 0:t.htmlInput,InputProps:pH(t==null?void 0:t.input),InputLabelProps:z({shrink:!0},t==null?void 0:t.inputLabel)}))}function rSt(e){const t=yt(),{id:n,multiple:r,freeSolo:o,options:i,getOptionLabel:a,isOptionEqualToValue:s,value:l,onChange:c,label:u,placeholder:f,slotProps:h,material:m}=e,g=$e(e,kxt);return k.jsx(_c,z({id:n,multiple:r,freeSolo:o,options:i,getOptionLabel:a,isOptionEqualToValue:s,value:l,onChange:c,renderTags:(y,v)=>y.map((w,C)=>{const E=v({index:C}),{key:I}=E,O=$e(E,_xt);return k.jsx(Wl,z({variant:"outlined",size:"small",label:typeof w=="string"?w:a==null?void 0:a(w)},O),I)}),renderInput:y=>{var I;const{inputProps:v,InputProps:w,InputLabelProps:C}=y,E=$e(y,$xt);return k.jsx(dn,z({},E,{label:u,placeholder:f,inputProps:v,InputProps:pH(w,!1),InputLabelProps:z({shrink:!0},C)},h==null?void 0:h.textField,(I=t.slotProps)==null?void 0:I.baseTextField))}},g,m))}function oSt(e){return k.jsx(iw,z({},pH(e)))}function pH(e,t=!0){if(!e)return;const{slotProps:n,material:r}=e,i=$e(e,Nxt);t&&(i.startAdornment&&(i.startAdornment=k.jsx(wZ,{position:"start",children:i.startAdornment})),i.endAdornment&&(i.endAdornment=k.jsx(wZ,{position:"end",children:i.endAdornment})));for(const a in r)Object.hasOwn(r,a)&&(i[a]=r[a]);return n!=null&&n.htmlInput&&(i.inputProps?i.inputProps=z({},i.inputProps,n==null?void 0:n.htmlInput):i.inputProps=n==null?void 0:n.htmlInput),i}const iSt={"bottom-start":"top left","bottom-end":"top right"};function aSt(e){const{open:t,children:n,className:r,flip:o,onExited:i,onDidShow:a,onDidHide:s,id:l,target:c,transition:u,placement:f,material:h}=e,m=$e(e,Lxt),g=x.useMemo(()=>{const v=[{name:"preventOverflow",options:{padding:8}}];return o&&v.push({name:"flip",enabled:!0,options:{rootBoundary:"document"}}),(a||s)&&v.push({name:"isPlaced",enabled:!0,phase:"main",fn:()=>{a==null||a()},effect:()=>()=>{s==null||s()}}),v},[o,a,s]);let y;if(!u)y=EZ(e,n);else{const v=w=>C=>{w&&w(),i&&i(C)};y=w=>{var C;return EZ(e,k.jsx(mh,z({},w.TransitionProps,{style:{transformOrigin:iSt[w.placement]},onExited:v((C=w.TransitionProps)==null?void 0:C.onExited),children:k.jsx(go,{children:n})})))}}return k.jsx(sv,z({id:l,className:r,open:t,anchorEl:c,transition:u,placement:f,modifiers:g},m,h,{children:y}))}function EZ(e,t){return lSt(e,sSt(e,t))}function sSt(e,t){return e.onClickAway===void 0?t:k.jsx(gne,{onClickAway:e.onClickAway,touchEvent:e.clickAwayTouchEvent,mouseEvent:e.clickAwayMouseEvent,children:t})}function lSt(e,t){return e.focusTrap===void 0?t:k.jsx(lB,{open:!0,disableEnforceFocus:!0,disableAutoFocus:!0,children:k.jsx("div",{tabIndex:-1,children:t})})}function cSt(e){let{native:t}=e,n=$e(e,Fxt);return t?k.jsx("option",z({},n)):k.jsx(Jt,z({},n))}const uSt={booleanCellTrueIcon:XJ,booleanCellFalseIcon:KJ,columnMenuIcon:Tgt,openFilterButtonIcon:vgt,filterPanelDeleteIcon:KJ,columnFilteredIcon:WJ,columnSelectorIcon:xgt,columnSortedAscendingIcon:HJ,columnSortedDescendingIcon:UJ,columnResizeIcon:Sgt,densityCompactIcon:wgt,densityStandardIcon:Cgt,densityComfortableIcon:Egt,exportIcon:Dgt,moreActionsIcon:Pgt,treeDataCollapseIcon:qJ,treeDataExpandIcon:GJ,groupingCriteriaCollapseIcon:qJ,groupingCriteriaExpandIcon:GJ,detailPanelExpandIcon:YJ,detailPanelCollapseIcon:Ogt,rowReorderIcon:QJ,quickFilterIcon:bgt,quickFilterClearIcon:JJ,columnMenuHideIcon:Agt,columnMenuSortAscendingIcon:HJ,columnMenuSortDescendingIcon:UJ,columnMenuUnsortIcon:null,columnMenuFilterIcon:WJ,columnMenuManageColumnsIcon:Mgt,columnMenuClearIcon:JJ,loadIcon:Igt,filterPanelAddIcon:YJ,filterPanelRemoveAllIcon:Rgt,columnReorderIcon:QJ,menuItemCheckIcon:XJ},dSt={baseAutocomplete:rSt,baseBadge:Hxt,baseCheckbox:Uxt,baseChip:Yxt,baseCircularProgress:Gxt,baseDivider:qxt,baseInput:oSt,baseLinearProgress:Wxt,baseMenuList:eSt,baseMenuItem:tSt,baseTextField:nSt,baseButton:Kxt,baseIconButton:Qxt,baseTooltip:Xxt,basePagination:Vxt,basePopper:aSt,baseSelect:Bxt,baseSelectOption:cSt,baseSkeleton:Jxt,baseSwitch:Zxt},fSt=z({},dSt,uSt),pSt=()=>Me({root:["bottomContainer"]},Cn,{}),hSt=Nn("div")({position:"sticky",zIndex:40,bottom:"calc(var(--DataGrid-hasScrollX) * var(--DataGrid-scrollbarSize))"});function mSt(e){const t=pSt();return k.jsx(hSt,z({},e,{className:fe(t.root,ee["container--bottom"]),role:"presentation"}))}const gSt=z({},fSt,{cell:Bht,skeletonCell:Yht,columnHeaderFilterIconButton:ggt,columnHeaderSortIcon:hgt,columnMenu:Ygt,columnHeaders:oxt,detailPanels:ixt,bottomContainer:mSt,footer:Ivt,footerRowCount:Hvt,toolbar:wvt,pinnedRows:axt,loadingOverlay:$vt,noResultsOverlay:sxt,noRowsOverlay:Nvt,noColumnsOverlay:Lvt,pagination:jvt,filterPanel:Eyt,columnsPanel:Zgt,columnsManagement:kyt,panel:oyt,row:Kvt}),ySt={disableMultipleColumnsFiltering:!0,disableMultipleColumnsSorting:!0,throttleRowsMs:void 0,hideFooterRowCount:!1,pagination:!0,checkboxSelectionVisibleOnly:!1,disableColumnReorder:!0,keepColumnPositionIfDraggedOutside:!1,signature:"DataGrid",listView:!1},vSt=e=>z({},ySt,e.dataSource?{filterMode:"server",sortingMode:"server",paginationMode:"server"}:{}),bSt=gSt,xSt=e=>{const t=Lr(),n=x.useMemo(()=>_j({props:e,theme:t,name:"MuiDataGrid"}),[t,e]),r=x.useMemo(()=>z({},qut,n.localeText),[n.localeText]),o=x.useMemo(()=>kht({defaultSlots:bSt,slots:n.slots}),[n.slots]),i=x.useMemo(()=>Object.keys(lj).reduce((a,s)=>(a[s]=n[s]??lj[s],a),{}),[n]);return x.useMemo(()=>z({},n,i,{localeText:r,slots:o},vSt(n)),[n,r,o,i])};class SSt{constructor(){this.maxListeners=20,this.warnOnce=!1,this.events={}}on(t,n,r={}){let o=this.events[t];o||(o={highPriority:new Map,regular:new Map},this.events[t]=o),r.isFirst?o.highPriority.set(n,!0):o.regular.set(n,!0)}removeListener(t,n){this.events[t]&&(this.events[t].regular.delete(n),this.events[t].highPriority.delete(n))}removeAllListeners(){this.events={}}emit(t,...n){const r=this.events[t];if(!r)return;const o=Array.from(r.highPriority.keys()),i=Array.from(r.regular.keys());for(let a=o.length-1;a>=0;a-=1){const s=o[a];r.highPriority.has(s)&&s.apply(this,n)}for(let a=0;a<i.length;a+=1){const s=i[a];r.regular.has(s)&&s.apply(this,n)}}once(t,n){const r=this;this.on(t,function o(...i){r.removeListener(t,o),n.apply(r,i)})}}class hH{static create(t){return new hH(t)}constructor(t){this.value=void 0,this.listeners=void 0,this.subscribe=n=>(this.listeners.add(n),()=>{this.listeners.delete(n)}),this.getSnapshot=()=>this.value,this.update=n=>{this.value=n,this.listeners.forEach(r=>r(n))},this.value=t,this.listeners=new Set}}const Spe=Symbol("mui.api_private"),wSt=e=>e.isPropagationStopped!==void 0;let TZ=0;function CSt(e){var o;const t=(o=e.current)==null?void 0:o[Spe];if(t)return t;const n={},r={state:n,store:hH.create(n),instanceId:{id:TZ}};return TZ+=1,r.getPublicApi=()=>e.current,r.register=(i,a)=>{Object.keys(a).forEach(s=>{const l=a[s],c=r[s];if((c==null?void 0:c.spying)===!0?c.target=l:r[s]=l,i==="public"){const u=e.current,f=u[s];(f==null?void 0:f.spying)===!0?f.target=l:u[s]=l}})},r.register("private",{caches:{},eventManager:new SSt}),r}function ESt(e){return{get state(){return e.current.state},get store(){return e.current.store},get instanceId(){return e.current.instanceId},[Spe]:e.current}}function TSt(e,t){var a;const n=x.useRef(null),r=x.useRef(null);r.current||(r.current=CSt(n)),n.current||(n.current=ESt(r));const o=x.useCallback((...s)=>{const[l,c,u={}]=s;if(u.defaultMuiPrevented=!1,wSt(u)&&u.isPropagationStopped())return;const f=t.signature===Vl.DataGridPro||t.signature===Vl.DataGridPremium?{api:r.current.getPublicApi()}:{};r.current.eventManager.emit(l,c,u,f)},[r,t.signature]),i=x.useCallback((s,l,c)=>{r.current.eventManager.on(s,l,c);const u=r.current;return()=>{u.eventManager.removeListener(s,l)}},[r]);return yn(r,{subscribeEvent:i,publishEvent:o},"public"),e&&!((a=e.current)!=null&&a.state)&&(e.current=n.current),x.useImperativeHandle(e,()=>n.current,[n]),x.useEffect(()=>{const s=r.current;return()=>{s.publishEvent("unmount")}},[r]),r}const OSt={hooks:{useCSSVariables:fxt,useGridAriaAttributes:Yvt,useGridRowAriaAttributes:Qvt,useCellAggregationResult:()=>null}},wpe=Vt(function(t,n){var i;const r=xSt(t),o=TSt(r.apiRef,r);return K0t(o,r),k.jsx(Xvt,{privateApiRef:o,configuration:OSt,props:r,children:k.jsx(dmt,z({className:r.className,style:r.style,sx:r.sx},(i=r.slotProps)==null?void 0:i.root,{ref:n}))})}),Cpe=x.memo(wpe);wpe.propTypes={apiRef:U.shape({current:U.object}),"aria-label":U.string,"aria-labelledby":U.string,autoHeight:U.bool,autoPageSize:U.bool,autosizeOnMount:U.bool,autosizeOptions:U.shape({columns:U.arrayOf(U.string),disableColumnVirtualization:U.bool,expand:U.bool,includeHeaders:U.bool,includeOutliers:U.bool,outliersFactor:U.number}),cellModesModel:U.object,checkboxSelection:U.bool,classes:U.object,className:U.string,clipboardCopyCellDelimiter:U.string,columnBufferPx:U.number,columnGroupHeaderHeight:U.number,columnGroupingModel:U.arrayOf(U.object),columnHeaderHeight:U.number,columns:U.arrayOf(U.object).isRequired,columnVisibilityModel:U.object,dataSource:U.shape({getRows:U.func.isRequired,updateRow:U.func}),dataSourceCache:U.shape({clear:U.func.isRequired,get:U.func.isRequired,set:U.func.isRequired}),density:U.oneOf(["comfortable","compact","standard"]),disableAutosize:U.bool,disableColumnFilter:U.bool,disableColumnMenu:U.bool,disableColumnResize:U.bool,disableColumnSelector:U.bool,disableColumnSorting:U.bool,disableDensitySelector:U.bool,disableEval:U.bool,disableMultipleRowSelection:U.bool,disableRowSelectionOnClick:U.bool,disableVirtualization:U.bool,editMode:U.oneOf(["cell","row"]),estimatedRowCount:U.number,experimentalFeatures:U.shape({warnIfFocusStateIsNotSynced:U.bool}),filterDebounceMs:U.number,filterMode:U.oneOf(["client","server"]),filterModel:U.shape({items:U.arrayOf(U.shape({field:U.string.isRequired,id:U.oneOfType([U.number,U.string]),operator:U.string.isRequired,value:U.any})).isRequired,logicOperator:U.oneOf(["and","or"]),quickFilterExcludeHiddenColumns:U.bool,quickFilterLogicOperator:U.oneOf(["and","or"]),quickFilterValues:U.array}),getCellClassName:U.func,getDetailPanelContent:U.func,getEstimatedRowHeight:U.func,getRowClassName:U.func,getRowHeight:U.func,getRowId:U.func,getRowSpacing:U.func,hideFooter:U.bool,hideFooterPagination:U.bool,hideFooterSelectedRowCount:U.bool,ignoreDiacritics:U.bool,ignoreValueFormatterDuringExport:U.oneOfType([U.shape({clipboardExport:U.bool,csvExport:U.bool}),U.bool]),initialState:U.object,isCellEditable:U.func,isRowSelectable:U.func,keepNonExistentRowsSelected:U.bool,label:U.string,loading:U.bool,localeText:U.object,logger:U.shape({debug:U.func.isRequired,error:U.func.isRequired,info:U.func.isRequired,warn:U.func.isRequired}),logLevel:U.oneOf(["debug","error","info","warn",!1]),nonce:U.string,onCellClick:U.func,onCellDoubleClick:U.func,onCellEditStart:U.func,onCellEditStop:U.func,onCellKeyDown:U.func,onCellModesModelChange:U.func,onClipboardCopy:U.func,onColumnHeaderClick:U.func,onColumnHeaderContextMenu:U.func,onColumnHeaderDoubleClick:U.func,onColumnHeaderEnter:U.func,onColumnHeaderLeave:U.func,onColumnHeaderOut:U.func,onColumnHeaderOver:U.func,onColumnOrderChange:U.func,onColumnResize:U.func,onColumnVisibilityModelChange:U.func,onColumnWidthChange:U.func,onDataSourceError:U.func,onDensityChange:U.func,onFilterModelChange:U.func,onMenuClose:U.func,onMenuOpen:U.func,onPaginationMetaChange:U.func,onPaginationModelChange:U.func,onPreferencePanelClose:U.func,onPreferencePanelOpen:U.func,onProcessRowUpdateError:U.func,onResize:U.func,onRowClick:U.func,onRowCountChange:U.func,onRowDoubleClick:U.func,onRowEditStart:U.func,onRowEditStop:U.func,onRowModesModelChange:U.func,onRowSelectionModelChange:U.func,onSortModelChange:U.func,onStateChange:U.func,pageSizeOptions:U.arrayOf(U.oneOfType([U.number,U.shape({label:U.string.isRequired,value:U.number.isRequired})]).isRequired),pagination:U.oneOf([!0]),paginationMeta:U.shape({hasNextPage:U.bool}),paginationMode:U.oneOf(["client","server"]),paginationModel:U.shape({page:U.number.isRequired,pageSize:U.number.isRequired}),processRowUpdate:U.func,resizeThrottleMs:U.number,rowBufferPx:U.number,rowCount:U.number,rowHeight:U.number,rowModesModel:U.object,rows:U.arrayOf(U.object),rowSelection:U.bool,rowSelectionModel:U.shape({ids:U.instanceOf(Set).isRequired,type:U.oneOf(["exclude","include"]).isRequired}),rowSpacingType:U.oneOf(["border","margin"]),rowSpanning:U.bool,scrollbarSize:U.number,showCellVerticalBorder:U.bool,showColumnVerticalBorder:U.bool,showToolbar:U.bool,slotProps:U.object,slots:U.object,sortingMode:U.oneOf(["client","server"]),sortingOrder:U.arrayOf(U.oneOf(["asc","desc"])),sortModel:U.arrayOf(U.shape({field:U.string.isRequired,sort:U.oneOf(["asc","desc"])})),style:U.object,sx:U.oneOfType([U.arrayOf(U.oneOfType([U.func,U.object,U.bool])),U.func,U.object]),virtualizeColumnsWithAutoRowHeight:U.bool};const ISt=e=>e.map(t=>({id:t.id,category:t.category,date:t.date,value:t.value,notes:t.notes})),PSt=e=>{const[t]=je(),n=ISt(e.category.entries),r=$de(),o=fut(),[i,a]=x.useState(n),[s,l]=x.useState({}),c=(C,E)=>{C.reason===ks.rowFocusOut&&(E.defaultMuiPrevented=!0)},u=C=>()=>{l({...s,[C]:{mode:zn.Edit}})},f=C=>()=>{l({...s,[C]:{mode:zn.View}})},h=C=>async()=>{console.log("deleting entry",C),o.mutate(parseInt(C.toString())),a(i.filter(E=>E.id!==C))},m=C=>()=>{l({...s,[C]:{mode:zn.View,ignoreModifications:!0}});const E=i.find(I=>I.id===C);(E==null?void 0:E.id)===null&&a(i.filter(I=>I.id!==C))},g=async C=>{r.mutate({id:C.id,categoryId:C.category,date:C.date,value:C.value,notes:C.notes});const E={...C,isNew:!1};return a(i.map(I=>I.id===C.id?E:I)),E},y=C=>{console.log(C)},v=C=>{l(C)},w=[{field:"value",headerName:t("value"),width:80,editable:!0,valueFormatter:C=>C==null?"":C+e.category.unit},{field:"date",headerName:t("date"),type:"date",width:120,editable:!0,valueFormatter:C=>C==null?"":xt.fromJSDate(C).toLocaleString(xt.DATE_MED)},{field:"notes",headerName:t("notes"),type:"string",flex:1,editable:!0},{field:"actions",type:"actions",headerName:t("actions"),width:100,cellClassName:"actions",getActions:({id:C})=>{var I;return((I=s[C])==null?void 0:I.mode)===zn.Edit?[S(mf,{icon:S(ide,{}),label:"Save",sx:{color:"primary.main"},onClick:f(C)}),S(mf,{icon:S(cw,{}),label:"Cancel",className:"textPrimary",onClick:m(C),color:"inherit"})]:[S(mf,{icon:S(DV,{}),label:"Edit",className:"textPrimary",onClick:u(C),color:"inherit"}),S(mf,{icon:S(OS,{}),label:"Delete",onClick:h(C),color:"inherit"})]}}];return S(Zt,{sx:{width:"100%"},children:S(Cpe,{editMode:"row",rows:n,columns:w,initialState:{pagination:{paginationModel:{pageSize:YN.pageSize}}},pageSizeOptions:YN.pageSizeOptions,disableRowSelectionOnClick:!0,rowModesModel:s,onRowModesModelChange:v,onRowEditStop:c,processRowUpdate:g,onProcessRowUpdateError:y})})},XP=({title:e,subtitle:t,isOpen:n,message:r,deleteFn:o,closeFn:i})=>{const[a]=je();return S(lv,{open:n,onClose:i,"aria-labelledby":"modal-modal-title","aria-describedby":"modal-modal-description",children:Q(ho,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",bgcolor:"background.paper",borderWidth:0,boxShadow:24,p:2},children:[S(Jl,{title:e,titleTypographyProps:{variant:"h6"},subheader:t,action:S(cw,{onClick:i})}),S(Fi,{children:S(at,{variant:"body1",children:r})}),Q(ll,{children:[S(ct,{color:"error",variant:"contained",onClick:()=>{o(),i()},children:a("delete")}),S(ct,{color:"primary",onClick:i,children:a("close")})]})]})})},Epe=({category:e,closeFn:t})=>{const[n]=je(),r=lut(),o=cut(e==null?void 0:e.id),i=Wo({name:Ho().required(n("forms.fieldRequired")).max(20,n("forms.maxLength",{chars:"20"})).min(3,n("forms.minLength",{chars:"3"})),unit:Ho().required(n("forms.fieldRequired")).max(5,n("forms.maxLength",{chars:"5"}))});return S(Ti,{initialValues:{name:e?e.name:"",unit:e?e.unit:""},validationSchema:i,onSubmit:async a=>{e?o.mutate({...a,id:e.id}):r.mutate(a),t&&t()},children:a=>S(fi,{children:Q(Ft,{spacing:2,children:[S(dn,{fullWidth:!0,id:"name",label:n("name"),error:a.touched.name&&!!a.touched.name,helperText:a.touched.name&&a.errors.name,...a.getFieldProps("name")}),S(dn,{fullWidth:!0,id:"unit",label:n("unit"),error:a.touched.unit&&!!a.errors.unit,helperText:a.touched.unit&&a.errors.unit?a.errors.unit:n("measurements.unitFormHelpText"),...a.getFieldProps("unit")}),S(Ft,{direction:"row",justifyContent:"end",sx:{mt:2},children:S(ct,{color:"primary",variant:"contained",type:"submit",sx:{mt:2},children:n("submit")})})]})})})},ASt=e=>{const t=uut(e.category.id),n=id(),[r]=je(),[o,i]=J.useState(null),[a,s]=J.useState(!1),[l,c]=J.useState(!1),u=!!o,f=I=>{i(I.currentTarget)},h=()=>{m(),v()},m=()=>{i(null)},g=()=>{C(),i(null)},y=()=>{t.mutate(e.category.id),n(cn(Qt.MEASUREMENT_OVERVIEW))},v=()=>s(!0),w=()=>s(!1),C=()=>c(!0),E=()=>c(!1);return Q("div",{children:[S(ct,{onClick:f,children:S(kV,{})}),Q(ss,{anchorEl:o,open:u,onClose:m,MenuListProps:{"aria-labelledby":"basic-button"},children:[S(Jt,{onClick:h,children:r("edit")}),S(Jt,{onClick:g,children:r("delete")})]}),S(Bi,{title:r("edit"),isOpen:a,closeFn:w,children:S(Epe,{category:e.category,closeFn:w})}),S(XP,{title:r("deleteConfirmation",{name:e.category.name}),message:r("measurements.deleteInfo"),isOpen:l,closeFn:E,deleteFn:y})]})};to.defaultZone=f2e;const Tpe=({entry:e,closeFn:t,categoryId:n})=>{const[r,o]=je(),i=dut(),a=$de(),s=_de(n),[l,c]=J.useState(e?xt.fromJSDate(e.date):xt.now()),u=Wo({value:Do().required(r("forms.fieldRequired")).min(0,r("forms.minValue",{value:"0"})).max(1e3,r("forms.maxValue",{value:"1000"})),date:Xs().required(r("forms.fieldRequired")),notes:Ho().max(500,r("forms.maxLength",{value:"500"}))});return S(Ti,{initialValues:{value:e?e.value:0,date:e?e.date:new Date,notes:e?e.notes:""},validationSchema:u,onSubmit:async f=>{e?a.mutate({...f,id:e.id}):i.mutate({...f,categoryId:n}),t&&t()},children:f=>S(fi,{children:Q(Ft,{spacing:2,children:[S(dn,{fullWidth:!0,id:"value",type:"number",label:r("value"),error:f.touched.value&&!!f.errors.value,helperText:f.touched.value&&f.errors.value,...f.getFieldProps("value")}),s.isLoading?S(Er,{}):S(Ys,{dateAdapter:zl,adapterLocale:o.language,children:S(Ih,{format:"yyyy-MM-dd",label:r("date"),value:l,disableFuture:!0,onChange:h=>{h&&f.setFieldValue("date",h.toJSDate()),c(h)},shouldDisableDate:h=>e&&Jn(e.date)===Jn(h.toJSDate())?!1:h?s.data.entries.some(m=>Jn(m.date)===Jn(h.toJSDate())):!1})}),S(dn,{fullWidth:!0,id:"notes",label:r("notes"),multiline:!0,error:f.touched.notes&&!!f.errors.notes,helperText:f.touched.notes&&f.errors.notes,...f.getFieldProps("notes")}),S(Ft,{direction:"row",justifyContent:"end",sx:{mt:2},children:S(ct,{color:"primary",variant:"contained",type:"submit",sx:{mt:2},children:r("submit")})})]})})})},MSt=()=>{const[e]=je(),[t,n]=J.useState(!1),r=()=>n(!0),o=()=>n(!1);return Q("div",{children:[S(Lh,{color:"secondary","aria-label":"add",onClick:r,sx:{position:"fixed",bottom:"5rem",right:i=>i.spacing(2),zIndex:9},children:S(Ko,{})}),S(Bi,{title:e("add"),isOpen:t,closeFn:o,children:S(Epe,{closeFn:o})})]})},RSt=()=>{const[e]=je(),[t,n]=J.useState(!1),r=()=>n(!0),o=()=>n(!1),i=Ma(),a=parseInt(i.categoryId);return Q(Tt,{children:[S(Lh,{color:"secondary","aria-label":"add",onClick:r,sx:{position:"fixed",bottom:"5rem",right:s=>s.spacing(2),zIndex:9},children:S(Ko,{})}),S(Bi,{title:e("add"),isOpen:t,closeFn:o,children:S(Tpe,{closeFn:o,categoryId:a})})]})},rE=['"Open Sans Bold"',"sans-serif"].join(","),DSt=['"Open Sans Light"',"sans-serif"].join(","),Ope={spacing:8,typography:{h3:{fontFamily:rE},h4:{fontFamily:rE},h5:{fontFamily:rE},h6:{fontFamily:rE},fontFamily:DSt},palette:{primary:{main:"#2A4C7D"},secondary:{main:"#e63946"},warning:{main:"#cba328"},info:{main:"#457b9d"},success:{main:"#307916"}}},tm=ZS(Ope),kSt=e=>ZS({...Ope,components:{MuiPopover:{defaultProps:{container:e}},MuiPopper:{defaultProps:{container:e}},MuiModal:{defaultProps:{container:e}}}}),Ipe=e=>{const{i18n:t}=je(),n=30,r=[...e.category.entries].sort((o,i)=>o.date.getTime()-i.date.getTime()).map(o=>({date:o.date.getTime(),value:o.value,entry:o}));return S(Zt,{alignItems:"center",display:"flex",flexDirection:"column",children:S(nd,{width:"90%",height:200,children:Q(qz,{data:r,children:[S(qh,{type:"monotone",dataKey:"value",stroke:tm.palette.secondary.main,strokeWidth:2,dot:r.length>n?!1:{strokeWidth:1,r:4},activeDot:{stroke:"black",strokeWidth:1,r:6}}),S(Uf,{stroke:"#ccc",strokeDasharray:"5 5"}),S(ls,{dataKey:"date",type:"number",domain:["dataMin","dataMax"],tickFormatter:o=>new Date(o).toLocaleDateString(t.language),tickCount:10}),S(cs,{domain:["auto","auto"],unit:e.category.unit})]})})})},_St=()=>{const e=Ma(),t=parseInt(e.categoryId??"");if(Number.isNaN(t))return S("p",{children:"Please pass an integer as the category id."});const n=_de(t);return n.isLoading?S(Er,{}):S(ds,{title:n.data.name,optionsMenu:S(ASt,{category:n.data}),mainContent:Q(Ft,{spacing:2,children:[S(Ipe,{category:n.data}),S(PSt,{category:n.data})]}),fab:S(RSt,{})})},$St=e=>{const[t,n]=je(),[r,o]=J.useState(!1),i=()=>o(!0),a=()=>o(!1);return Q(Tt,{children:[Q(ho,{children:[S(Jl,{title:e.category.name,subheader:e.category.unit}),S(Fi,{children:S(Ipe,{category:e.category})}),Q(ll,{disableSpacing:!0,sx:{justifyContent:"space-between"},children:[S(ct,{size:"small",children:S(Ro,{to:cn(Qt.MEASUREMENT_DETAIL,n.language,{id:e.category.id}),children:t("seeDetails")})}),S(pn,{onClick:i,children:S(Ko,{})})]})]}),S(Bi,{title:t("add"),isOpen:r,closeFn:a,children:S(Tpe,{closeFn:a,categoryId:e.category.id})})]})},OZ=()=>{const e=kde(),[t]=je();return e.isLoading?S(Er,{}):S(ds,{title:t("measurements.measurements"),mainContent:Q(Ft,{spacing:2,children:[e.data.length===0&&S(Bh,{}),e.data.map(n=>S($St,{category:n},n.id))]}),fab:S(MSt,{})})};function Ra(){return yr({queryKey:[st.QUERY_PROFILE],queryFn:VLe})}const NSt=()=>{const e=Mt();return Dt({mutationFn:t=>HLe(t),onSuccess:async()=>{await e.invalidateQueries({queryKey:[st.QUERY_PROFILE]})}})},NE=[{range:"obese",color:"#FF5733",min:30,max:100},{range:"overweight",color:"#FFC107",min:25,max:30},{range:"normal",color:"#90EE90",min:18.5,max:25},{range:"underweight",color:"#FFC300",min:0,max:18.5}],oE=e=>{const t=NE.find(n=>n.range===e);return t?t.color:"gray"},LSt=()=>{const[e]=je(),t=Bw(),n=Ra(),[r,o]=x.useState(),[i,a]=x.useState();x.useEffect(()=>{var u;if(t.data&&t.data.length>0){const f=t.data[0],h=(u=n.data)!=null&&u.useMetric?f.weight:f.weight*.453592;a(h)}},[t.data,n.data]),x.useEffect(()=>{var u;(u=n.data)!=null&&u.height&&o(n.data.height)},[n.data]);const l=(()=>{if(r&&i){const u=r/100;return i/(u*u)}return null})();if(t.isLoading||n.isLoading)return S(Er,{});const c=[];for(let u=140;u<=220;u+=10){const f=u/100,h={height:u};let m=0;NE.forEach((g,y)=>{const v=g.max>100?100:g.max;let w=v*f*f-m;w=Math.min(w,150-m),y===0?h[g.range]=w:h[g.range]=h[NE[y-1].range]+w,m=Math.min(v*f*f,150)}),c.push(h)}return S(ds,{title:e("bmi.calculator"),mainContent:S(Tt,{children:Q(Ft,{spacing:2,children:[Q(me,{container:!0,spacing:2,children:[S(me,{size:{xs:12,sm:6},children:S(dn,{label:e("height"),fullWidth:!0,slotProps:{input:{endAdornment:S(at,{children:e("cm")})}},type:"number",value:r??"",onChange:u=>o(parseFloat(u.target.value))})}),S(me,{size:{xs:12,sm:6},children:S(dn,{label:e("weight"),slotProps:{input:{endAdornment:S(at,{children:e("server.kg")})}},fullWidth:!0,type:"number",value:i??"",onChange:u=>a(parseFloat(u.target.value))})})]}),l!==null&&S(at,{variant:"h6",children:e("bmi.result",{value:l.toFixed(1)})}),S(nd,{width:"100%",height:400,children:Q(pYe,{data:c,children:[S(ls,{dataKey:"height",type:"number",domain:[140,220],unit:"cm"}),S(cs,{domain:[40,150],tickFormatter:u=>Math.round(u).toString(),unit:"kg"}),S(Uf,{strokeDasharray:"3 3"}),S(ba,{formatter:(u,f)=>[Math.round(u),e("bmi."+f)]}),NE.map(u=>S(Gf,{type:"monotone",dataKey:u.range,stroke:"black",fill:u.color,fillOpacity:.8},u.range)),l!==null&&S(Ow,{x:r,y:i,r:8,fill:"black",stroke:"none"})]})}),Q(Ft,{direction:"row",justifyContent:"center",children:[S(Zt,{height:20,width:20,sx:{backgroundColor:oE("obese")}}),e("bmi.obese"),S(Zt,{height:20,width:20,sx:{backgroundColor:oE("overweight"),marginLeft:2}}),e("bmi.overweight"),S(Zt,{height:20,width:20,sx:{backgroundColor:oE("normal"),marginLeft:2}}),e("bmi.normal"),S(Zt,{height:20,width:20,sx:{backgroundColor:oE("underweight"),marginLeft:2}}),e("bmi.underweight")]})]})})})},FSt=e=>{var r,o,i,a;const[t,n]=je();return Q(ln,{children:[S(ke,{sx:{paddingX:1},children:S(Kl,{alt:(r=e.item.ingredient)==null?void 0:r.name,src:(i=(o=e.item.ingredient)==null?void 0:o.image)==null?void 0:i.url,sx:{width:45,height:45},children:S(Ju,{})})}),Q(ke,{sx:{paddingX:1},children:[e.item.amountString," ",(a=e.item.ingredient)==null?void 0:a.name]}),S(ke,{align:"right",sx:{paddingX:1},children:t("nutrition.valueEnergyKcalKj",{kcal:_i(e.item.nutritionalValues.energy,n.language),kj:_i(e.item.nutritionalValues.energyKj,n.language)})}),S(ke,{align:"right",sx:{paddingX:1},children:$n(e.item.nutritionalValues.protein,n.language)}),S(ke,{align:"right",sx:{paddingX:1},children:$n(e.item.nutritionalValues.carbohydrates,n.language)}),S(ke,{align:"right",sx:{paddingX:1},children:$n(e.item.nutritionalValues.fat,n.language)})]},e.item.id)},pj=e=>{const[t,n]=je();return S(Fc,{children:Q(Nc,{children:[S(Ff,{children:Q(ln,{children:[S(ke,{}),S(ke,{}),S(ke,{align:"right",sx:{paddingX:1},children:t("nutrition.energy")}),S(ke,{align:"right",sx:{paddingX:1},children:t("nutrition.protein")}),S(ke,{align:"right",sx:{paddingX:1},children:t("nutrition.carbohydrates")}),S(ke,{align:"right",sx:{paddingX:1},children:t("nutrition.fat")})]})}),Q(Lc,{children:[e.items.map(r=>S(FSt,{item:r},r.id)),e.showSum&&Q(ln,{children:[S(ke,{sx:{paddingX:1},children:" "}),S(ke,{sx:{paddingX:1},children:t("total")}),S(ke,{align:"right",sx:{paddingX:1},children:t("nutrition.valueEnergyKcalKj",{kcal:_i(e.values.energy,n.language),kj:_i(e.values.energyKj,n.language)})}),S(ke,{align:"right",sx:{paddingX:1},children:$n(e.values.protein,n.language)}),S(ke,{align:"right",sx:{paddingX:1},children:$n(e.values.carbohydrates,n.language)}),S(ke,{align:"right",sx:{paddingX:1},children:$n(e.values.fat,n.language)})]})]})]})})},jSt=e=>{const[t,n]=je();return S(Fc,{children:Q(Nc,{size:"small",children:[S(Ff,{children:Q(ln,{children:[S(ke,{children:t("nutrition.macronutrient")}),S(ke,{align:"right",children:t("nutrition.planned")}),S(ke,{align:"right",children:t("nutrition.logged")}),S(ke,{align:"right",children:t("nutrition.difference")})]})}),Q(Lc,{children:[Q(ln,{children:[S(ke,{children:t("nutrition.energy")}),S(ke,{align:"right",children:t("nutrition.valueEnergyKcalKj",{kcal:_i(e.planned.energy,n.language),kj:_i(e.planned.energyKj,n.language)})}),S(ke,{align:"right",children:t("nutrition.valueEnergyKcalKj",{kcal:_i(e.logged.energy,n.language),kj:_i(e.logged.energyKj,n.language)})}),S(ke,{align:"right",children:t("nutrition.valueEnergyKcalKj",{kcal:_i(e.logged.energy-e.planned.energy,n.language),kj:_i(e.logged.energyKj-e.planned.energyKj,n.language)})})]}),Q(ln,{children:[S(ke,{children:t("nutrition.protein")}),S(ke,{align:"right",children:$n(e.planned.protein,n.language)}),S(ke,{align:"right",children:$n(e.logged.protein,n.language)}),S(ke,{align:"right",children:$n(e.logged.protein-e.planned.protein,n.language)})]}),Q(ln,{children:[S(ke,{children:t("nutrition.carbohydrates")}),S(ke,{align:"right",children:$n(e.planned.carbohydrates,n.language)}),S(ke,{align:"right",children:$n(e.logged.carbohydrates,n.language)}),S(ke,{align:"right",children:$n(e.logged.carbohydrates-e.planned.carbohydrates,n.language)})]}),Q(ln,{children:[S(ke,{sx:{pl:5},children:t("nutrition.ofWhichSugars")}),S(ke,{align:"right",children:$n(e.planned.carbohydratesSugar,n.language)}),S(ke,{align:"right",children:$n(e.logged.carbohydratesSugar,n.language)}),S(ke,{align:"right",children:$n(e.logged.carbohydratesSugar-e.planned.carbohydratesSugar,n.language)})]}),Q(ln,{children:[S(ke,{children:t("nutrition.fat")}),S(ke,{align:"right",children:$n(e.planned.fat,n.language)}),S(ke,{align:"right",children:$n(e.logged.fat,n.language)}),S(ke,{align:"right",children:$n(e.logged.fat-e.planned.fat,n.language)})]}),Q(ln,{children:[S(ke,{sx:{paddingLeft:5},children:t("nutrition.ofWhichSaturated")}),S(ke,{align:"right",children:$n(e.planned.fatSaturated,n.language)}),S(ke,{align:"right",children:$n(e.logged.fatSaturated,n.language)}),S(ke,{align:"right",children:$n(e.logged.fatSaturated-e.planned.fatSaturated,n.language)})]}),Q(ln,{children:[S(ke,{children:t("nutrition.others")}),S(ke,{}),S(ke,{}),S(ke,{})]}),Q(ln,{children:[S(ke,{children:t("nutrition.fibres")}),S(ke,{align:"right",children:$n(e.planned.fiber,n.language)}),S(ke,{align:"right",children:$n(e.logged.fiber,n.language)}),S(ke,{align:"right",children:$n(e.logged.fiber-e.planned.fiber,n.language)})]}),Q(ln,{children:[S(ke,{children:t("nutrition.sodium")}),S(ke,{align:"right",children:$n(e.planned.sodium,n.language)}),S(ke,{align:"right",children:$n(e.logged.sodium,n.language)}),S(ke,{align:"right",children:$n(e.logged.sodium-e.planned.sodium,n.language)})]})]})]})})},IZ=()=>{const[e]=je(),t=Ma(),n=parseInt(t.planId);if(Number.isNaN(n))return S("p",{children:"Please pass an integer as the nutritional plan id."});const r=new Date(t.date),o=JLe(n,t.date);return o.isLoading?S(Er,{}):S(ds,{title:e("nutrition.nutritionalDiary"),mainContent:S(Tt,{children:Q(Ft,{spacing:2,children:[S(at,{gutterBottom:!0,variant:"h4",children:r.toLocaleDateString()}),S(jSt,{logged:o.data.loggedNutritionalValuesDate(r),planned:o.data.plannedNutritionalValues}),S(pj,{values:o.data.loggedNutritionalValuesDate(r),items:o.data.loggedEntriesDate(r),showSum:!0})]})})})};function*Zw(e){let t;e<=3?t=d2e:e<=5?t=u2e:t=c2e;for(const n of t)yield n}const BSt=e=>{const[t,n]=je(),r=Zw(3),o=[{name:t("nutrition.carbohydrates"),value:e.data.carbohydrates},{name:t("nutrition.protein"),value:e.data.protein},{name:t("nutrition.fat"),value:e.data.fat}],i=Math.PI/180;return S(nd,{width:"100%",height:300,children:Q(Nle,{children:[S(Gc,{data:o,labelLine:!1,label:({cx:s,cy:l,midAngle:c,innerRadius:u,outerRadius:f,payload:h})=>{const m=u+(f-u)*.4,g=s+m*Math.cos(-c*i),y=l+m*Math.sin(-c*i);return S("text",{x:g,y,fill:"white",textAnchor:"middle",dominantBaseline:"central",children:$n(h.value,n.language)})},fill:"#8884d8",dataKey:"value",children:o.map((s,l)=>S(Ev,{fill:r.next().value},`cell-${l}`))}),S(Oc,{})]})})},zSt=({showPlanned:e,planned:t,today:n,avg7Days:r})=>{const[o,i]=je(),a=Zw(3),s=[{name:o("nutrition.protein"),planned:t.protein,today:n.protein,avg7Days:r.protein},{name:o("nutrition.carbohydrates"),planned:t.carbohydrates,today:n.carbohydrates,avg7Days:r.carbohydrates},{name:o("nutrition.sugar"),planned:t.carbohydratesSugar,today:n.carbohydratesSugar,avg7Days:r.carbohydratesSugar},{name:o("nutrition.fat"),planned:t.fat,today:n.fat,avg7Days:r.fat},{name:o("nutrition.saturatedFat"),planned:t.fatSaturated,today:n.fatSaturated,avg7Days:r.fatSaturated}];return S(nd,{width:"100%",height:300,children:Q($le,{data:s,margin:{top:20,right:30,left:20,bottom:5},children:[S(Uf,{strokeDasharray:"3 4"}),S(ls,{dataKey:"name"}),S(cs,{type:"number",orientation:"left",unit:o("nutrition.gramShort")}),S(ba,{formatter:l=>_i(l,i.language)}),S(Oc,{}),e&&S(Ac,{dataKey:"planned",unit:o("nutrition.gramShort"),name:o("nutrition.planned"),fill:a.next().value}),S(Ac,{dataKey:"today",unit:o("nutrition.gramShort"),name:o("nutrition.today"),fill:a.next().value}),S(Ac,{dataKey:"avg7Days",unit:o("nutrition.gramShort"),name:o("nutrition.7dayAvg"),fill:a.next().value})]})})},VSt=e=>{const[t,n]=je();return S(Fc,{children:Q(Nc,{size:"small",children:[S(Ff,{children:Q(ln,{children:[S(ke,{children:t("date")}),S(ke,{align:"right",children:t("nutrition.logged")}),S(ke,{align:"right",children:t("nutrition.difference")})]})}),S(Lc,{children:Array.from(e.logged).map(([r])=>{var o,i;return Q(ln,{children:[S(ke,{children:S(Ro,{to:cn(Qt.NUTRITION_DIARY,n.language,{id:e.planId,date:r}),children:new Date(r).toLocaleDateString(n.language)})}),S(ke,{align:"right",children:t("nutrition.valueEnergyKcal",{value:_i((o=e.logged.get(r))==null?void 0:o.nutritionalValues.energy,n.language)})}),S(ke,{align:"right",children:_i(((i=e.logged.get(r))==null?void 0:i.nutritionalValues.energy)-e.planned.energy,n.language)})]},r)})})]})})},HSt=()=>{const[e]=je(),[t,n]=J.useState(!1),r=()=>n(!0),o=()=>n(!1);return Q("div",{children:[S(Lh,{color:"secondary","aria-label":"add",onClick:r,sx:{position:"fixed",bottom:"5rem",right:i=>i.spacing(2),zIndex:9},children:S(Ko,{})}),S(Bi,{title:e("add"),isOpen:t,closeFn:o,children:S(RV,{closeFn:o})})]})},USt=e=>{const[t]=je(),[n,r]=J.useState(!1),o=()=>r(!0),i=()=>r(!1);return Q("div",{children:[S(Lh,{color:"secondary","aria-label":"add",onClick:o,sx:{position:"fixed",bottom:"5rem",right:a=>a.spacing(2),zIndex:9},children:S(lw,{})}),S(Bi,{title:t("nutrition.addNutritionalDiary"),isOpen:n,closeFn:i,children:S(MV,{closeFn:i,planId:e.plan.id,meals:e.plan.meals})})]})},Ppe=({meal:e,planId:t,closeFn:n})=>{const[r,o]=je(),i=iFe(t),a=sFe(t),s=Wo({name:Ho().required().max(25,r("forms.maxLength",{chars:"25"})).min(3,r("forms.minLength",{chars:"3"})),time:Xs().required()});return S(Ti,{initialValues:{name:e?e.name:"",time:e?e.time:new Date},validationSchema:s,onSubmit:async l=>{l.time instanceof Date||(l.time=l.time.toJSDate());const c={...l,time:Dx(l.time)};e?a.mutate({...c,plan:t,id:e.id}):i.mutate({...c,plan:t}),n&&n()},children:l=>S(fi,{children:Q(Ft,{spacing:2,children:[S(dn,{fullWidth:!0,id:"name",label:r("description"),error:l.touched.name&&!!l.errors.name,helperText:l.touched.name&&l.errors.name,...l.getFieldProps("name")}),S(Ys,{dateAdapter:zl,adapterLocale:o.language,children:S(HF,{label:r("timeOfDay"),value:l.values.time!==null?xt.fromJSDate(l.values.time):null,onChange:c=>l.setFieldValue("time",c)})}),Q(Ft,{direction:"row",justifyContent:"end",spacing:2,children:[n!==void 0&&S(ct,{color:"primary",variant:"outlined",onClick:()=>n(),children:r("close")}),S(ct,{disabled:i.isPending||a.isPending,color:"primary",variant:"contained",type:"submit",children:r("submit")})]})]})})})},GSt=e=>{const[t]=je(),n=Zw(3),r=[{name:t("nutrition.energy"),value:e.logged.energy/e.planned.energy*100},{name:t("nutrition.protein"),value:e.logged.protein/e.planned.protein*100},{name:t("nutrition.carbohydrates"),value:e.logged.carbohydrates/e.planned.carbohydrates*100},{name:t("nutrition.fat"),value:e.logged.fat/e.planned.fat*100}];return S(nd,{width:"100%",height:150,children:Q($le,{data:r,layout:"vertical",margin:{left:60},children:[S(Uf,{strokeDasharray:"3 4"}),S(ls,{type:"number",unit:"%"}),S(cs,{type:"category",dataKey:"name"}),S(Ac,{dataKey:"value",unit:"%",fill:n.next().value})]})})},Ape=({planId:e,item:t,mealId:n,closeFn:r})=>{const[o]=je(),i=lFe(e),a=cFe(e),s=uFe(e),l=()=>{t&&s.mutate(t.id),r&&r()},c=Wo({amount:Do().required(o("forms.fieldRequired")).max(1e3,o("forms.maxValue",{value:"1000"})).min(1,o("forms.minValue",{value:"1"})),ingredient:Do().required(o("forms.fieldRequired"))});return S(Ti,{initialValues:{amount:t?t.amount:0,ingredient:t?t.ingredientId:0},validationSchema:c,onSubmit:async u=>{const f={...u,meal:n,weight_unit:null};t?a.mutate({...f,id:t.id}):i.mutate(f),r&&r()},children:u=>{var f;return S(fi,{children:Q(Ft,{spacing:2,children:[S(vV,{callback:h=>u.setFieldValue("ingredient",h?h.data.id:null),initialIngredient:t?(f=t.ingredient)==null?void 0:f.name:null}),S(dn,{fullWidth:!0,id:"amount",label:"amount",InputProps:{endAdornment:S(So,{position:"end",children:o("nutrition.gramShort")})},error:u.touched.amount&&!!u.errors.amount,helperText:u.touched.amount&&u.errors.amount,...u.getFieldProps("amount")}),Q(Ft,{direction:"row",justifyContent:"end",spacing:2,children:[r!==void 0&&t!==void 0&&S(ct,{color:"error",variant:"outlined",onClick:l,children:o("delete")}),r!==void 0&&S(ct,{color:"primary",variant:"outlined",onClick:()=>r(),children:o("close")}),S(ct,{color:"primary",variant:"contained",type:"submit",children:o("submit")})]})]})})}})},qSt=e=>{const t=oie(e.planId),n=aFe(e.planId),[r]=je(),[o,i]=J.useState(!1),[a,s]=x.useState(null),[l,c]=x.useState(!1),[u,f]=x.useState(!1),h=!!a,m=D=>{s(D.currentTarget)},g=()=>{y(),C()},y=()=>{s(null)},v=()=>{I(),s(null)},w=()=>{n.mutate(e.meal.id)},C=()=>c(!0),E=()=>c(!1),I=()=>f(!0),O=()=>f(!1),P=(D,M)=>{M!=="clickaway"&&i(!1)},R=()=>{const D=e.meal.items.map(M=>({plan:e.planId,meal:e.meal.id,mealItem:M.id,ingredient:M.ingredientId,weight_unit:M.weightUnitId,datetime:new Date().toISOString(),amount:M.amount}));t.mutate(D),i(!0)};return Q(Tt,{children:[!e.onlyLogging&&S(Go,{title:r("nutrition.logThisMeal"),children:S(pn,{"aria-label":"settings",onClick:R,children:S(lw,{})})}),S(pn,{"aria-label":"settings",onClick:m,children:S(ode,{})}),S(pn,{"aria-label":"settings",onClick:e.handleExpanded,children:e.isExpanded?S(nde,{}):S(rde,{})}),Q(ss,{anchorEl:a,open:h,onClose:y,MenuListProps:{"aria-labelledby":"basic-button"},children:[S(Jt,{onClick:g,children:r("edit")}),S(Jt,{onClick:v,children:r("delete")})]}),S(Bi,{title:r("edit"),isOpen:l,closeFn:E,children:S(Ppe,{meal:e.meal,closeFn:E,planId:e.planId})}),S(XP,{title:r("deleteConfirmation",{name:e.meal.name}),message:r("nutrition.mealDeleteInfo"),isOpen:u,closeFn:O,deleteFn:w}),S(dI,{open:o,autoHideDuration:EI,onClose:P,children:S(Ci,{onClose:P,severity:"success",sx:{width:"100%"},children:r("nutrition.diaryEntrySaved")})})]})},WSt=e=>{var o,i,a,s;const[t,n]=x.useState(!1),r=()=>n(!t);return Q(Tt,{children:[Q(Co,{children:[S(fB,{onClick:r,sx:{"&:hover":{cursor:"pointer"}},children:S(Kl,{alt:(o=e.mealItem.ingredient)==null?void 0:o.name,src:(a=(i=e.mealItem.ingredient)==null?void 0:i.image)==null?void 0:a.url,sx:{width:45,height:45},children:S(Ju,{})})}),S(Wr,{primary:`${e.mealItem.amountString} ${(s=e.mealItem.ingredient)==null?void 0:s.name}`})]}),S(aa,{in:t,timeout:"auto",unmountOnExit:!0,sx:{width:"100%"},children:S(Co,{children:S(Wr,{children:S(Ape,{planId:e.planId,mealId:e.mealId,item:e.mealItem,closeFn:r})})})})]})},PZ=e=>{const t=Lr(),n=e.meal.id!==bE,[r]=je(),[o,i]=x.useState(!1),a=()=>i(!o),[s,l]=x.useState(!1),c=()=>{l(!s),f(!1)},[u,f]=x.useState(!1),h=()=>{f(!u),l(!1)};return Q(ho,{children:[S(Jl,{sx:{bgcolor:t.palette.grey[300]},action:e.meal.id!==bE&&S(qSt,{meal:e.meal,planId:e.planId,onlyLogging:e.onlyLogging,isExpanded:o,handleExpanded:a}),title:e.meal.name,subheader:e.meal.timeHHMMLocale}),Q(Fi,{sx:{paddingY:0},children:[Q(aa,{in:o,timeout:"auto",unmountOnExit:!0,children:[!e.onlyLogging&&S(pj,{showSum:n,items:e.meal.items,values:e.meal.plannedNutritionalValues}),S(at,{gutterBottom:!0,variant:"h6",sx:{my:2},children:r("nutrition.loggedToday")}),!e.meal.plannedNutritionalValues.isEmpty&&S(GSt,{logged:e.meal.loggedNutritionalValuesToday,planned:e.meal.plannedNutritionalValues}),S(pj,{showSum:n,items:e.meal.diaryEntriesToday,values:e.meal.loggedNutritionalValuesToday})]}),!o&&S(ai,{children:e.meal.items.map(m=>S(WSt,{mealItem:m,planId:e.planId,mealId:e.meal.id},m.id))})]}),Q(ll,{children:[!e.onlyLogging&&S(Go,{title:r("nutrition.addMealItem"),children:S(pn,{onClick:c,children:S(Ko,{})})}),S(Go,{title:r("nutrition.addNutritionalDiary"),children:S(pn,{onClick:h,children:S(lw,{})})})]}),S(aa,{in:s,timeout:"auto",unmountOnExit:!0,children:Q(Fi,{sx:{paddingY:0},children:[S("p",{children:S("b",{children:r("nutrition.addMealItem")})}),S(Ape,{planId:e.planId,mealId:e.meal.id,closeFn:c})]})}),S(aa,{in:u,timeout:"auto",unmountOnExit:!0,children:Q(Fi,{sx:{paddingY:0},children:[S("p",{children:S("b",{children:r("nutrition.addNutritionalDiary")})}),S(MV,{closeFn:h,planId:e.planId,mealId:e.meal.id!==bE?e.meal.id:null})]})})]})},AZ=e=>{const[t,n]=je();return S(Fc,{children:Q(Nc,{size:"small",children:[S(Ff,{children:Q(ln,{children:[S(ke,{children:t("nutrition.macronutrient")}),S(ke,{align:"right",children:t("total")}),S(ke,{align:"right",children:t("nutrition.percentEnergy")})]})}),Q(Lc,{children:[Q(ln,{children:[S(ke,{children:t("nutrition.energy")}),S(ke,{align:"right",children:t("nutrition.valueEnergyKcalKj",{kcal:_i(e.values.energy,n.language),kj:_i(e.values.energyKj,n.language)})}),S(ke,{align:"right"})]}),Q(ln,{children:[S(ke,{children:t("nutrition.protein")}),S(ke,{align:"right",children:$n(e.values.protein,n.language)}),S(ke,{align:"right",children:JR(e.values.percent.protein,n.language)})]}),Q(ln,{children:[S(ke,{children:t("nutrition.carbohydrates")}),S(ke,{align:"right",children:$n(e.values.carbohydrates,n.language)}),S(ke,{align:"right",children:JR(e.values.percent.carbohydrates,n.language)})]}),Q(ln,{children:[S(ke,{sx:{pl:5},children:t("nutrition.ofWhichSugars")}),S(ke,{align:"right",children:$n(e.values.carbohydratesSugar,n.language)}),S(ke,{align:"right"})]}),Q(ln,{children:[S(ke,{children:t("nutrition.fat")}),S(ke,{align:"right",children:$n(e.values.fat,n.language)}),S(ke,{align:"right",children:JR(e.values.percent.fat,n.language)})]}),Q(ln,{children:[S(ke,{sx:{pl:5},children:t("nutrition.ofWhichSaturated")}),S(ke,{align:"right",children:$n(e.values.fatSaturated,n.language)}),S(ke,{align:"right"})]}),Q(ln,{children:[S(ke,{children:t("nutrition.others")}),S(ke,{children:" "}),S(ke,{align:"right"})]}),Q(ln,{children:[S(ke,{children:t("nutrition.fibres")}),S(ke,{align:"right",children:$n(e.values.fiber,n.language)}),S(ke,{align:"right"})]}),Q(ln,{children:[S(ke,{children:t("nutrition.sodium")}),S(ke,{align:"right",children:$n(e.values.sodium,n.language)}),S(ke,{align:"right"})]})]})]})})},KSt=e=>{const t=eFe(e.plan.id),n=id(),[r,o]=je(),[i,a]=J.useState(null),[s,l]=J.useState(!1),[c,u]=J.useState(!1),f=!!i,h=R=>{a(R.currentTarget)},m=()=>{g(),E()},g=()=>{a(null)},y=()=>{O(),a(null)},v=()=>{t.mutate(e.plan.id),n(cn(Qt.NUTRITION_OVERVIEW))},w=()=>window.location.href=cn(Qt.NUTRITION_PLAN_PDF,o.language,{id:e.plan.id}),C=()=>window.location.href=cn(Qt.NUTRITION_PLAN_COPY,o.language,{id:e.plan.id}),E=()=>l(!0),I=()=>l(!1),O=()=>u(!0),P=()=>u(!1);return Q(Tt,{children:[S(ct,{onClick:h,children:S(kV,{})}),Q(ss,{anchorEl:i,open:f,onClose:g,MenuListProps:{"aria-labelledby":"basic-button"},children:[S(Jt,{onClick:m,children:r("edit")}),S(Jt,{onClick:w,children:r("downloadAsPdf")}),S(Jt,{onClick:C,children:r("nutrition.copyPlan")}),S(Jt,{onClick:y,children:r("delete")})]}),S(Bi,{title:r("edit"),isOpen:s,closeFn:I,children:S(RV,{plan:e.plan,closeFn:I})}),S(XP,{title:r("deleteConfirmation",{name:e.plan.description}),message:r("nutrition.planDeleteInfo"),isOpen:c,closeFn:P,deleteFn:v})]})},YSt=e=>{const[t]=je(),n=e.plan.plannedNutritionalValues,r=e.plan.loggedNutritionalValuesToday,o=e.plan.percentageValuesLoggedToday;return S(Tt,{children:Q(Ft,{direction:"column",spacing:1,children:[S(at,{gutterBottom:!0,variant:"h6",children:t("nutrition.goalsTitle")}),S(Lg,{title:t("nutrition.protein"),percentage:o.protein,logged:r.protein,planned:n.protein}),S(Lg,{title:t("nutrition.carbohydrates"),percentage:o.carbohydrates,logged:r.carbohydrates,planned:n.carbohydrates}),S(Lg,{title:t("nutrition.fat"),percentage:o.fat,logged:r.fat,planned:n.fat})]})})},QSt=()=>{const[e]=je(),t=Ma(),n=parseInt(t.planId??"");if(Number.isNaN(n))return S("p",{children:"Please pass an integer as the nutritional plan id."});const r=XLe(n),[o,i]=x.useState(!1),a=()=>i(!o),s=r.data;return r.isLoading?S(Er,{}):S(ds,{title:s.description,optionsMenu:S(KSt,{plan:s}),mainContent:S(Tt,{children:Q(Ft,{spacing:2,children:[s.meals.map(l=>S(PZ,{meal:l,planId:s.id,onlyLogging:s.onlyLogging},l.id)),S(PZ,{meal:r.data.pseudoMealOthers(e("nutrition.pseudoMealTitle")),planId:s.id,onlyLogging:!0},-1),!s.onlyLogging&&Q(Tt,{children:[S(Go,{title:e("nutrition.addMeal"),children:S(pn,{onClick:a,children:S(Ko,{})})}),Q(aa,{in:o,timeout:"auto",unmountOnExit:!0,children:[S("p",{children:S("b",{children:e("nutrition.addMeal")})}),S(Ppe,{planId:s.id,closeFn:a})]})]}),S(AZ,{values:s.plannedNutritionalValues}),s.hasAnyPlanned&&S(BSt,{data:s.plannedNutritionalValues}),S(at,{gutterBottom:!0,variant:"h4",children:e("nutrition.logged")}),S(zSt,{showPlanned:s.hasAnyPlanned,planned:s.plannedNutritionalValues,today:s.loggedNutritionalValuesToday,avg7Days:s.loggedNutritionalValues7DayAvg}),S(AZ,{values:s.loggedNutritionalValuesToday}),S(VSt,{planId:s.id,logged:s.groupDiaryEntries,planned:s.plannedNutritionalValues})]})}),sideBar:S(YSt,{plan:s}),fab:S(USt,{plan:s})})},XSt=()=>{var n;const e=YLe(),[t]=je();return e.isLoading?S(Er,{}):S(ds,{title:t("nutrition.plans"),mainContent:Q(Ft,{spacing:2,children:[((n=e.data)==null?void 0:n.length)===0&&S(Bh,{}),S(ZSt,{plans:e.data})]}),fab:S(HSt,{})})},JSt=e=>{const[t,n]=je(),r=cn(Qt.NUTRITION_DETAIL,n.language,{id:e.plan.id});return Q(Tt,{children:[S(Co,{sx:{p:0},children:Q(Fl,{component:"a",href:r,children:[S(Wr,{primary:e.plan.description!==""?e.plan.description:t("routines.routine"),secondary:e.plan.end?`${e.plan.start.toLocaleDateString()} – ${e.plan.end.toLocaleDateString()}`:`${e.plan.start.toLocaleDateString()}`}),S(ede,{})]})}),S(ji,{component:"li"})]})},ZSt=e=>S(go,{children:S(ai,{sx:{py:0},children:e.plans.map(t=>S(JSt,{plan:t},t.id))},"abc")});function Xu(e){const[t,n]=us(e.fieldName),r=e.fullwidth??!0;return S(dn,{fullWidth:r,id:e.fieldName,label:e.title,variant:"standard",error:n.touched&&!!n.error,helperText:n.touched&&n.error,...t,...e.fieldProps})}const ewt=e=>{const{t}=je(),n=Nw(e.routineId),r=[{value:"normal",label:t("routines.set.normalSet")},{value:"dropset",label:t("routines.set.dropSet")},{value:"myo",label:t("routines.set.myo")},{value:"partial",label:t("routines.set.partial")},{value:"forced",label:t("routines.set.forced")},{value:"tut",label:t("routines.set.tut")},{value:"iso",label:t("routines.set.iso")},{value:"jump",label:t("routines.set.jump")}],o=i=>{n.mutate({id:e.slotEntry.id,type:i})};return S(Tt,{children:S(dn,{fullWidth:!0,select:!0,label:t("routines.set.type"),variant:"standard",value:e.slotEntry.type,disabled:n.isPending,onChange:i=>o(i.target.value),children:r.map(i=>S(Jt,{value:i.value,children:i.label},i.value))})})},twt=e=>{var a;const{t}=je(),n=Nw(e.routineId),r=hst();if(r.isLoading)return S(gh,{});const o=(a=r.data)==null?void 0:a.map(s=>({value:s.id,label:s.name})),i=s=>{n.mutate({id:e.slotEntry.id,repetition_unit:parseInt(s)})};return S(Tt,{children:S(dn,{fullWidth:!0,select:!0,label:t("unit"),variant:"standard",value:e.slotEntry.repetitionUnitId,disabled:n.isPending,onChange:s=>i(s.target.value),children:o.map(s=>S(Jt,{value:s.value,children:s.label},s.value))})})},nwt=e=>{var s;const{t}=je(),n=Nw(e.routineId),r=pst(),o=Ra();if(r.isLoading||o.isLoading)return S(gh,{});const i=(s=r.data)==null?void 0:s.map(l=>({value:l.id,label:l.name})),a=l=>{n.mutate({id:e.slotEntry.id,weight_unit:parseInt(l)})};return S(Tt,{children:S(dn,{fullWidth:!0,select:!0,label:t("unit"),variant:"standard",value:e.slotEntry.weightUnitId,disabled:n.isPending,onChange:l=>a(l.target.value),children:i.map(l=>S(Jt,{value:l.value,children:l.label},l.value))})})};function rwt(e,t){let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>e(...r),t)}}const RO=e=>{const{t}=je(),n=Nw(e.routineId),r=NSt(),[o,i]=x.useState(e.initialValue===null?"":e.initialValue),a=x.useCallback(rwt(l=>{let c=parseFloat(l);Number.isNaN(c)&&(c=null);const u=e.rounding==="weight"?{weight_rounding:c}:{reps_rounding:c};e.editProfile?r.mutate(u):n.mutate({id:e.entryId,...u})},$re),[]),s=l=>{i(l),a(l)};return S(dn,{fullWidth:!0,label:e.rounding==="weight"?t("weight"):t("routines.reps"),variant:"standard",value:o,disabled:n.isPending||r.isPending,onChange:l=>s(l.target.value)})},mH=({routine:e,closeFn:t})=>{const[n,r]=je(),o=Mat(),i=Kue(e==null?void 0:e.id),a=id(),[s,l]=x.useState(e?xt.fromJSDate(e.start):xt.now()),[c,u]=x.useState(e?xt.fromJSDate(e.end):xt.now().plus({weeks:F$e})),f=c.diff(s,["weeks","days"]),h=Math.floor(f.weeks),m=Math.floor(f.days),g=Wo({name:Ho().required().max(Hq,n("forms.maxLength",{chars:Hq})).min(Vq,n("forms.minLength",{chars:Vq})),description:Ho().max(Uq,n("forms.maxLength",{chars:Uq})),start:Xs().required(),end:Xs().required().min(AP("start"),n("forms.endBeforeStart")).test("hasMinimumDuration",n("routines.minLengthRoutine",{number:Gq}),function(y){const v=this.parent.start;if(v&&y){const w=xt.fromJSDate(v);return xt.fromJSDate(y).diff(w,"weeks").weeks>=Gq}return!0}).test("hasMaximumDuration",n("routines.maxLengthRoutine",{number:qq}),function(y){const v=this.parent.start;if(v&&y){const w=xt.fromJSDate(v);return xt.fromJSDate(y).diff(w,"weeks").weeks<=qq}return!0}),fitInWeek:Lu()});return S(Ti,{initialValues:{name:e?e.name:"",description:e?e.description:"",start:s,end:c,fitInWeek:e?e.fitInWeek:!0},validationSchema:g,onSubmit:async y=>{var v,w,C,E;if(e)i.mutate({...y,fit_in_week:y.fitInWeek,start:(v=y.start)==null?void 0:v.toISODate(),end:(w=y.end)==null?void 0:w.toISODate(),id:e.id});else{const I=await o.mutateAsync({...y,fit_in_week:y.fitInWeek,start:(C=y.start)==null?void 0:C.toISODate(),end:(E=y.end)==null?void 0:E.toISODate()});a(cn(Qt.ROUTINE_EDIT,r.language,{id:I.id})),t&&t()}},children:y=>S(fi,{children:Q(me,{container:!0,spacing:2,children:[S(me,{size:{xs:12,sm:5},children:S(Xu,{fieldName:"name",title:n("name")})}),S(me,{size:{xs:6,sm:3},children:S(Ys,{dateAdapter:zl,adapterLocale:r.language,children:S(Ih,{defaultValue:xt.now(),label:n("start"),value:s,onChange:v=>{v&&(y.setFieldValue("start",v),l(v))},slotProps:{textField:{variant:"standard",fullWidth:!0,error:y.touched.start&&!!y.errors.start,helperText:y.touched.start&&y.errors.start?String(y.errors.start):""}}})})}),S(me,{size:{xs:6,sm:3},children:S(Ys,{dateAdapter:zl,adapterLocale:r.language,children:S(Ih,{defaultValue:xt.now(),label:n("end"),value:c,onChange:v=>{v&&(y.setFieldValue("end",v),u(v))},slotProps:{textField:{variant:"standard",fullWidth:!0,error:y.touched.end&&!!y.errors.end,helperText:y.touched.end&&y.errors.end?String(y.errors.end):""}}})})}),S(me,{size:{xs:12,sm:1},sx:{display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center"},children:m===0?n("durationWeeks",{number:h}):n("durationWeeksDays",{nrWeeks:h,nrDays:m})}),S(me,{size:12,children:S(Xu,{fieldName:"description",title:n("description"),fieldProps:{multiline:!0,rows:4}})}),Q(me,{size:12,children:[S(os,{control:S(qo,{checked:y.values.fitInWeek,...y.getFieldProps("fitInWeek")}),label:n("routines.fitDaysInWeek")}),S(Go,{title:n("routines.fitDaysInWeekHelpText"),children:S(pn,{size:"small",children:S(IS,{fontSize:"inherit"})})})]}),S(me,{size:12,children:S(ct,{disabled:y.isSubmitting,color:"primary",variant:"contained",type:"submit",sx:{mt:2},children:n("save")})})]})})})},owt=e=>{const t=Ra(),{t:n}=je(),[r,o]=J.useState(null),i=!!r,a=l=>{o(l.currentTarget)},s=()=>{o(null)};return Q(Ft,{direction:"row",children:[S(ct,{variant:"text",id:"basic-button","aria-controls":i?"basic-menu":void 0,"aria-haspopup":"true","aria-expanded":i?"true":void 0,onClick:a,children:n("routines.defaultRounding")}),Q(ss,{id:"basic-menu",anchorEl:r,open:i,onClose:s,MenuListProps:{"aria-labelledby":"basic-button"},children:[S(Jt,{children:S(RO,{routineId:e.routineId,rounding:"weight",editProfile:!0,initialValue:t.data.weightRounding})}),S(Jt,{children:S(RO,{routineId:e.routineId,rounding:"reps",editProfile:!0,initialValue:t.data.repetitionsRounding})})]}),S(Go,{title:n("routines.roundingHelp"),children:S(pn,{onClick:()=>{},children:S(IS,{fontSize:"small"})})})]})},iwt=()=>S(me,{container:!0,children:S(me,{size:6,offset:3,children:S(mH,{})})}),awt=e=>{const{t}=je(),n=Kue(e.routine.id),[r,o]=x.useState(e.routine.isTemplate),[i,a]=x.useState(e.routine.isPublic),s=u=>{const f=u&&i;o(u),a(f),c(u,f)},l=u=>{const f=u&&r;a(f),c(r,f)},c=(u,f)=>{n.mutate({id:e.routine.id,is_template:u,is_public:f})};return Q(me,{container:!0,spacing:2,children:[S(me,{size:12,children:Q(Ft,{children:[S(os,{disabled:n.isPending,control:S(qo,{checked:r,onChange:async()=>s(!r)}),label:t("routines.template")}),S(at,{variant:"caption",children:t("routines.templatesHelpText")})]})}),S(me,{size:12,children:Q(Ft,{children:[S(os,{disabled:n.isPending||!r,control:S(qo,{checked:i,onChange:async()=>l(!i)}),label:t("routines.publicTemplate")}),S(at,{variant:"caption",children:t("routines.publicTemplateHelpText")})]})})]})},swt=e=>{const t=id(),n=Rat(e.routine.id),[r,o]=je(),[i,a]=x.useState(null),[s,l]=x.useState(0),c=!!i,u=w=>{a(w.currentTarget)},f=()=>{l(1),y()},h=()=>{l(2),y()},m=async()=>{await n.mutateAsync(),t(cn(Qt.ROUTINE_OVERVIEW,o.language))},g=()=>{l(0)},y=()=>{a(null)},v=()=>window.location.href=cn(Qt.ROUTINE_EDIT,o.language,{id:e.routine.id});return Q("div",{children:[S(ct,{onClick:u,children:S(kV,{})}),Q(ss,{anchorEl:i,open:c,onClose:y,MenuListProps:{"aria-labelledby":"basic-button"},children:[S(Jt,{disabled:e.routine.isTemplate,onClick:v,children:r("edit")}),S(Jt,{component:Ro,to:cn(Qt.ROUTINE_DETAIL_TABLE,o.language,{id:e.routine.id}),children:"Table view"}),S(Jt,{component:Ro,to:cn(Qt.ROUTINE_LOGS_OVERVIEW,o.language,{id:e.routine.id}),children:r("routines.logsOverview")}),S(Jt,{component:Ro,to:cn(Qt.ROUTINE_STATS_OVERVIEW,o.language,{id:e.routine.id}),children:r("routines.statsOverview")}),S(Jt,{component:"a",href:cn(Qt.ROUTINE_COPY,o.language,{id:e.routine.id}),children:r("routines.duplicate")}),S(Jt,{onClick:h,children:r("routines.markAsTemplate")}),S(Jt,{component:"a",href:cn(Qt.ROUTINE_PDF_TABLE,o.language,{id:e.routine.id}),download:`Routine-${e.routine.id}-table.pdf`,children:r("routines.downloadPdfTable")}),S(Jt,{component:"a",href:cn(Qt.ROUTINE_PDF_LOGS,o.language,{id:e.routine.id}),download:`Routine-${e.routine.id}-logs.pdf`,children:r("routines.downloadPdfLogs")}),S(Jt,{component:"a",href:cn(Qt.ROUTINE_ICAL,o.language,{id:e.routine.id}),download:`Routine-${e.routine.id}-calendar.ics`,children:r("routines.downloadIcal")}),S(ji,{}),S(Jt,{onClick:f,children:r("delete")})]}),Q(Ix,{open:s===1,onClose:g,children:[S(ZE,{id:"alert-dialog-title",children:r("delete")}),S(Ax,{children:S(r6,{id:"alert-dialog-description",children:r("deleteConfirmation",{name:e.routine.name})})}),Q(Px,{children:[S(ct,{onClick:g,children:r("cancel")}),S(ct,{onClick:m,color:"error",autoFocus:!0,children:r("delete")})]})]}),Q(Ix,{open:s===2,onClose:g,children:[S(ZE,{children:r("routines.markAsTemplate")}),S(Ax,{children:S(r6,{children:S(awt,{routine:e.routine})})}),S(Px,{children:S(ct,{onClick:g,children:r("close")})})]})]})},lwt=()=>{const{t:e}=je(),t=Ma(),n=parseInt(t.routineId??"");if(Number.isNaN(n))return S("p",{children:"Please pass an integer as the routine id."});const r=Kc(n),o=r.data,i=`${o==null?void 0:o.start.toLocaleDateString()} - ${o==null?void 0:o.end.toLocaleDateString()} (${o==null?void 0:o.durationText})`,a=o!=null&&o.isTemplate?S(Wl,{color:"info",size:"small",label:e("routines.template")}):null;return S(RP,{query:r,child:r.isSuccess&&S(ds,{title:Q(Tt,{children:[o.name," ",a]}),subTitle:i,optionsMenu:S(swt,{routine:r.data}),mainContent:Q(Ft,{spacing:2,children:[o.description!==""&&S(at,{variant:"body2",sx:{whiteSpace:"pre-line"},children:o==null?void 0:o.description}),o.dayDataCurrentIteration.filter(s=>s.day!==null).map((s,l)=>S(BV,{routineId:n,dayData:s},l))]}),sideBar:Q(Ft,{children:[S(Zt,{height:40}),Q(me,{container:!0,children:[S(me,{size:6,children:S(Ql,{primaryMuscles:o.mainMuscles.filter(s=>s.isFront),secondaryMuscles:o.secondaryMuscles.filter(s=>s.isFront),isFront:!0})}),S(me,{size:6,children:S(Ql,{primaryMuscles:o.mainMuscles.filter(s=>!s.isFront),secondaryMuscles:o.secondaryMuscles.filter(s=>!s.isFront),isFront:!1})})]})]})})})},P$="RoutineDetailsTable",Tu={stickyColumn:`${P$}-stickyColumn`,stickyHeader:`${P$}-stickyHeader`,whiteBg:`${P$}-whiteBg`},cwt=ae(Uu)({[`& .${Tu.stickyColumn}`]:{position:"sticky",left:0,zIndex:1},[`& .${Tu.stickyHeader}`]:{position:"sticky",top:0,zIndex:2,background:"white"},[`& .${Tu.whiteBg}`]:{backgroundColor:"white"}}),uwt=()=>{const{t:e,i18n:t}=je(),n=Ma(),r=n.routineId?parseInt(n.routineId):0,o=Kc(r),i=Wue(r),[a,s]=J.useState(!1);return S(RP,{query:o,child:o.isSuccess&&S(Vw,{title:o.data.name,backToUrl:cn(Qt.ROUTINE_DETAIL,t.language,{id:r}),maxWidth:!1,children:Q(Ft,{children:[S(os,{control:S(qo,{checked:a,onChange:(l,c)=>s(c)}),label:e("routines.alsoShowLogs")}),S(Mpe,{routine:o.data,showLogs:a,logData:i.data})]})})})};function dwt(e,t,n){return e==null?null:t!=null&&n!==null&&n!==void 0?e<t?"lower":e>n?"higher":"match":t!=null?e<t?"lower":e>t?"higher":"match":null}const Mpe=e=>{const{t,i18n:n}=je(),r=Lr(),o=Yc(),i=e.showLogs??!1,a=e.logData??[];let s;o.isSuccess&&(s=Gu(n.language,o.data));const l={};for(const v of a)for(const w of v.logs)w.iteration!==null&&(l[w.iteration]||(l[w.iteration]=[]),l[w.iteration].push(w));const c=Object.keys(e.routine.groupedDayDataByIteration).map(v=>parseInt(v));function u(){return S(ln,{children:c.map(v=>{const w=v===1?S(ke,{className:Tu.stickyColumn}):null;return Q(J.Fragment,{children:[w,S(ke,{align:"center",children:t("routines.sets")}),S(ke,{align:"center",sx:{minWidth:40},children:t("routines.reps")}),S(ke,{align:"center",sx:{minWidth:40},children:t("weight")}),S(ke,{align:"center",sx:{minWidth:60},children:t("routines.restTime")}),S(ke,{align:"center",sx:{minWidth:40},children:t("routines.rir")})]},`header-${v}`)})})}function f(){return S(ln,{children:c.map(v=>{const w=v===1?S(ke,{className:Tu.stickyColumn}):null;return Q(J.Fragment,{children:[w,S(ke,{colSpan:5,children:S(at,{variant:"h6",children:t("routines.weekNr",{number:v})})})]},`header-iteration-${v}`)})})}function h(v,w){var I;const C={borderBottomWidth:i?0:null,minWidth:40};function E(O,P,R){return Q(Tt,{children:[O===null||P===null?"-/-":P,O!==null&&R!==null&&Q(Tt,{children:[" - ",R]})]})}return Q(ln,{children:[S(ke,{className:Tu.stickyColumn,sx:{minWidth:150,backgroundColor:"white",borderBottomWidth:i?0:null},children:(I=v.exercise)==null?void 0:I.getTranslation(s).name}),c.map(O=>{const P=e.routine.getSetConfigData(w.id,O,v.id);return Q(J.Fragment,{children:[S(ke,{align:"center",sx:C,children:E(P,P==null?void 0:P.nrOfSets,P==null?void 0:P.maxNrOfSets)}),S(ke,{align:"center",sx:C,children:E(P,P==null?void 0:P.repetitions,P==null?void 0:P.maxRepetitions)}),S(ke,{align:"center",sx:C,children:E(P,P==null?void 0:P.weight,P==null?void 0:P.maxWeight)}),S(ke,{align:"center",sx:C,children:E(P,P==null?void 0:P.restTime,P==null?void 0:P.maxRestTime)}),S(ke,{align:"center",sx:C,children:E(P,P==null?void 0:P.rir,P==null?void 0:P.maxRir)})]},O)})]})}function m(v,w,C,E){const I=dwt(v,w,C);v===105&&console.log(v,w,C,E,I);const O=17;return E=E??!0,I===null?null:I==="lower"?S(Zst,{sx:{fontSize:O},color:E?"error":"success"}):I==="higher"?S(qst,{sx:{fontSize:O},color:E?"success":"error"}):S(Bst,{sx:{fontSize:O},color:"success"})}function g(v,w){return Q(ln,{children:[S(ke,{sx:{verticalAlign:"top",backgroundColor:"white"},className:Tu.stickyColumn,children:S("small",{children:t("nutrition.logged")})}),c.map(C=>{const E=e.routine.getSetConfigData(w.id,C,v.id),O=(l[C]??[]).filter(P=>P.slotEntryId===v.id);return Q(J.Fragment,{children:[S(ke,{align:"center",sx:{verticalAlign:"top"}}),S(ke,{align:"center",sx:{verticalAlign:"top"},children:O.map((P,R)=>S(Ft,{children:Q("span",{children:[P.repetitions??"-/-",m(P.repetitions,E==null?void 0:E.repetitions,E==null?void 0:E.maxRepetitions)]})},R))}),S(ke,{align:"center",sx:{verticalAlign:"top"},children:O.map((P,R)=>S(Ft,{children:Q("span",{children:[P.weight??"-/-",m(P.weight,E==null?void 0:E.weight,E==null?void 0:E.maxWeight)]})},R))}),S(ke,{align:"center",sx:{verticalAlign:"top"},children:O.map((P,R)=>S(Ft,{children:Q("span",{children:[P.restTime??"-/-",m(P.restTime,E==null?void 0:E.restTime,E==null?void 0:E.maxRestTime)]})},R))}),S(ke,{align:"center",sx:{verticalAlign:"top"},children:O.map((P,R)=>S(Ft,{children:Q("span",{children:[P.rir??"-/-",m(P.rir,E==null?void 0:E.rir,E==null?void 0:E.maxRir,!1)]})},R))})]},C)})]})}function y(){return S(Tt,{children:e.routine.days.map(v=>Q(J.Fragment,{children:[Q(ln,{children:[S(ke,{sx:{backgroundColor:r.palette.action.hover},className:Tu.stickyColumn,children:S("b",{children:v.getDisplayName()})}),S(ke,{sx:{backgroundColor:r.palette.action.hover},colSpan:5*c.length})]}),v.slots.map((w,C)=>S(J.Fragment,{children:w.entries.map((E,I)=>Q(J.Fragment,{children:[h(E,v),i&&g(E,v)]},I))},C))]},v.id))})}return S(cwt,{maxWidth:!1,sx:{overflowX:"scroll",display:"flex",height:"80vh"},children:S(Fc,{children:Q(Nc,{size:"small",children:[Q(Ff,{className:Tu.stickyHeader,children:[f(),u()]}),S(Lc,{children:y()})]})})})};function Ki(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var fwt=typeof Symbol=="function"&&Symbol.observable||"@@observable",MZ=fwt,RZ=()=>Math.random().toString(36).substring(7).split("").join("."),pwt={INIT:`@@redux/INIT${RZ()}`,REPLACE:`@@redux/REPLACE${RZ()}`},DZ=pwt;function hwt(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function Rpe(e,t,n){if(typeof e!="function")throw new Error(Ki(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Ki(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Ki(1));return n(Rpe)(e,t)}let r=e,o=t,i=new Map,a=i,s=0,l=!1;function c(){a===i&&(a=new Map,i.forEach((v,w)=>{a.set(w,v)}))}function u(){if(l)throw new Error(Ki(3));return o}function f(v){if(typeof v!="function")throw new Error(Ki(4));if(l)throw new Error(Ki(5));let w=!0;c();const C=s++;return a.set(C,v),function(){if(w){if(l)throw new Error(Ki(6));w=!1,c(),a.delete(C),i=null}}}function h(v){if(!hwt(v))throw new Error(Ki(7));if(typeof v.type>"u")throw new Error(Ki(8));if(typeof v.type!="string")throw new Error(Ki(17));if(l)throw new Error(Ki(9));try{l=!0,o=r(o,v)}finally{l=!1}return(i=a).forEach(C=>{C()}),v}function m(v){if(typeof v!="function")throw new Error(Ki(10));r=v,h({type:DZ.REPLACE})}function g(){const v=f;return{subscribe(w){if(typeof w!="object"||w===null)throw new Error(Ki(11));function C(){const I=w;I.next&&I.next(u())}return C(),{unsubscribe:v(C)}},[MZ](){return this}}}return h({type:DZ.INIT}),{dispatch:h,subscribe:f,getState:u,replaceReducer:m,[MZ]:g}}function kZ(e,t){return function(...n){return t(e.apply(this,n))}}function _Z(e,t){if(typeof e=="function")return kZ(e,t);if(typeof e!="object"||e===null)throw new Error(Ki(16));const n={};for(const r in e){const o=e[r];typeof o=="function"&&(n[r]=kZ(o,t))}return n}function Dpe(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function mwt(...e){return t=>(n,r)=>{const o=t(n,r);let i=()=>{throw new Error(Ki(15))};const a={getState:o.getState,dispatch:(l,...c)=>i(l,...c)},s=e.map(l=>l(a));return i=Dpe(...s)(o.dispatch),{...o,dispatch:i}}}var A$={exports:{}},M$={};/**
+`));n[e.field]=t;return}const{groupId:r,children:o}=e;o.forEach(i=>{ype(i,[...t,r],n)})},cj=e=>{if(!e)return{};const t={};return e.forEach(n=>{ype(n,[],t)}),t},uj=(e,t,n)=>{const r=l=>t[l]??[],o=[],i=Math.max(...e.map(l=>r(l).length)),a=(l,c,u)=>Js(r(l).slice(0,u+1),r(c).slice(0,u+1)),s=(l,c)=>!!(n!=null&&n.left&&n.left.includes(l)&&!n.left.includes(c)||n!=null&&n.right&&!n.right.includes(l)&&n.right.includes(c));for(let l=0;l<i;l+=1){const c=e.reduce((u,f)=>{const h=r(f)[l]??null;if(u.length===0)return[{columnFields:[f],groupId:h}];const m=u[u.length-1],g=m.columnFields[m.columnFields.length-1];return m.groupId!==h||!a(g,f,l)||s(g,f)?[...u,{columnFields:[f],groupId:h}]:[...u.slice(0,u.length-1),{columnFields:[...m.columnFields,f],groupId:h}]},[]);o.push(c)}return o},T0t=["groupId","children"],fH=e=>{let t={};return e.forEach(n=>{if(rfe(n))return;const{groupId:r,children:o}=n,i=$e(n,T0t);if(!r)throw new Error("MUI X: An element of the columnGroupingModel does not have either `field` or `groupId`.");const a=z({},i,{groupId:r}),s=fH(o);if(s[r]!==void 0||t[r]!==void 0)throw new Error(`MUI X: The groupId ${r} is used multiple times in the columnGroupingModel.`);t=z({},t,s,{[r]:a})}),z({},t)},O0t=(e,t,n)=>{if(!t.columnGroupingModel)return e;const r=Rc(n),o=zv(n),i=fH(t.columnGroupingModel??[]),a=cj(t.columnGroupingModel??[]),s=uj(r,a,n.current.state.pinnedColumns??{}),l=o.length===0?0:Math.max(...o.map(c=>{var u;return((u=a[c])==null?void 0:u.length)??0}));return z({},e,{columnGrouping:{lookup:i,unwrappedGroupingModel:a,headerStructure:s,maxDepth:l}})},I0t=(e,t)=>{const n=x.useCallback(s=>Nfe(e)[s]??[],[e]),r=x.useCallback(()=>Lfe(e),[e]);yn(e,{getColumnGroupPath:n,getAllGroupDetails:r},"public");const i=x.useCallback(()=>{const s=cj(t.columnGroupingModel??[]);e.current.setState(l=>{var h;const c=((h=l.columns)==null?void 0:h.orderedFields)??[],u=l.pinnedColumns??{},f=uj(c,s,u);return z({},l,{columnGrouping:z({},l.columnGrouping,{headerStructure:f})})})},[e,t.columnGroupingModel]),a=x.useCallback(s=>{var y,v;const l=((v=(y=e.current).getPinnedColumns)==null?void 0:v.call(y))??{},c=Rc(e),u=zv(e),f=fH(s??[]),h=cj(s??[]),m=uj(c,h,l),g=u.length===0?0:Math.max(...u.map(w=>{var C;return((C=h[w])==null?void 0:C.length)??0}));e.current.setState(w=>z({},w,{columnGrouping:{lookup:f,unwrappedGroupingModel:h,headerStructure:m,maxDepth:g}}))},[e]);At(e,"columnIndexChange",i),At(e,"columnsChange",()=>{a(t.columnGroupingModel)}),At(e,"columnVisibilityModelChange",()=>{a(t.columnGroupingModel)}),x.useEffect(()=>{a(t.columnGroupingModel)},[a,t.columnGroupingModel])};function P0t(){let e,t;const n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n}function hZ(e,t){if(t!==void 0&&e.changedTouches){for(let n=0;n<e.changedTouches.length;n+=1){const r=e.changedTouches[n];if(r.identifier===t)return{x:r.clientX,y:r.clientY}}return!1}return{x:e.clientX,y:e.clientY}}function mZ(e,t,n,r){let o=e;return r==="Right"?o+=t-n.left:o+=n.right-t,o}function A0t(e,t,n){return n==="Left"?e-t.left:t.right-e}function M0t(e){return e==="Right"?"Left":"Right"}function R0t(e,t){const n=e.classList.contains(ee["columnSeparator--sideRight"])?"Right":"Left";return t?M0t(n):n}function gZ(e){e.preventDefault(),e.stopImmediatePropagation()}function D0t(e){const t=x.useRef(void 0),n=()=>zfe(e),r=Ge(e,n);return x.useEffect(()=>{t.current&&r===!1&&(t.current.resolve(),t.current=void 0)}),()=>{if(!t.current){if(n()===!1)return Promise.resolve();t.current=P0t()}return t.current}}function k0t(e,t){if(e.length<4)return e;const n=e.slice();n.sort((s,l)=>s-l);const r=n[Math.floor(n.length*.25)],o=n[Math.floor(n.length*.75)-1],i=o-r,a=i<5?5:i*t;return n.filter(s=>s>r-a&&s<o+a)}function _0t(e,t,n){const r={},o=e.current.rootElementRef.current;return o.classList.add(ee.autosizing),n.forEach(i=>{const s=Hmt(e.current,i.field).map(g=>g.getBoundingClientRect().width??0),l=t.includeOutliers?s:k0t(s,t.outliersFactor);if(t.includeHeaders){const g=Vmt(e.current,i.field);if(g){const y=g.querySelector(`.${ee.columnHeaderTitle}`),v=g.querySelector(`.${ee.columnHeaderTitleContainerContent}`),w=g.querySelector(`.${ee.iconButtonContainer}`),C=g.querySelector(`.${ee.menuIcon}`),E=y??v,I=window.getComputedStyle(g,null),O=parseInt(I.paddingLeft,10)+parseInt(I.paddingRight,10),R=E.scrollWidth+1+O+((w==null?void 0:w.clientWidth)??0)+((C==null?void 0:C.clientWidth)??0);l.push(R)}}const c=i.minWidth!==-1/0&&i.minWidth!==void 0,u=i.maxWidth!==1/0&&i.maxWidth!==void 0,f=c?i.minWidth:0,h=u?i.maxWidth:1/0,m=l.length===0?0:Math.max(...l);r[i.field]=Za(m,f,h)}),o.classList.remove(ee.autosizing),r}const $0t=e=>z({},e,{columnResize:{resizingColumnField:""}});function N0t(){return{colDef:void 0,initialColWidth:0,initialTotalWidth:0,previousMouseClickEvent:void 0,columnHeaderElement:void 0,headerFilterElement:void 0,groupHeaderElements:[],cellElements:[],leftPinnedCellsAfter:[],rightPinnedCellsBefore:[],fillerLeft:void 0,fillerRight:void 0,leftPinnedHeadersAfter:[],rightPinnedHeadersBefore:[]}}const L0t=(e,t)=>{const n=vr(),r=Qo(e,"useGridColumnResize"),o=Xl(N0t).current,i=x.useRef(null),a=x.useRef(null),s=ko(),l=x.useRef(void 0),c=M=>{var j,L;r.debug(`Updating width to ${M} for col ${o.colDef.field}`);const A=o.columnHeaderElement.offsetWidth,_=M-A,N=M-o.initialColWidth;if(N>0){const V=o.initialTotalWidth+N;(L=(j=e.current.rootElementRef)==null?void 0:j.current)==null||L.style.setProperty("--DataGrid-rowWidth",`${V}px`)}o.colDef.computedWidth=M,o.colDef.width=M,o.colDef.flex=0,o.columnHeaderElement.style.width=`${M}px`;const B=o.headerFilterElement;B&&(B.style.width=`${M}px`),o.groupHeaderElements.forEach(V=>{const W=V;let K;W.getAttribute("aria-colspan")==="1"?K=`${M}px`:K=`${W.offsetWidth+_}px`,W.style.width=K}),o.cellElements.forEach(V=>{const W=V;let K;W.getAttribute("aria-colspan")==="1"?K=`${M}px`:K=`${W.offsetWidth+_}px`,W.style.setProperty("--width",K)});const H=e.current.unstable_applyPipeProcessors("isColumnPinned",!1,o.colDef.field);H===qd.LEFT&&(ag(o.fillerLeft,"width",_),o.leftPinnedCellsAfter.forEach(V=>{ag(V,"left",_)}),o.leftPinnedHeadersAfter.forEach(V=>{ag(V,"left",_)})),H===qd.RIGHT&&(ag(o.fillerRight,"width",_),o.rightPinnedCellsBefore.forEach(V=>{ag(V,"right",_)}),o.rightPinnedHeadersBefore.forEach(V=>{ag(V,"right",_)}))},u=M=>{if(w(),o.previousMouseClickEvent){const A=o.previousMouseClickEvent,_=A.timeStamp,N=A.clientX,B=A.clientY;if(M.timeStamp-_<300&&M.clientX===N&&M.clientY===B){o.previousMouseClickEvent=void 0,e.current.publishEvent("columnResizeStop",null,M);return}}if(o.colDef){e.current.setColumnWidth(o.colDef.field,o.colDef.width),r.debug(`Updating col ${o.colDef.field} with new width: ${o.colDef.width}`);const A=Hl(e);o.groupHeaderElements.forEach(_=>{const N=$mt(_),B=_,j=`${N.reduce((L,V)=>A.columnVisibilityModel[V]!==!1?L+A.lookup[V].computedWidth:L,0)}px`;B.style.width=j})}s.start(0,()=>{e.current.publishEvent("columnResizeStop",null,M)})},f=(M,A,_)=>{var j;const N=e.current.rootElementRef.current;o.initialColWidth=M.computedWidth,o.initialTotalWidth=e.current.getRootDimensions().rowWidth,o.colDef=M,o.columnHeaderElement=_mt(e.current.columnHeadersContainerRef.current,M.field);const B=N.querySelector(`.${ee.headerFilterRow} [data-field="${cd(M.field)}"]`);B&&(o.headerFilterElement=B),o.groupHeaderElements=Nmt((j=e.current.columnHeadersContainerRef)==null?void 0:j.current,M.field),o.cellElements=Lmt(o.columnHeaderElement,e.current),o.fillerLeft=VJ(e.current,n?"filler--pinnedRight":"filler--pinnedLeft"),o.fillerRight=VJ(e.current,n?"filler--pinnedLeft":"filler--pinnedRight");const H=e.current.unstable_applyPipeProcessors("isColumnPinned",!1,o.colDef.field);o.leftPinnedCellsAfter=H!==qd.LEFT?[]:Fmt(e.current,o.columnHeaderElement,n),o.rightPinnedCellsBefore=H!==qd.RIGHT?[]:jmt(e.current,o.columnHeaderElement,n),o.leftPinnedHeadersAfter=H!==qd.LEFT?[]:Bmt(e.current,o.columnHeaderElement,n),o.rightPinnedHeadersBefore=H!==qd.RIGHT?[]:zmt(e.current,o.columnHeaderElement,n),a.current=R0t(A,n),i.current=A0t(_,o.columnHeaderElement.getBoundingClientRect(),a.current)},h=Je(u),m=Je(M=>{if(M.buttons===0){h(M);return}let A=mZ(i.current,M.clientX,o.columnHeaderElement.getBoundingClientRect(),a.current);A=Za(A,o.colDef.minWidth,o.colDef.maxWidth),c(A);const _={element:o.columnHeaderElement,colDef:o.colDef,width:A};e.current.publishEvent("columnResize",_,M)}),g=Je(M=>{hZ(M,l.current)&&u(M)}),y=Je(M=>{const A=hZ(M,l.current);if(!A)return;if(M.type==="mousemove"&&M.buttons===0){g(M);return}let _=mZ(i.current,A.x,o.columnHeaderElement.getBoundingClientRect(),a.current);_=Za(_,o.colDef.minWidth,o.colDef.maxWidth),c(_);const N={element:o.columnHeaderElement,colDef:o.colDef,width:_};e.current.publishEvent("columnResize",N,M)}),v=Je(M=>{const A=OO(M.target,ee["columnSeparator--resizable"]);if(!A)return;const _=M.changedTouches[0];_!=null&&(l.current=_.identifier);const N=OO(M.target,ee.columnHeader),B=kmt(N),H=e.current.getColumn(B);r.debug(`Start Resize on col ${H.field}`),e.current.publishEvent("columnResizeStart",{field:B},M),f(H,A,_.clientX);const j=Mr(M.currentTarget);j.addEventListener("touchmove",y),j.addEventListener("touchend",g)}),w=x.useCallback(()=>{const M=Mr(e.current.rootElementRef.current);M.body.style.removeProperty("cursor"),M.removeEventListener("mousemove",m),M.removeEventListener("mouseup",h),M.removeEventListener("touchmove",y),M.removeEventListener("touchend",g),setTimeout(()=>{M.removeEventListener("click",gZ,!0)},100),o.columnHeaderElement&&(o.columnHeaderElement.style.pointerEvents="unset")},[e,o,m,h,y,g]),C=x.useCallback(({field:M})=>{e.current.setState(A=>z({},A,{columnResize:z({},A.columnResize,{resizingColumnField:M})}))},[e]),E=x.useCallback(()=>{e.current.setState(M=>z({},M,{columnResize:z({},M.columnResize,{resizingColumnField:""})}))},[e]),I=Je(({colDef:M},A)=>{if(A.button!==0||!A.currentTarget.classList.contains(ee["columnSeparator--resizable"]))return;A.preventDefault(),r.debug(`Start Resize on col ${M.field}`),e.current.publishEvent("columnResizeStart",{field:M.field},A),f(M,A.currentTarget,A.clientX);const _=Mr(e.current.rootElementRef.current);_.body.style.cursor="col-resize",o.previousMouseClickEvent=A.nativeEvent,_.addEventListener("mousemove",m),_.addEventListener("mouseup",h),_.addEventListener("click",gZ,!0)}),O=Je((M,A)=>{if(t.disableAutosize||A.button!==0)return;const _=e.current.state.columns.lookup[M.field];_.resizable!==!1&&e.current.autosizeColumns(z({},t.autosizeOptions,{disableColumnVirtualization:!1,columns:[_.field]}))}),P=D0t(e),R=x.useRef(!1),D=x.useCallback(async M=>{var H;if(!((H=e.current.rootElementRef)==null?void 0:H.current)||R.current)return;R.current=!0;const _=Hl(e),N=z({},yht,M,{columns:(M==null?void 0:M.columns)??_.orderedFields});N.columns=N.columns.filter(j=>_.columnVisibilityModel[j]!==!1);const B=N.columns.map(j=>e.current.state.columns.lookup[j]);try{!t.disableVirtualization&&N.disableColumnVirtualization&&(e.current.unstable_setColumnVirtualization(!1),await P());const j=_0t(e,N,B),L=B.map(V=>z({},V,{width:j[V.field],computedWidth:j[V.field],flex:0}));if(N.expand){const W=_.orderedFields.map(Y=>_.lookup[Y]).filter(Y=>_.columnVisibilityModel[Y.field]!==!1).reduce((Y,Z)=>Y+(j[Z.field]??Z.computedWidth??Z.width),0),q=e.current.getRootDimensions().viewportInnerSize.width-W;if(q>0){const Y=q/(L.length||1);L.forEach(Z=>{Z.width+=Y,Z.computedWidth+=Y})}}e.current.updateColumns(L),L.forEach((V,W)=>{if(V.width!==B[W].width){const K=V.width;e.current.publishEvent("columnWidthChange",{element:e.current.getColumnHeaderElement(V.field),colDef:V,width:K})}})}finally{t.disableVirtualization||e.current.unstable_setColumnVirtualization(!0),R.current=!1}},[e,P,t.disableVirtualization]);x.useEffect(()=>w,[w]),Nj(()=>{t.autosizeOnMount&&Promise.resolve().then(()=>{e.current.autosizeColumns(t.autosizeOptions)})}),Bfe(e,()=>{var M;return(M=e.current.columnHeadersContainerRef)==null?void 0:M.current},"touchstart",v,{passive:!0}),yn(e,{autosizeColumns:D},"public"),At(e,"columnResizeStop",E),At(e,"columnResizeStart",C),At(e,"columnSeparatorMouseDown",I),At(e,"columnSeparatorDoubleClick",O),sr(e,"columnResize",t.onColumnResize),sr(e,"columnWidthChange",t.onColumnWidthChange)};function ag(e,t,n){e&&(e.style[t]=`${parseInt(e.style[t],10)+n}px`)}function F0t(e,t){return e.firstRowIndex>=t.firstRowIndex&&e.lastRowIndex<=t.lastRowIndex?null:e.firstRowIndex>=t.firstRowIndex&&e.lastRowIndex>t.lastRowIndex?{firstRowIndex:t.lastRowIndex,lastRowIndex:e.lastRowIndex}:e.firstRowIndex<t.firstRowIndex&&e.lastRowIndex<=t.lastRowIndex?{firstRowIndex:e.firstRowIndex,lastRowIndex:t.firstRowIndex-1}:e}function yZ(e){return e.firstRowIndex!==0||e.lastRowIndex!==0}const E$=(e,t,n)=>{if(!e)return null;let r=e[t.field];const o=t.rowSpanValueGetter??t.valueGetter;return o&&(r=o(r,e,t,n)),r},Ig={spannedCells:{},hiddenCells:{},hiddenCellOriginMap:{}},MO={firstRowIndex:0,lastRowIndex:0},j0t=new Set([wu,"__reorder__",zP]),vZ=20,vpe=(e,t,n,r,o,i,a)=>{const s=i?{}:z({},e.current.state.rowSpanning.spannedCells),l=i?{}:z({},e.current.state.rowSpanning.hiddenCells),c=i?{}:z({},e.current.state.rowSpanning.hiddenCellOriginMap);return i&&(a=MO),t.forEach(u=>{var f;if(!j0t.has(u.field)){for(let h=o.firstRowIndex;h<o.lastRowIndex;h+=1){const m=n[h];if((f=l[m.id])!=null&&f[u.field])continue;const g=E$(m.model,u,e);if(g==null)continue;let y=m.id,v=h,w=0;const C=[];if(h===o.firstRowIndex){let I=h-1,O=n[I];for(;I>=r.firstRowIndex&&O&&E$(O.model,u,e)===g;){const P=n[I+1];l[P.id]?l[P.id][u.field]=!0:l[P.id]={[u.field]:!0},C.push(h),w+=1,y=O.id,v=I,I-=1,O=n[I]}}C.forEach(I=>{c[I]?c[I][u.field]=v:c[I]={[u.field]:v}});let E=h+1;for(;E<=r.lastRowIndex&&n[E]&&E$(n[E].model,u,e)===g;){const I=n[E];l[I.id]?l[I.id][u.field]=!0:l[I.id]={[u.field]:!0},c[E]?c[E][u.field]=v:c[E]={[u.field]:v},E+=1,w+=1}w>0&&(s[y]?s[y][u.field]=w+1:s[y]={[u.field]:w+1})}a={firstRowIndex:Math.min(a.firstRowIndex,o.firstRowIndex),lastRowIndex:Math.max(a.lastRowIndex,o.lastRowIndex)}}}),{spannedCells:s,hiddenCells:l,hiddenCellOriginMap:c,processedRange:a}},bpe=(e,t)=>{const n=Gp(t).length;if(e.pagination){const r=Mfe(t);let o=vZ;return r>0&&(o=r-1),{firstRowIndex:0,lastRowIndex:Math.min(o,n)}}return{firstRowIndex:0,lastRowIndex:Math.min(vZ,n)}},B0t=(e,t,n)=>{var g;if(!t.rowSpanning)return z({},e,{rowSpanning:Ig});const r=e.rows.dataRowIds||[],o=e.columns.orderedFields||[],i=e.rows.dataRowIdToModelLookup,a=e.columns.lookup,s=!!e.filter.filterModel.items.length||!!((g=e.filter.filterModel.quickFilterValues)!=null&&g.length);if(!r.length||!o.length||!i||!a||s)return z({},e,{rowSpanning:Ig});const l=bpe(t,n),c=r.map(y=>({id:y,model:i[y]})),u=o.map(y=>a[y]),{spannedCells:f,hiddenCells:h,hiddenCellOriginMap:m}=vpe(n,u,c,l,l,!0,MO);return z({},e,{rowSpanning:{spannedCells:f,hiddenCells:h,hiddenCellOriginMap:m}})},z0t=(e,t)=>{const n=Xl(()=>e.current.state.rowSpanning!==Ig?bpe(t,e):MO),r=x.useCallback((i,a=!1)=>{const{range:s,rows:l}=bf(e,{pagination:t.pagination,paginationMode:t.paginationMode});if(s===null||!yZ(i))return;a&&(n.current=MO);const c=F0t({firstRowIndex:i.firstRowIndex,lastRowIndex:Math.min(i.lastRowIndex,s.lastRowIndex+1)},n.current);if(c===null)return;const u=Yr(e),{spannedCells:f,hiddenCells:h,hiddenCellOriginMap:m,processedRange:g}=vpe(e,u,l,s,c,a,n.current);n.current=g;const y=Object.keys(f).length,v=Object.keys(h).length,w=Object.keys(e.current.state.rowSpanning.spannedCells).length,C=Object.keys(e.current.state.rowSpanning.hiddenCells).length;!(a||y!==w||v!==C)||y===0&&w===0||e.current.setState(O=>z({},O,{rowSpanning:{spannedCells:f,hiddenCells:h,hiddenCellOriginMap:m}}))},[e,n,t.pagination,t.paginationMode]),o=x.useCallback(()=>{const i=Xw(e);yZ(i)&&r(i,!0)},[e,r]);At(e,"renderedRowsIntervalChange",Xd(t.rowSpanning,r)),At(e,"sortedRowsSet",Xd(t.rowSpanning,o)),At(e,"paginationModelChange",Xd(t.rowSpanning,o)),At(e,"filteredRowsSet",Xd(t.rowSpanning,o)),At(e,"columnsChange",Xd(t.rowSpanning,o)),x.useEffect(()=>{t.rowSpanning?e.current.state.rowSpanning===Ig&&o():e.current.state.rowSpanning!==Ig&&e.current.setState(i=>z({},i,{rowSpanning:Ig}))},[e,o,t.rowSpanning])},V0t=(e,t,n)=>z({},e,{listViewColumn:t.listViewColumn?z({},t.listViewColumn,{computedWidth:dj(n)}):void 0});function H0t(e,t){const n=()=>{e.current.setState(i=>i.listViewColumn?z({},i,{listViewColumn:z({},i.listViewColumn,{computedWidth:dj(e)})}):i)},r=x.useRef(null);At(e,"viewportInnerSizeChange",i=>{r.current!==i.width&&(r.current=i.width,n())}),At(e,"columnVisibilityModelChange",n),In(()=>{const i=t.listViewColumn;i&&e.current.setState(a=>z({},a,{listViewColumn:z({},i,{computedWidth:dj(e)})}))},[e,t.listViewColumn]),x.useEffect(()=>{t.listView&&t.listViewColumn},[t.listView,t.listViewColumn])}function dj(e){return dr(e).viewportInnerSize.width}const U0t=Pt(jo,Ns,ri,(e,t,n)=>({groupKeys:[],paginationModel:n,sortModel:t,filterModel:e,start:n.page*n.pageSize,end:n.page*n.pageSize+n.pageSize-1}));let T$=function(e){return e.Default="set-new-rows",e.LazyLoading="replace-row-range",e}({});class fj{constructor(t){this.chunkSize=void 0,this.getCacheKeys=n=>{if(this.chunkSize<1||typeof n.start!="number")return[n];const r=[];for(let o=n.start;o<n.end;o+=this.chunkSize){const i=Math.min(o+this.chunkSize-1,n.end);r.push(z({},n,{start:o,end:i}))}return r},this.splitResponse=(n,r)=>{const o=this.getCacheKeys(n),i=new Map;return o.forEach(a=>{var c,u,f,h;const s=a.end===n.end,l=z({},r,{pageInfo:z({},r.pageInfo,{hasNextPage:((c=r.pageInfo)==null?void 0:c.hasNextPage)!==void 0&&!s?!0:(u=r.pageInfo)==null?void 0:u.hasNextPage,nextCursor:((f=r.pageInfo)==null?void 0:f.nextCursor)!==void 0&&!s?r.rows[a.end+1].id:(h=r.pageInfo)==null?void 0:h.nextCursor}),rows:typeof a.start!="number"||typeof n.start!="number"?r.rows:r.rows.slice(a.start-n.start,a.end-n.start+1)});i.set(a,l)}),i},this.chunkSize=t}}fj.mergeResponses=e=>e.length===1?e[0]:e.reduce((t,n)=>({rows:[...t.rows,...n.rows],rowCount:n.rowCount,pageInfo:n.pageInfo}),{rows:[],rowCount:0,pageInfo:{}});const G0t={clear:()=>{},get:()=>{},set:()=>{}};function bZ(e,t={}){return e===null?G0t:e??new Sht(t)}const q0t=(e,t,n={})=>{var O,P;const r=x.useCallback(()=>{e.current.setStrategyAvailability(Zd.DataSource,T$.Default,t.dataSource?()=>!0:()=>!1)},[e,t.dataSource]),[o,i]=x.useState(!1),a=Ge(e,ri),s=x.useRef(0),l=t.onDataSourceError,c=Xl(()=>{const R=t.pageSizeOptions.map(M=>typeof M=="number"?M:M.value).sort((M,A)=>M-A),D=Math.min(a.pageSize,R[0]);return new fj(D)}).current,[u,f]=x.useState(()=>bZ(t.dataSourceCache,n.cacheOptions)),h=x.useCallback(async(R,D)=>{var H,j,L;const M=(H=t.dataSource)==null?void 0:H.getRows;if(!M)return;if(R&&R!==ii&&t.signature!=="DataGrid"){(j=n.fetchRowChildren)==null||j.call(n,[R]);return}(L=n.clearDataSourceState)==null||L.call(n);const A=z({},U0t(e),e.current.unstable_applyPipeProcessors("getRowsParams",{}),D),N=c.getCacheKeys(A).map(V=>u.get(V));if(N.every(V=>V!==void 0)){e.current.applyStrategyProcessor("dataSourceRowsUpdate",{response:fj.mergeResponses(N),fetchParams:A});return}(o||e.current.getRowsCount()===0)&&e.current.setLoading(!0);const B=s.current+1;s.current=B;try{const V=await M(A);c.splitResponse(A,V).forEach((K,G)=>u.set(G,K)),s.current===B&&e.current.applyStrategyProcessor("dataSourceRowsUpdate",{response:V,fetchParams:A})}catch(V){s.current===B&&(e.current.applyStrategyProcessor("dataSourceRowsUpdate",{error:V,fetchParams:A}),typeof l=="function"&&l(new wht({message:V==null?void 0:V.message,params:A,cause:V})))}finally{o&&s.current===B&&e.current.setLoading(!1)}},[c,u,e,o,(O=t.dataSource)==null?void 0:O.getRows,l,n,t.signature]),m=x.useCallback(()=>{i(e.current.getActiveStrategy(Zd.DataSource)===T$.Default)},[e]),g=x.useCallback(R=>{if("error"in R){e.current.setRows([]);return}const{response:D}=R;D.rowCount!==void 0&&e.current.setRowCount(D.rowCount),e.current.setRows(D.rows),e.current.unstable_applyPipeProcessors("processDataSourceRows",{params:R.fetchParams,response:D},!0)},[e]),y=(P=t.dataSource)==null?void 0:P.updateRow,v=n.handleEditRow,w=x.useCallback(async R=>{if(y)try{const D=await y(R);return typeof v=="function"?(v(R,D),D):(e.current.updateNestedRows([D],[]),D&&!Js(D,R.previousRow)&&e.current.dataSource.cache.clear(),D)}catch(D){throw typeof l=="function"&&l(new Cht({message:D==null?void 0:D.message,params:R,cause:D})),D}},[e,y,l,v]),C={dataSource:{fetchRows:h,cache:u,editRow:w}},E=x.useMemo(()=>$h(h,0),[h]),I=x.useRef(!0);return x.useEffect(()=>{if(I.current){I.current=!1;return}if(t.dataSourceCache===void 0)return;const R=bZ(t.dataSourceCache,n.cacheOptions);f(D=>D!==R?R:D)},[t.dataSourceCache,n.cacheOptions]),x.useEffect(()=>{t.dataSource&&(e.current.dataSource.cache.clear(),e.current.dataSource.fetchRows())},[e,t.dataSource]),{api:{public:C},debouncedFetchRows:E,strategyProcessor:{strategyName:T$.Default,group:"dataSourceRowsUpdate",processor:g},setStrategyAvailability:r,cacheChunkManager:c,cache:u,events:{strategyAvailabilityChange:m,sortModelChange:Xd(o,()=>E()),filterModelChange:Xd(o,()=>E()),paginationModelChange:Xd(o,()=>E())}}},W0t=(e,t)=>{const{api:n,strategyProcessor:r,events:o,setStrategyAvailability:i}=q0t(e,t);yn(e,n.public,"public"),kS(e,r.strategyName,r.group,r.processor),Object.entries(o).forEach(([a,s])=>{At(e,a,s)}),x.useEffect(()=>{i()},[i])},K0t=(e,t)=>{ubt(e,t),l0t(e,t),r0t(e),Lo(lbt,e,t),Lo(i0t,e,t),Lo(vbt,e,t),Lo(Jbt,e,t),Lo(Bbt,e,t),Lo(Qbt,e,t),Lo(kbt,e,t),Lo(c0t,e,t),Lo(Vbt,e,t),Lo(Abt,e,t),Lo(B0t,e,t),Lo(xbt,e,t),Lo($0t,e,t),Lo(gbt,e,t),Lo(O0t,e,t),Lo(Rpt,e,t),Lo(m0t,e,t),Lo(x0t,e,t),Lo(V0t,e,t),Lbt(e,t),a0t(e,t),bbt(e,t),Zbt(e,t),z0t(e,t),o0t(e,t),C0t(e),I0t(e,t),Xbt(e,t),_bt(e,t),Hbt(e,t),Dbt(e,t),u0t(e,t),Sbt(e,t),L0t(e,t),zbt(e,t),S0t(e,t),d0t(e,t),ybt(e),Cbt(e,t),Pbt(e,t),mbt(e,t),g0t(e,t),f0t(e,t),w0t(e),Dpt(e,t),H0t(e,t),W0t(e,t)},Y0t=e=>{const{classes:t,headerAlign:n,isDragging:r,isLastColumn:o,showLeftBorder:i,showRightBorder:a,groupId:s,pinnedPosition:l}=e,c={root:["columnHeader",n==="left"&&"columnHeader--alignLeft",n==="center"&&"columnHeader--alignCenter",n==="right"&&"columnHeader--alignRight",r&&"columnHeader--moving",a&&"columnHeader--withRightBorder",i&&"columnHeader--withLeftBorder","withBorderColor",s===null?"columnHeader--emptyGroup":"columnHeader--filledGroup",l===On.LEFT&&"columnHeader--pinnedLeft",l===On.RIGHT&&"columnHeader--pinnedRight",o&&"columnHeader--last"],draggableContainer:["columnHeaderDraggableContainer"],titleContainer:["columnHeaderTitleContainer","withBorderColor"],titleContainerContent:["columnHeaderTitleContainerContent"]};return Me(c,Cn,t)};function Q0t(e){var W;const{groupId:t,width:n,depth:r,maxDepth:o,fields:i,height:a,colIndex:s,hasFocus:l,tabIndex:c,isLastColumn:u,pinnedPosition:f,pinnedOffset:h}=e,m=yt(),g=vr(),y=x.useRef(null),v=tn(),w=Ge(v,Lfe),C=t?w[t]:{},{headerName:E=t??"",description:I="",headerAlign:O=void 0}=C;let P;const R=t&&((W=w[t])==null?void 0:W.renderHeaderGroup),D=x.useMemo(()=>({groupId:t,headerName:E,description:I,depth:r,maxDepth:o,fields:i,colIndex:s,isLastColumn:u}),[t,E,I,r,o,i,s,u]);t&&R&&(P=R(D));const M=z({},e,{classes:m.classes,headerAlign:O,depth:r,isDragging:!1}),A=E??t,_=bn(),N=t===null?`empty-group-cell-${_}`:t,B=Y0t(M);x.useLayoutEffect(()=>{if(l){const G=y.current.querySelector('[tabindex="0"]')||y.current;G==null||G.focus()}},[v,l]);const H=x.useCallback(K=>G=>{Jw(G)||v.current.publishEvent(K,D,G)},[v,D]),j=x.useMemo(()=>({onKeyDown:H("columnGroupHeaderKeyDown"),onFocus:H("columnGroupHeaderFocus"),onBlur:H("columnGroupHeaderBlur")}),[H]),L=typeof C.headerClassName=="function"?C.headerClassName(D):C.headerClassName,V=x.useMemo(()=>YP(z({},e.style),g,f,h),[f,h,e.style,g]);return k.jsx(ope,z({ref:y,classes:B,columnMenuOpen:!1,colIndex:s,height:a,isResizing:!1,sortDirection:null,hasFocus:!1,tabIndex:c,isDraggable:!1,headerComponent:P,headerClassName:L,description:I,elementId:N,width:n,columnMenuIconButton:null,columnTitleIconButtons:null,resizable:!1,label:A,"aria-colspan":i.length,"data-fields":`|-${i.join("-|-")}-|`,style:V},j))}const xZ=ae("div",{name:"MuiDataGrid",slot:"ColumnHeaderRow"})({display:"flex"}),X0t=e=>{const{visibleColumns:t,sortColumnLookup:n,filterColumnLookup:r,columnHeaderTabIndexState:o,columnGroupHeaderTabIndexState:i,columnHeaderFocus:a,columnGroupHeaderFocus:s,headerGroupingMaxDepth:l,columnMenuState:c,columnVisibility:u,columnGroupsHeaderStructure:f,hasOtherElementInTabSequence:h}=e,[m,g]=x.useState(""),[y,v]=x.useState(""),w=fs(),C=yt(),E=Ge(w,Nfe),I=Ge(w,Yf),O=Ge(w,Mpt),P=Ge(w,Vv),R=Ge(w,ld),D=Ufe(I,O,P.left.length),M=Ge(w,NP),A=Ge(w,qde),_=Ge(w,Vut),N=Ge(w,Hut),B=Ge(w,Wde),H=x.useCallback(ce=>v(ce.field),[]),j=x.useCallback(()=>v(""),[]),L=x.useCallback(ce=>g(ce.field),[]),V=x.useCallback(()=>g(""),[]),W=x.useMemo(()=>P.left.length?{firstColumnIndex:0,lastColumnIndex:P.left.length}:null,[P.left.length]),K=x.useMemo(()=>P.right.length?{firstColumnIndex:t.length-P.right.length,lastColumnIndex:t.length}:null,[P.right.length,t.length]);At(w,"columnResizeStart",H),At(w,"columnResizeStop",j),At(w,"columnHeaderDragStart",L),At(w,"columnHeaderDragEnd",V);const G=ce=>{const{renderContext:ye=O}=ce||{},Se=ye.firstColumnIndex,ne=ye.lastColumnIndex;return{renderedColumns:t.slice(Se,ne),firstColumnToRender:Se,lastColumnToRender:ne}},q=(ce,ye,Se,ne=!1)=>{const le=(ce==null?void 0:ce.position)===On.RIGHT,de=(ce==null?void 0:ce.position)===void 0,oe=P.right.length>0&&le||P.right.length===0&&de,ue=D-Se;return k.jsxs(x.Fragment,{children:[de&&k.jsx("div",{role:"presentation",style:{width:ue}}),ye,de&&k.jsx("div",{role:"presentation",className:fe(ee.filler,ne&&ee["filler--borderBottom"])}),oe&&k.jsx(uH,{header:!0,pinnedRight:le,borderBottom:ne,borderTop:!1})]})},Y=(ce,ye={})=>{const{renderedColumns:Se,firstColumnToRender:ne}=G(ce),le=[];for(let de=0;de<Se.length;de+=1){const oe=Se[de],ue=ne+de,pe=ue===0,Ee=o!==null&&o.field===oe.field||pe&&!h?0:-1,xe=a!==null&&a.field===oe.field,Re=c.open&&c.field===oe.field,he=ce==null?void 0:ce.position,Pe=px(he,oe.computedWidth,ue,I,M,B),ve=he===On.RIGHT?Se[de-1]:Se[de+1],Ie=ve?a!==null&&a.field===ve.field:!1,te=ue+1===I.length-P.right.length,Te=de,De=Se.length,Ve=AO(he,Te),We=PO(he,Te,De,C.showColumnVerticalBorder,A);le.push(k.jsx(ngt,z({},n[oe.field],{columnMenuOpen:Re,filterItemsCounter:r[oe.field]&&r[oe.field].length,headerHeight:_,isDragging:oe.field===m,colDef:oe,colIndex:ue,isResizing:y===oe.field,isLast:ue===I.length-1,hasFocus:xe,tabIndex:Ee,pinnedPosition:he,pinnedOffset:Pe,isLastUnpinned:te,isSiblingFocused:Ie,showLeftBorder:Ve,showRightBorder:We},ye),oe.field))}return q(ce,le,0)},Z=()=>k.jsxs(xZ,{role:"row","aria-rowindex":l+1,ownerState:C,className:ee["row--borderBottom"],style:{height:_},children:[W&&Y({position:On.LEFT,renderContext:W},{disableReorder:!0}),Y({renderContext:O}),K&&Y({position:On.RIGHT,renderContext:K},{disableReorder:!0,separatorSide:lH.Left})]}),ie=({depth:ce,params:ye})=>{var De,Ve;const Se=G(ye);if(Se.renderedColumns.length===0)return null;const{firstColumnToRender:ne,lastColumnToRender:le}=Se,de=f[ce],oe=t[ne].field,ue=((De=E[oe])==null?void 0:De[ce])??null,pe=de.findIndex(({groupId:We,columnFields:rt})=>We===ue&&rt.includes(oe)),Ee=t[le-1].field,xe=((Ve=E[Ee])==null?void 0:Ve[ce])??null,Re=de.findIndex(({groupId:We,columnFields:rt})=>We===xe&&rt.includes(Ee)),he=de.slice(pe,Re+1).map(We=>z({},We,{columnFields:We.columnFields.filter(rt=>u[rt]!==!1)})).filter(We=>We.columnFields.length>0),Pe=he[0].columnFields.indexOf(oe),Ie=he[0].columnFields.slice(0,Pe).reduce((We,rt)=>{const ut=R[rt];return We+(ut.computedWidth??0)},0);let te=ne;const Te=he.map(({groupId:We,columnFields:rt},ut)=>{const Be=s!==null&&s.depth===ce&&rt.includes(s.field),et=i!==null&&i.depth===ce&&rt.includes(i.field)?0:-1,Le={width:rt.reduce((lt,vt)=>lt+R[vt].computedWidth,0),fields:rt,colIndex:te},It=ye.position,Lt=px(It,Le.width,te,I,M,B);te+=rt.length;let nt=ut;return It===On.LEFT&&(nt=te-1),k.jsx(Q0t,{groupId:We,width:Le.width,fields:Le.fields,colIndex:Le.colIndex,depth:ce,isLastColumn:ut===he.length-1,maxDepth:l,height:N,hasFocus:Be,tabIndex:et,pinnedPosition:It,pinnedOffset:Lt,showLeftBorder:AO(It,nt),showRightBorder:PO(It,nt,he.length,C.showColumnVerticalBorder,A)},ut)});return q(ye,Te,Ie)};return{renderContext:O,leftRenderContext:W,rightRenderContext:K,pinnedColumns:P,visibleColumns:t,columnPositions:I,getFillers:q,getColumnHeadersRow:Z,getColumnsToRender:G,getColumnGroupHeadersRows:()=>{if(l===0)return null;const ce=[];for(let ye=0;ye<l;ye+=1)ce.push(k.jsxs(xZ,{role:"row","aria-rowindex":ye+1,ownerState:C,style:{height:N},children:[W&&ie({depth:ye,params:{position:On.LEFT,renderContext:W,maxLastColumn:W.lastColumnIndex}}),ie({depth:ye,params:{renderContext:O}}),K&&ie({depth:ye,params:{position:On.RIGHT,renderContext:K,maxLastColumn:K.lastColumnIndex}})]},ye));return ce},getPinnedCellOffset:px,isDragging:!!m,getInnerProps:()=>({role:"rowgroup"})}},J0t=["className"],Z0t=e=>{const{classes:t}=e;return Me({root:["columnHeaders"]},Cn,t)},ext=Nn("div",{name:"MuiDataGrid",slot:"ColumnHeaders"})({display:"flex",flexDirection:"column",borderTopLeftRadius:"var(--unstable_DataGrid-radius)",borderTopRightRadius:"var(--unstable_DataGrid-radius)"}),txt=Vt(function(t,n){const{className:r}=t,o=$e(t,J0t),i=yt(),a=Z0t(i);return k.jsx(ext,z({className:fe(a.root,r),ownerState:i},o,{role:"presentation",ref:n}))}),nxt=["className","visibleColumns","sortColumnLookup","filterColumnLookup","columnHeaderTabIndexState","columnGroupHeaderTabIndexState","columnHeaderFocus","columnGroupHeaderFocus","headerGroupingMaxDepth","columnMenuState","columnVisibility","columnGroupsHeaderStructure","hasOtherElementInTabSequence"],rxt=Vt(function(t,n){const{visibleColumns:r,sortColumnLookup:o,filterColumnLookup:i,columnHeaderTabIndexState:a,columnGroupHeaderTabIndexState:s,columnHeaderFocus:l,columnGroupHeaderFocus:c,headerGroupingMaxDepth:u,columnMenuState:f,columnVisibility:h,columnGroupsHeaderStructure:m,hasOtherElementInTabSequence:g}=t,y=$e(t,nxt),{getInnerProps:v,getColumnHeadersRow:w,getColumnGroupHeadersRows:C}=X0t({visibleColumns:r,sortColumnLookup:o,filterColumnLookup:i,columnHeaderTabIndexState:a,columnGroupHeaderTabIndexState:s,columnHeaderFocus:l,columnGroupHeaderFocus:c,headerGroupingMaxDepth:u,columnMenuState:f,columnVisibility:h,columnGroupsHeaderStructure:m,hasOtherElementInTabSequence:g});return k.jsxs(txt,z({},y,v(),{ref:n,children:[C(),w()]}))}),oxt=ad(rxt);function ixt(e){return null}function axt(e){return null}const sxt=Vt(function(t,n){const o=tn().current.getLocaleText("noResultsOverlayLabel");return k.jsx(QP,z({},t,{ref:n,children:o}))}),lxt=new TextEncoder;let $E=2*1024,mx=new ArrayBuffer($E),O$=new Uint8Array(mx),Cp=new Int32Array(mx);const cxt=uxt;function uxt(e){const t=e.length*2;t>$E&&($E=t+(4-t%4),mx=new ArrayBuffer($E),O$=new Uint8Array(mx),Cp=new Int32Array(mx));const n=lxt.encodeInto(e,O$).written,r=0,o=n|0;let i=0,a=(r+o|0)+374761393|0;if(o<16)for(;(i+3|0)<o;i=i+4|0)a=Math.imul(Sl(a+Math.imul(Cp[i]|0,3266489917)|0,17)|0,668265263);else{let s=r+606290984|0,l=r+2246822519|0,c=r,u=r-2654435761|0;for(;(i+15|0)<o;i=i+16|0)s=Math.imul(Sl(s+Math.imul(Cp[i+0|0]|0,2246822519)|0,13)|0,2654435761),l=Math.imul(Sl(l+Math.imul(Cp[i+4|0]|0,2246822519)|0,13)|0,2654435761),c=Math.imul(Sl(c+Math.imul(Cp[i+8|0]|0,2246822519)|0,13)|0,2654435761),u=Math.imul(Sl(u+Math.imul(Cp[i+12|0]|0,2246822519)|0,13)|0,2654435761);for(a=(((Sl(s,1)|0+Sl(l,7)|0)+Sl(c,12)|0)+Sl(u,18)|0)+o|0;(i+3|0)<o;i=i+4|0)a=Math.imul(Sl(a+Math.imul(Cp[i]|0,3266489917)|0,17)|0,668265263)}for(;i<o;i=i+1|0)a=Math.imul(Sl(a+Math.imul(O$[i]|0,374761393)|0,11)|0,2654435761);return a=Math.imul(a^a>>>15,2246822519),a=Math.imul(a^a>>>13,3266489917),((a^a>>>16)>>>0).toString()}function Sl(e,t){return e<<t|e>>>32-t}function dxt(e){const t=new WeakSet;return JSON.stringify(e,(n,r)=>{if(r!==null&&typeof r=="object"){if(t.has(r))return null;t.add(r)}return r})}function fxt(){const e=Lr();return x.useMemo(()=>{const t=cxt(dxt(e)),n=pxt(e);return{id:t,variables:n}},[e])}function pxt(e){var g,y,v,w,C,E;const t=mxt(e),n=e.palette.DataGrid,r=(n==null?void 0:n.bg)??(e.vars||e).palette.background.default,o=(n==null?void 0:n.headerBg)??r,i=(n==null?void 0:n.pinnedBg)??r,a=e.vars?`rgba(${e.vars.palette.background.defaultChannel} / ${e.vars.palette.action.disabledOpacity})`:Nt(e.palette.background.default,e.palette.action.disabledOpacity),s=e.palette.mode==="dark"?`color-mix(in srgb, ${(e.vars||e).palette.background.paper} 95%, #fff)`:(e.vars||e).palette.background.paper,l=e.vars?`rgb(${e.vars.palette.primary.mainChannel})`:e.palette.primary.main,c=hxt(e),u=((y=(g=e.vars)==null?void 0:g.font)==null?void 0:y.body2)??I$(e.typography.body2),f=((w=(v=e.vars)==null?void 0:v.font)==null?void 0:w.caption)??I$(e.typography.caption),h=((E=(C=e.vars)==null?void 0:C.font)==null?void 0:E.body1)??I$(e.typography.body1),m=Ct.keys;return{[m.spacingUnit]:e.vars?e.vars.spacing??e.spacing(1):e.spacing(1),[m.colors.border.base]:t,[m.colors.background.base]:r,[m.colors.background.overlay]:s,[m.colors.background.backdrop]:a,[m.colors.foreground.base]:(e.vars||e).palette.text.primary,[m.colors.foreground.muted]:(e.vars||e).palette.text.secondary,[m.colors.foreground.accent]:(e.vars||e).palette.primary.dark,[m.colors.foreground.disabled]:(e.vars||e).palette.text.disabled,[m.colors.foreground.error]:(e.vars||e).palette.error.dark,[m.colors.interactive.hover]:(e.vars||e).palette.action.hover,[m.colors.interactive.hoverOpacity]:(e.vars||e).palette.action.hoverOpacity,[m.colors.interactive.focus]:SZ((e.vars||e).palette.primary.main),[m.colors.interactive.focusOpacity]:(e.vars||e).palette.action.focusOpacity,[m.colors.interactive.disabled]:SZ((e.vars||e).palette.action.disabled),[m.colors.interactive.disabledOpacity]:(e.vars||e).palette.action.disabledOpacity,[m.colors.interactive.selected]:l,[m.colors.interactive.selectedOpacity]:(e.vars||e).palette.action.selectedOpacity,[m.header.background.base]:o,[m.cell.background.pinned]:i,[m.radius.base]:c,[m.typography.fontFamily.base]:e.typography.fontFamily,[m.typography.fontWeight.light]:e.typography.fontWeightLight,[m.typography.fontWeight.regular]:e.typography.fontWeightRegular,[m.typography.fontWeight.medium]:e.typography.fontWeightMedium,[m.typography.fontWeight.bold]:e.typography.fontWeightBold,[m.typography.font.body]:u,[m.typography.font.small]:f,[m.typography.font.large]:h,[m.transitions.easing.easeIn]:e.transitions.easing.easeIn,[m.transitions.easing.easeOut]:e.transitions.easing.easeOut,[m.transitions.easing.easeInOut]:e.transitions.easing.easeInOut,[m.transitions.duration.short]:`${e.transitions.duration.shorter}ms`,[m.transitions.duration.base]:`${e.transitions.duration.short}ms`,[m.transitions.duration.long]:`${e.transitions.duration.standard}ms`,[m.shadows.base]:(e.vars||e).shadows[2],[m.shadows.overlay]:(e.vars||e).shadows[8],[m.zIndex.panel]:(e.vars||e).zIndex.modal,[m.zIndex.menu]:(e.vars||e).zIndex.modal}}function hxt(e){return e.vars?e.vars.shape.borderRadius:typeof e.shape.borderRadius=="number"?`${e.shape.borderRadius}px`:e.shape.borderRadius}function mxt(e){return e.vars?e.vars.palette.TableCell.border:e.palette.mode==="light"?Vu(Nt(e.palette.divider,1),.88):zu(Nt(e.palette.divider,1),.68)}function gxt(e,t){return`rgba(from ${e} r g b / ${t})`}function SZ(e){return gxt(e,1)}function I$(e){return`${e.fontWeight} ${e.fontSize} / ${e.lineHeight} ${e.fontFamily}`}const yxt=["id","label","labelId","material","disabled","slotProps","onChange","onKeyDown","onOpen","onClose","size","style","fullWidth"],vxt=["onRowsPerPageChange","material","disabled"],bxt=["material"],xxt=["autoFocus","label","fullWidth","slotProps","className","material"],Sxt=["material"],wxt=["material"],Cxt=["material"],Ext=["material"],Txt=["material"],Oxt=["material"],Ixt=["material"],Pxt=["material"],Axt=["material","label","className"],Mxt=["material"],Rxt=["inert","iconStart","iconEnd","children","material"],Dxt=["slotProps","material"],kxt=["id","multiple","freeSolo","options","getOptionLabel","isOptionEqualToValue","value","onChange","label","placeholder","slotProps","material"],_xt=["key"],$xt=["inputProps","InputProps","InputLabelProps"],Nxt=["slotProps","material"],Lxt=["ref","open","children","className","clickAwayTouchEvent","clickAwayMouseEvent","flip","focusTrap","onExited","onClickAway","onDidShow","onDidHide","id","target","transition","placement","material"],Fxt=["native"],wZ=ae(So)(({theme:e})=>({[`&.${TN.positionEnd} .${bN.sizeSmall}`]:{marginRight:e.spacing(-.75)}})),xpe=ae(os,{shouldForwardProp:e=>e!=="fullWidth"})(({theme:e})=>({gap:e.spacing(.5),margin:0,overflow:"hidden",[`& .${hg.label}`]:{fontSize:e.typography.pxToRem(14),overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},variants:[{props:{fullWidth:!0},style:{width:"100%"}}]})),CZ=ae(nTe,{shouldForwardProp:e=>e!=="density"})(({theme:e})=>({variants:[{props:{density:"compact"},style:{padding:e.spacing(.5)}}]})),jxt=ae(Wr)({[`& .${Np.primary}`]:{overflowX:"clip",textOverflow:"ellipsis",maxWidth:"300px"}}),Bxt=Vt(function(t,n){const{id:r,label:o,labelId:i,material:a,disabled:s,slotProps:l,onChange:c,onKeyDown:u,onOpen:f,onClose:h,size:m,style:g,fullWidth:y}=t,v=$e(t,yxt),w={PaperProps:{onKeyDown:u}};return h&&(w.onClose=h),k.jsxs(Fh,{size:m,fullWidth:y,style:g,disabled:s,ref:n,children:[k.jsx(jh,{id:i,htmlFor:r,shrink:!0,variant:"outlined",children:o}),k.jsx(Lf,z({id:r,labelId:i,label:o,displayEmpty:!0,onChange:c},v,{variant:"outlined",notched:!0,inputProps:l==null?void 0:l.htmlInput,onOpen:f,MenuProps:w,size:m},a))]})}),zxt=ae(Lne)(({theme:e})=>({[`& .${th.selectLabel}`]:{display:"none",[e.breakpoints.up("sm")]:{display:"block"}},[`& .${th.input}`]:{display:"none",[e.breakpoints.up("sm")]:{display:"inline-flex"}}})),Vxt=Vt(function(t,n){const{onRowsPerPageChange:r,material:o,disabled:i}=t,a=$e(t,vxt),s=x.useMemo(()=>{if(i)return{backIconButtonProps:{disabled:!0},nextIconButtonProps:{disabled:!0}}},[i]),l=tn(),c=yt(),{estimatedRowCount:u}=c;return k.jsx(zxt,z({component:"div",onRowsPerPageChange:Je(f=>{r==null||r(Number(f.target.value))}),labelRowsPerPage:l.current.getLocaleText("paginationRowsPerPage"),labelDisplayedRows:f=>l.current.getLocaleText("paginationDisplayedRows")(z({},f,{estimated:u})),getItemAriaLabel:l.current.getLocaleText("paginationItemAriaLabel")},s,a,o,{ref:n}))}),Hxt=Vt(function(t,n){const{material:r}=t,o=$e(t,bxt);return k.jsx(iEe,z({},o,r,{ref:n}))}),Uxt=Vt(function(t,n){const{autoFocus:r,label:o,fullWidth:i,slotProps:a,className:s,material:l}=t,c=$e(t,xxt),u=x.useRef(null),f=en(u,n),h=x.useRef(null);return x.useEffect(()=>{var m;if(r){const g=(m=u.current)==null?void 0:m.querySelector("input");g==null||g.focus({preventScroll:!0})}else r===!1&&h.current&&h.current.stop({})},[r]),o?k.jsx(xpe,{className:s,control:k.jsx(CZ,z({},c,l,{inputProps:a==null?void 0:a.htmlInput,ref:f,touchRippleRef:h})),label:o,fullWidth:i}):k.jsx(CZ,z({},c,l,{className:fe(s,l==null?void 0:l.className),inputProps:a==null?void 0:a.htmlInput,ref:f,touchRippleRef:h}))}),Gxt=Vt(function(t,n){const{material:r}=t,o=$e(t,Sxt);return k.jsx(nw,z({},o,r,{ref:n}))}),qxt=Vt(function(t,n){const{material:r}=t,o=$e(t,wxt);return k.jsx(ji,z({},o,r,{ref:n}))}),Wxt=Vt(function(t,n){const{material:r}=t,o=$e(t,Cxt);return k.jsx(Cne,z({},o,r,{ref:n}))}),Kxt=Vt(function(t,n){const{material:r}=t,o=$e(t,Ext);return k.jsx(ct,z({},o,r,{ref:n}))}),Yxt=Vt(function(t,n){const{material:r}=t,o=$e(t,Txt);return k.jsx(Wl,z({},o,r,{ref:n}))}),Qxt=Vt(function(t,n){const{material:r}=t,o=$e(t,Oxt);return k.jsx(pn,z({},o,r,{ref:n}))}),Xxt=Vt(function(t,n){const{material:r}=t,o=$e(t,Ixt);return k.jsx(Go,z({},o,r,{ref:n}))}),Jxt=Vt(function(t,n){const{material:r}=t,o=$e(t,Pxt);return k.jsx(hE,z({},o,r,{ref:n}))}),Zxt=Vt(function(t,n){const{material:r,label:o,className:i}=t,a=$e(t,Axt);return o?k.jsx(xpe,{className:i,control:k.jsx(qo,z({},a,r,{ref:n})),label:o}):k.jsx(qo,z({},a,r,{className:i,ref:n}))}),eSt=Vt(function(t,n){const{material:r}=t,o=$e(t,Mxt);return k.jsx(uI,z({},o,r,{ref:n}))});function tSt(e){const{inert:t,iconStart:n,iconEnd:r,children:o,material:i}=e,a=$e(e,Rxt);return t&&(a.disableRipple=!0),x.createElement(Jt,z({},a,i),[n&&k.jsx(nl,{children:n},"1"),k.jsx(jxt,{children:o},"2"),r&&k.jsx(nl,{children:r},"3")])}function nSt(e){const{slotProps:t,material:n}=e,r=$e(e,Dxt);return k.jsx(dn,z({variant:"outlined"},r,n,{inputProps:t==null?void 0:t.htmlInput,InputProps:pH(t==null?void 0:t.input),InputLabelProps:z({shrink:!0},t==null?void 0:t.inputLabel)}))}function rSt(e){const t=yt(),{id:n,multiple:r,freeSolo:o,options:i,getOptionLabel:a,isOptionEqualToValue:s,value:l,onChange:c,label:u,placeholder:f,slotProps:h,material:m}=e,g=$e(e,kxt);return k.jsx(_c,z({id:n,multiple:r,freeSolo:o,options:i,getOptionLabel:a,isOptionEqualToValue:s,value:l,onChange:c,renderTags:(y,v)=>y.map((w,C)=>{const E=v({index:C}),{key:I}=E,O=$e(E,_xt);return k.jsx(Wl,z({variant:"outlined",size:"small",label:typeof w=="string"?w:a==null?void 0:a(w)},O),I)}),renderInput:y=>{var I;const{inputProps:v,InputProps:w,InputLabelProps:C}=y,E=$e(y,$xt);return k.jsx(dn,z({},E,{label:u,placeholder:f,inputProps:v,InputProps:pH(w,!1),InputLabelProps:z({shrink:!0},C)},h==null?void 0:h.textField,(I=t.slotProps)==null?void 0:I.baseTextField))}},g,m))}function oSt(e){return k.jsx(iw,z({},pH(e)))}function pH(e,t=!0){if(!e)return;const{slotProps:n,material:r}=e,i=$e(e,Nxt);t&&(i.startAdornment&&(i.startAdornment=k.jsx(wZ,{position:"start",children:i.startAdornment})),i.endAdornment&&(i.endAdornment=k.jsx(wZ,{position:"end",children:i.endAdornment})));for(const a in r)Object.hasOwn(r,a)&&(i[a]=r[a]);return n!=null&&n.htmlInput&&(i.inputProps?i.inputProps=z({},i.inputProps,n==null?void 0:n.htmlInput):i.inputProps=n==null?void 0:n.htmlInput),i}const iSt={"bottom-start":"top left","bottom-end":"top right"};function aSt(e){const{open:t,children:n,className:r,flip:o,onExited:i,onDidShow:a,onDidHide:s,id:l,target:c,transition:u,placement:f,material:h}=e,m=$e(e,Lxt),g=x.useMemo(()=>{const v=[{name:"preventOverflow",options:{padding:8}}];return o&&v.push({name:"flip",enabled:!0,options:{rootBoundary:"document"}}),(a||s)&&v.push({name:"isPlaced",enabled:!0,phase:"main",fn:()=>{a==null||a()},effect:()=>()=>{s==null||s()}}),v},[o,a,s]);let y;if(!u)y=EZ(e,n);else{const v=w=>C=>{w&&w(),i&&i(C)};y=w=>{var C;return EZ(e,k.jsx(mh,z({},w.TransitionProps,{style:{transformOrigin:iSt[w.placement]},onExited:v((C=w.TransitionProps)==null?void 0:C.onExited),children:k.jsx(go,{children:n})})))}}return k.jsx(sv,z({id:l,className:r,open:t,anchorEl:c,transition:u,placement:f,modifiers:g},m,h,{children:y}))}function EZ(e,t){return lSt(e,sSt(e,t))}function sSt(e,t){return e.onClickAway===void 0?t:k.jsx(gne,{onClickAway:e.onClickAway,touchEvent:e.clickAwayTouchEvent,mouseEvent:e.clickAwayMouseEvent,children:t})}function lSt(e,t){return e.focusTrap===void 0?t:k.jsx(lB,{open:!0,disableEnforceFocus:!0,disableAutoFocus:!0,children:k.jsx("div",{tabIndex:-1,children:t})})}function cSt(e){let{native:t}=e,n=$e(e,Fxt);return t?k.jsx("option",z({},n)):k.jsx(Jt,z({},n))}const uSt={booleanCellTrueIcon:XJ,booleanCellFalseIcon:KJ,columnMenuIcon:Tgt,openFilterButtonIcon:vgt,filterPanelDeleteIcon:KJ,columnFilteredIcon:WJ,columnSelectorIcon:xgt,columnSortedAscendingIcon:HJ,columnSortedDescendingIcon:UJ,columnResizeIcon:Sgt,densityCompactIcon:wgt,densityStandardIcon:Cgt,densityComfortableIcon:Egt,exportIcon:Dgt,moreActionsIcon:Pgt,treeDataCollapseIcon:qJ,treeDataExpandIcon:GJ,groupingCriteriaCollapseIcon:qJ,groupingCriteriaExpandIcon:GJ,detailPanelExpandIcon:YJ,detailPanelCollapseIcon:Ogt,rowReorderIcon:QJ,quickFilterIcon:bgt,quickFilterClearIcon:JJ,columnMenuHideIcon:Agt,columnMenuSortAscendingIcon:HJ,columnMenuSortDescendingIcon:UJ,columnMenuUnsortIcon:null,columnMenuFilterIcon:WJ,columnMenuManageColumnsIcon:Mgt,columnMenuClearIcon:JJ,loadIcon:Igt,filterPanelAddIcon:YJ,filterPanelRemoveAllIcon:Rgt,columnReorderIcon:QJ,menuItemCheckIcon:XJ},dSt={baseAutocomplete:rSt,baseBadge:Hxt,baseCheckbox:Uxt,baseChip:Yxt,baseCircularProgress:Gxt,baseDivider:qxt,baseInput:oSt,baseLinearProgress:Wxt,baseMenuList:eSt,baseMenuItem:tSt,baseTextField:nSt,baseButton:Kxt,baseIconButton:Qxt,baseTooltip:Xxt,basePagination:Vxt,basePopper:aSt,baseSelect:Bxt,baseSelectOption:cSt,baseSkeleton:Jxt,baseSwitch:Zxt},fSt=z({},dSt,uSt),pSt=()=>Me({root:["bottomContainer"]},Cn,{}),hSt=Nn("div")({position:"sticky",zIndex:40,bottom:"calc(var(--DataGrid-hasScrollX) * var(--DataGrid-scrollbarSize))"});function mSt(e){const t=pSt();return k.jsx(hSt,z({},e,{className:fe(t.root,ee["container--bottom"]),role:"presentation"}))}const gSt=z({},fSt,{cell:Bht,skeletonCell:Yht,columnHeaderFilterIconButton:ggt,columnHeaderSortIcon:hgt,columnMenu:Ygt,columnHeaders:oxt,detailPanels:ixt,bottomContainer:mSt,footer:Ivt,footerRowCount:Hvt,toolbar:wvt,pinnedRows:axt,loadingOverlay:$vt,noResultsOverlay:sxt,noRowsOverlay:Nvt,noColumnsOverlay:Lvt,pagination:jvt,filterPanel:Eyt,columnsPanel:Zgt,columnsManagement:kyt,panel:oyt,row:Kvt}),ySt={disableMultipleColumnsFiltering:!0,disableMultipleColumnsSorting:!0,throttleRowsMs:void 0,hideFooterRowCount:!1,pagination:!0,checkboxSelectionVisibleOnly:!1,disableColumnReorder:!0,keepColumnPositionIfDraggedOutside:!1,signature:"DataGrid",listView:!1},vSt=e=>z({},ySt,e.dataSource?{filterMode:"server",sortingMode:"server",paginationMode:"server"}:{}),bSt=gSt,xSt=e=>{const t=Lr(),n=x.useMemo(()=>_j({props:e,theme:t,name:"MuiDataGrid"}),[t,e]),r=x.useMemo(()=>z({},qut,n.localeText),[n.localeText]),o=x.useMemo(()=>kht({defaultSlots:bSt,slots:n.slots}),[n.slots]),i=x.useMemo(()=>Object.keys(lj).reduce((a,s)=>(a[s]=n[s]??lj[s],a),{}),[n]);return x.useMemo(()=>z({},n,i,{localeText:r,slots:o},vSt(n)),[n,r,o,i])};class SSt{constructor(){this.maxListeners=20,this.warnOnce=!1,this.events={}}on(t,n,r={}){let o=this.events[t];o||(o={highPriority:new Map,regular:new Map},this.events[t]=o),r.isFirst?o.highPriority.set(n,!0):o.regular.set(n,!0)}removeListener(t,n){this.events[t]&&(this.events[t].regular.delete(n),this.events[t].highPriority.delete(n))}removeAllListeners(){this.events={}}emit(t,...n){const r=this.events[t];if(!r)return;const o=Array.from(r.highPriority.keys()),i=Array.from(r.regular.keys());for(let a=o.length-1;a>=0;a-=1){const s=o[a];r.highPriority.has(s)&&s.apply(this,n)}for(let a=0;a<i.length;a+=1){const s=i[a];r.regular.has(s)&&s.apply(this,n)}}once(t,n){const r=this;this.on(t,function o(...i){r.removeListener(t,o),n.apply(r,i)})}}class hH{static create(t){return new hH(t)}constructor(t){this.value=void 0,this.listeners=void 0,this.subscribe=n=>(this.listeners.add(n),()=>{this.listeners.delete(n)}),this.getSnapshot=()=>this.value,this.update=n=>{this.value=n,this.listeners.forEach(r=>r(n))},this.value=t,this.listeners=new Set}}const Spe=Symbol("mui.api_private"),wSt=e=>e.isPropagationStopped!==void 0;let TZ=0;function CSt(e){var o;const t=(o=e.current)==null?void 0:o[Spe];if(t)return t;const n={},r={state:n,store:hH.create(n),instanceId:{id:TZ}};return TZ+=1,r.getPublicApi=()=>e.current,r.register=(i,a)=>{Object.keys(a).forEach(s=>{const l=a[s],c=r[s];if((c==null?void 0:c.spying)===!0?c.target=l:r[s]=l,i==="public"){const u=e.current,f=u[s];(f==null?void 0:f.spying)===!0?f.target=l:u[s]=l}})},r.register("private",{caches:{},eventManager:new SSt}),r}function ESt(e){return{get state(){return e.current.state},get store(){return e.current.store},get instanceId(){return e.current.instanceId},[Spe]:e.current}}function TSt(e,t){var a;const n=x.useRef(null),r=x.useRef(null);r.current||(r.current=CSt(n)),n.current||(n.current=ESt(r));const o=x.useCallback((...s)=>{const[l,c,u={}]=s;if(u.defaultMuiPrevented=!1,wSt(u)&&u.isPropagationStopped())return;const f=t.signature===Vl.DataGridPro||t.signature===Vl.DataGridPremium?{api:r.current.getPublicApi()}:{};r.current.eventManager.emit(l,c,u,f)},[r,t.signature]),i=x.useCallback((s,l,c)=>{r.current.eventManager.on(s,l,c);const u=r.current;return()=>{u.eventManager.removeListener(s,l)}},[r]);return yn(r,{subscribeEvent:i,publishEvent:o},"public"),e&&!((a=e.current)!=null&&a.state)&&(e.current=n.current),x.useImperativeHandle(e,()=>n.current,[n]),x.useEffect(()=>{const s=r.current;return()=>{s.publishEvent("unmount")}},[r]),r}const OSt={hooks:{useCSSVariables:fxt,useGridAriaAttributes:Yvt,useGridRowAriaAttributes:Qvt,useCellAggregationResult:()=>null}},wpe=Vt(function(t,n){var i;const r=xSt(t),o=TSt(r.apiRef,r);return K0t(o,r),k.jsx(Xvt,{privateApiRef:o,configuration:OSt,props:r,children:k.jsx(dmt,z({className:r.className,style:r.style,sx:r.sx},(i=r.slotProps)==null?void 0:i.root,{ref:n}))})}),Cpe=x.memo(wpe);wpe.propTypes={apiRef:U.shape({current:U.object}),"aria-label":U.string,"aria-labelledby":U.string,autoHeight:U.bool,autoPageSize:U.bool,autosizeOnMount:U.bool,autosizeOptions:U.shape({columns:U.arrayOf(U.string),disableColumnVirtualization:U.bool,expand:U.bool,includeHeaders:U.bool,includeOutliers:U.bool,outliersFactor:U.number}),cellModesModel:U.object,checkboxSelection:U.bool,classes:U.object,className:U.string,clipboardCopyCellDelimiter:U.string,columnBufferPx:U.number,columnGroupHeaderHeight:U.number,columnGroupingModel:U.arrayOf(U.object),columnHeaderHeight:U.number,columns:U.arrayOf(U.object).isRequired,columnVisibilityModel:U.object,dataSource:U.shape({getRows:U.func.isRequired,updateRow:U.func}),dataSourceCache:U.shape({clear:U.func.isRequired,get:U.func.isRequired,set:U.func.isRequired}),density:U.oneOf(["comfortable","compact","standard"]),disableAutosize:U.bool,disableColumnFilter:U.bool,disableColumnMenu:U.bool,disableColumnResize:U.bool,disableColumnSelector:U.bool,disableColumnSorting:U.bool,disableDensitySelector:U.bool,disableEval:U.bool,disableMultipleRowSelection:U.bool,disableRowSelectionOnClick:U.bool,disableVirtualization:U.bool,editMode:U.oneOf(["cell","row"]),estimatedRowCount:U.number,experimentalFeatures:U.shape({warnIfFocusStateIsNotSynced:U.bool}),filterDebounceMs:U.number,filterMode:U.oneOf(["client","server"]),filterModel:U.shape({items:U.arrayOf(U.shape({field:U.string.isRequired,id:U.oneOfType([U.number,U.string]),operator:U.string.isRequired,value:U.any})).isRequired,logicOperator:U.oneOf(["and","or"]),quickFilterExcludeHiddenColumns:U.bool,quickFilterLogicOperator:U.oneOf(["and","or"]),quickFilterValues:U.array}),getCellClassName:U.func,getDetailPanelContent:U.func,getEstimatedRowHeight:U.func,getRowClassName:U.func,getRowHeight:U.func,getRowId:U.func,getRowSpacing:U.func,hideFooter:U.bool,hideFooterPagination:U.bool,hideFooterSelectedRowCount:U.bool,ignoreDiacritics:U.bool,ignoreValueFormatterDuringExport:U.oneOfType([U.shape({clipboardExport:U.bool,csvExport:U.bool}),U.bool]),initialState:U.object,isCellEditable:U.func,isRowSelectable:U.func,keepNonExistentRowsSelected:U.bool,label:U.string,loading:U.bool,localeText:U.object,logger:U.shape({debug:U.func.isRequired,error:U.func.isRequired,info:U.func.isRequired,warn:U.func.isRequired}),logLevel:U.oneOf(["debug","error","info","warn",!1]),nonce:U.string,onCellClick:U.func,onCellDoubleClick:U.func,onCellEditStart:U.func,onCellEditStop:U.func,onCellKeyDown:U.func,onCellModesModelChange:U.func,onClipboardCopy:U.func,onColumnHeaderClick:U.func,onColumnHeaderContextMenu:U.func,onColumnHeaderDoubleClick:U.func,onColumnHeaderEnter:U.func,onColumnHeaderLeave:U.func,onColumnHeaderOut:U.func,onColumnHeaderOver:U.func,onColumnOrderChange:U.func,onColumnResize:U.func,onColumnVisibilityModelChange:U.func,onColumnWidthChange:U.func,onDataSourceError:U.func,onDensityChange:U.func,onFilterModelChange:U.func,onMenuClose:U.func,onMenuOpen:U.func,onPaginationMetaChange:U.func,onPaginationModelChange:U.func,onPreferencePanelClose:U.func,onPreferencePanelOpen:U.func,onProcessRowUpdateError:U.func,onResize:U.func,onRowClick:U.func,onRowCountChange:U.func,onRowDoubleClick:U.func,onRowEditStart:U.func,onRowEditStop:U.func,onRowModesModelChange:U.func,onRowSelectionModelChange:U.func,onSortModelChange:U.func,onStateChange:U.func,pageSizeOptions:U.arrayOf(U.oneOfType([U.number,U.shape({label:U.string.isRequired,value:U.number.isRequired})]).isRequired),pagination:U.oneOf([!0]),paginationMeta:U.shape({hasNextPage:U.bool}),paginationMode:U.oneOf(["client","server"]),paginationModel:U.shape({page:U.number.isRequired,pageSize:U.number.isRequired}),processRowUpdate:U.func,resizeThrottleMs:U.number,rowBufferPx:U.number,rowCount:U.number,rowHeight:U.number,rowModesModel:U.object,rows:U.arrayOf(U.object),rowSelection:U.bool,rowSelectionModel:U.shape({ids:U.instanceOf(Set).isRequired,type:U.oneOf(["exclude","include"]).isRequired}),rowSpacingType:U.oneOf(["border","margin"]),rowSpanning:U.bool,scrollbarSize:U.number,showCellVerticalBorder:U.bool,showColumnVerticalBorder:U.bool,showToolbar:U.bool,slotProps:U.object,slots:U.object,sortingMode:U.oneOf(["client","server"]),sortingOrder:U.arrayOf(U.oneOf(["asc","desc"])),sortModel:U.arrayOf(U.shape({field:U.string.isRequired,sort:U.oneOf(["asc","desc"])})),style:U.object,sx:U.oneOfType([U.arrayOf(U.oneOfType([U.func,U.object,U.bool])),U.func,U.object]),virtualizeColumnsWithAutoRowHeight:U.bool};const ISt=e=>e.map(t=>({id:t.id,category:t.category,date:t.date,value:t.value,notes:t.notes})),PSt=e=>{const[t]=je(),n=ISt(e.category.entries),r=$de(),o=fut(),[i,a]=x.useState(n),[s,l]=x.useState({}),c=(C,E)=>{C.reason===ks.rowFocusOut&&(E.defaultMuiPrevented=!0)},u=C=>()=>{l({...s,[C]:{mode:zn.Edit}})},f=C=>()=>{l({...s,[C]:{mode:zn.View}})},h=C=>async()=>{console.log("deleting entry",C),o.mutate(parseInt(C.toString())),a(i.filter(E=>E.id!==C))},m=C=>()=>{l({...s,[C]:{mode:zn.View,ignoreModifications:!0}});const E=i.find(I=>I.id===C);(E==null?void 0:E.id)===null&&a(i.filter(I=>I.id!==C))},g=async C=>{r.mutate({id:C.id,categoryId:C.category,date:C.date,value:C.value,notes:C.notes});const E={...C,isNew:!1};return a(i.map(I=>I.id===C.id?E:I)),E},y=C=>{console.log(C)},v=C=>{l(C)},w=[{field:"value",headerName:t("value"),width:80,editable:!0,valueFormatter:C=>C==null?"":C+e.category.unit},{field:"date",headerName:t("date"),type:"date",width:120,editable:!0,valueFormatter:C=>C==null?"":xt.fromJSDate(C).toLocaleString(xt.DATE_MED)},{field:"notes",headerName:t("notes"),type:"string",flex:1,editable:!0},{field:"actions",type:"actions",headerName:t("actions"),width:100,cellClassName:"actions",getActions:({id:C})=>{var I;return((I=s[C])==null?void 0:I.mode)===zn.Edit?[S(mf,{icon:S(ide,{}),label:"Save",sx:{color:"primary.main"},onClick:f(C)}),S(mf,{icon:S(cw,{}),label:"Cancel",className:"textPrimary",onClick:m(C),color:"inherit"})]:[S(mf,{icon:S(DV,{}),label:"Edit",className:"textPrimary",onClick:u(C),color:"inherit"}),S(mf,{icon:S(OS,{}),label:"Delete",onClick:h(C),color:"inherit"})]}}];return S(Zt,{sx:{width:"100%"},children:S(Cpe,{editMode:"row",rows:n,columns:w,initialState:{pagination:{paginationModel:{pageSize:YN.pageSize}}},pageSizeOptions:YN.pageSizeOptions,disableRowSelectionOnClick:!0,rowModesModel:s,onRowModesModelChange:v,onRowEditStop:c,processRowUpdate:g,onProcessRowUpdateError:y})})},XP=({title:e,subtitle:t,isOpen:n,message:r,deleteFn:o,closeFn:i})=>{const[a]=je();return S(lv,{open:n,onClose:i,"aria-labelledby":"modal-modal-title","aria-describedby":"modal-modal-description",children:Q(ho,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",bgcolor:"background.paper",borderWidth:0,boxShadow:24,p:2},children:[S(Jl,{title:e,titleTypographyProps:{variant:"h6"},subheader:t,action:S(cw,{onClick:i})}),S(Fi,{children:S(at,{variant:"body1",children:r})}),Q(ll,{children:[S(ct,{color:"error",variant:"contained",onClick:()=>{o(),i()},children:a("delete")}),S(ct,{color:"primary",onClick:i,children:a("close")})]})]})})},Epe=({category:e,closeFn:t})=>{const[n]=je(),r=lut(),o=cut(e==null?void 0:e.id),i=Wo({name:Ho().required(n("forms.fieldRequired")).max(20,n("forms.maxLength",{chars:"20"})).min(3,n("forms.minLength",{chars:"3"})),unit:Ho().required(n("forms.fieldRequired")).max(5,n("forms.maxLength",{chars:"5"}))});return S(Ti,{initialValues:{name:e?e.name:"",unit:e?e.unit:""},validationSchema:i,onSubmit:async a=>{e?o.mutate({...a,id:e.id}):r.mutate(a),t&&t()},children:a=>S(fi,{children:Q(Ft,{spacing:2,children:[S(dn,{fullWidth:!0,id:"name",label:n("name"),error:a.touched.name&&!!a.touched.name,helperText:a.touched.name&&a.errors.name,...a.getFieldProps("name")}),S(dn,{fullWidth:!0,id:"unit",label:n("unit"),error:a.touched.unit&&!!a.errors.unit,helperText:a.touched.unit&&a.errors.unit?a.errors.unit:n("measurements.unitFormHelpText"),...a.getFieldProps("unit")}),S(Ft,{direction:"row",justifyContent:"end",sx:{mt:2},children:S(ct,{color:"primary",variant:"contained",type:"submit",sx:{mt:2},children:n("submit")})})]})})})},ASt=e=>{const t=uut(e.category.id),n=id(),[r]=je(),[o,i]=J.useState(null),[a,s]=J.useState(!1),[l,c]=J.useState(!1),u=!!o,f=I=>{i(I.currentTarget)},h=()=>{m(),v()},m=()=>{i(null)},g=()=>{C(),i(null)},y=()=>{t.mutate(e.category.id),n(cn(Qt.MEASUREMENT_OVERVIEW))},v=()=>s(!0),w=()=>s(!1),C=()=>c(!0),E=()=>c(!1);return Q("div",{children:[S(ct,{onClick:f,children:S(kV,{})}),Q(ss,{anchorEl:o,open:u,onClose:m,MenuListProps:{"aria-labelledby":"basic-button"},children:[S(Jt,{onClick:h,children:r("edit")}),S(Jt,{onClick:g,children:r("delete")})]}),S(Bi,{title:r("edit"),isOpen:a,closeFn:w,children:S(Epe,{category:e.category,closeFn:w})}),S(XP,{title:r("deleteConfirmation",{name:e.category.name}),message:r("measurements.deleteInfo"),isOpen:l,closeFn:E,deleteFn:y})]})};to.defaultZone=f2e;const Tpe=({entry:e,closeFn:t,categoryId:n})=>{const[r,o]=je(),i=dut(),a=$de(),s=_de(n),[l,c]=J.useState(e?xt.fromJSDate(e.date):xt.now()),u=Wo({value:Do().required(r("forms.fieldRequired")).min(0,r("forms.minValue",{value:"0"})).max(1e3,r("forms.maxValue",{value:"1000"})),date:Xs().required(r("forms.fieldRequired")),notes:Ho().max(500,r("forms.maxLength",{value:"500"}))});return S(Ti,{initialValues:{value:e?e.value:0,date:e?e.date:new Date,notes:e?e.notes:""},validationSchema:u,onSubmit:async f=>{e?a.mutate({...f,id:e.id}):i.mutate({...f,categoryId:n}),t&&t()},children:f=>S(fi,{children:Q(Ft,{spacing:2,children:[S(dn,{fullWidth:!0,id:"value",type:"number",label:r("value"),error:f.touched.value&&!!f.errors.value,helperText:f.touched.value&&f.errors.value,...f.getFieldProps("value")}),s.isLoading?S(Er,{}):S(Ys,{dateAdapter:zl,adapterLocale:o.language,children:S(Ih,{format:"yyyy-MM-dd",label:r("date"),value:l,disableFuture:!0,onChange:h=>{h&&f.setFieldValue("date",h.toJSDate()),c(h)},shouldDisableDate:h=>e&&Zn(e.date)===Zn(h.toJSDate())?!1:h?s.data.entries.some(m=>Zn(m.date)===Zn(h.toJSDate())):!1})}),S(dn,{fullWidth:!0,id:"notes",label:r("notes"),multiline:!0,error:f.touched.notes&&!!f.errors.notes,helperText:f.touched.notes&&f.errors.notes,...f.getFieldProps("notes")}),S(Ft,{direction:"row",justifyContent:"end",sx:{mt:2},children:S(ct,{color:"primary",variant:"contained",type:"submit",sx:{mt:2},children:r("submit")})})]})})})},MSt=()=>{const[e]=je(),[t,n]=J.useState(!1),r=()=>n(!0),o=()=>n(!1);return Q("div",{children:[S(Lh,{color:"secondary","aria-label":"add",onClick:r,sx:{position:"fixed",bottom:"5rem",right:i=>i.spacing(2),zIndex:9},children:S(Ko,{})}),S(Bi,{title:e("add"),isOpen:t,closeFn:o,children:S(Epe,{closeFn:o})})]})},RSt=()=>{const[e]=je(),[t,n]=J.useState(!1),r=()=>n(!0),o=()=>n(!1),i=Ma(),a=parseInt(i.categoryId);return Q(Tt,{children:[S(Lh,{color:"secondary","aria-label":"add",onClick:r,sx:{position:"fixed",bottom:"5rem",right:s=>s.spacing(2),zIndex:9},children:S(Ko,{})}),S(Bi,{title:e("add"),isOpen:t,closeFn:o,children:S(Tpe,{closeFn:o,categoryId:a})})]})},rE=['"Open Sans Bold"',"sans-serif"].join(","),DSt=['"Open Sans Light"',"sans-serif"].join(","),Ope={spacing:8,typography:{h3:{fontFamily:rE},h4:{fontFamily:rE},h5:{fontFamily:rE},h6:{fontFamily:rE},fontFamily:DSt},palette:{primary:{main:"#2A4C7D"},secondary:{main:"#e63946"},warning:{main:"#cba328"},info:{main:"#457b9d"},success:{main:"#307916"}}},tm=ZS(Ope),kSt=e=>ZS({...Ope,components:{MuiPopover:{defaultProps:{container:e}},MuiPopper:{defaultProps:{container:e}},MuiModal:{defaultProps:{container:e}}}}),Ipe=e=>{const{i18n:t}=je(),n=30,r=[...e.category.entries].sort((o,i)=>o.date.getTime()-i.date.getTime()).map(o=>({date:o.date.getTime(),value:o.value,entry:o}));return S(Zt,{alignItems:"center",display:"flex",flexDirection:"column",children:S(nd,{width:"90%",height:200,children:Q(qz,{data:r,children:[S(qh,{type:"monotone",dataKey:"value",stroke:tm.palette.secondary.main,strokeWidth:2,dot:r.length>n?!1:{strokeWidth:1,r:4},activeDot:{stroke:"black",strokeWidth:1,r:6}}),S(Uf,{stroke:"#ccc",strokeDasharray:"5 5"}),S(ls,{dataKey:"date",type:"number",domain:["dataMin","dataMax"],tickFormatter:o=>new Date(o).toLocaleDateString(t.language),tickCount:10}),S(cs,{domain:["auto","auto"],unit:e.category.unit})]})})})},_St=()=>{const e=Ma(),t=parseInt(e.categoryId??"");if(Number.isNaN(t))return S("p",{children:"Please pass an integer as the category id."});const n=_de(t);return n.isLoading?S(Er,{}):S(ds,{title:n.data.name,optionsMenu:S(ASt,{category:n.data}),mainContent:Q(Ft,{spacing:2,children:[S(Ipe,{category:n.data}),S(PSt,{category:n.data})]}),fab:S(RSt,{})})},$St=e=>{const[t,n]=je(),[r,o]=J.useState(!1),i=()=>o(!0),a=()=>o(!1);return Q(Tt,{children:[Q(ho,{children:[S(Jl,{title:e.category.name,subheader:e.category.unit}),S(Fi,{children:S(Ipe,{category:e.category})}),Q(ll,{disableSpacing:!0,sx:{justifyContent:"space-between"},children:[S(ct,{size:"small",children:S(Ro,{to:cn(Qt.MEASUREMENT_DETAIL,n.language,{id:e.category.id}),children:t("seeDetails")})}),S(pn,{onClick:i,children:S(Ko,{})})]})]}),S(Bi,{title:t("add"),isOpen:r,closeFn:a,children:S(Tpe,{closeFn:a,categoryId:e.category.id})})]})},OZ=()=>{const e=kde(),[t]=je();return e.isLoading?S(Er,{}):S(ds,{title:t("measurements.measurements"),mainContent:Q(Ft,{spacing:2,children:[e.data.length===0&&S(Bh,{}),e.data.map(n=>S($St,{category:n},n.id))]}),fab:S(MSt,{})})};function Ra(){return yr({queryKey:[st.QUERY_PROFILE],queryFn:VLe})}const NSt=()=>{const e=Mt();return Dt({mutationFn:t=>HLe(t),onSuccess:async()=>{await e.invalidateQueries({queryKey:[st.QUERY_PROFILE]})}})},NE=[{range:"obese",color:"#FF5733",min:30,max:100},{range:"overweight",color:"#FFC107",min:25,max:30},{range:"normal",color:"#90EE90",min:18.5,max:25},{range:"underweight",color:"#FFC300",min:0,max:18.5}],oE=e=>{const t=NE.find(n=>n.range===e);return t?t.color:"gray"},LSt=()=>{const[e]=je(),t=Bw(),n=Ra(),[r,o]=x.useState(),[i,a]=x.useState();x.useEffect(()=>{var u;if(t.data&&t.data.length>0){const f=t.data[0],h=(u=n.data)!=null&&u.useMetric?f.weight:f.weight*.453592;a(h)}},[t.data,n.data]),x.useEffect(()=>{var u;(u=n.data)!=null&&u.height&&o(n.data.height)},[n.data]);const l=(()=>{if(r&&i){const u=r/100;return i/(u*u)}return null})();if(t.isLoading||n.isLoading)return S(Er,{});const c=[];for(let u=140;u<=220;u+=10){const f=u/100,h={height:u};let m=0;NE.forEach((g,y)=>{const v=g.max>100?100:g.max;let w=v*f*f-m;w=Math.min(w,150-m),y===0?h[g.range]=w:h[g.range]=h[NE[y-1].range]+w,m=Math.min(v*f*f,150)}),c.push(h)}return S(ds,{title:e("bmi.calculator"),mainContent:S(Tt,{children:Q(Ft,{spacing:2,children:[Q(me,{container:!0,spacing:2,children:[S(me,{size:{xs:12,sm:6},children:S(dn,{label:e("height"),fullWidth:!0,slotProps:{input:{endAdornment:S(at,{children:e("cm")})}},type:"number",value:r??"",onChange:u=>o(parseFloat(u.target.value))})}),S(me,{size:{xs:12,sm:6},children:S(dn,{label:e("weight"),slotProps:{input:{endAdornment:S(at,{children:e("server.kg")})}},fullWidth:!0,type:"number",value:i??"",onChange:u=>a(parseFloat(u.target.value))})})]}),l!==null&&S(at,{variant:"h6",children:e("bmi.result",{value:l.toFixed(1)})}),S(nd,{width:"100%",height:400,children:Q(pYe,{data:c,children:[S(ls,{dataKey:"height",type:"number",domain:[140,220],unit:"cm"}),S(cs,{domain:[40,150],tickFormatter:u=>Math.round(u).toString(),unit:"kg"}),S(Uf,{strokeDasharray:"3 3"}),S(ba,{formatter:(u,f)=>[Math.round(u),e("bmi."+f)]}),NE.map(u=>S(Gf,{type:"monotone",dataKey:u.range,stroke:"black",fill:u.color,fillOpacity:.8},u.range)),l!==null&&S(Ow,{x:r,y:i,r:8,fill:"black",stroke:"none"})]})}),Q(Ft,{direction:"row",justifyContent:"center",children:[S(Zt,{height:20,width:20,sx:{backgroundColor:oE("obese")}}),e("bmi.obese"),S(Zt,{height:20,width:20,sx:{backgroundColor:oE("overweight"),marginLeft:2}}),e("bmi.overweight"),S(Zt,{height:20,width:20,sx:{backgroundColor:oE("normal"),marginLeft:2}}),e("bmi.normal"),S(Zt,{height:20,width:20,sx:{backgroundColor:oE("underweight"),marginLeft:2}}),e("bmi.underweight")]})]})})})},FSt=e=>{var r,o,i,a;const[t,n]=je();return Q(ln,{children:[S(ke,{sx:{paddingX:1},children:S(Kl,{alt:(r=e.item.ingredient)==null?void 0:r.name,src:(i=(o=e.item.ingredient)==null?void 0:o.image)==null?void 0:i.url,sx:{width:45,height:45},children:S(Ju,{})})}),Q(ke,{sx:{paddingX:1},children:[e.item.amountString," ",(a=e.item.ingredient)==null?void 0:a.name]}),S(ke,{align:"right",sx:{paddingX:1},children:t("nutrition.valueEnergyKcalKj",{kcal:_i(e.item.nutritionalValues.energy,n.language),kj:_i(e.item.nutritionalValues.energyKj,n.language)})}),S(ke,{align:"right",sx:{paddingX:1},children:$n(e.item.nutritionalValues.protein,n.language)}),S(ke,{align:"right",sx:{paddingX:1},children:$n(e.item.nutritionalValues.carbohydrates,n.language)}),S(ke,{align:"right",sx:{paddingX:1},children:$n(e.item.nutritionalValues.fat,n.language)})]},e.item.id)},pj=e=>{const[t,n]=je();return S(Fc,{children:Q(Nc,{children:[S(Ff,{children:Q(ln,{children:[S(ke,{}),S(ke,{}),S(ke,{align:"right",sx:{paddingX:1},children:t("nutrition.energy")}),S(ke,{align:"right",sx:{paddingX:1},children:t("nutrition.protein")}),S(ke,{align:"right",sx:{paddingX:1},children:t("nutrition.carbohydrates")}),S(ke,{align:"right",sx:{paddingX:1},children:t("nutrition.fat")})]})}),Q(Lc,{children:[e.items.map(r=>S(FSt,{item:r},r.id)),e.showSum&&Q(ln,{children:[S(ke,{sx:{paddingX:1},children:" "}),S(ke,{sx:{paddingX:1},children:t("total")}),S(ke,{align:"right",sx:{paddingX:1},children:t("nutrition.valueEnergyKcalKj",{kcal:_i(e.values.energy,n.language),kj:_i(e.values.energyKj,n.language)})}),S(ke,{align:"right",sx:{paddingX:1},children:$n(e.values.protein,n.language)}),S(ke,{align:"right",sx:{paddingX:1},children:$n(e.values.carbohydrates,n.language)}),S(ke,{align:"right",sx:{paddingX:1},children:$n(e.values.fat,n.language)})]})]})]})})},jSt=e=>{const[t,n]=je();return S(Fc,{children:Q(Nc,{size:"small",children:[S(Ff,{children:Q(ln,{children:[S(ke,{children:t("nutrition.macronutrient")}),S(ke,{align:"right",children:t("nutrition.planned")}),S(ke,{align:"right",children:t("nutrition.logged")}),S(ke,{align:"right",children:t("nutrition.difference")})]})}),Q(Lc,{children:[Q(ln,{children:[S(ke,{children:t("nutrition.energy")}),S(ke,{align:"right",children:t("nutrition.valueEnergyKcalKj",{kcal:_i(e.planned.energy,n.language),kj:_i(e.planned.energyKj,n.language)})}),S(ke,{align:"right",children:t("nutrition.valueEnergyKcalKj",{kcal:_i(e.logged.energy,n.language),kj:_i(e.logged.energyKj,n.language)})}),S(ke,{align:"right",children:t("nutrition.valueEnergyKcalKj",{kcal:_i(e.logged.energy-e.planned.energy,n.language),kj:_i(e.logged.energyKj-e.planned.energyKj,n.language)})})]}),Q(ln,{children:[S(ke,{children:t("nutrition.protein")}),S(ke,{align:"right",children:$n(e.planned.protein,n.language)}),S(ke,{align:"right",children:$n(e.logged.protein,n.language)}),S(ke,{align:"right",children:$n(e.logged.protein-e.planned.protein,n.language)})]}),Q(ln,{children:[S(ke,{children:t("nutrition.carbohydrates")}),S(ke,{align:"right",children:$n(e.planned.carbohydrates,n.language)}),S(ke,{align:"right",children:$n(e.logged.carbohydrates,n.language)}),S(ke,{align:"right",children:$n(e.logged.carbohydrates-e.planned.carbohydrates,n.language)})]}),Q(ln,{children:[S(ke,{sx:{pl:5},children:t("nutrition.ofWhichSugars")}),S(ke,{align:"right",children:$n(e.planned.carbohydratesSugar,n.language)}),S(ke,{align:"right",children:$n(e.logged.carbohydratesSugar,n.language)}),S(ke,{align:"right",children:$n(e.logged.carbohydratesSugar-e.planned.carbohydratesSugar,n.language)})]}),Q(ln,{children:[S(ke,{children:t("nutrition.fat")}),S(ke,{align:"right",children:$n(e.planned.fat,n.language)}),S(ke,{align:"right",children:$n(e.logged.fat,n.language)}),S(ke,{align:"right",children:$n(e.logged.fat-e.planned.fat,n.language)})]}),Q(ln,{children:[S(ke,{sx:{paddingLeft:5},children:t("nutrition.ofWhichSaturated")}),S(ke,{align:"right",children:$n(e.planned.fatSaturated,n.language)}),S(ke,{align:"right",children:$n(e.logged.fatSaturated,n.language)}),S(ke,{align:"right",children:$n(e.logged.fatSaturated-e.planned.fatSaturated,n.language)})]}),Q(ln,{children:[S(ke,{children:t("nutrition.others")}),S(ke,{}),S(ke,{}),S(ke,{})]}),Q(ln,{children:[S(ke,{children:t("nutrition.fibres")}),S(ke,{align:"right",children:$n(e.planned.fiber,n.language)}),S(ke,{align:"right",children:$n(e.logged.fiber,n.language)}),S(ke,{align:"right",children:$n(e.logged.fiber-e.planned.fiber,n.language)})]}),Q(ln,{children:[S(ke,{children:t("nutrition.sodium")}),S(ke,{align:"right",children:$n(e.planned.sodium,n.language)}),S(ke,{align:"right",children:$n(e.logged.sodium,n.language)}),S(ke,{align:"right",children:$n(e.logged.sodium-e.planned.sodium,n.language)})]})]})]})})},IZ=()=>{const[e]=je(),t=Ma(),n=parseInt(t.planId);if(Number.isNaN(n))return S("p",{children:"Please pass an integer as the nutritional plan id."});const r=new Date(t.date),o=JLe(n,t.date);return o.isLoading?S(Er,{}):S(ds,{title:e("nutrition.nutritionalDiary"),mainContent:S(Tt,{children:Q(Ft,{spacing:2,children:[S(at,{gutterBottom:!0,variant:"h4",children:r.toLocaleDateString()}),S(jSt,{logged:o.data.loggedNutritionalValuesDate(r),planned:o.data.plannedNutritionalValues}),S(pj,{values:o.data.loggedNutritionalValuesDate(r),items:o.data.loggedEntriesDate(r),showSum:!0})]})})})};function*Zw(e){let t;e<=3?t=d2e:e<=5?t=u2e:t=c2e;for(const n of t)yield n}const BSt=e=>{const[t,n]=je(),r=Zw(3),o=[{name:t("nutrition.carbohydrates"),value:e.data.carbohydrates},{name:t("nutrition.protein"),value:e.data.protein},{name:t("nutrition.fat"),value:e.data.fat}],i=Math.PI/180;return S(nd,{width:"100%",height:300,children:Q(Nle,{children:[S(Gc,{data:o,labelLine:!1,label:({cx:s,cy:l,midAngle:c,innerRadius:u,outerRadius:f,payload:h})=>{const m=u+(f-u)*.4,g=s+m*Math.cos(-c*i),y=l+m*Math.sin(-c*i);return S("text",{x:g,y,fill:"white",textAnchor:"middle",dominantBaseline:"central",children:$n(h.value,n.language)})},fill:"#8884d8",dataKey:"value",children:o.map((s,l)=>S(Ev,{fill:r.next().value},`cell-${l}`))}),S(Oc,{})]})})},zSt=({showPlanned:e,planned:t,today:n,avg7Days:r})=>{const[o,i]=je(),a=Zw(3),s=[{name:o("nutrition.protein"),planned:t.protein,today:n.protein,avg7Days:r.protein},{name:o("nutrition.carbohydrates"),planned:t.carbohydrates,today:n.carbohydrates,avg7Days:r.carbohydrates},{name:o("nutrition.sugar"),planned:t.carbohydratesSugar,today:n.carbohydratesSugar,avg7Days:r.carbohydratesSugar},{name:o("nutrition.fat"),planned:t.fat,today:n.fat,avg7Days:r.fat},{name:o("nutrition.saturatedFat"),planned:t.fatSaturated,today:n.fatSaturated,avg7Days:r.fatSaturated}];return S(nd,{width:"100%",height:300,children:Q($le,{data:s,margin:{top:20,right:30,left:20,bottom:5},children:[S(Uf,{strokeDasharray:"3 4"}),S(ls,{dataKey:"name"}),S(cs,{type:"number",orientation:"left",unit:o("nutrition.gramShort")}),S(ba,{formatter:l=>_i(l,i.language)}),S(Oc,{}),e&&S(Ac,{dataKey:"planned",unit:o("nutrition.gramShort"),name:o("nutrition.planned"),fill:a.next().value}),S(Ac,{dataKey:"today",unit:o("nutrition.gramShort"),name:o("nutrition.today"),fill:a.next().value}),S(Ac,{dataKey:"avg7Days",unit:o("nutrition.gramShort"),name:o("nutrition.7dayAvg"),fill:a.next().value})]})})},VSt=e=>{const[t,n]=je();return S(Fc,{children:Q(Nc,{size:"small",children:[S(Ff,{children:Q(ln,{children:[S(ke,{children:t("date")}),S(ke,{align:"right",children:t("nutrition.logged")}),S(ke,{align:"right",children:t("nutrition.difference")})]})}),S(Lc,{children:Array.from(e.logged).map(([r])=>{var o,i;return Q(ln,{children:[S(ke,{children:S(Ro,{to:cn(Qt.NUTRITION_DIARY,n.language,{id:e.planId,date:r}),children:new Date(r).toLocaleDateString(n.language)})}),S(ke,{align:"right",children:t("nutrition.valueEnergyKcal",{value:_i((o=e.logged.get(r))==null?void 0:o.nutritionalValues.energy,n.language)})}),S(ke,{align:"right",children:_i(((i=e.logged.get(r))==null?void 0:i.nutritionalValues.energy)-e.planned.energy,n.language)})]},r)})})]})})},HSt=()=>{const[e]=je(),[t,n]=J.useState(!1),r=()=>n(!0),o=()=>n(!1);return Q("div",{children:[S(Lh,{color:"secondary","aria-label":"add",onClick:r,sx:{position:"fixed",bottom:"5rem",right:i=>i.spacing(2),zIndex:9},children:S(Ko,{})}),S(Bi,{title:e("add"),isOpen:t,closeFn:o,children:S(RV,{closeFn:o})})]})},USt=e=>{const[t]=je(),[n,r]=J.useState(!1),o=()=>r(!0),i=()=>r(!1);return Q("div",{children:[S(Lh,{color:"secondary","aria-label":"add",onClick:o,sx:{position:"fixed",bottom:"5rem",right:a=>a.spacing(2),zIndex:9},children:S(lw,{})}),S(Bi,{title:t("nutrition.addNutritionalDiary"),isOpen:n,closeFn:i,children:S(MV,{closeFn:i,planId:e.plan.id,meals:e.plan.meals})})]})},Ppe=({meal:e,planId:t,closeFn:n})=>{const[r,o]=je(),i=iFe(t),a=sFe(t),s=Wo({name:Ho().required().max(25,r("forms.maxLength",{chars:"25"})).min(3,r("forms.minLength",{chars:"3"})),time:Xs().required()});return S(Ti,{initialValues:{name:e?e.name:"",time:e?e.time:new Date},validationSchema:s,onSubmit:async l=>{l.time instanceof Date||(l.time=l.time.toJSDate());const c={...l,time:Dx(l.time)};e?a.mutate({...c,plan:t,id:e.id}):i.mutate({...c,plan:t}),n&&n()},children:l=>S(fi,{children:Q(Ft,{spacing:2,children:[S(dn,{fullWidth:!0,id:"name",label:r("description"),error:l.touched.name&&!!l.errors.name,helperText:l.touched.name&&l.errors.name,...l.getFieldProps("name")}),S(Ys,{dateAdapter:zl,adapterLocale:o.language,children:S(HF,{label:r("timeOfDay"),value:l.values.time!==null?xt.fromJSDate(l.values.time):null,onChange:c=>l.setFieldValue("time",c)})}),Q(Ft,{direction:"row",justifyContent:"end",spacing:2,children:[n!==void 0&&S(ct,{color:"primary",variant:"outlined",onClick:()=>n(),children:r("close")}),S(ct,{disabled:i.isPending||a.isPending,color:"primary",variant:"contained",type:"submit",children:r("submit")})]})]})})})},GSt=e=>{const[t]=je(),n=Zw(3),r=[{name:t("nutrition.energy"),value:e.logged.energy/e.planned.energy*100},{name:t("nutrition.protein"),value:e.logged.protein/e.planned.protein*100},{name:t("nutrition.carbohydrates"),value:e.logged.carbohydrates/e.planned.carbohydrates*100},{name:t("nutrition.fat"),value:e.logged.fat/e.planned.fat*100}];return S(nd,{width:"100%",height:150,children:Q($le,{data:r,layout:"vertical",margin:{left:60},children:[S(Uf,{strokeDasharray:"3 4"}),S(ls,{type:"number",unit:"%"}),S(cs,{type:"category",dataKey:"name"}),S(Ac,{dataKey:"value",unit:"%",fill:n.next().value})]})})},Ape=({planId:e,item:t,mealId:n,closeFn:r})=>{const[o]=je(),i=lFe(e),a=cFe(e),s=uFe(e),l=()=>{t&&s.mutate(t.id),r&&r()},c=Wo({amount:Do().required(o("forms.fieldRequired")).max(1e3,o("forms.maxValue",{value:"1000"})).min(1,o("forms.minValue",{value:"1"})),ingredient:Do().required(o("forms.fieldRequired"))});return S(Ti,{initialValues:{amount:t?t.amount:0,ingredient:t?t.ingredientId:0},validationSchema:c,onSubmit:async u=>{const f={...u,meal:n,weight_unit:null};t?a.mutate({...f,id:t.id}):i.mutate(f),r&&r()},children:u=>{var f;return S(fi,{children:Q(Ft,{spacing:2,children:[S(vV,{callback:h=>u.setFieldValue("ingredient",h?h.data.id:null),initialIngredient:t?(f=t.ingredient)==null?void 0:f.name:null}),S(dn,{fullWidth:!0,id:"amount",label:"amount",InputProps:{endAdornment:S(So,{position:"end",children:o("nutrition.gramShort")})},error:u.touched.amount&&!!u.errors.amount,helperText:u.touched.amount&&u.errors.amount,...u.getFieldProps("amount")}),Q(Ft,{direction:"row",justifyContent:"end",spacing:2,children:[r!==void 0&&t!==void 0&&S(ct,{color:"error",variant:"outlined",onClick:l,children:o("delete")}),r!==void 0&&S(ct,{color:"primary",variant:"outlined",onClick:()=>r(),children:o("close")}),S(ct,{color:"primary",variant:"contained",type:"submit",children:o("submit")})]})]})})}})},qSt=e=>{const t=oie(e.planId),n=aFe(e.planId),[r]=je(),[o,i]=J.useState(!1),[a,s]=x.useState(null),[l,c]=x.useState(!1),[u,f]=x.useState(!1),h=!!a,m=D=>{s(D.currentTarget)},g=()=>{y(),C()},y=()=>{s(null)},v=()=>{I(),s(null)},w=()=>{n.mutate(e.meal.id)},C=()=>c(!0),E=()=>c(!1),I=()=>f(!0),O=()=>f(!1),P=(D,M)=>{M!=="clickaway"&&i(!1)},R=()=>{const D=e.meal.items.map(M=>({plan:e.planId,meal:e.meal.id,mealItem:M.id,ingredient:M.ingredientId,weight_unit:M.weightUnitId,datetime:new Date().toISOString(),amount:M.amount}));t.mutate(D),i(!0)};return Q(Tt,{children:[!e.onlyLogging&&S(Go,{title:r("nutrition.logThisMeal"),children:S(pn,{"aria-label":"settings",onClick:R,children:S(lw,{})})}),S(pn,{"aria-label":"settings",onClick:m,children:S(ode,{})}),S(pn,{"aria-label":"settings",onClick:e.handleExpanded,children:e.isExpanded?S(nde,{}):S(rde,{})}),Q(ss,{anchorEl:a,open:h,onClose:y,MenuListProps:{"aria-labelledby":"basic-button"},children:[S(Jt,{onClick:g,children:r("edit")}),S(Jt,{onClick:v,children:r("delete")})]}),S(Bi,{title:r("edit"),isOpen:l,closeFn:E,children:S(Ppe,{meal:e.meal,closeFn:E,planId:e.planId})}),S(XP,{title:r("deleteConfirmation",{name:e.meal.name}),message:r("nutrition.mealDeleteInfo"),isOpen:u,closeFn:O,deleteFn:w}),S(dI,{open:o,autoHideDuration:EI,onClose:P,children:S(Ci,{onClose:P,severity:"success",sx:{width:"100%"},children:r("nutrition.diaryEntrySaved")})})]})},WSt=e=>{var o,i,a,s;const[t,n]=x.useState(!1),r=()=>n(!t);return Q(Tt,{children:[Q(Co,{children:[S(fB,{onClick:r,sx:{"&:hover":{cursor:"pointer"}},children:S(Kl,{alt:(o=e.mealItem.ingredient)==null?void 0:o.name,src:(a=(i=e.mealItem.ingredient)==null?void 0:i.image)==null?void 0:a.url,sx:{width:45,height:45},children:S(Ju,{})})}),S(Wr,{primary:`${e.mealItem.amountString} ${(s=e.mealItem.ingredient)==null?void 0:s.name}`})]}),S(aa,{in:t,timeout:"auto",unmountOnExit:!0,sx:{width:"100%"},children:S(Co,{children:S(Wr,{children:S(Ape,{planId:e.planId,mealId:e.mealId,item:e.mealItem,closeFn:r})})})})]})},PZ=e=>{const t=Lr(),n=e.meal.id!==bE,[r]=je(),[o,i]=x.useState(!1),a=()=>i(!o),[s,l]=x.useState(!1),c=()=>{l(!s),f(!1)},[u,f]=x.useState(!1),h=()=>{f(!u),l(!1)};return Q(ho,{children:[S(Jl,{sx:{bgcolor:t.palette.grey[300]},action:e.meal.id!==bE&&S(qSt,{meal:e.meal,planId:e.planId,onlyLogging:e.onlyLogging,isExpanded:o,handleExpanded:a}),title:e.meal.name,subheader:e.meal.timeHHMMLocale}),Q(Fi,{sx:{paddingY:0},children:[Q(aa,{in:o,timeout:"auto",unmountOnExit:!0,children:[!e.onlyLogging&&S(pj,{showSum:n,items:e.meal.items,values:e.meal.plannedNutritionalValues}),S(at,{gutterBottom:!0,variant:"h6",sx:{my:2},children:r("nutrition.loggedToday")}),!e.meal.plannedNutritionalValues.isEmpty&&S(GSt,{logged:e.meal.loggedNutritionalValuesToday,planned:e.meal.plannedNutritionalValues}),S(pj,{showSum:n,items:e.meal.diaryEntriesToday,values:e.meal.loggedNutritionalValuesToday})]}),!o&&S(ai,{children:e.meal.items.map(m=>S(WSt,{mealItem:m,planId:e.planId,mealId:e.meal.id},m.id))})]}),Q(ll,{children:[!e.onlyLogging&&S(Go,{title:r("nutrition.addMealItem"),children:S(pn,{onClick:c,children:S(Ko,{})})}),S(Go,{title:r("nutrition.addNutritionalDiary"),children:S(pn,{onClick:h,children:S(lw,{})})})]}),S(aa,{in:s,timeout:"auto",unmountOnExit:!0,children:Q(Fi,{sx:{paddingY:0},children:[S("p",{children:S("b",{children:r("nutrition.addMealItem")})}),S(Ape,{planId:e.planId,mealId:e.meal.id,closeFn:c})]})}),S(aa,{in:u,timeout:"auto",unmountOnExit:!0,children:Q(Fi,{sx:{paddingY:0},children:[S("p",{children:S("b",{children:r("nutrition.addNutritionalDiary")})}),S(MV,{closeFn:h,planId:e.planId,mealId:e.meal.id!==bE?e.meal.id:null})]})})]})},AZ=e=>{const[t,n]=je();return S(Fc,{children:Q(Nc,{size:"small",children:[S(Ff,{children:Q(ln,{children:[S(ke,{children:t("nutrition.macronutrient")}),S(ke,{align:"right",children:t("total")}),S(ke,{align:"right",children:t("nutrition.percentEnergy")})]})}),Q(Lc,{children:[Q(ln,{children:[S(ke,{children:t("nutrition.energy")}),S(ke,{align:"right",children:t("nutrition.valueEnergyKcalKj",{kcal:_i(e.values.energy,n.language),kj:_i(e.values.energyKj,n.language)})}),S(ke,{align:"right"})]}),Q(ln,{children:[S(ke,{children:t("nutrition.protein")}),S(ke,{align:"right",children:$n(e.values.protein,n.language)}),S(ke,{align:"right",children:JR(e.values.percent.protein,n.language)})]}),Q(ln,{children:[S(ke,{children:t("nutrition.carbohydrates")}),S(ke,{align:"right",children:$n(e.values.carbohydrates,n.language)}),S(ke,{align:"right",children:JR(e.values.percent.carbohydrates,n.language)})]}),Q(ln,{children:[S(ke,{sx:{pl:5},children:t("nutrition.ofWhichSugars")}),S(ke,{align:"right",children:$n(e.values.carbohydratesSugar,n.language)}),S(ke,{align:"right"})]}),Q(ln,{children:[S(ke,{children:t("nutrition.fat")}),S(ke,{align:"right",children:$n(e.values.fat,n.language)}),S(ke,{align:"right",children:JR(e.values.percent.fat,n.language)})]}),Q(ln,{children:[S(ke,{sx:{pl:5},children:t("nutrition.ofWhichSaturated")}),S(ke,{align:"right",children:$n(e.values.fatSaturated,n.language)}),S(ke,{align:"right"})]}),Q(ln,{children:[S(ke,{children:t("nutrition.others")}),S(ke,{children:" "}),S(ke,{align:"right"})]}),Q(ln,{children:[S(ke,{children:t("nutrition.fibres")}),S(ke,{align:"right",children:$n(e.values.fiber,n.language)}),S(ke,{align:"right"})]}),Q(ln,{children:[S(ke,{children:t("nutrition.sodium")}),S(ke,{align:"right",children:$n(e.values.sodium,n.language)}),S(ke,{align:"right"})]})]})]})})},KSt=e=>{const t=eFe(e.plan.id),n=id(),[r,o]=je(),[i,a]=J.useState(null),[s,l]=J.useState(!1),[c,u]=J.useState(!1),f=!!i,h=R=>{a(R.currentTarget)},m=()=>{g(),E()},g=()=>{a(null)},y=()=>{O(),a(null)},v=()=>{t.mutate(e.plan.id),n(cn(Qt.NUTRITION_OVERVIEW))},w=()=>window.location.href=cn(Qt.NUTRITION_PLAN_PDF,o.language,{id:e.plan.id}),C=()=>window.location.href=cn(Qt.NUTRITION_PLAN_COPY,o.language,{id:e.plan.id}),E=()=>l(!0),I=()=>l(!1),O=()=>u(!0),P=()=>u(!1);return Q(Tt,{children:[S(ct,{onClick:h,children:S(kV,{})}),Q(ss,{anchorEl:i,open:f,onClose:g,MenuListProps:{"aria-labelledby":"basic-button"},children:[S(Jt,{onClick:m,children:r("edit")}),S(Jt,{onClick:w,children:r("downloadAsPdf")}),S(Jt,{onClick:C,children:r("nutrition.copyPlan")}),S(Jt,{onClick:y,children:r("delete")})]}),S(Bi,{title:r("edit"),isOpen:s,closeFn:I,children:S(RV,{plan:e.plan,closeFn:I})}),S(XP,{title:r("deleteConfirmation",{name:e.plan.description}),message:r("nutrition.planDeleteInfo"),isOpen:c,closeFn:P,deleteFn:v})]})},YSt=e=>{const[t]=je(),n=e.plan.plannedNutritionalValues,r=e.plan.loggedNutritionalValuesToday,o=e.plan.percentageValuesLoggedToday;return S(Tt,{children:Q(Ft,{direction:"column",spacing:1,children:[S(at,{gutterBottom:!0,variant:"h6",children:t("nutrition.goalsTitle")}),S(Lg,{title:t("nutrition.protein"),percentage:o.protein,logged:r.protein,planned:n.protein}),S(Lg,{title:t("nutrition.carbohydrates"),percentage:o.carbohydrates,logged:r.carbohydrates,planned:n.carbohydrates}),S(Lg,{title:t("nutrition.fat"),percentage:o.fat,logged:r.fat,planned:n.fat})]})})},QSt=()=>{const[e]=je(),t=Ma(),n=parseInt(t.planId??"");if(Number.isNaN(n))return S("p",{children:"Please pass an integer as the nutritional plan id."});const r=XLe(n),[o,i]=x.useState(!1),a=()=>i(!o),s=r.data;return r.isLoading?S(Er,{}):S(ds,{title:s.description,optionsMenu:S(KSt,{plan:s}),mainContent:S(Tt,{children:Q(Ft,{spacing:2,children:[s.meals.map(l=>S(PZ,{meal:l,planId:s.id,onlyLogging:s.onlyLogging},l.id)),S(PZ,{meal:r.data.pseudoMealOthers(e("nutrition.pseudoMealTitle")),planId:s.id,onlyLogging:!0},-1),!s.onlyLogging&&Q(Tt,{children:[S(Go,{title:e("nutrition.addMeal"),children:S(pn,{onClick:a,children:S(Ko,{})})}),Q(aa,{in:o,timeout:"auto",unmountOnExit:!0,children:[S("p",{children:S("b",{children:e("nutrition.addMeal")})}),S(Ppe,{planId:s.id,closeFn:a})]})]}),S(AZ,{values:s.plannedNutritionalValues}),s.hasAnyPlanned&&S(BSt,{data:s.plannedNutritionalValues}),S(at,{gutterBottom:!0,variant:"h4",children:e("nutrition.logged")}),S(zSt,{showPlanned:s.hasAnyPlanned,planned:s.plannedNutritionalValues,today:s.loggedNutritionalValuesToday,avg7Days:s.loggedNutritionalValues7DayAvg}),S(AZ,{values:s.loggedNutritionalValuesToday}),S(VSt,{planId:s.id,logged:s.groupDiaryEntries,planned:s.plannedNutritionalValues})]})}),sideBar:S(YSt,{plan:s}),fab:S(USt,{plan:s})})},XSt=()=>{var n;const e=YLe(),[t]=je();return e.isLoading?S(Er,{}):S(ds,{title:t("nutrition.plans"),mainContent:Q(Ft,{spacing:2,children:[((n=e.data)==null?void 0:n.length)===0&&S(Bh,{}),S(ZSt,{plans:e.data})]}),fab:S(HSt,{})})},JSt=e=>{const[t,n]=je(),r=cn(Qt.NUTRITION_DETAIL,n.language,{id:e.plan.id});return Q(Tt,{children:[S(Co,{sx:{p:0},children:Q(Fl,{component:"a",href:r,children:[S(Wr,{primary:e.plan.description!==""?e.plan.description:t("routines.routine"),secondary:e.plan.end?`${e.plan.start.toLocaleDateString()} – ${e.plan.end.toLocaleDateString()}`:`${e.plan.start.toLocaleDateString()}`}),S(ede,{})]})}),S(ji,{component:"li"})]})},ZSt=e=>S(go,{children:S(ai,{sx:{py:0},children:e.plans.map(t=>S(JSt,{plan:t},t.id))},"abc")});function Xu(e){const[t,n]=us(e.fieldName),r=e.fullwidth??!0;return S(dn,{fullWidth:r,id:e.fieldName,label:e.title,variant:"standard",error:n.touched&&!!n.error,helperText:n.touched&&n.error,...t,...e.fieldProps})}const ewt=e=>{const{t}=je(),n=Nw(e.routineId),r=[{value:"normal",label:t("routines.set.normalSet")},{value:"dropset",label:t("routines.set.dropSet")},{value:"myo",label:t("routines.set.myo")},{value:"partial",label:t("routines.set.partial")},{value:"forced",label:t("routines.set.forced")},{value:"tut",label:t("routines.set.tut")},{value:"iso",label:t("routines.set.iso")},{value:"jump",label:t("routines.set.jump")}],o=i=>{n.mutate({id:e.slotEntry.id,type:i})};return S(Tt,{children:S(dn,{fullWidth:!0,select:!0,label:t("routines.set.type"),variant:"standard",value:e.slotEntry.type,disabled:n.isPending,onChange:i=>o(i.target.value),children:r.map(i=>S(Jt,{value:i.value,children:i.label},i.value))})})},twt=e=>{var a;const{t}=je(),n=Nw(e.routineId),r=hst();if(r.isLoading)return S(gh,{});const o=(a=r.data)==null?void 0:a.map(s=>({value:s.id,label:s.name})),i=s=>{n.mutate({id:e.slotEntry.id,repetition_unit:parseInt(s)})};return S(Tt,{children:S(dn,{fullWidth:!0,select:!0,label:t("unit"),variant:"standard",value:e.slotEntry.repetitionUnitId,disabled:n.isPending,onChange:s=>i(s.target.value),children:o.map(s=>S(Jt,{value:s.value,children:s.label},s.value))})})},nwt=e=>{var s;const{t}=je(),n=Nw(e.routineId),r=pst(),o=Ra();if(r.isLoading||o.isLoading)return S(gh,{});const i=(s=r.data)==null?void 0:s.map(l=>({value:l.id,label:l.name})),a=l=>{n.mutate({id:e.slotEntry.id,weight_unit:parseInt(l)})};return S(Tt,{children:S(dn,{fullWidth:!0,select:!0,label:t("unit"),variant:"standard",value:e.slotEntry.weightUnitId,disabled:n.isPending,onChange:l=>a(l.target.value),children:i.map(l=>S(Jt,{value:l.value,children:l.label},l.value))})})};function rwt(e,t){let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>e(...r),t)}}const RO=e=>{const{t}=je(),n=Nw(e.routineId),r=NSt(),[o,i]=x.useState(e.initialValue===null?"":e.initialValue),a=x.useCallback(rwt(l=>{let c=parseFloat(l);Number.isNaN(c)&&(c=null);const u=e.rounding==="weight"?{weight_rounding:c}:{reps_rounding:c};e.editProfile?r.mutate(u):n.mutate({id:e.entryId,...u})},$re),[]),s=l=>{i(l),a(l)};return S(dn,{fullWidth:!0,label:e.rounding==="weight"?t("weight"):t("routines.reps"),variant:"standard",value:o,disabled:n.isPending||r.isPending,onChange:l=>s(l.target.value)})},mH=({routine:e,closeFn:t})=>{const[n,r]=je(),o=Mat(),i=Kue(e==null?void 0:e.id),a=id(),[s,l]=x.useState(e?xt.fromJSDate(e.start):xt.now()),[c,u]=x.useState(e?xt.fromJSDate(e.end):xt.now().plus({weeks:F$e})),f=c.diff(s,["weeks","days"]),h=Math.floor(f.weeks),m=Math.floor(f.days),g=Wo({name:Ho().required().max(Hq,n("forms.maxLength",{chars:Hq})).min(Vq,n("forms.minLength",{chars:Vq})),description:Ho().max(Uq,n("forms.maxLength",{chars:Uq})),start:Xs().required(),end:Xs().required().min(AP("start"),n("forms.endBeforeStart")).test("hasMinimumDuration",n("routines.minLengthRoutine",{number:Gq}),function(y){const v=this.parent.start;if(v&&y){const w=xt.fromJSDate(v);return xt.fromJSDate(y).diff(w,"weeks").weeks>=Gq}return!0}).test("hasMaximumDuration",n("routines.maxLengthRoutine",{number:qq}),function(y){const v=this.parent.start;if(v&&y){const w=xt.fromJSDate(v);return xt.fromJSDate(y).diff(w,"weeks").weeks<=qq}return!0}),fitInWeek:Lu()});return S(Ti,{initialValues:{name:e?e.name:"",description:e?e.description:"",start:s,end:c,fitInWeek:e?e.fitInWeek:!0},validationSchema:g,onSubmit:async y=>{var v,w,C,E;if(e)i.mutate({...y,fit_in_week:y.fitInWeek,start:(v=y.start)==null?void 0:v.toISODate(),end:(w=y.end)==null?void 0:w.toISODate(),id:e.id});else{const I=await o.mutateAsync({...y,fit_in_week:y.fitInWeek,start:(C=y.start)==null?void 0:C.toISODate(),end:(E=y.end)==null?void 0:E.toISODate()});a(cn(Qt.ROUTINE_EDIT,r.language,{id:I.id})),t&&t()}},children:y=>S(fi,{children:Q(me,{container:!0,spacing:2,children:[S(me,{size:{xs:12,sm:5},children:S(Xu,{fieldName:"name",title:n("name")})}),S(me,{size:{xs:6,sm:3},children:S(Ys,{dateAdapter:zl,adapterLocale:r.language,children:S(Ih,{defaultValue:xt.now(),label:n("start"),value:s,onChange:v=>{v&&(y.setFieldValue("start",v),l(v))},slotProps:{textField:{variant:"standard",fullWidth:!0,error:y.touched.start&&!!y.errors.start,helperText:y.touched.start&&y.errors.start?String(y.errors.start):""}}})})}),S(me,{size:{xs:6,sm:3},children:S(Ys,{dateAdapter:zl,adapterLocale:r.language,children:S(Ih,{defaultValue:xt.now(),label:n("end"),value:c,onChange:v=>{v&&(y.setFieldValue("end",v),u(v))},slotProps:{textField:{variant:"standard",fullWidth:!0,error:y.touched.end&&!!y.errors.end,helperText:y.touched.end&&y.errors.end?String(y.errors.end):""}}})})}),S(me,{size:{xs:12,sm:1},sx:{display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center"},children:m===0?n("durationWeeks",{number:h}):n("durationWeeksDays",{nrWeeks:h,nrDays:m})}),S(me,{size:12,children:S(Xu,{fieldName:"description",title:n("description"),fieldProps:{multiline:!0,rows:4}})}),Q(me,{size:12,children:[S(os,{control:S(qo,{checked:y.values.fitInWeek,...y.getFieldProps("fitInWeek")}),label:n("routines.fitDaysInWeek")}),S(Go,{title:n("routines.fitDaysInWeekHelpText"),children:S(pn,{size:"small",children:S(IS,{fontSize:"inherit"})})})]}),S(me,{size:12,children:S(ct,{disabled:y.isSubmitting,color:"primary",variant:"contained",type:"submit",sx:{mt:2},children:n("save")})})]})})})},owt=e=>{const t=Ra(),{t:n}=je(),[r,o]=J.useState(null),i=!!r,a=l=>{o(l.currentTarget)},s=()=>{o(null)};return Q(Ft,{direction:"row",children:[S(ct,{variant:"text",id:"basic-button","aria-controls":i?"basic-menu":void 0,"aria-haspopup":"true","aria-expanded":i?"true":void 0,onClick:a,children:n("routines.defaultRounding")}),Q(ss,{id:"basic-menu",anchorEl:r,open:i,onClose:s,MenuListProps:{"aria-labelledby":"basic-button"},children:[S(Jt,{children:S(RO,{routineId:e.routineId,rounding:"weight",editProfile:!0,initialValue:t.data.weightRounding})}),S(Jt,{children:S(RO,{routineId:e.routineId,rounding:"reps",editProfile:!0,initialValue:t.data.repetitionsRounding})})]}),S(Go,{title:n("routines.roundingHelp"),children:S(pn,{onClick:()=>{},children:S(IS,{fontSize:"small"})})})]})},iwt=()=>S(me,{container:!0,children:S(me,{size:6,offset:3,children:S(mH,{})})}),awt=e=>{const{t}=je(),n=Kue(e.routine.id),[r,o]=x.useState(e.routine.isTemplate),[i,a]=x.useState(e.routine.isPublic),s=u=>{const f=u&&i;o(u),a(f),c(u,f)},l=u=>{const f=u&&r;a(f),c(r,f)},c=(u,f)=>{n.mutate({id:e.routine.id,is_template:u,is_public:f})};return Q(me,{container:!0,spacing:2,children:[S(me,{size:12,children:Q(Ft,{children:[S(os,{disabled:n.isPending,control:S(qo,{checked:r,onChange:async()=>s(!r)}),label:t("routines.template")}),S(at,{variant:"caption",children:t("routines.templatesHelpText")})]})}),S(me,{size:12,children:Q(Ft,{children:[S(os,{disabled:n.isPending||!r,control:S(qo,{checked:i,onChange:async()=>l(!i)}),label:t("routines.publicTemplate")}),S(at,{variant:"caption",children:t("routines.publicTemplateHelpText")})]})})]})},swt=e=>{const t=id(),n=Rat(e.routine.id),[r,o]=je(),[i,a]=x.useState(null),[s,l]=x.useState(0),c=!!i,u=w=>{a(w.currentTarget)},f=()=>{l(1),y()},h=()=>{l(2),y()},m=async()=>{await n.mutateAsync(),t(cn(Qt.ROUTINE_OVERVIEW,o.language))},g=()=>{l(0)},y=()=>{a(null)},v=()=>window.location.href=cn(Qt.ROUTINE_EDIT,o.language,{id:e.routine.id});return Q("div",{children:[S(ct,{onClick:u,children:S(kV,{})}),Q(ss,{anchorEl:i,open:c,onClose:y,MenuListProps:{"aria-labelledby":"basic-button"},children:[S(Jt,{disabled:e.routine.isTemplate,onClick:v,children:r("edit")}),S(Jt,{component:Ro,to:cn(Qt.ROUTINE_DETAIL_TABLE,o.language,{id:e.routine.id}),children:"Table view"}),S(Jt,{component:Ro,to:cn(Qt.ROUTINE_LOGS_OVERVIEW,o.language,{id:e.routine.id}),children:r("routines.logsOverview")}),S(Jt,{component:Ro,to:cn(Qt.ROUTINE_STATS_OVERVIEW,o.language,{id:e.routine.id}),children:r("routines.statsOverview")}),S(Jt,{component:"a",href:cn(Qt.ROUTINE_COPY,o.language,{id:e.routine.id}),children:r("routines.duplicate")}),S(Jt,{onClick:h,children:r("routines.markAsTemplate")}),S(Jt,{component:"a",href:cn(Qt.ROUTINE_PDF_TABLE,o.language,{id:e.routine.id}),download:`Routine-${e.routine.id}-table.pdf`,children:r("routines.downloadPdfTable")}),S(Jt,{component:"a",href:cn(Qt.ROUTINE_PDF_LOGS,o.language,{id:e.routine.id}),download:`Routine-${e.routine.id}-logs.pdf`,children:r("routines.downloadPdfLogs")}),S(Jt,{component:"a",href:cn(Qt.ROUTINE_ICAL,o.language,{id:e.routine.id}),download:`Routine-${e.routine.id}-calendar.ics`,children:r("routines.downloadIcal")}),S(ji,{}),S(Jt,{onClick:f,children:r("delete")})]}),Q(Ix,{open:s===1,onClose:g,children:[S(ZE,{id:"alert-dialog-title",children:r("delete")}),S(Ax,{children:S(r6,{id:"alert-dialog-description",children:r("deleteConfirmation",{name:e.routine.name})})}),Q(Px,{children:[S(ct,{onClick:g,children:r("cancel")}),S(ct,{onClick:m,color:"error",autoFocus:!0,children:r("delete")})]})]}),Q(Ix,{open:s===2,onClose:g,children:[S(ZE,{children:r("routines.markAsTemplate")}),S(Ax,{children:S(r6,{children:S(awt,{routine:e.routine})})}),S(Px,{children:S(ct,{onClick:g,children:r("close")})})]})]})},lwt=()=>{const{t:e}=je(),t=Ma(),n=parseInt(t.routineId??"");if(Number.isNaN(n))return S("p",{children:"Please pass an integer as the routine id."});const r=Kc(n),o=r.data,i=`${o==null?void 0:o.start.toLocaleDateString()} - ${o==null?void 0:o.end.toLocaleDateString()} (${o==null?void 0:o.durationText})`,a=o!=null&&o.isTemplate?S(Wl,{color:"info",size:"small",label:e("routines.template")}):null;return S(RP,{query:r,child:r.isSuccess&&S(ds,{title:Q(Tt,{children:[o.name," ",a]}),subTitle:i,optionsMenu:S(swt,{routine:r.data}),mainContent:Q(Ft,{spacing:2,children:[o.description!==""&&S(at,{variant:"body2",sx:{whiteSpace:"pre-line"},children:o==null?void 0:o.description}),o.dayDataCurrentIteration.filter(s=>s.day!==null).map((s,l)=>S(BV,{routineId:n,dayData:s},l))]}),sideBar:Q(Ft,{children:[S(Zt,{height:40}),Q(me,{container:!0,children:[S(me,{size:6,children:S(Ql,{primaryMuscles:o.mainMuscles.filter(s=>s.isFront),secondaryMuscles:o.secondaryMuscles.filter(s=>s.isFront),isFront:!0})}),S(me,{size:6,children:S(Ql,{primaryMuscles:o.mainMuscles.filter(s=>!s.isFront),secondaryMuscles:o.secondaryMuscles.filter(s=>!s.isFront),isFront:!1})})]})]})})})},P$="RoutineDetailsTable",Tu={stickyColumn:`${P$}-stickyColumn`,stickyHeader:`${P$}-stickyHeader`,whiteBg:`${P$}-whiteBg`},cwt=ae(Uu)({[`& .${Tu.stickyColumn}`]:{position:"sticky",left:0,zIndex:1},[`& .${Tu.stickyHeader}`]:{position:"sticky",top:0,zIndex:2,background:"white"},[`& .${Tu.whiteBg}`]:{backgroundColor:"white"}}),uwt=()=>{const{t:e,i18n:t}=je(),n=Ma(),r=n.routineId?parseInt(n.routineId):0,o=Kc(r),i=Wue(r),[a,s]=J.useState(!1);return S(RP,{query:o,child:o.isSuccess&&S(Vw,{title:o.data.name,backToUrl:cn(Qt.ROUTINE_DETAIL,t.language,{id:r}),maxWidth:!1,children:Q(Ft,{children:[S(os,{control:S(qo,{checked:a,onChange:(l,c)=>s(c)}),label:e("routines.alsoShowLogs")}),S(Mpe,{routine:o.data,showLogs:a,logData:i.data})]})})})};function dwt(e,t,n){return e==null?null:t!=null&&n!==null&&n!==void 0?e<t?"lower":e>n?"higher":"match":t!=null?e<t?"lower":e>t?"higher":"match":null}const Mpe=e=>{const{t,i18n:n}=je(),r=Lr(),o=Yc(),i=e.showLogs??!1,a=e.logData??[];let s;o.isSuccess&&(s=Gu(n.language,o.data));const l={};for(const v of a)for(const w of v.logs)w.iteration!==null&&(l[w.iteration]||(l[w.iteration]=[]),l[w.iteration].push(w));const c=Object.keys(e.routine.groupedDayDataByIteration).map(v=>parseInt(v));function u(){return S(ln,{children:c.map(v=>{const w=v===1?S(ke,{className:Tu.stickyColumn}):null;return Q(J.Fragment,{children:[w,S(ke,{align:"center",children:t("routines.sets")}),S(ke,{align:"center",sx:{minWidth:40},children:t("routines.reps")}),S(ke,{align:"center",sx:{minWidth:40},children:t("weight")}),S(ke,{align:"center",sx:{minWidth:60},children:t("routines.restTime")}),S(ke,{align:"center",sx:{minWidth:40},children:t("routines.rir")})]},`header-${v}`)})})}function f(){return S(ln,{children:c.map(v=>{const w=v===1?S(ke,{className:Tu.stickyColumn}):null;return Q(J.Fragment,{children:[w,S(ke,{colSpan:5,children:S(at,{variant:"h6",children:t("routines.weekNr",{number:v})})})]},`header-iteration-${v}`)})})}function h(v,w){var I;const C={borderBottomWidth:i?0:null,minWidth:40};function E(O,P,R){return Q(Tt,{children:[O===null||P===null?"-/-":P,O!==null&&R!==null&&Q(Tt,{children:[" - ",R]})]})}return Q(ln,{children:[S(ke,{className:Tu.stickyColumn,sx:{minWidth:150,backgroundColor:"white",borderBottomWidth:i?0:null},children:(I=v.exercise)==null?void 0:I.getTranslation(s).name}),c.map(O=>{const P=e.routine.getSetConfigData(w.id,O,v.id);return Q(J.Fragment,{children:[S(ke,{align:"center",sx:C,children:E(P,P==null?void 0:P.nrOfSets,P==null?void 0:P.maxNrOfSets)}),S(ke,{align:"center",sx:C,children:E(P,P==null?void 0:P.repetitions,P==null?void 0:P.maxRepetitions)}),S(ke,{align:"center",sx:C,children:E(P,P==null?void 0:P.weight,P==null?void 0:P.maxWeight)}),S(ke,{align:"center",sx:C,children:E(P,P==null?void 0:P.restTime,P==null?void 0:P.maxRestTime)}),S(ke,{align:"center",sx:C,children:E(P,P==null?void 0:P.rir,P==null?void 0:P.maxRir)})]},O)})]})}function m(v,w,C,E){const I=dwt(v,w,C);v===105&&console.log(v,w,C,E,I);const O=17;return E=E??!0,I===null?null:I==="lower"?S(Zst,{sx:{fontSize:O},color:E?"error":"success"}):I==="higher"?S(qst,{sx:{fontSize:O},color:E?"success":"error"}):S(Bst,{sx:{fontSize:O},color:"success"})}function g(v,w){return Q(ln,{children:[S(ke,{sx:{verticalAlign:"top",backgroundColor:"white"},className:Tu.stickyColumn,children:S("small",{children:t("nutrition.logged")})}),c.map(C=>{const E=e.routine.getSetConfigData(w.id,C,v.id),O=(l[C]??[]).filter(P=>P.slotEntryId===v.id);return Q(J.Fragment,{children:[S(ke,{align:"center",sx:{verticalAlign:"top"}}),S(ke,{align:"center",sx:{verticalAlign:"top"},children:O.map((P,R)=>S(Ft,{children:Q("span",{children:[P.repetitions??"-/-",m(P.repetitions,E==null?void 0:E.repetitions,E==null?void 0:E.maxRepetitions)]})},R))}),S(ke,{align:"center",sx:{verticalAlign:"top"},children:O.map((P,R)=>S(Ft,{children:Q("span",{children:[P.weight??"-/-",m(P.weight,E==null?void 0:E.weight,E==null?void 0:E.maxWeight)]})},R))}),S(ke,{align:"center",sx:{verticalAlign:"top"},children:O.map((P,R)=>S(Ft,{children:Q("span",{children:[P.restTime??"-/-",m(P.restTime,E==null?void 0:E.restTime,E==null?void 0:E.maxRestTime)]})},R))}),S(ke,{align:"center",sx:{verticalAlign:"top"},children:O.map((P,R)=>S(Ft,{children:Q("span",{children:[P.rir??"-/-",m(P.rir,E==null?void 0:E.rir,E==null?void 0:E.maxRir,!1)]})},R))})]},C)})]})}function y(){return S(Tt,{children:e.routine.days.map(v=>Q(J.Fragment,{children:[Q(ln,{children:[S(ke,{sx:{backgroundColor:r.palette.action.hover},className:Tu.stickyColumn,children:S("b",{children:v.getDisplayName()})}),S(ke,{sx:{backgroundColor:r.palette.action.hover},colSpan:5*c.length})]}),v.slots.map((w,C)=>S(J.Fragment,{children:w.entries.map((E,I)=>Q(J.Fragment,{children:[h(E,v),i&&g(E,v)]},I))},C))]},v.id))})}return S(cwt,{maxWidth:!1,sx:{overflowX:"scroll",display:"flex",height:"80vh"},children:S(Fc,{children:Q(Nc,{size:"small",children:[Q(Ff,{className:Tu.stickyHeader,children:[f(),u()]}),S(Lc,{children:y()})]})})})};function Ki(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var fwt=typeof Symbol=="function"&&Symbol.observable||"@@observable",MZ=fwt,RZ=()=>Math.random().toString(36).substring(7).split("").join("."),pwt={INIT:`@@redux/INIT${RZ()}`,REPLACE:`@@redux/REPLACE${RZ()}`},DZ=pwt;function hwt(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function Rpe(e,t,n){if(typeof e!="function")throw new Error(Ki(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Ki(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Ki(1));return n(Rpe)(e,t)}let r=e,o=t,i=new Map,a=i,s=0,l=!1;function c(){a===i&&(a=new Map,i.forEach((v,w)=>{a.set(w,v)}))}function u(){if(l)throw new Error(Ki(3));return o}function f(v){if(typeof v!="function")throw new Error(Ki(4));if(l)throw new Error(Ki(5));let w=!0;c();const C=s++;return a.set(C,v),function(){if(w){if(l)throw new Error(Ki(6));w=!1,c(),a.delete(C),i=null}}}function h(v){if(!hwt(v))throw new Error(Ki(7));if(typeof v.type>"u")throw new Error(Ki(8));if(typeof v.type!="string")throw new Error(Ki(17));if(l)throw new Error(Ki(9));try{l=!0,o=r(o,v)}finally{l=!1}return(i=a).forEach(C=>{C()}),v}function m(v){if(typeof v!="function")throw new Error(Ki(10));r=v,h({type:DZ.REPLACE})}function g(){const v=f;return{subscribe(w){if(typeof w!="object"||w===null)throw new Error(Ki(11));function C(){const I=w;I.next&&I.next(u())}return C(),{unsubscribe:v(C)}},[MZ](){return this}}}return h({type:DZ.INIT}),{dispatch:h,subscribe:f,getState:u,replaceReducer:m,[MZ]:g}}function kZ(e,t){return function(...n){return t(e.apply(this,n))}}function _Z(e,t){if(typeof e=="function")return kZ(e,t);if(typeof e!="object"||e===null)throw new Error(Ki(16));const n={};for(const r in e){const o=e[r];typeof o=="function"&&(n[r]=kZ(o,t))}return n}function Dpe(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function mwt(...e){return t=>(n,r)=>{const o=t(n,r);let i=()=>{throw new Error(Ki(15))};const a={getState:o.getState,dispatch:(l,...c)=>i(l,...c)},s=e.map(l=>l(a));return i=Dpe(...s)(o.dispatch),{...o,dispatch:i}}}var A$={exports:{}},M$={};/**
* @license React
* use-sync-external-store-with-selector.production.js
*
@@ -534,4 +534,4 @@ ${ce.current.stack}
-ms-user-select: none;
overflow-anchor: none;
`}}];return{always:T0(a,"always"),resting:T0(a,"resting"),dragging:T0(a,"dragging"),dropAnimating:T0(a,"dropAnimating"),userCancel:T0(a,"userCancel")}};const ts=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?x.useLayoutEffect:x.useEffect,j$=()=>{const e=document.querySelector("head");return e||Et(),e},aee=e=>{const t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.type="text/css",t};function BEt(e,t){const n=Kn(()=>jEt(e),[e]),r=x.useRef(null),o=x.useRef(null),i=Wt(li(f=>{const h=o.current;h||Et(),h.textContent=f}),[]),a=Wt(f=>{const h=r.current;h||Et(),h.textContent=f},[]);ts(()=>{!r.current&&!o.current||Et();const f=aee(t),h=aee(t);return r.current=f,o.current=h,f.setAttribute(`${Zy}-always`,e),h.setAttribute(`${Zy}-dynamic`,e),j$().appendChild(f),j$().appendChild(h),a(n.always),i(n.resting),()=>{const m=g=>{const y=g.current;y||Et(),j$().removeChild(y),g.current=null};m(r),m(o)}},[t,a,i,n.always,n.resting,e]);const s=Wt(()=>i(n.dragging),[i,n.dragging]),l=Wt(f=>{if(f==="DROP"){i(n.dropAnimating);return}i(n.userCancel)},[i,n.dropAnimating,n.userCancel]),c=Wt(()=>{o.current&&i(n.resting)},[i,n.resting]);return Kn(()=>({dragging:s,dropping:l,resting:c}),[s,l,c])}function Ehe(e,t){return Array.from(e.querySelectorAll(t))}var The=e=>e&&e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView:window;function nA(e){return e instanceof The(e).HTMLElement}function zEt(e,t){const n=`[${ev.contextId}="${e}"]`,r=Ehe(document,n);if(!r.length)return null;const o=r.find(i=>i.getAttribute(ev.draggableId)===t);return!o||!nA(o)?null:o}function VEt(e){const t=x.useRef({}),n=x.useRef(null),r=x.useRef(null),o=x.useRef(!1),i=Wt(function(h,m){const g={id:h,focus:m};return t.current[h]=g,function(){const v=t.current;v[h]!==g&&delete v[h]}},[]),a=Wt(function(h){const m=zEt(e,h);m&&m!==document.activeElement&&m.focus()},[e]),s=Wt(function(h,m){n.current===h&&(n.current=m)},[]),l=Wt(function(){r.current||o.current&&(r.current=requestAnimationFrame(()=>{r.current=null;const h=n.current;h&&a(h)}))},[a]),c=Wt(function(h){n.current=null;const m=document.activeElement;m&&m.getAttribute(ev.draggableId)===h&&(n.current=h)},[]);return ts(()=>(o.current=!0,function(){o.current=!1;const h=r.current;h&&cancelAnimationFrame(h)}),[]),Kn(()=>({register:i,tryRecordFocus:c,tryRestoreFocusRecorded:l,tryShiftRecord:s}),[i,c,l,s])}function HEt(){const e={draggables:{},droppables:{}},t=[];function n(f){return t.push(f),function(){const m=t.indexOf(f);m!==-1&&t.splice(m,1)}}function r(f){t.length&&t.forEach(h=>h(f))}function o(f){return e.draggables[f]||null}function i(f){const h=o(f);return h||Et(),h}const a={register:f=>{e.draggables[f.descriptor.id]=f,r({type:"ADDITION",value:f})},update:(f,h)=>{const m=e.draggables[h.descriptor.id];m&&m.uniqueId===f.uniqueId&&(delete e.draggables[h.descriptor.id],e.draggables[f.descriptor.id]=f)},unregister:f=>{const h=f.descriptor.id,m=o(h);m&&f.uniqueId===m.uniqueId&&(delete e.draggables[h],e.droppables[f.descriptor.droppableId]&&r({type:"REMOVAL",value:f}))},getById:i,findById:o,exists:f=>!!o(f),getAllByType:f=>Object.values(e.draggables).filter(h=>h.descriptor.type===f)};function s(f){return e.droppables[f]||null}function l(f){const h=s(f);return h||Et(),h}const c={register:f=>{e.droppables[f.descriptor.id]=f},unregister:f=>{const h=s(f.descriptor.id);h&&f.uniqueId===h.uniqueId&&delete e.droppables[f.descriptor.id]},getById:l,findById:s,exists:f=>!!s(f),getAllByType:f=>Object.values(e.droppables).filter(h=>h.descriptor.type===f)};function u(){e.draggables={},e.droppables={},t.length=0}return{draggable:a,droppable:c,subscribe:n,clean:u}}function UEt(){const e=Kn(HEt,[]);return x.useEffect(()=>function(){e.clean()},[e]),e}var _H=J.createContext(null),FO=()=>{const e=document.body;return e||Et(),e};const GEt={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},qEt=e=>`rfd-announcement-${e}`;function WEt(e){const t=Kn(()=>qEt(e),[e]),n=x.useRef(null);return x.useEffect(function(){const i=document.createElement("div");return n.current=i,i.id=t,i.setAttribute("aria-live","assertive"),i.setAttribute("aria-atomic","true"),z(i.style,GEt),FO().appendChild(i),function(){setTimeout(function(){const l=FO();l.contains(i)&&l.removeChild(i),i===n.current&&(n.current=null)})}},[t]),Wt(o=>{const i=n.current;if(i){i.textContent=o;return}},[])}const KEt={separator:"::"};function $H(e,t=KEt){const n=J.useId();return Kn(()=>`${e}${t.separator}${n}`,[t.separator,e,n])}function YEt({contextId:e,uniqueId:t}){return`rfd-hidden-text-${e}-${t}`}function QEt({contextId:e,text:t}){const n=$H("hidden-text",{separator:"-"}),r=Kn(()=>YEt({contextId:e,uniqueId:n}),[n,e]);return x.useEffect(function(){const i=document.createElement("div");return i.id=r,i.textContent=t,i.style.display="none",FO().appendChild(i),function(){const s=FO();s.contains(i)&&s.removeChild(i)}},[r,t]),r}var rA=J.createContext(null);function Ohe(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),t}function XEt(){let e=null;function t(){return!!e}function n(a){return a===e}function r(a){e&&Et();const s={abandon:a};return e=s,s}function o(){e||Et(),e=null}function i(){e&&(e.abandon(),o())}return{isClaimed:t,isActive:n,claim:r,release:o,tryAbandon:i}}function BS(e){return e.phase==="IDLE"||e.phase==="DROP_ANIMATING"?!1:e.isDragging}const JEt=9,ZEt=13,NH=27,Ihe=32,eTt=33,tTt=34,nTt=35,rTt=36,oTt=37,iTt=38,aTt=39,sTt=40,lTt={[ZEt]:!0,[JEt]:!0};var Phe=e=>{lTt[e.keyCode]&&e.preventDefault()};const oA=(()=>{const e="visibilitychange";return typeof document>"u"?e:[e,`ms${e}`,`webkit${e}`,`moz${e}`,`o${e}`].find(r=>`on${r}`in document)||e})(),Ahe=0,see=5;function cTt(e,t){return Math.abs(t.x-e.x)>=see||Math.abs(t.y-e.y)>=see}const lee={type:"IDLE"};function uTt({cancel:e,completed:t,getPhase:n,setPhase:r}){return[{eventName:"mousemove",fn:o=>{const{button:i,clientX:a,clientY:s}=o;if(i!==Ahe)return;const l={x:a,y:s},c=n();if(c.type==="DRAGGING"){o.preventDefault(),c.actions.move(l);return}c.type!=="PENDING"&&Et();const u=c.point;if(!cTt(u,l))return;o.preventDefault();const f=c.actions.fluidLift(l);r({type:"DRAGGING",actions:f})}},{eventName:"mouseup",fn:o=>{const i=n();if(i.type!=="DRAGGING"){e();return}o.preventDefault(),i.actions.drop({shouldBlockNextClick:!0}),t()}},{eventName:"mousedown",fn:o=>{n().type==="DRAGGING"&&o.preventDefault(),e()}},{eventName:"keydown",fn:o=>{if(n().type==="PENDING"){e();return}if(o.keyCode===NH){o.preventDefault(),e();return}Phe(o)}},{eventName:"resize",fn:e},{eventName:"scroll",options:{passive:!0,capture:!1},fn:()=>{n().type==="PENDING"&&e()}},{eventName:"webkitmouseforcedown",fn:o=>{const i=n();if(i.type==="IDLE"&&Et(),i.actions.shouldRespectForcePress()){e();return}o.preventDefault()}},{eventName:oA,fn:e}]}function dTt(e){const t=x.useRef(lee),n=x.useRef(xf),r=Kn(()=>({eventName:"mousedown",fn:function(f){if(f.defaultPrevented||f.button!==Ahe||f.ctrlKey||f.metaKey||f.shiftKey||f.altKey)return;const h=e.findClosestDraggableId(f);if(!h)return;const m=e.tryGetLock(h,a,{sourceEvent:f});if(!m)return;f.preventDefault();const g={x:f.clientX,y:f.clientY};n.current(),c(m,g)}}),[e]),o=Kn(()=>({eventName:"webkitmouseforcewillbegin",fn:u=>{if(u.defaultPrevented)return;const f=e.findClosestDraggableId(u);if(!f)return;const h=e.findOptionsForDraggable(f);h&&(h.shouldRespectForcePress||e.canGetLock(f)&&u.preventDefault())}}),[e]),i=Wt(function(){const f={passive:!1,capture:!0};n.current=Gs(window,[o,r],f)},[o,r]),a=Wt(()=>{t.current.type!=="IDLE"&&(t.current=lee,n.current(),i())},[i]),s=Wt(()=>{const u=t.current;a(),u.type==="DRAGGING"&&u.actions.cancel({shouldBlockNextClick:!0}),u.type==="PENDING"&&u.actions.abort()},[a]),l=Wt(function(){const f={capture:!0,passive:!1},h=uTt({cancel:s,completed:a,getPhase:()=>t.current,setPhase:m=>{t.current=m}});n.current=Gs(window,h,f)},[s,a]),c=Wt(function(f,h){t.current.type!=="IDLE"&&Et(),t.current={type:"PENDING",point:h,actions:f},l()},[l]);ts(function(){return i(),function(){n.current()}},[i])}function fTt(){}const pTt={[tTt]:!0,[eTt]:!0,[rTt]:!0,[nTt]:!0};function hTt(e,t){function n(){t(),e.cancel()}function r(){t(),e.drop()}return[{eventName:"keydown",fn:o=>{if(o.keyCode===NH){o.preventDefault(),n();return}if(o.keyCode===Ihe){o.preventDefault(),r();return}if(o.keyCode===sTt){o.preventDefault(),e.moveDown();return}if(o.keyCode===iTt){o.preventDefault(),e.moveUp();return}if(o.keyCode===aTt){o.preventDefault(),e.moveRight();return}if(o.keyCode===oTt){o.preventDefault(),e.moveLeft();return}if(pTt[o.keyCode]){o.preventDefault();return}Phe(o)}},{eventName:"mousedown",fn:n},{eventName:"mouseup",fn:n},{eventName:"click",fn:n},{eventName:"touchstart",fn:n},{eventName:"resize",fn:n},{eventName:"wheel",fn:n,options:{passive:!0}},{eventName:oA,fn:n}]}function mTt(e){const t=x.useRef(fTt),n=Kn(()=>({eventName:"keydown",fn:function(i){if(i.defaultPrevented||i.keyCode!==Ihe)return;const a=e.findClosestDraggableId(i);if(!a)return;const s=e.tryGetLock(a,u,{sourceEvent:i});if(!s)return;i.preventDefault();let l=!0;const c=s.snapLift();t.current();function u(){l||Et(),l=!1,t.current(),r()}t.current=Gs(window,hTt(c,u),{capture:!0,passive:!1})}}),[e]),r=Wt(function(){const i={passive:!1,capture:!0};t.current=Gs(window,[n],i)},[n]);ts(function(){return r(),function(){t.current()}},[r])}const B$={type:"IDLE"},gTt=120,yTt=.15;function vTt({cancel:e,getPhase:t}){return[{eventName:"orientationchange",fn:e},{eventName:"resize",fn:e},{eventName:"contextmenu",fn:n=>{n.preventDefault()}},{eventName:"keydown",fn:n=>{if(t().type!=="DRAGGING"){e();return}n.keyCode===NH&&n.preventDefault(),e()}},{eventName:oA,fn:e}]}function bTt({cancel:e,completed:t,getPhase:n}){return[{eventName:"touchmove",options:{capture:!1},fn:r=>{const o=n();if(o.type!=="DRAGGING"){e();return}o.hasMoved=!0;const{clientX:i,clientY:a}=r.touches[0],s={x:i,y:a};r.preventDefault(),o.actions.move(s)}},{eventName:"touchend",fn:r=>{const o=n();if(o.type!=="DRAGGING"){e();return}r.preventDefault(),o.actions.drop({shouldBlockNextClick:!0}),t()}},{eventName:"touchcancel",fn:r=>{if(n().type!=="DRAGGING"){e();return}r.preventDefault(),e()}},{eventName:"touchforcechange",fn:r=>{const o=n();o.type==="IDLE"&&Et();const i=r.touches[0];if(!i||!(i.force>=yTt))return;const s=o.actions.shouldRespectForcePress();if(o.type==="PENDING"){s&&e();return}if(s){if(o.hasMoved){r.preventDefault();return}e();return}r.preventDefault()}},{eventName:oA,fn:e}]}function xTt(e){const t=x.useRef(B$),n=x.useRef(xf),r=Wt(function(){return t.current},[]),o=Wt(function(m){t.current=m},[]),i=Kn(()=>({eventName:"touchstart",fn:function(m){if(m.defaultPrevented)return;const g=e.findClosestDraggableId(m);if(!g)return;const y=e.tryGetLock(g,s,{sourceEvent:m});if(!y)return;const v=m.touches[0],{clientX:w,clientY:C}=v,E={x:w,y:C};n.current(),f(y,E)}}),[e]),a=Wt(function(){const m={capture:!0,passive:!1};n.current=Gs(window,[i],m)},[i]),s=Wt(()=>{const h=t.current;h.type!=="IDLE"&&(h.type==="PENDING"&&clearTimeout(h.longPressTimerId),o(B$),n.current(),a())},[a,o]),l=Wt(()=>{const h=t.current;s(),h.type==="DRAGGING"&&h.actions.cancel({shouldBlockNextClick:!0}),h.type==="PENDING"&&h.actions.abort()},[s]),c=Wt(function(){const m={capture:!0,passive:!1},g={cancel:l,completed:s,getPhase:r},y=Gs(window,bTt(g),m),v=Gs(window,vTt(g),m);n.current=function(){y(),v()}},[l,r,s]),u=Wt(function(){const m=r();m.type!=="PENDING"&&Et();const g=m.actions.fluidLift(m.point);o({type:"DRAGGING",actions:g,hasMoved:!1})},[r,o]),f=Wt(function(m,g){r().type!=="IDLE"&&Et();const y=setTimeout(u,gTt);o({type:"PENDING",point:g,actions:m,longPressTimerId:y}),c()},[c,r,o,u]);ts(function(){return a(),function(){n.current();const g=r();g.type==="PENDING"&&(clearTimeout(g.longPressTimerId),o(B$))}},[r,a,o]),ts(function(){return Gs(window,[{eventName:"touchmove",fn:()=>{},options:{capture:!1,passive:!1}}])},[])}const STt=["input","button","textarea","select","option","optgroup","video","audio"];function Mhe(e,t){if(t==null)return!1;if(STt.includes(t.tagName.toLowerCase()))return!0;const r=t.getAttribute("contenteditable");return r==="true"||r===""?!0:t===e?!1:Mhe(e,t.parentElement)}function wTt(e,t){const n=t.target;return nA(n)?Mhe(e,n):!1}var CTt=e=>Ll(e.getBoundingClientRect()).center;function ETt(e){return e instanceof The(e).Element}const TTt=(()=>{const e="matches";return typeof document>"u"?e:[e,"msMatchesSelector","webkitMatchesSelector"].find(r=>r in Element.prototype)||e})();function Rhe(e,t){return e==null?null:e[TTt](t)?e:Rhe(e.parentElement,t)}function OTt(e,t){return e.closest?e.closest(t):Rhe(e,t)}function ITt(e){return`[${ev.contextId}="${e}"]`}function PTt(e,t){const n=t.target;if(!ETt(n))return null;const r=ITt(e),o=OTt(n,r);return!o||!nA(o)?null:o}function ATt(e,t){const n=PTt(e,t);return n?n.getAttribute(ev.draggableId):null}function MTt(e,t){const n=`[${xj.contextId}="${e}"]`,o=Ehe(document,n).find(i=>i.getAttribute(xj.id)===t);return!o||!nA(o)?null:o}function RTt(e){e.preventDefault()}function aE({expected:e,phase:t,isLockActive:n,shouldWarn:r}){return!(!n()||e!==t)}function Dhe({lockAPI:e,store:t,registry:n,draggableId:r}){if(e.isClaimed())return!1;const o=n.draggable.findById(r);return!(!o||!o.options.isEnabled||!xhe(t.getState(),r))}function DTt({lockAPI:e,contextId:t,store:n,registry:r,draggableId:o,forceSensorStop:i,sourceEvent:a}){if(!Dhe({lockAPI:e,store:n,registry:r,draggableId:o}))return null;const l=r.draggable.getById(o),c=MTt(t,l.descriptor.id);if(!c||a&&!l.options.canDragInteractiveElements&&wTt(c,a))return null;const u=e.claim(i||xf);let f="PRE_DRAG";function h(){return l.options.shouldRespectForcePress}function m(){return e.isActive(u)}function g(O,P){aE({expected:O,phase:f,isLockActive:m,shouldWarn:!0})&&n.dispatch(P())}const y=g.bind(null,"DRAGGING");function v(O){function P(){e.release(),f="COMPLETED"}f!=="PRE_DRAG"&&(P(),Et()),n.dispatch(O1t(O.liftActionArgs)),f="DRAGGING";function R(D,M={shouldBlockNextClick:!1}){if(O.cleanup(),M.shouldBlockNextClick){const A=Gs(window,[{eventName:"click",fn:RTt,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(A)}P(),n.dispatch(fhe({reason:D}))}return{isActive:()=>aE({expected:"DRAGGING",phase:f,isLockActive:m,shouldWarn:!1}),shouldRespectForcePress:h,drop:D=>R("DROP",D),cancel:D=>R("CANCEL",D),...O.actions}}function w(O){const P=_S(D=>{y(()=>dhe({client:D}))});return{...v({liftActionArgs:{id:o,clientSelection:O,movementMode:"FLUID"},cleanup:()=>P.cancel(),actions:{move:P}}),move:P}}function C(){const O={moveUp:()=>y($1t),moveRight:()=>y(L1t),moveDown:()=>y(N1t),moveLeft:()=>y(F1t)};return v({liftActionArgs:{id:o,clientSelection:CTt(c),movementMode:"SNAP"},cleanup:xf,actions:O})}function E(){aE({expected:"PRE_DRAG",phase:f,isLockActive:m,shouldWarn:!0})&&e.release()}return{isActive:()=>aE({expected:"PRE_DRAG",phase:f,isLockActive:m,shouldWarn:!1}),shouldRespectForcePress:h,fluidLift:w,snapLift:C,abort:E}}const kTt=[dTt,mTt,xTt];function _Tt({contextId:e,store:t,registry:n,customSensors:r,enableDefaultSensors:o}){const i=[...o?kTt:[],...r||[]],a=x.useState(()=>XEt())[0],s=Wt(function(v,w){BS(v)&&!BS(w)&&a.tryAbandon()},[a]);ts(function(){let v=t.getState();return t.subscribe(()=>{const C=t.getState();s(v,C),v=C})},[a,t,s]),ts(()=>a.tryAbandon,[a.tryAbandon]);const l=Wt(y=>Dhe({lockAPI:a,registry:n,store:t,draggableId:y}),[a,n,t]),c=Wt((y,v,w)=>DTt({lockAPI:a,registry:n,contextId:e,store:t,draggableId:y,forceSensorStop:v||null,sourceEvent:w&&w.sourceEvent?w.sourceEvent:null}),[e,a,n,t]),u=Wt(y=>ATt(e,y),[e]),f=Wt(y=>{const v=n.draggable.findById(y);return v?v.options:null},[n.draggable]),h=Wt(function(){a.isClaimed()&&(a.tryAbandon(),t.getState().phase!=="IDLE"&&t.dispatch(IH()))},[a,t]),m=Wt(()=>a.isClaimed(),[a]),g=Kn(()=>({canGetLock:l,tryGetLock:c,findClosestDraggableId:u,findOptionsForDraggable:f,tryReleaseLock:h,isLockClaimed:m}),[l,c,u,f,h,m]);for(let y=0;y<i.length;y++)i[y](g)}const $Tt=e=>({onBeforeCapture:t=>{const n=()=>{e.onBeforeCapture&&e.onBeforeCapture(t)};ew.flushSync(n)},onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragEnd:e.onDragEnd,onDragUpdate:e.onDragUpdate}),NTt=e=>({...jS,...e.autoScrollerOptions,durationDampening:{...jS.durationDampening,...e.autoScrollerOptions}});function O0(e){return e.current||Et(),e.current}function LTt(e){const{contextId:t,setCallbacks:n,sensors:r,nonce:o,dragHandleUsageInstructions:i}=e,a=x.useRef(null),s=Ohe(e),l=Wt(()=>$Tt(s.current),[s]),c=Wt(()=>NTt(s.current),[s]),u=WEt(t),f=QEt({contextId:t,text:i}),h=BEt(t,o),m=Wt(A=>{O0(a).dispatch(A)},[]),g=Kn(()=>_Z({publishWhileDragging:P1t,updateDroppableScroll:M1t,updateDroppableIsEnabled:R1t,updateDroppableIsCombineEnabled:D1t,collectionStarting:A1t},m),[m]),y=UEt(),v=Kn(()=>vEt(y,g),[y,g]),w=Kn(()=>$Et({scrollWindow:bEt,scrollDroppable:v.scrollDroppable,getAutoScrollerOptions:c,..._Z({move:dhe},m)}),[v.scrollDroppable,m,c]),C=VEt(t),E=Kn(()=>hEt({announce:u,autoScroller:w,dimensionMarshal:v,focusMarshal:C,getResponders:l,styleMarshal:h}),[u,w,v,C,l,h]);a.current=E;const I=Wt(()=>{const A=O0(a);A.getState().phase!=="IDLE"&&A.dispatch(IH())},[]),O=Wt(()=>{const A=O0(a).getState();return A.phase==="DROP_ANIMATING"?!0:A.phase==="IDLE"?!1:A.isDragging},[]),P=Kn(()=>({isDragging:O,tryAbort:I}),[O,I]);n(P);const R=Wt(A=>xhe(O0(a).getState(),A),[]),D=Wt(()=>Rp(O0(a).getState()),[]),M=Kn(()=>({marshal:v,focus:C,contextId:t,canLift:R,isMovementAllowed:D,dragHandleUsageInstructionsId:f,registry:y}),[t,v,f,C,R,D,y]);return _Tt({contextId:t,store:E,registry:y,customSensors:r||null,enableDefaultSensors:e.enableDefaultSensors!==!1}),x.useEffect(()=>I,[I]),J.createElement(rA.Provider,{value:M},J.createElement(uCt,{context:_H,store:E},e.children))}function FTt(){return J.useId()}function khe(e){const t=FTt(),n=e.dragHandleUsageInstructions||LE.dragHandleUsageInstructions;return J.createElement(mCt,null,r=>J.createElement(LTt,{nonce:e.nonce,contextId:t,setCallbacks:r,dragHandleUsageInstructions:n,enableDefaultSensors:e.enableDefaultSensors,sensors:e.sensors,onBeforeCapture:e.onBeforeCapture,onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragUpdate:e.onDragUpdate,onDragEnd:e.onDragEnd,autoScrollerOptions:e.autoScrollerOptions},e.children))}const cee={dragging:5e3,dropAnimating:4500},jTt=(e,t)=>t?yx.drop(t.duration):e?yx.snap:yx.fluid,BTt=(e,t)=>{if(e)return t?FS.opacity.drop:FS.opacity.combining},zTt=e=>e.forceShouldAnimate!=null?e.forceShouldAnimate:e.mode==="SNAP";function VTt(e){const n=e.dimension.client,{offset:r,combineWith:o,dropping:i}=e,a=!!o,s=zTt(e),l=!!i,c=l?vj.drop(r,a):vj.moveTo(r);return{position:"fixed",top:n.marginBox.top,left:n.marginBox.left,boxSizing:"border-box",width:n.borderBox.width,height:n.borderBox.height,transition:jTt(s,i),transform:c,opacity:BTt(a,l),zIndex:l?cee.dropAnimating:cee.dragging,pointerEvents:"none"}}function HTt(e){return{transform:vj.moveTo(e.offset),transition:e.shouldAnimateDisplacement?void 0:"none"}}function UTt(e){return e.type==="DRAGGING"?VTt(e):HTt(e)}function GTt(e,t,n=ci){const r=window.getComputedStyle(t),o=t.getBoundingClientRect(),i=jpe(o,r),a=_O(i,n),s={client:i,tagName:t.tagName.toLowerCase(),display:r.display},l={x:i.marginBox.width,y:i.marginBox.height};return{descriptor:e,placeholder:s,displaceBy:l,client:i,page:a}}function qTt(e){const t=$H("draggable"),{descriptor:n,registry:r,getDraggableRef:o,canDragInteractiveElements:i,shouldRespectForcePress:a,isEnabled:s}=e,l=Kn(()=>({canDragInteractiveElements:i,shouldRespectForcePress:a,isEnabled:s}),[i,s,a]),c=Wt(m=>{const g=o();return g||Et(),GTt(n,g,m)},[n,o]),u=Kn(()=>({uniqueId:t,descriptor:n,options:l,getDimension:c}),[n,c,l,t]),f=x.useRef(u),h=x.useRef(!0);ts(()=>(r.draggable.register(f.current),()=>r.draggable.unregister(f.current)),[r.draggable]),ts(()=>{if(h.current){h.current=!1;return}const m=f.current;f.current=u,r.draggable.update(u,m)},[u,r.draggable])}var LH=J.createContext(null);function jO(e){const t=x.useContext(e);return t||Et(),t}function WTt(e){e.preventDefault()}const KTt=e=>{const t=x.useRef(null),n=Wt((P=null)=>{t.current=P},[]),r=Wt(()=>t.current,[]),{contextId:o,dragHandleUsageInstructionsId:i,registry:a}=jO(rA),{type:s,droppableId:l}=jO(LH),c=Kn(()=>({id:e.draggableId,index:e.index,type:s,droppableId:l}),[e.draggableId,e.index,s,l]),{children:u,draggableId:f,isEnabled:h,shouldRespectForcePress:m,canDragInteractiveElements:g,isClone:y,mapped:v,dropAnimationFinished:w}=e;if(!y){const P=Kn(()=>({descriptor:c,registry:a,getDraggableRef:r,canDragInteractiveElements:g,shouldRespectForcePress:m,isEnabled:h}),[c,a,r,g,m,h]);qTt(P)}const C=Kn(()=>h?{tabIndex:0,role:"button","aria-describedby":i,"data-rfd-drag-handle-draggable-id":f,"data-rfd-drag-handle-context-id":o,draggable:!1,onDragStart:WTt}:null,[o,i,f,h]),E=Wt(P=>{v.type==="DRAGGING"&&v.dropping&&P.propertyName==="transform"&&ew.flushSync(w)},[w,v]),I=Kn(()=>{const P=UTt(v),R=v.type==="DRAGGING"&&v.dropping?E:void 0;return{innerRef:n,draggableProps:{"data-rfd-draggable-context-id":o,"data-rfd-draggable-id":f,style:P,onTransitionEnd:R},dragHandleProps:C}},[o,C,f,v,E,n]),O=Kn(()=>({draggableId:c.id,type:c.type,source:{index:c.index,droppableId:c.droppableId}}),[c.droppableId,c.id,c.index,c.type]);return J.createElement(J.Fragment,null,u(I,v.snapshot,O))};var _he=(e,t)=>e===t,$he=e=>{const{combine:t,destination:n}=e;return n?n.droppableId:t?t.droppableId:null};const YTt=e=>e.combine?e.combine.draggableId:null,QTt=e=>e.at&&e.at.type==="COMBINE"?e.at.combine.draggableId:null;function XTt(){const e=li((o,i)=>({x:o,y:i})),t=li((o,i,a=null,s=null,l=null)=>({isDragging:!0,isClone:i,isDropAnimating:!!l,dropAnimation:l,mode:o,draggingOver:a,combineWith:s,combineTargetFor:null})),n=li((o,i,a,s,l=null,c=null,u=null)=>({mapped:{type:"DRAGGING",dropping:null,draggingOver:l,combineWith:c,mode:i,offset:o,dimension:a,forceShouldAnimate:u,snapshot:t(i,s,l,c,null)}}));return(o,i)=>{if(BS(o)){if(o.critical.draggable.id!==i.draggableId)return null;const a=o.current.client.offset,s=o.dimensions.draggables[i.draggableId],l=es(o.impact),c=QTt(o.impact),u=o.forceShouldAnimate;return n(e(a.x,a.y),o.movementMode,s,i.isClone,l,c,u)}if(o.phase==="DROP_ANIMATING"){const a=o.completed;if(a.result.draggableId!==i.draggableId)return null;const s=i.isClone,l=o.dimensions.draggables[i.draggableId],c=a.result,u=c.mode,f=$he(c),h=YTt(c),g={duration:o.dropDuration,curve:AH.drop,moveTo:o.newHomeClientOffset,opacity:h?FS.opacity.drop:null,scale:h?FS.scale.drop:null};return{mapped:{type:"DRAGGING",offset:o.newHomeClientOffset,dimension:l,dropping:g,draggingOver:f,combineWith:h,mode:u,forceShouldAnimate:null,snapshot:t(u,s,f,h,g)}}}return null}}function Nhe(e=null){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:e,combineWith:null}}const JTt={mapped:{type:"SECONDARY",offset:ci,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:Nhe(null)}};function ZTt(){const e=li((a,s)=>({x:a,y:s})),t=li(Nhe),n=li((a,s=null,l)=>({mapped:{type:"SECONDARY",offset:a,combineTargetFor:s,shouldAnimateDisplacement:l,snapshot:t(s)}})),r=a=>a?n(ci,a,!0):null,o=(a,s,l,c)=>{const u=l.displaced.visible[a],f=!!(c.inVirtualList&&c.effected[a]),h=ZP(l),m=h&&h.draggableId===a?s:null;if(!u){if(!f)return r(m);if(l.displaced.invisible[a])return null;const v=Wv(c.displacedBy.point),w=e(v.x,v.y);return n(w,m,!0)}if(f)return r(m);const g=l.displacedBy.point,y=e(g.x,g.y);return n(y,m,u.shouldAnimate)};return(a,s)=>{if(BS(a))return a.critical.draggable.id===s.draggableId?null:o(s.draggableId,a.critical.draggable.id,a.impact,a.afterCritical);if(a.phase==="DROP_ANIMATING"){const l=a.completed;return l.result.draggableId===s.draggableId?null:o(s.draggableId,l.result.draggableId,l.impact,l.afterCritical)}return null}}const eOt=()=>{const e=XTt(),t=ZTt();return(r,o)=>e(r,o)||t(r,o)||JTt},tOt={dropAnimationFinished:phe},nOt=Fpe(eOt,tOt,null,{context:_H,areStatePropsEqual:_he})(KTt);function Lhe(e){return jO(LH).isUsingCloneFor===e.draggableId&&!e.isClone?null:J.createElement(nOt,e)}function Fhe(e){const t=typeof e.isDragDisabled=="boolean"?!e.isDragDisabled:!0,n=!!e.disableInteractiveElementBlocking,r=!!e.shouldRespectForcePress;return J.createElement(Lhe,z({},e,{isClone:!1,isEnabled:t,canDragInteractiveElements:n,shouldRespectForcePress:r}))}const jhe=e=>t=>e===t,rOt=jhe("scroll"),oOt=jhe("auto"),uee=(e,t)=>t(e.overflowX)||t(e.overflowY),iOt=e=>{const t=window.getComputedStyle(e),n={overflowX:t.overflowX,overflowY:t.overflowY};return uee(n,rOt)||uee(n,oOt)},aOt=()=>!1,Bhe=e=>e==null?null:e===document.body?aOt()?e:null:e===document.documentElement?null:iOt(e)?e:Bhe(e.parentElement);var Sj=e=>({x:e.scrollLeft,y:e.scrollTop});const zhe=e=>e?window.getComputedStyle(e).position==="fixed"?!0:zhe(e.parentElement):!1;var sOt=e=>{const t=Bhe(e),n=zhe(e);return{closestScrollable:t,isFixedOnPage:n}},lOt=({descriptor:e,isEnabled:t,isCombineEnabled:n,isFixedOnPage:r,direction:o,client:i,page:a,closest:s})=>{const l=(()=>{if(!s)return null;const{scrollSize:h,client:m}=s,g=yhe({scrollHeight:h.scrollHeight,scrollWidth:h.scrollWidth,height:m.paddingBox.height,width:m.paddingBox.width});return{pageMarginBox:s.page.marginBox,frameClient:m,scrollSize:h,shouldClipSubject:s.shouldClipSubject,scroll:{initial:s.scroll,current:s.scroll,max:g,diff:{value:ci,displacement:ci}}}})(),c=o==="vertical"?wH:Qpe,u=Jy({page:a,withPlaceholder:null,axis:c,frame:l});return{descriptor:e,isCombineEnabled:n,isFixedOnPage:r,axis:c,isEnabled:t,client:i,page:a,frame:l,subject:u}};const cOt=(e,t)=>{const n=Bpe(e);if(!t||e!==t)return n;const r=n.paddingBox.top-t.scrollTop,o=n.paddingBox.left-t.scrollLeft,i=r+t.scrollHeight,a=o+t.scrollWidth,l=vH({top:r,right:a,bottom:i,left:o},n.border);return bH({borderBox:l,margin:n.margin,border:n.border,padding:n.padding})};var uOt=({ref:e,descriptor:t,env:n,windowScroll:r,direction:o,isDropDisabled:i,isCombineEnabled:a,shouldClipSubject:s})=>{const l=n.closestScrollable,c=cOt(e,l),u=_O(c,r),f=(()=>{if(!l)return null;const m=Bpe(l),g={scrollHeight:l.scrollHeight,scrollWidth:l.scrollWidth};return{client:m,page:_O(m,r),scroll:Sj(l),scrollSize:g,shouldClipSubject:s}})();return lOt({descriptor:t,isEnabled:!i,isCombineEnabled:a,isFixedOnPage:n.isFixedOnPage,direction:o,client:c,page:u,closest:f})};const dOt={passive:!1},fOt={passive:!0};var dee=e=>e.shouldPublishImmediately?dOt:fOt;const sE=e=>e&&e.env.closestScrollable||null;function pOt(e){const t=x.useRef(null),n=jO(rA),r=$H("droppable"),{registry:o,marshal:i}=n,a=Ohe(e),s=Kn(()=>({id:e.droppableId,type:e.type,mode:e.mode}),[e.droppableId,e.mode,e.type]),l=x.useRef(s),c=Kn(()=>li((I,O)=>{t.current||Et();const P={x:I,y:O};i.updateDroppableScroll(s.id,P)}),[s.id,i]),u=Wt(()=>{const I=t.current;return!I||!I.env.closestScrollable?ci:Sj(I.env.closestScrollable)},[]),f=Wt(()=>{const I=u();c(I.x,I.y)},[u,c]),h=Kn(()=>_S(f),[f]),m=Wt(()=>{const I=t.current,O=sE(I);if(I&&O||Et(),I.scrollOptions.shouldPublishImmediately){f();return}h()},[h,f]),g=Wt((I,O)=>{t.current&&Et();const P=a.current,R=P.getDroppableRef();R||Et();const D=sOt(R),M={ref:R,descriptor:s,env:D,scrollOptions:O};t.current=M;const A=uOt({ref:R,descriptor:s,env:D,windowScroll:I,direction:P.direction,isDropDisabled:P.isDropDisabled,isCombineEnabled:P.isCombineEnabled,shouldClipSubject:!P.ignoreContainerClipping}),_=D.closestScrollable;return _&&(_.setAttribute(iee.contextId,n.contextId),_.addEventListener("scroll",m,dee(M.scrollOptions))),A},[n.contextId,s,m,a]),y=Wt(()=>{const I=t.current,O=sE(I);return I&&O||Et(),Sj(O)},[]),v=Wt(()=>{const I=t.current;I||Et();const O=sE(I);t.current=null,O&&(h.cancel(),O.removeAttribute(iee.contextId),O.removeEventListener("scroll",m,dee(I.scrollOptions)))},[m,h]),w=Wt(I=>{const O=t.current;O||Et();const P=sE(O);P||Et(),P.scrollTop+=I.y,P.scrollLeft+=I.x},[]),C=Kn(()=>({getDimensionAndWatchScroll:g,getScrollWhileDragging:y,dragStopped:v,scroll:w}),[v,g,y,w]),E=Kn(()=>({uniqueId:r,descriptor:s,callbacks:C}),[C,s,r]);ts(()=>(l.current=E.descriptor,o.droppable.register(E),()=>{t.current&&v(),o.droppable.unregister(E)}),[C,s,v,E,i,o.droppable]),ts(()=>{t.current&&i.updateDroppableIsEnabled(l.current.id,!e.isDropDisabled)},[e.isDropDisabled,i]),ts(()=>{t.current&&i.updateDroppableIsCombineEnabled(l.current.id,e.isCombineEnabled)},[e.isCombineEnabled,i])}function z$(){}const fee={width:0,height:0,margin:wCt},hOt=({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>e||n==="close"?fee:{height:t.client.borderBox.height,width:t.client.borderBox.width,margin:t.client.margin},mOt=({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>{const r=hOt({isAnimatingOpenOnMount:e,placeholder:t,animate:n});return{display:t.display,boxSizing:"border-box",width:r.width,height:r.height,marginTop:r.margin.top,marginRight:r.margin.right,marginBottom:r.margin.bottom,marginLeft:r.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:n!=="none"?yx.placeholder:null}},gOt=e=>{const t=x.useRef(null),n=Wt(()=>{t.current&&(clearTimeout(t.current),t.current=null)},[]),{animate:r,onTransitionEnd:o,onClose:i,contextId:a}=e,[s,l]=x.useState(e.animate==="open");x.useEffect(()=>s?r!=="open"?(n(),l(!1),z$):t.current?z$:(t.current=setTimeout(()=>{t.current=null,l(!1)}),n):z$,[r,s,n]);const c=Wt(f=>{f.propertyName==="height"&&(o(),r==="close"&&i())},[r,i,o]),u=mOt({isAnimatingOpenOnMount:s,animate:e.animate,placeholder:e.placeholder});return J.createElement(e.placeholder.tagName,{style:u,"data-rfd-placeholder-context-id":a,onTransitionEnd:c,ref:e.innerRef})};var yOt=J.memo(gOt);class vOt extends J.PureComponent{constructor(...t){super(...t),this.state={isVisible:!!this.props.on,data:this.props.on,animate:this.props.shouldAnimate&&this.props.on?"open":"none"},this.onClose=()=>{this.state.animate==="close"&&this.setState({isVisible:!1})}}static getDerivedStateFromProps(t,n){return t.shouldAnimate?t.on?{isVisible:!0,data:t.on,animate:"open"}:n.isVisible?{isVisible:!0,data:n.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:!!t.on,data:t.on,animate:"none"}}render(){if(!this.state.isVisible)return null;const t={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(t)}}const bOt=e=>{const t=x.useContext(rA);t||Et();const{contextId:n,isMovementAllowed:r}=t,o=x.useRef(null),i=x.useRef(null),{children:a,droppableId:s,type:l,mode:c,direction:u,ignoreContainerClipping:f,isDropDisabled:h,isCombineEnabled:m,snapshot:g,useClone:y,updateViewportMaxScroll:v,getContainerForClone:w}=e,C=Wt(()=>o.current,[]),E=Wt((_=null)=>{o.current=_},[]);Wt(()=>i.current,[]);const I=Wt((_=null)=>{i.current=_},[]),O=Wt(()=>{r()&&v({maxScroll:bhe()})},[r,v]);pOt({droppableId:s,type:l,mode:c,direction:u,isDropDisabled:h,isCombineEnabled:m,ignoreContainerClipping:f,getDroppableRef:C});const P=Kn(()=>J.createElement(vOt,{on:e.placeholder,shouldAnimate:e.shouldAnimatePlaceholder},({onClose:_,data:N,animate:B})=>J.createElement(yOt,{placeholder:N,onClose:_,innerRef:I,animate:B,contextId:n,onTransitionEnd:O})),[n,O,e.placeholder,e.shouldAnimatePlaceholder,I]),R=Kn(()=>({innerRef:E,placeholder:P,droppableProps:{"data-rfd-droppable-id":s,"data-rfd-droppable-context-id":n}}),[n,s,P,E]),D=y?y.dragging.draggableId:null,M=Kn(()=>({droppableId:s,type:l,isUsingCloneFor:D}),[s,D,l]);function A(){if(!y)return null;const{dragging:_,render:N}=y,B=J.createElement(Lhe,{draggableId:_.draggableId,index:_.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},(H,j)=>N(H,j,_));return D0.createPortal(B,w())}return J.createElement(LH.Provider,{value:M},a(R,g),A())};function xOt(){return document.body||Et(),document.body}const pee={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:xOt},Vhe=e=>{let t={...e},n;for(n in pee)e[n]===void 0&&(t={...t,[n]:pee[n]});return t},V$=(e,t)=>e===t.droppable.type,hee=(e,t)=>t.draggables[e.draggable.id],SOt=()=>{const e={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},t={...e,shouldAnimatePlaceholder:!1},n=li(i=>({draggableId:i.id,type:i.type,source:{index:i.index,droppableId:i.droppableId}})),r=li((i,a,s,l,c,u)=>{const f=c.descriptor.id;if(c.descriptor.droppableId===i){const g=u?{render:u,dragging:n(c.descriptor)}:null,y={isDraggingOver:s,draggingOverWith:s?f:null,draggingFromThisWith:f,isUsingPlaceholder:!0};return{placeholder:c.placeholder,shouldAnimatePlaceholder:!1,snapshot:y,useClone:g}}if(!a)return t;if(!l)return e;const m={isDraggingOver:s,draggingOverWith:f,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:c.placeholder,shouldAnimatePlaceholder:!0,snapshot:m,useClone:null}});return(i,a)=>{const s=Vhe(a),l=s.droppableId,c=s.type,u=!s.isDropDisabled,f=s.renderClone;if(BS(i)){const h=i.critical;if(!V$(c,h))return t;const m=hee(h,i.dimensions),g=es(i.impact)===l;return r(l,u,g,g,m,f)}if(i.phase==="DROP_ANIMATING"){const h=i.completed;if(!V$(c,h.critical))return t;const m=hee(h.critical,i.dimensions);return r(l,u,$he(h.result)===l,es(h.impact)===l,m,f)}if(i.phase==="IDLE"&&i.completed&&!i.shouldFlush){const h=i.completed;if(!V$(c,h.critical))return t;const m=es(h.impact)===l,g=!!(h.impact.at&&h.impact.at.type==="COMBINE"),y=h.critical.droppable.id===l;return m?g?e:t:y?e:t}return t}},wOt={updateViewportMaxScroll:_1t},Hhe=Fpe(SOt,wOt,(e,t,n)=>({...Vhe(n),...e,...t}),{context:_H,areStatePropsEqual:_he})(bOt);let mee=!1;const COt=()=>{mee||(console.warn(["MUI: The LoadingButton component functionality is now part of the Button component from Material UI.","","You should use `import Button from '@mui/material/Button'`","or `import { Button } from '@mui/material'`"].join(`
-`)),mee=!0)},EOt=x.forwardRef(function(t,n){return COt(),k.jsx(ct,{ref:n,...t})}),TOt=e=>{const{t}=je(),n=ost(e.routineId),r=sst(e.routineId),[o,i]=x.useState(!1),[a,s]=x.useState(!1),[l,c]=x.useState(e.day.isRest),u=()=>{l?(c(!1),I({isRest:!1})):s(!0)},f=()=>s(!1),h=()=>{I({isRest:!l}),c(!l),s(!1)},m=()=>i(!0),g=()=>{e.setSelectedDayIndex(null),r.mutate(e.day.id),i(!1)},y=()=>i(!1),v=3,w=20,C=1e3,E=Wo().shape({name:Ho().max(w,t("forms.maxLength",{chars:w})).min(v,t("forms.minLength",{chars:v})).required("Name is required"),description:Ho().max(C,t("forms.maxLength",{chars:C})),isRest:Lu(),needsLogsToAdvance:Lu()}),I=O=>n.mutate({id:e.day.id,routine:e.routineId,...O.name!==void 0&&{name:O.name},...O.description!==void 0&&{description:O.description},...O.isRest!==void 0&&{is_rest:l},...O.needsLogsToAdvance!==void 0&&{need_logs_to_advance:O.needsLogsToAdvance}});return S(Tt,{children:S(Ti,{initialValues:{name:e.day.name,description:e.day.description,isRest:e.day.isRest,needsLogsToAdvance:e.day.needLogsToAdvance},validationSchema:E,onSubmit:(O,{setSubmitting:P})=>{I(O),P(!1)},initialTouched:{name:!0,description:!0,isRest:!0,needsLogsToAdvance:!0},children:O=>Q(fi,{children:[Q(me,{container:!0,spacing:2,children:[S(me,{size:{xs:12,sm:6},children:S(Xu,{fieldName:"name",title:"Name",fieldProps:{disabled:l}})}),S(me,{size:{xs:6,sm:2},children:S(os,{control:S(qo,{checked:l,onChange:u}),label:t("routines.restDay")})}),Q(me,{size:{xs:6,sm:4},children:[S(os,{disabled:l,control:S(qo,{checked:O.values.needsLogsToAdvance,...O.getFieldProps("needsLogsToAdvance")}),label:t("routines.needsLogsToAdvance")}),S(Go,{title:t("routines.needsLogsToAdvanceHelpText"),children:S(pn,{onClick:()=>{},children:S(IS,{fontSize:"small"})})})]}),S(me,{size:12,children:S(Xu,{fieldName:"description",title:"Description",fieldProps:{multiline:!0,rows:4,disabled:l}})}),Q(me,{size:8,children:[n.isPending?S(EOt,{loading:!0,variant:"contained",color:"primary",children:t("save")}):S(ct,{variant:"contained",color:"primary",type:"submit",disabled:l,children:t("save")})," ",S(ct,{variant:"outlined",startIcon:S(MP,{}),onClick:m,disabled:n.isPending,children:t("delete")})]}),S(me,{size:4,sx:{display:"flex",justifyContent:"flex-end"},children:S(owt,{routineId:e.routineId})})]}),Q(Ix,{open:a,onClose:f,children:[S(ZE,{children:t("routines.confirmRestDay")}),S(Ax,{children:t("routines.confirmRestDayHelpText")}),Q(Px,{children:[S(ct,{onClick:f,children:t("cancel")}),S(ct,{onClick:h,children:t("continue")})]})]}),S(XP,{title:t("deleteConfirmation",{name:e.day.getDisplayName()}),message:t("routines.deleteDayConfirmation"),isOpen:o,closeFn:y,deleteFn:g})]})})})},OOt=e=>{const{t}=je(),n=gst(e.routineId),[r,o]=x.useState(e.slot.comment),[i,a]=x.useState(!1),s=c=>{a(!0),o(c)},l=()=>{i&&(n.mutate({id:e.slot.id,comment:r}),a(!1))};return S(Tt,{children:S(dn,{label:t("comment"),variant:"standard",fullWidth:!0,size:"small",value:r,disabled:n.isPending,onChange:c=>s(c.target.value),onBlur:l,InputProps:{endAdornment:n.isPending&&S(gh,{})}})})};function Uhe(e){const t=[];if(!e)return t;for(const n in e)Object.hasOwn(e,n)&&t.push(...e[n]);return t}function H$(e){const t=Uhe(e);return t.length>0?t.join(" | "):""}const IOt={weight:{edit:kat,add:_at,delete:$at},"max-weight":{edit:Nat,add:Lat,delete:Fat},reps:{edit:jat,add:Bat,delete:zat},"max-reps":{edit:Vat,add:YX,delete:Hat},sets:{edit:Uat,add:Gat,delete:qat},"max-sets":{edit:Wat,add:Kat,delete:YX},rest:{edit:Jat,add:Zat,delete:est},"max-rest":{edit:tst,add:nst,delete:rst},rir:{edit:Yue,add:Que,delete:Xue},"max-rir":{edit:Yat,add:Qat,delete:Xat}},gee=e=>{var P,R,D,M,A,_,N;const{t}=je(),{edit:n,add:r,delete:o}=IOt[e.type],i=n(e.routineId),a=r(e.routineId),s=o(e.routineId),[l,c]=x.useState(((P=e.config)==null?void 0:P.value)||""),[u,f]=x.useState(null),[h,m]=x.useState(null),g=["sets","max-sets","rest","max-rest"].includes(e.type),y=g?parseInt:parseFloat;let v="";switch(e.type){case"weight":v=t("weight");break;case"max-weight":v="max "+t("weight");break;case"reps":v=t("server.repetitions");break;case"max-reps":v=t("server.max_reps");break;case"sets":v=t("routines.sets");break;case"max-sets":v="max "+t("routines.sets");break;case"rest":v=t("routines.restTime");break;case"max-rest":v="max "+t("routines.restTime");break;case"rir":v=t("routines.rir");break;case"max-rir":v="max "+t("routines.rir");break}const w=B=>{const H={slot_entry:e.slotEntryId,value:y(B)};B===""&&e.config?s.mutate(e.config.id):e.config?i.mutate({id:e.config.id,...H}):a.mutate({iteration:1,operation:Qi,step:"abs",requirements:null,...H})},C=B=>{if(c(B),B!==""&&Number.isNaN(y(B))){f(t(g?"forms.enterInteger":"forms.enterNumber"));return}else f(null);h&&clearTimeout(h),m(setTimeout(()=>w(B),$re))},E=i.isPending||a.isPending||s.isPending,I=i.isError||a.isError||s.isError,O=H$((D=(R=i.error)==null?void 0:R.response)==null?void 0:D.data)||H$((A=(M=a.error)==null?void 0:M.response)==null?void 0:A.data)||H$((N=(_=s.error)==null?void 0:_.response)==null?void 0:N.data);return S(dn,{slotProps:{input:{endAdornment:E&&S(gh,{})}},inputProps:{"data-testid":`${e.type}-field`},label:v,value:l,fullWidth:!0,variant:"standard",disabled:E,onChange:B=>C(B.target.value),error:!!u||I,helperText:u||O})},POt=e=>{const{setFieldValue:t}=AV(),{t:n}=je(),r=e.disabled??!1,[o,i]=x.useState(e.values),[a,s]=J.useState(null),l=u=>{o.includes(u)?i(o.filter(f=>f!==u)):i([...o,u])},c=async()=>{await t(e.fieldName,o),s(null)};return Q(Tt,{children:[S(pn,{disabled:r,onClick:u=>s(u.currentTarget),children:a?S(Tst,{fontSize:"small"}):S(Jst,{fontSize:"small"})}),Q(ss,{anchorEl:a,open:!!a,onClose:()=>s(null),children:[...JN.map((u,f)=>Q(Jt,{onClick:()=>l(u),children:[S(nl,{children:o.includes(u)?S(Rst,{fontSize:"small"}):S(Dst,{fontSize:"small"})}),S(Wr,{children:u})]},f)),S(ji,{}),S(Jt,{children:S(ct,{color:"primary",variant:"contained",type:"submit",size:"small",onClick:c,children:n("save")})})]})]})},AOt=e=>{var i;const t=Yue(e.routineId),n=Xue(e.routineId),r=Que(e.routineId),o=a=>{const s={value:parseFloat(a)};a===""&&e.config?n.mutate(e.config.id):e.config!==void 0?t.mutate({id:e.config.id,...s}):r.mutate({slot_entry:e.slotEntryId,iteration:1,operation:Qi,...s})};return S(dn,{fullWidth:!0,select:!0,label:"RiR",variant:"standard",defaultValue:"",value:(i=e.config)==null?void 0:i.value,disabled:t.isPending,onChange:a=>o(a.target.value),children:Hre.map(a=>S(Jt,{value:a.value,children:a.label},a.value))})};function MOt(e){let t="";for(;e>0;)e--,t=String.fromCharCode(97+e%26)+t,e=Math.floor(e/26);return t}const wl=(e,t,n,r)=>t.length>0?S(gee,{config:t[0],type:e,routineId:n}):S(gee,{type:e,routineId:n,slotEntryId:r}),ROt=e=>{const{t}=je();return Q(Tt,{children:[e.slot.entries.length===0&&Q(Ci,{severity:"warning",children:[S(fh,{children:t("routines.setHasNoExercises")}),t("nothingHereYetAction")]}),e.slot.entries.map((n,r)=>S(DOt,{slotEntry:n,routineId:e.routineId,simpleMode:e.simpleMode,index:r,total:e.slot.entries.length},n.id))]})},DOt=e=>{var g;const{t,i18n:n}=je(),[r,o]=x.useState(!1),i=()=>o(!r),a=Yc(),s=Nw(e.routineId),l=fst(e.routineId),c=s.isPending||l.isPending,u=y=>{y!==null&&(s.mutate({id:e.slotEntry.id,exercise:y.data.base_id}),o(!1))};let f;a.isSuccess&&(f=Gu(n.language,a.data));const h=()=>e.simpleMode?Q(J.Fragment,{children:[S(me,{size:{xs:12,sm:2},children:wl("sets",e.slotEntry.nrOfSetsConfigs,e.routineId,e.slotEntry.id)},`sets-config-${e.slotEntry.id}`),S(me,{size:{xs:12,sm:3},children:wl("weight",e.slotEntry.weightConfigs,e.routineId,e.slotEntry.id)},`weight-config-${e.slotEntry.id}`),S(me,{size:{xs:12,sm:3},children:wl("reps",e.slotEntry.repetitionsConfigs,e.routineId,e.slotEntry.id)},`reps-config-${e.slotEntry.id}`)]}):Q(J.Fragment,{children:[S(me,{size:{xs:6,sm:1},children:wl("sets",e.slotEntry.nrOfSetsConfigs,e.routineId,e.slotEntry.id)}),S(me,{size:{xs:6,sm:1},children:wl("max-sets",e.slotEntry.maxNrOfSetsConfigs,e.routineId,e.slotEntry.id)}),S(me,{size:{xs:6,sm:2},children:S(ewt,{routineId:e.routineId,slotEntry:e.slotEntry})}),S(me,{size:{xs:12,sm:2},children:S(AOt,{routineId:e.routineId,config:e.slotEntry.rirConfigs.length>0?e.slotEntry.rirConfigs[0]:void 0,slotEntryId:e.slotEntry.id})}),S(me,{size:{xs:6,sm:1},children:wl("rest",e.slotEntry.restTimeConfigs,e.routineId,e.slotEntry.id)}),S(me,{size:{xs:6,sm:1},children:wl("max-rest",e.slotEntry.maxRestTimeConfigs,e.routineId,e.slotEntry.id)}),S(me,{size:{xs:6,sm:2},offset:{sm:4},children:wl("weight",e.slotEntry.weightConfigs,e.routineId,e.slotEntry.id)}),S(me,{size:{xs:6,sm:2},children:wl("max-weight",e.slotEntry.maxWeightConfigs,e.routineId,e.slotEntry.id)}),S(me,{size:{xs:12,sm:4},children:S(nwt,{slotEntry:e.slotEntry,routineId:e.routineId})}),S(me,{size:{xs:6,sm:2},offset:{sm:4},children:wl("reps",e.slotEntry.repetitionsConfigs,e.routineId,e.slotEntry.id)}),S(me,{size:{xs:6,sm:2},children:wl("max-reps",e.slotEntry.maxRepetitionsConfigs,e.routineId,e.slotEntry.id)}),S(me,{size:{xs:12,sm:4},children:S(twt,{slotEntry:e.slotEntry,routineId:e.routineId})})]}),m=e.total>1?MOt(e.index+1)+") ":"";return S(J.Fragment,{children:Q(me,{container:!0,paddingTop:1,spacing:1,children:[Q(me,{size:{xs:3,sm:1},alignContent:"center",children:[S(pn,{size:"small",onClick:i,disabled:c,children:r?S(Fst,{}):S(DV,{})}),S(pn,{size:"small",onClick:()=>l.mutate(e.slotEntry.id),disabled:c,children:S(OS,{})})]}),S(me,{size:{xs:9,sm:3},alignContent:"center",children:Q(at,{variant:"body1",children:[m," ",(g=e.slotEntry.exercise)==null?void 0:g.getTranslation(f).name]})}),r&&Q(J.Fragment,{children:[S(me,{size:{xs:12,sm:8},children:S(Wy,{callback:u})}),S(me,{size:{xs:12,sm:4}})]}),e.slotEntry.hasProgressionRules?S(me,{size:8,children:S(Ci,{severity:"info",variant:"standard",sx:{mt:2},children:t("routines.exerciseHasProgression")})}):h()]})})},kOt=e=>{const{t}=je(),n=Kc(e.routineId),r=ist(e.routineId),o=ast(e.routineId),i=u=>({background:u?"lightblue":void 0}),a=(u,f)=>({backgroundColor:"white",margin:4,...f,opacity:1}),s=()=>{e.setSelectedDayIndex(null)},l=u=>{if(!u.destination)return;const f=Array.from(n.data.days),[h]=f.splice(u.source.index,1);f.splice(u.destination.index,0,h),e.setSelectedDayIndex(u.destination.index),n.data.days=f,r.mutate(f.map((m,g)=>({id:m.id,order:g+1})))},c=async()=>{const u={routine:e.routineId,name:`${t("routines.newDay")} ${n.data.days.length+1}`,order:n.data.days.length+1,is_rest:!1,need_logs_to_advance:!1};await o.mutateAsync(u),e.setSelectedDayIndex(n.data.days.length)};return n.isLoading?S(Er,{}):Q(me,{container:!0,direction:"row",spacing:1,children:[S(me,{size:12,children:S(Ft,{direction:"row",children:Q(khe,{onDragEnd:l,onDragStart:s,children:[S(Hhe,{droppableId:"dayDroppable",direction:"horizontal",children:(u,f)=>Q(Fne,{ref:u.innerRef,...u.droppableProps,value:e.selectedDayIndex,variant:"scrollable",scrollButtons:"auto",style:i(f.isDraggingOver),children:[n.data.days.map((h,m)=>S(Fhe,{draggableId:h.id.toString(),index:m,children:(g,y)=>S(DN,{ref:g.innerRef,...g.draggableProps,...g.dragHandleProps,style:a(y.isDragging,g.draggableProps.style??{}),label:h.getDisplayName(),value:h.id,icon:S(tde,{}),iconPosition:"start",onClick:()=>e.setSelectedDayIndex(m)})},h.id)),u.placeholder]})}),S(ct,{startIcon:o.isPending?S(gh,{}):S(Ko,{}),onClick:c,disabled:o.isPending,children:t("routines.addDay")})]})})}),n.data.days.length===0&&S(me,{size:12,children:Q(Ci,{severity:"info",children:[S(fh,{children:t("routines.routineHasNoDays")}),t("nothingHereYetAction")]})})]})},_Ot=e=>{const[t,n]=je(),r=vst(e.routineId),o=dst(e.routineId),i=mst(e.routineId),a=yst(e.routineId),s=Ra(),l=Lr(),[c,u]=x.useState(!1),[f,h]=x.useState(null),[m,g]=x.useState(null),[y,v]=x.useState(!0),w=(M,A)=>{m!==null&&(A==="timeout"?(r.mutate(m.id),g(null)):A!=="clickaway"&&(e.day.slots=[...e.day.slots,m].sort((_,N)=>_.order-N.order),g(null))),u(!1)},C=M=>{const A=e.day.slots.findIndex(_=>_.id===M);if(A!==-1){const _=[...e.day.slots],[N]=_.splice(A,1);e.day.slots=_,g(N),u(!0)}},E=M=>{if(e.day.slots.find(_=>_.id===M)===void 0){console.info(`Could not find slot with id ${M} to add config`);return}h(f===M?null:M)},I=()=>i.mutate({day:e.day.id,order:e.day.slots.length+1}),O=8,P=M=>{if(!M.destination)return;const A=Array.from(e.day.slots),[_]=A.splice(M.source.index,1);A.splice(M.destination.index,0,_),a.mutate(A.map((N,B)=>({id:N.id,order:B+1}))),e.day.slots=A},R=M=>({background:M?"lightblue":void 0}),D=(M,A)=>({border:M?`1px solid ${l.palette.grey[900]}`:`1px solid ${l.palette.grey[300]}`,backgroundColor:"white",marginBottom:O,...A});return Q(Tt,{children:[S(TOt,{routineId:e.routineId,day:e.day,setSelectedDayIndex:e.setSelectedDayIndex},`day-form-${e.day.id}`),!e.day.isRest&&e.day.slots.length>0&&Q(Tt,{children:[S(Zt,{height:40}),S(os,{control:S(qo,{checked:y,onChange:()=>v(!y)}),label:t("routines.simpleMode")})]}),S(Zt,{height:20}),S(khe,{onDragEnd:P,children:S(Hhe,{droppableId:"setDroppable",direction:"vertical",children:(M,A)=>S("div",{...M.droppableProps,ref:M.innerRef,style:R(A.isDraggingOver),children:e.day.slots.map((_,N)=>Q(J.Fragment,{children:[S(Fhe,{draggableId:_.id.toString(),index:N,children:(B,H)=>Q(me,{container:!0,padding:1,ref:B.innerRef,...B.draggableProps,style:D(H.isDragging,B.draggableProps.style??{}),children:[S(me,{sx:{backgroundColor:l.palette.common.white},size:12,children:Q(me,{container:!0,justifyContent:"space-between",alignItems:"center",children:[S(me,{children:Q(at,{variant:"h6",children:[S(pn,{...B.dragHandleProps,children:S(tde,{})}),S(pn,{onClick:()=>C(_.id),children:S(MP,{})}),_.entries.length>1?t("routines.supersetNr",{number:N+1}):t("routines.exerciseNr",{number:N+1})]})}),S(me,{children:_.entries.length>0&&Q(sB,{variant:"outlined",children:[S(ct,{onClick:()=>E(_.id),size:"small",disabled:o.isPending,startIcon:o.isPending?S(gh,{}):S(Ko,{}),children:t("routines.addSuperset")}),_.entries.length>0&&S(ct,{startIcon:S(elt,{}),component:Ro,size:"small",to:cn(Qt.ROUTINE_EDIT_PROGRESSION,n.language,{id:e.routineId,id2:_.id}),children:t("routines.editProgression")})]})})]})}),!y&&Q(me,{size:12,children:[S(OOt,{routineId:e.routineId,slot:_},`slot-form-${_.id}`),S(Zt,{height:10})]}),S(me,{size:12,children:S(ROt,{slot:_,routineId:e.routineId,simpleMode:y})}),(f===_.id||_.entries.length===0)&&Q(me,{size:12,children:[S(Zt,{height:20}),S(Wy,{callback:j=>{j!==null&&(o.mutate({slot:_.id,exercise:j.data.base_id,type:"normal",order:_.entries.length+1,weight_unit:s.data.useMetric?o2e:i2e}),h(null))}})]})]})},_.id),S(Zt,{height:0,children:M.placeholder})]},`slot-${_.id}-${N}`))})})}),S(dI,{open:c,autoHideDuration:EI,onClose:w,children:S(Ci,{severity:"success",variant:"filled",sx:{width:"100%"},action:S(ct,{color:"warning",variant:"contained",size:"small",onClick:w,children:t("undo")}),children:"Set successfully deleted"})}),!e.day.isRest&&S(ct,{variant:"contained",color:"primary",startIcon:i.isPending?S(gh,{}):S(Ko,{}),onClick:I,children:t("routines.addExercise")})]})},$Ot=()=>{var c;const{t:e,i18n:t}=je(),n=Lr(),r=Ra(),o=Ma(),i=o.routineId?parseInt(o.routineId):0,a=Kc(i),[s,l]=x.useState(null);return a.isLoading||r.isLoading?S(Er,{}):a.isError?Q("p",{children:["Error: ",a.error.message]}):(s===null&&a.data.days.length>0&&l(0),Q(Vw,{title:e("editName",{name:(c=a.data)==null?void 0:c.name}),backToUrl:cn(Qt.ROUTINE_DETAIL,t.language,{id:i}),children:[Q(me,{container:!0,children:[S(me,{size:12,children:S(mH,{routine:a.data})}),Q(me,{size:12,children:[S(Zt,{height:20}),S(kOt,{routineId:i,selectedDayIndex:s,setSelectedDayIndex:l})]}),s!==null&&S(Tt,{children:S(me,{size:12,sx:{backgroundColor:n.palette.grey[100],padding:1},children:S(Zt,{children:S(_Ot,{day:a.data.days[s],routineId:i,setSelectedDayIndex:l})})})})]}),a.data.days.length>0&&Q(Ft,{spacing:2,sx:{mt:2},children:[S(Zt,{height:40}),S(at,{variant:"h4",children:e("routines.resultingRoutine")}),S(ji,{}),Q(Zt,{children:[S(Rct,{}),S(Zt,{height:20}),S(Mpe,{routine:a.data})]})]})]}))},NOt=({initialSession:e,dayId:t,routineId:n,selectedDate:r,setSelectedDate:o})=>{let i;const[a,s]=je(),[l,c]=J.useState(e),u=xst(),f=wst(l==null?void 0:l.id),h=bst(n,{routine:n,date:Jn(r.toJSDate()),day:t}),m=u.isPending||f.isPending||h.isLoading,g=Wo({notes:Ho().max(Wq,a("forms.maxLength",{chars:Wq})),date:Xs().required(),start:Xs().nullable(),end:Xs().nullable().min(AP("start"),a("forms.endBeforeStart")),fitInWeek:Lu()});return x.useEffect(()=>{h.data?(i.setValues({notes:h.data.notes||"",impression:h.data.impression||cg,date:h.data.date,start:h.data.timeStart?xt.fromJSDate(h.data.timeStart):null,end:h.data.timeEnd?xt.fromJSDate(h.data.timeEnd):null}),c(h.data)):h.isSuccess&&!h.data&&(i.setValues({notes:"",impression:cg,date:(e==null?void 0:e.date)||xt.now().toJSDate(),start:e!=null&&e.timeStart?xt.fromJSDate(e.timeStart):null,end:e!=null&&e.timeEnd?xt.fromJSDate(e.timeEnd):null}),c(void 0))},[h.data,h.isSuccess,e,r]),S(Ti,{enableReinitialize:!0,initialValues:{notes:l!==void 0?l.notes:"",date:l!==void 0?l.date:new Date,start:l!==void 0&&l.timeStart!==null?xt.fromJSDate(l.timeStart):null,end:l!==void 0&&l.timeEnd!==null?xt.fromJSDate(l.timeEnd):null,impression:l!==void 0?l.impression:cg},innerRef:y=>i=y,validationSchema:g,onSubmit:async y=>{const v={day:t,routine:n,date:Jn(r.toJSDate()),notes:y.notes,impression:y.impression,time_start:y.start?Dx(y.start.toJSDate()):null,time_end:y.end?Dx(y.end.toJSDate()):null};l!==void 0?await f.mutateAsync({...v,id:l.id}):await u.mutateAsync(v)},children:y=>S(fi,{children:Q(me,{container:!0,spacing:2,children:[S(me,{size:{xs:12,sm:6},children:S(Ys,{dateAdapter:zl,adapterLocale:s.language,children:S(Ih,{value:r,defaultValue:xt.now(),label:a("date"),onChange:v=>{v&&(y.setFieldValue("date",v),o(v))},disableFuture:!0,slotProps:{textField:{variant:"standard",fullWidth:!0,error:y.touched.date&&!!y.errors.date}}})})}),S(me,{size:{xs:6,sm:3},children:S(Ys,{dateAdapter:zl,adapterLocale:s.language,children:S(HF,{label:a("start"),...y.getFieldProps("start"),onChange:v=>{v&&y.setFieldValue("start",v)},slotProps:{textField:{variant:"standard",fullWidth:!0,error:y.touched.start&&!!y.errors.start,helperText:y.touched.start&&y.errors.start}}})})}),S(me,{size:{xs:6,sm:3},children:S(Ys,{dateAdapter:zl,adapterLocale:s.language,children:S(HF,{label:a("end"),...y.getFieldProps("end"),onChange:v=>{v&&y.setFieldValue("end",v)},slotProps:{textField:{variant:"standard",fullWidth:!0,error:y.touched.end&&!!y.errors.end,helperText:y.touched.end&&y.errors.end}}})})}),S(me,{size:12,children:S(Xu,{fieldName:"notes",title:a("notes"),fieldProps:{multiline:!0,rows:4}})}),Q(me,{size:12,children:[S(at,{variant:"caption",children:a("routines.impression")}),Q(sB,{fullWidth:!0,color:"primary",children:[Q(ct,{size:"small",color:"info",variant:y.values.impression===uL?"contained":"outlined",onClick:()=>y.setFieldValue("impression",uL),children:[S(Xst,{}),a("routines.impressionBad")]}),Q(ct,{size:"small",color:"info",variant:y.values.impression===cg?"contained":"outlined",onClick:()=>y.setFieldValue("impression",cg),children:[S(Yst,{}),a("routines.impressionNeutral")]}),Q(ct,{size:"small",color:"info",variant:y.values.impression===dL?"contained":"outlined",onClick:()=>y.setFieldValue("impression",dL),children:[S(Qst,{}),a("routines.impressionGood")]})]})]}),S(me,{size:12,display:"flex",justifyContent:"end",children:S(ct,{disabled:m,color:"primary",variant:"contained",type:"submit",sx:{mt:2},children:a("submit")})})]})})})},LOt=({dayId:e,routineId:t,selectedDate:n})=>{const{t:r,i18n:o}=je(),[i,a]=x.useState(!1),s=Kc(t),l=ust(t),c=Yc(),u=()=>a(!1),[f,h]=x.useState(null);let m;if(c.isSuccess&&(m=Gu(o.language,c.data)),s.isLoading)return S(Er,{});const g=s.data,y=(g==null?void 0:g.getDayData(e,n.toJSDate()))??[],v=y.length===0,w=Wo({logs:sh().of(Wo().shape({rir:Do().nullable(),repetitions:Do().typeError(r("forms.enterNumber")).nullable(),weight:Do().typeError(r("forms.enterNumber")).nullable()}))}),C=async P=>{const R=v?null:y[0].iteration,D=P.logs.filter(M=>M.rir!==""||M.repetitions!==""||M.weight!=="").map(M=>{var A,_,N;return{date:n.toISO(),iteration:R,exercise:(A=M.exercise)==null?void 0:A.id,day:e,routine:t,slot_entry:M.slotEntry,rir:M.rir!==""?M.rir:null,rir_target:M.rirTarget!==""?M.rirTarget:null,repetitions_unit:(_=M.repetitionsUnit)==null?void 0:_.id,repetitions:M.repetitions!==""?M.repetitions:null,repetitions_target:M.repetitionsTarget!==""?M.repetitionsTarget:null,weight_unit:(N=M.weightUnit)==null?void 0:N.id,weight:M.weight!==""?M.weight:null,weight_target:M.weightTarget!==""?M.weightTarget:null}});await l.mutateAsync(D),a(!0)},E=async(P,R)=>{if(P===null)return;const D=R.values.logs.map(M=>f===M.exercise.id?{...M,weight:"",weightTarget:"",repetitions:"",repetitionsTarget:"",rir:"",rirTarget:"",exercise:P.exercise}:M);await R.setValues({...R.values,logs:D}),h(null)},I={logs:[]},O=v?g.dayDataCurrentIteration.filter(P=>{var R;return((R=P.day)==null?void 0:R.id)===e}):y;for(const P of O)for(const R of P.slots)for(const D of R.setConfigs)for(let M=0;M<D.nrOfSets;M++)I.logs.push({exercise:D.exercise,repetitionsUnit:D.repetitionsUnit,weightUnit:D.weightUnit,slotEntry:D.slotEntryId,rir:!v&&D.rir!==null?D.rir:"",rirTarget:!v&&D.rir!==null?D.rir:"",repetitions:!v&&D.repetitions!==null?D.repetitions:"",repetitionsTarget:!v&&D.repetitions!==null?D.repetitions:"",weight:!v&&D.weight!==null?D.weight:"",weightTarget:!v&&D.weight!==null?D.weight:""});return Q(Tt,{children:[v&&S(Ci,{severity:"info",sx:{marginTop:2},children:r("routines.weightLogNotPlanned")}),S(Ti,{enableReinitialize:!0,initialValues:I,validationSchema:w,onSubmit:C,children:P=>Q(fi,{children:[S(Due,{name:"logs",children:({insert:R,remove:D})=>S(Tt,{children:P.values.logs.map((M,A)=>{var _,N,B,H;return Q(me,{container:!0,spacing:1,sx:{mt:2},children:[(A===0||A>0&&P.values.logs[A-1].exercise.id!=P.values.logs[A].exercise.id)&&Q(Tt,{children:[Q(me,{size:12,children:[f!==P.values.logs[A].exercise.id&&S(at,{variant:"h6",children:(_=P.values.logs[A].exercise)==null?void 0:_.getTranslation(m).name}),f===P.values.logs[A].exercise.id&&S(Wy,{loadExercise:!0,callback:j=>E(j,P)})]}),Q(me,{size:12,children:[Q(ct,{type:"button",size:"small",onClick:()=>R(A,{exercise:P.values.logs[A].exercise,repetitions:P.values.logs[A].repetitions,weight:P.values.logs[A].weight}),children:[S(Ko,{}),r("routines.addAdditionalLog")]}),Q(ct,{type:"button",size:"small",onClick:()=>{f===P.values.logs[A].exercise.id?h(null):h(P.values.logs[A].exercise.id)},children:[S(tlt,{}),r("exercises.swapExercise")]}),Q(ct,{type:"button",size:"small",onClick:async()=>await P.setValues({...P.values,logs:P.values.logs.filter(j=>j.exercise.id!==P.values.logs[A].exercise.id)}),children:[S(OS,{}),r("delete")]})]})]}),S(me,{size:4,children:S(Xu,{fieldName:`logs.${A}.repetitions`,title:r("server.repetitions"),fieldProps:{slotProps:{input:{endAdornment:S(So,{position:"end",children:((N=P.values.logs[A].repetitionsUnit)==null?void 0:N.id)!==r2e?S(at,{variant:"caption",children:(B=P.values.logs[A].repetitionsUnit)==null?void 0:B.name}):null})}}}})}),S(me,{size:4,children:S(Xu,{fieldName:`logs.${A}.weight`,title:r("weight"),fieldProps:{slotProps:{input:{endAdornment:S(So,{position:"end",children:S(at,{variant:"caption",children:(H=P.values.logs[A].weightUnit)==null?void 0:H.name})})}}}})}),S(me,{size:3,children:S(dn,{fullWidth:!0,select:!0,label:r("routines.rir"),variant:"standard",...P.getFieldProps(`logs.${A}.rir`),children:Hre.map(j=>S(Jt,{value:j.value,children:j.label},j.value))})}),S(me,{size:1,children:S(pn,{size:"small",onClick:()=>D(A),children:S(OS,{})})})]},A)})})}),S(me,{container:!0,spacing:2,children:S(me,{size:12,display:"flex",justifyContent:"end",children:S(ct,{color:"primary",disabled:!P.isValid||P.isSubmitting||l.isPending,variant:"contained",type:"submit",sx:{mt:2},children:r("submit")})})})]})}),S(dI,{open:i,autoHideDuration:EI,onClose:u,children:S(Ci,{onClose:u,severity:"success",sx:{width:"100%"},children:r("success")})})]})},FOt=()=>{const e=Ma(),{t,i18n:n}=je(),[r,o]=x.useState(xt.now()),i=parseInt(e.routineId??"");if(Number.isNaN(i))return S("p",{children:"Please pass an integer as the routine id."});const a=parseInt(e.dayId??"");return Number.isNaN(a)?S("p",{children:"Please pass an integer as the day id."}):S(ds,{title:t("routines.addWeightLog"),backToUrl:cn(Qt.ROUTINE_DETAIL,n.language,{id:i}),mainContent:Q(Ft,{children:[S(NOt,{routineId:i,dayId:a,selectedDate:r,setSelectedDate:o}),S(at,{variant:"h5",children:t("exercises.exercises")}),S(at,{variant:"body2",children:t("routines.impressionHelpText")}),S(LOt,{routineId:i,dayId:a,selectedDate:r})]})})},Ghe=e=>{var t,n,r;return(t=e.mutationQuery)!=null&&t.isError?S(Tt,{children:Q(Ci,{severity:"error",sx:{mb:1},children:[S(fh,{children:(n=e.mutationQuery.error)==null?void 0:n.message}),S("ul",{children:Uhe((r=e.mutationQuery.error.response)==null?void 0:r.data).map((o,i)=>S("li",{children:o},i))})]})}):null},I0=e=>{var y,v;const{t}=je(),[n,r]=x.useState(!0),[o,i]=x.useState([]),a=Dat(e.routineId),s=e.forceInteger??!1;let l,c,u="";switch(e.type){case"weight":l=St.WEIGHT_CONFIG,c=St.MAX_WEIGHT_CONFIG,u=t("weight");break;case"reps":l=St.REPETITIONS_CONFIG,c=St.MAX_REPS_CONFIG,u=t("server.repetitions");break;case"sets":l=St.NR_OF_SETS_CONFIG,c=St.MAX_NR_OF_SETS_CONFIG,u=t("routines.sets");break;case"rest":l=St.REST_CONFIG,c=St.MAX_REST_CONFIG,u=t("routines.restTime");break;case"rir":l=St.RIR_CONFIG,c=St.MAX_RIR_CONFIG,u=t("routines.rir");break}const f=Wo({entries:sh().of(Wo().shape({edited:Lu(),iteration:Do().required(),value:Do().when("forceInteger",{is:!0,then:w=>w.integer(t("forms.enterInteger")).typeError(t("forms.enterNumber")),otherwise:w=>w.typeError(t("forms.enterNumber")).nullable().notRequired()}),valueMax:Do().typeError(t("forms.enterNumber")).nullable().when("forceInteger",{is:!0,then:w=>w.integer(t("forms.enterInteger")).typeError(t("forms.enterNumber")),otherwise:w=>w.typeError(t("forms.enterNumber")).nullable().notRequired()}).when("operation",{is:Qi,then:w=>w.min(AP("value"),t("forms.maxLessThanMin")),otherwise:w=>w}),operation:Ho().required(),operationMax:Ho().required(),requirements:sh().of(Ho().oneOf(JN)),requirementsMax:sh().of(Ho().oneOf(JN)),repeat:Lu(),repeatMax:Lu()})).test("inter-entry-validation","Your error message here",function(w){const{createError:C}=this,E=w;for(let I=0;I<E.length;I++){const O=E[I];if(O.iteration>1&&O.operation!==Qi){let P=!1,R=!1;for(let D=0;D<I;D++)E[D].operation===Qi&&E[D].value!==""&&E[D].edited&&(P=!0),E[D].operation===Qi&&E[D].valueMax!==""&&E[D].edited&&(R=!0);if(!P)return C({path:`entries[${I}].value`,message:t("routines.progressionNeedsReplace")});if(!R)return C({path:`entries[${I}].valueMax`,message:t("routines.progressionNeedsReplace")})}}return!0})}),h=(w,C)=>({forceInteger:s,edited:C,iteration:w,id:null,idMax:null,value:"",valueMax:"",operation:Qi,operationMax:Qi,step:"abs",stepMax:"abs",requirements:[],requirementsMax:[],repeat:!1,repeatMax:!1}),m={entries:[]};for(const w of e.iterations){const C=e.configs.find(I=>I.iteration===w),E=e.configsMax.find(I=>I.iteration===w);C===void 0?m.entries.push(h(w,!1)):m.entries.push({forceInteger:s,edited:!0,id:C.id,idMax:E===void 0?null:E.id,iteration:w,value:String(C.value),valueMax:E===void 0?"":String(E.value),operation:C.operation,operationMax:E===void 0?Qi:C.operation,step:C.step,stepMax:E===void 0?"abs":E.step,requirements:((y=C.requirements)==null?void 0:y.rules)??[],requirementsMax:E===void 0?[]:((v=E.requirements)==null?void 0:v.rules)??[],repeat:C.repeat,repeatMax:E===void 0?!1:C.repeat})}const g=w=>{const C=w.entries.filter(M=>M.edited),E=C.filter(M=>M.id!==null).map(M=>({id:M.id,slot_entry:e.slotEntryId,value:M.value,iteration:M.iteration,operation:M.operation,step:M.step,repeat:M.repeat,requirements:{rules:M.requirements??[]}})),I=C.filter(M=>M.id===null&&M.value!=="").map(M=>({slot_entry:e.slotEntryId,value:M.value,iteration:M.iteration,operation:M.operation,step:M.step,repeat:M.repeat,requirements:{rules:M.requirements??[]}})),O=e.configs.filter(M=>o.includes(M.iteration)).map(M=>M.id);C.forEach(M=>{M.value===""&&M.id!==null&&!O.includes(M.id)&&O.push(M.id)});const P=C.filter(M=>M.idMax!==null&&M.valueMax!=="").map(M=>({id:M.idMax,slot_entry:e.slotEntryId,value:M.valueMax,iteration:M.iteration,operation:M.operation,step:M.step,repeat:M.repeat,requirements:{rules:M.requirements??[]}})),R=C.filter(M=>M.idMax===null&&M.valueMax!=="").map(M=>({iteration:M.iteration,slot_entry:e.slotEntryId,value:M.valueMax,operation:M.operation,step:M.stepMax,repeat:M.repeat,requirements:{rules:M.requirements??[]}})),D=e.configsMax.filter(M=>o.includes(M.iteration)).map(M=>M.id);C.forEach(M=>{M.valueMax===""&&M.idMax!==null&&!O.includes(M.idMax)&&D.push(M.idMax)}),a.mutate({values:{toAdd:I,toDelete:O,toEdit:E,apiPath:l},maxValues:{toAdd:R,toDelete:D,toEdit:P,apiPath:c}})};return S(Tt,{children:Q(Ft,{sx:{width:"100%"},children:[S(at,{variant:"h6",children:u}),S(Ti,{enableReinitialize:!0,initialValues:m,validationSchema:f,onSubmit:(w,{setSubmitting:C})=>{g(w),C(!1)},children:w=>S(fi,{children:Q(me,{container:!0,spacing:1,children:[S(me,{size:4,offset:2,textAlign:"center",children:t("value")}),S(me,{size:6,children:Q(me,{container:!0,spacing:1,children:[S(me,{size:3,children:t("routines.operation")}),S(me,{size:3,children:t("routines.step")}),Q(me,{size:3,textAlign:"center",children:[t("routines.requirements"),S("br",{}),S(Go,{title:t("routines.requirementsHelpText"),children:S(pn,{onClick:()=>{},children:S(IS,{fontSize:"small"})})})]}),Q(me,{size:3,textAlign:"center",children:[t("routines.repeat"),S("br",{}),S(Go,{title:t("routines.repeatHelpText"),children:S(pn,{onClick:()=>{},children:S(IS,{fontSize:"small"})})})]})]})}),S(me,{size:12,children:S(ji,{})}),S(Due,{name:"entries",validateOnChange:!0,children:({insert:C,remove:E})=>S(Tt,{children:w.values.entries.map((I,O)=>Q(J.Fragment,{children:[Q(me,{size:2,display:"flex",justifyContent:"space-around",alignItems:"center",children:[e.cycleLength===7?t("routines.weekNr",{number:I.iteration}):t("routines.workoutNr",{number:I.iteration}),I.edited?S(pn,{disabled:I.iteration===1&&w.values.entries.filter(P=>P.edited&&P.iteration!==1).length>0,size:"small",onClick:()=>{I.id!==null&&i([...o,I.iteration]),E(O),C(O,h(I.iteration,!1))},children:S(MP,{})}):S(pn,{size:"small",onClick:()=>{E(O),C(O,h(I.iteration,!0))},children:S(Ko,{})})]}),S(me,{size:2,children:I.edited&&S(Xu,{fieldName:`entries.${O}.value`,title:t("min"),fullwidth:!0})}),S(me,{size:2,children:I.edited&&S(Xu,{fieldName:`entries.${O}.valueMax`,title:t("max"),fullwidth:!0})}),S(me,{size:6,children:Q(me,{container:!0,spacing:1,children:[S(me,{size:3,children:I.edited&&S(dn,{disabled:I.iteration===1,fullWidth:!0,select:!0,label:t("routines.operation"),variant:"standard",...w.getFieldProps(`entries.${O}.operation`),onChange:async P=>{w.handleChange(P),P.target.value===Qi&&(await w.setFieldValue(`entries.${O}.requirements`,[]),await w.setFieldValue(`entries.${O}.repeat`,!1))},children:M2e.map(P=>S(Jt,{value:P.value,children:P.label},P.value))})}),S(me,{size:3,children:I.edited&&Q(dn,{disabled:I.iteration===1||I.operation===Qi,fullWidth:!0,select:!0,label:t("routines.step"),variant:"standard",...w.getFieldProps(`entries.${O}.step`),children:[A2e.map(P=>S(Jt,{value:P.value,children:P.label},P.value)),(I.iteration===1||I.operation===Qi)&&S(Jt,{value:"na",children:"n/a"},"na")]})}),Q(me,{size:3,textAlign:"center",children:[I.edited&&S(POt,{disabled:I.iteration===1||I.operation===Qi,values:I.requirements,fieldName:`entries.${O}.requirements`}),I.requirements.length>=0&&S("br",{}),I.requirements.length>=0&&I.requirements.map((P,R)=>Q(at,{variant:"caption",children:[P,"  "]},R))]}),S(me,{size:3,textAlign:"center",children:I.edited&&S(qo,{checked:w.values.entries[O].repeat,...w.getFieldProps(`entries.${O}.repeat`),disabled:I.iteration===1||I.operation===Qi})})]})})]},O))})}),a.isError&&S(me,{size:12,children:S(Ghe,{mutationQuery:a})}),S(me,{size:12,display:"flex",justifyContent:"end",children:S(ct,{color:"primary",disabled:!w.isValid||w.isSubmitting||!w.dirty,variant:"contained",type:"submit",sx:{mt:2},children:t("save")})}),S(me,{size:12,children:S(Zt,{height:20})})]})})})]})})},jOt=()=>{const{t:e,i18n:t}=je(),n=Ma(),r=n.routineId?parseInt(n.routineId):-1,o=n.slotId?parseInt(n.slotId):-1,i=Kc(r),a=Yc();if(i.isLoading)return S(Er,{});const s=i.data;let l;a.isSuccess&&(l=Gu(t.language,a.data));let c=null;for(const f of s.days){const h=f.slots.find(m=>m.id===o);if(h){c=h;break}}if(c===null)return S("p",{children:"Slot not found!"});const u=Object.keys(s.groupedDayDataByIteration).map(Number);return S(Tt,{children:S(Vw,{title:e("routines.editProgression"),backToUrl:cn(Qt.ROUTINE_EDIT,t.language,{id:r}),children:c.entries.map(f=>{var h;return Q(J.Fragment,{children:[S(at,{variant:"h5",gutterBottom:!0,children:(h=f.exercise)==null?void 0:h.getTranslation(l).name}),Q(me,{container:!0,spacing:1,children:[S(me,{size:2,display:"flex",alignItems:"end",children:S(at,{variant:"body2",children:e("routines.rounding")})}),S(me,{size:5,children:S(RO,{routineId:r,entryId:f.id,initialValue:f.weightRounding,rounding:"weight",editProfile:!1})}),S(me,{size:5,children:S(RO,{routineId:r,entryId:f.id,initialValue:f.repetitionRounding,rounding:"reps",editProfile:!1})}),S(I0,{type:"sets",configs:f.nrOfSetsConfigs,configsMax:f.maxNrOfSetsConfigs,slotEntryId:f.id,routineId:r,iterations:u,forceInteger:!0,cycleLength:s.cycleLength}),S(I0,{type:"weight",configs:f.weightConfigs,configsMax:f.maxWeightConfigs,slotEntryId:f.id,routineId:r,iterations:u,cycleLength:s.cycleLength}),S(I0,{type:"reps",configs:f.repetitionsConfigs,configsMax:f.maxRepetitionsConfigs,slotEntryId:f.id,routineId:r,iterations:u,cycleLength:s.cycleLength}),S(I0,{type:"rir",configs:f.rirConfigs,configsMax:f.maxRirConfigs,slotEntryId:f.id,routineId:r,iterations:u,cycleLength:s.cycleLength}),S(I0,{type:"rest",configs:f.restTimeConfigs,configsMax:f.maxRestTimeConfigs,slotEntryId:f.id,routineId:r,iterations:u,cycleLength:s.cycleLength})]})]},f.id)})})})},BOt=()=>{const{t:e,i18n:t}=je(),n=Ma(),r=parseInt(n.routineId??"");if(Number.isNaN(r))return S("p",{children:"Please pass an integer as the routine id."});const o=Kc(r),i=o.data;return S(RP,{query:o,child:o.isSuccess&&S(ds,{title:i!=null&&i.isPublic?e("routines.publicTemplate"):e("routines.template"),subTitle:i.name,mainContent:Q(Ft,{spacing:2,children:[Q(at,{variant:"subtitle1",children:[i.start.toLocaleDateString()," - ",i.end.toLocaleDateString()," (",i.durationText,")"]}),i.description!==""&&S(at,{variant:"body2",sx:{whiteSpace:"pre-line"},children:i==null?void 0:i.description}),S(ct,{component:"a",href:cn(Qt.ROUTINE_COPY,t.language,{id:r}),variant:"contained",children:e("routines.copyAndUseTemplate")}),i.dayDataCurrentIteration.filter(a=>a.day!==null).map((a,s)=>S(BV,{dayData:a,routineId:r,readOnly:!0},`dayDetails-${s}`))]}),sideBar:Q(Ft,{children:[S(Zt,{height:40}),Q(me,{container:!0,children:[S(me,{size:6,children:S(Ql,{primaryMuscles:i.mainMuscles.filter(a=>a.isFront),secondaryMuscles:i.secondaryMuscles.filter(a=>a.isFront),isFront:!0})}),S(me,{size:6,children:S(Ql,{primaryMuscles:i.mainMuscles.filter(a=>!a.isFront),secondaryMuscles:i.secondaryMuscles.filter(a=>!a.isFront),isFront:!1})})]})]})})})},zOt=e=>{const{t}=je(),n=e.logEntries??[],r=lst(e.routineId),o=cst(e.routineId),i=n.map(E=>({id:E.id,date:E.date,repetitions:E.repetitions,weight:E.weight,rir:E.rir,entry:E})),[a,s]=J.useState(i),[l,c]=J.useState({}),u=(E,I)=>{E.reason===ks.rowFocusOut&&(I.defaultMuiPrevented=!0)},f=E=>()=>{c({...l,[E]:{mode:zn.Edit}})},h=E=>()=>{c({...l,[E]:{mode:zn.View}})},m=E=>()=>{r.mutate(E),s(a.filter(I=>I.id!==E))},g=E=>()=>{c({...l,[E]:{mode:zn.View,ignoreModifications:!0}}),a.find(O=>O.id===E).isNew&&s(a.filter(O=>O.id!==E))},y=E=>{const I=E.entry;I!==void 0&&(I.date=E.date,I.repetitions=E.repetitions,I.weight=E.weight,I.rir=E.rir,o.mutate(I));const O={...E,isNew:!1};return s(a.map(P=>P.id===E.id?O:P)),O},v=E=>{c(E)},w=[{field:"date",type:"dateTime",flex:1,editable:!0,disableColumnMenu:!0,headerName:t("date"),valueFormatter:E=>E==null?"":`${E.toLocaleDateString()}`},{field:"repetitions",type:"number",disableColumnMenu:!0,editable:!0,headerName:t("routines.reps")},{field:"weight",type:"number",disableColumnMenu:!0,editable:!0,headerName:t("weight")},{field:"rir",type:"singleSelect",disableColumnMenu:!0,editable:!0,headerName:t("routines.rir"),getOptionValue:E=>E.value,getOptionLabel:E=>E.label,valueOptions:Vre},{field:"actions",type:"actions",headerName:"Actions",width:100,cellClassName:"actions",getActions:({id:E})=>{var O;return((O=l[E])==null?void 0:O.mode)===zn.Edit?[S(mf,{icon:S(ide,{}),sx:{color:"primary.main"},label:t("save"),onClick:h(E)}),S(mf,{icon:S(Mst,{}),label:t("cancel"),className:"textPrimary",onClick:g(E),color:"inherit"})]:[S(mf,{icon:S(DV,{}),label:t("edit"),className:"textPrimary",onClick:f(E),color:"inherit"}),S(mf,{icon:S(OS,{}),label:t("delete"),onClick:m(E),color:"inherit"})]}}],C={pagination:{paginationModel:{pageSize:5}}};return Q(Tt,{children:[S(at,{variant:"h6",sx:{mt:4},children:e.exercise.getTranslation().name}),Q(me,{container:!0,spacing:2,children:[Q(me,{size:{xs:12,md:6},children:[S(Ghe,{mutationQuery:o}),S(Cpe,{initialState:C,pageSizeOptions:YN.pageSizeOptions,disableRowSelectionOnClick:!0,rows:a,columns:w,editMode:"row",rowModesModel:l,onRowModesModelChange:v,onRowEditStop:u,processRowUpdate:y})]}),S(me,{size:{xs:12,md:6},children:S(UOt,{data:n},e.exercise.id)})]})]})},VOt=e=>e.map(t=>({id:t.id,value:t.weight,time:t.date.getTime(),entry:t})),HOt=({active:e,payload:t,label:n})=>{var r,o,i;if(e){let a="";return(r=t==null?void 0:t[1].payload)!=null&&r.entry.rir&&(a=`, ${(o=t==null?void 0:t[1].payload)==null?void 0:o.entry.rir} RiR`),S(ho,{children:Q(Fi,{children:[S(at,{variant:"body1",children:xt.fromMillis(t==null?void 0:t[0].value).toLocaleString(xt.DATE_MED)}),Q(at,{variant:"body2",children:[(i=t==null?void 0:t[1].payload)==null?void 0:i.entry.repetitions," × ",t==null?void 0:t[1].value,t==null?void 0:t[1].unit,a]})]})})}return null},UOt=e=>{const t=e.data.reduce(function(r,o){return r.set(o.repetitions,r.get(o.repetitions)||[]),r.get(o.repetitions).push(o),r},new Map),n=Zw(t.size);return S(Zt,{children:S(nd,{width:"100%",height:250,children:Q(fYe,{children:[S(ls,{dataKey:"time",domain:["auto","auto"],name:"Time",tickFormatter:r=>xt.fromMillis(r).toLocaleString(xt.DATE_MED),type:"number"}),S(cs,{domain:["auto","auto"],dataKey:"value",name:"Value",unit:"kg"}),Array.from(t).map(([r,o])=>{const i=n.next().value,a=VOt(o);return S(Iw,{data:a,fill:i,line:{stroke:i},lineType:"joint",lineJointType:"monotoneX",name:r==null?void 0:r.toString()},r)}),S(ba,{content:S(HOt,{})}),S(Uf,{strokeDasharray:"3 3"}),S(Oc,{})]})})})},GOt=()=>{const e=Ma(),t=e.routineId?parseInt(e.routineId):0,[n,r]=je(),o=Wue(t),i=Kc(t);if(o.isLoading||i.isLoading)return S(Er,{});let a=new Map;return a=o.data.reduce((s,l)=>(l.logs.forEach(c=>{const u=c.exerciseId;s.set(u,s.get(u)||[]),s.get(u).push(c)}),s),a),Q(Vw,{title:n("routines.logsHeader"),backToUrl:cn(Qt.ROUTINE_DETAIL,r.language,{id:t}),optionsMenu:S(Go,{title:n("routines.statsOverview"),children:S(pn,{component:"a",href:cn(Qt.ROUTINE_STATS_OVERVIEW,r.language,{id:t}),children:S(Zue,{})})}),children:[S(at,{variant:"body1",children:n("routines.logsFilterNote")}),i.data.dayDataCurrentIteration.filter(s=>s.day!==null&&!s.day.isRest).map((s,l)=>Q(J.Fragment,{children:[Q(Ft,{direction:{xs:"column",sm:"row"},justifyContent:"space-between",alignItems:"center",sx:{mt:4},children:[S(at,{variant:"h4",children:s.day.name}),S(ct,{component:Ro,to:cn(Qt.ROUTINE_ADD_LOG,r.language,{id:t,id2:s.day.id}),variant:"contained",children:n("routines.addLogToDay")})]}),s.slots.map(c=>c.exercises.map(u=>S(zOt,{routineId:t,exercise:u,logEntries:a.get(u.id)},u.id)))]},l))]})};var Dp=(e=>(e.Volume="volume",e.Sets="sets",e.Intensity="intensity",e))(Dp||{}),kp=(e=>(e.Mesocycle="mesocycle",e.Weekly="weekly",e.Iteration="iteration",e.Daily="daily",e))(kp||{}),G0=(e=>(e.Exercises="exercises",e.Muscles="muscles",e.Total="total",e))(G0||{});const U$=({label:e,options:t,value:n,onChange:r})=>Q(Fh,{fullWidth:!0,children:[S(jh,{id:`${e}-label`,children:e}),S(Lf,{labelId:`${e}-label`,id:`${e}-select`,value:n,label:e,onChange:r,children:t.map(o=>S(Jt,{value:o.value,children:o.label},o.value))})]});function qOt(e,t,n,r,o){switch(r){case"exercises":{const i=Object.keys(o.exercises).map(s=>{var l,c;return(c=(l=e.find(u=>u.id===parseInt(s)))==null?void 0:l.getTranslation(t))==null?void 0:c.name}),a=Object.keys(o.exercises).map(Number);return{headers:i,data:a.map(s=>o.exercises[s])}}case"muscles":{const i=Object.keys(o.muscle).map(s=>{var l;return((l=n.find(c=>c.id===parseInt(s)))==null?void 0:l.translatedName)??""}),a=Object.keys(o.muscle).map(Number);return{headers:i,data:a.map(s=>o.muscle[s])}}case"total":return{headers:[hr.t("total")],data:[o.total]};default:return{headers:[],data:[]}}}const WOt=(e,t,n,r,o,i,a,s)=>{const l={},c=e[t];let u=[],f=[];const h=(y,v)=>qOt(o,a,i,y,v);f=(y=>{let v=[];switch(n){case"mesocycle":v=h(r,c.mesocycle).headers;break;case"iteration":for(const w in y.iteration)v=v.concat(h(r,y.iteration[w]).headers);break;case"weekly":for(const w in y.weekly)v=v.concat(h(r,y.weekly[w]).headers);break;case"daily":for(const w in y.daily)v=v.concat(h(r,y.daily[w]).headers);break}return[...new Set(v)]})(c),f.forEach(y=>{l[y]=0});function g(y,v){f.map(C=>y[h(r,v).headers.indexOf(C)]).forEach((C,E)=>{C!==void 0&&(l[f[E]]+=C)})}switch(n){case"mesocycle":{const{data:y}=h(r,c.mesocycle);u=[{key:hr.t("total"),values:f.map(v=>y[f.indexOf(v)])}];break}case"iteration":{u=Object.entries(c.iteration).map(([y,v])=>{const{data:w}=h(r,v);return g(w,v),{key:`iteration ${y}`,values:f.map(C=>w[h(r,v).headers.indexOf(C)])}});break}case"weekly":{u=Object.entries(c.weekly).map(([y,v])=>{const{data:w}=h(r,v);return g(w,v),{key:`week ${y}`,values:f.map(C=>w[h(r,v).headers.indexOf(C)])}});break}case"daily":{u=Object.entries(c.daily).map(([y,v])=>{const{data:w}=h(r,v);return g(w,v),{key:new Date(y).toLocaleDateString(s),values:f.map(C=>w[h(r,v).headers.indexOf(C)])}});break}}return{headers:f,data:u,totals:l}};function KOt(e){const t=[];return e.headers.forEach(n=>{t.push({name:n,data:[]})}),e.data.forEach(n=>{n.values.forEach((r,o)=>{var a;const i=e.headers[o];i&&((a=t.find(s=>s.name===i))==null||a.data.push({category:n.key.toString(),value:r}))})}),t}const YOt=()=>{const e=Lr(),[t,n]=je(),r=Ma(),[o,i]=x.useState(Dp.Volume),[a,s]=x.useState(kp.Daily),[l,c]=x.useState(G0.Exercises),u=parseInt(r.routineId??"");if(Number.isNaN(u))return S("p",{children:"Please pass an integer as the routine id."});const f=Kc(u),h=Tat(u),m=_v(),g=Yc();if(h.isLoading||f.isLoading||m.isLoading||g.isLoading)return S(Er,{});const y=Gu(n.language,g.data),v=f.data,w=[{value:Dp.Volume,label:t("routines.volume")},{value:Dp.Sets,label:t("routines.sets")},{value:Dp.Intensity,label:t("routines.intensity")}],C=[{value:kp.Mesocycle,label:t("routines.currentRoutine")},{value:kp.Weekly,label:t("routines.weekly")},{value:kp.Iteration,label:t("routines.iteration")},{value:kp.Daily,label:t("routines.daily")}],E=[{value:G0.Exercises,label:t("exercises.exercises")},{value:G0.Muscles,label:t("exercises.muscles")},{value:G0.Total,label:t("total")}],I=_=>{i(_.target.value)},O=_=>{s(_.target.value)},P=_=>{c(_.target.value)},R=WOt(h.data,o,a,l,v.exercises,m.data,y,n.language),D=KOt(R),M=()=>S(Fc,{children:Q(Nc,{size:"small",children:[S(Ff,{children:Q(ln,{children:[S(ke,{}),R.headers.map(_=>S(ke,{sx:{textAlign:"right"},children:_},_))]})}),Q(Lc,{children:[R.data.map(_=>Q(ln,{children:[S(ke,{children:_.key}),_.values.map((N,B)=>S(ke,{sx:{textAlign:"right"},children:(N==null?void 0:N.toFixed(o===Dp.Intensity?2:0))||""},B))]},_.key)),a!==kp.Mesocycle&&Q(ln,{children:[S(ke,{sx:{fontWeight:"bold",backgroundColor:e.palette.grey.A200},children:t("total")}),R.headers.map(_=>{var N;return S(ke,{sx:{fontWeight:"bold",backgroundColor:e.palette.grey.A200,textAlign:"right"},children:(N=R.totals[_==null?void 0:_.toString()])==null?void 0:N.toFixed(o===Dp.Intensity?2:0)},_)})]})]})]})}),A=Zw(D.length);return S(Vw,{title:`${t("routines.statsOverview")} - ${v.name}`,backToUrl:cn(Qt.ROUTINE_DETAIL,n.language,{id:u}),optionsMenu:S(Go,{title:t("routines.logsOverview"),children:S(pn,{component:"a",href:cn(Qt.ROUTINE_LOGS_OVERVIEW,n.language,{id:u}),children:S(Zue,{})})}),children:Q(me,{container:!0,spacing:1,children:[S(me,{size:2,offset:3,children:S(U$,{label:"type",options:w,value:o,onChange:I})}),S(me,{size:2,children:S(U$,{label:"sub type",options:C,value:a,onChange:O})}),S(me,{size:2,children:S(U$,{label:"group by",options:E,value:l,onChange:P})}),S(me,{size:12,children:S(Zt,{width:"100%",height:400,children:S(nd,{width:"100%",height:"100%",children:Q(qz,{width:500,height:300,children:[S(Uf,{strokeDasharray:"3 3"}),S(ls,{dataKey:"category",type:"category",allowDuplicatedCategory:!1}),S(cs,{dataKey:"value"}),S(ba,{formatter:_=>Number.isInteger(_)?_.toFixed(0):_.toFixed(2)}),S(Oc,{layout:"vertical",verticalAlign:"middle",align:"right",wrapperStyle:{paddingLeft:"20px"}}),D.map(_=>S(qh,{dataKey:"value",data:_.data,name:_.name,stroke:A.next().value},_.name))]})})})}),Q(me,{size:12,children:[S(Zt,{height:20}),M()]})]})})},QOt=()=>{const[e]=je(),[t,n]=J.useState(!1),r=()=>n(!0),o=()=>n(!1);return Q("div",{children:[S(Lh,{color:"secondary","aria-label":"add",onClick:r,sx:{position:"fixed",bottom:"5rem",right:i=>i.spacing(2),zIndex:9},children:S(Ko,{})}),S(Bi,{title:e("add"),isOpen:t,closeFn:o,children:S(mH,{closeFn:o})})]})},FH=e=>{const[t,n]=je(),r=e.showTemplateChip??!0,o=e.linkDestination??Qt.ROUTINE_DETAIL,i=cn(o,n.language,{id:e.routine.id}),a=e.routine.name!==""?e.routine.name:t("routines.routine"),s=e.routine.isTemplate&&r?S(Wl,{color:"info",size:"small",label:t("routines.template")}):null;return Q(Tt,{children:[S(Co,{sx:{p:0},children:Q(Fl,{component:"a",href:i,children:[S(Wr,{primary:Q(Tt,{children:[a," ",s]}),secondary:`${e.routine.durationText} (${e.routine.start.toLocaleDateString()} - ${e.routine.end.toLocaleDateString()})`}),S(ede,{})]})}),S(ji,{component:"li"})]})},yee=()=>{const e=Oat(),[t]=je();return e.isLoading?S(Er,{}):S(ds,{title:t("routines.routines"),mainContent:S(Tt,{children:e.data.length===0?S(Bh,{}):S(go,{children:S(ai,{sx:{py:0},children:e.data.map(n=>S(FH,{routine:n},n.id))},"abc")})}),fab:S(QOt,{})})},XOt=()=>{const e=Iat(),[t]=je();return e.isLoading?S(Er,{}):S(ds,{title:t("routines.templates"),mainContent:S(Tt,{children:e.data.length===0?S(Bh,{}):S(go,{children:S(ai,{sx:{py:0},children:e.data.map(n=>S(FH,{routine:n,showTemplateChip:!1,linkDestination:Qt.TEMPLATE_DETAIL},n.id))},"abc")})})})},JOt=()=>{const e=Pat(),[t]=je();return e.isLoading?S(Er,{}):S(ds,{title:t("routines.publicTemplates"),mainContent:S(Tt,{children:e.data.length===0?S(Bh,{}):S(go,{children:S(ai,{sx:{py:0},children:e.data.map(n=>S(FH,{routine:n,linkDestination:Qt.TEMPLATE_DETAIL,showTemplateChip:!1},n.id))},"abc")})})})},ZOt=()=>S("div",{children:"About Page"});function jH(e){const[t]=je(),[n,r,o]=us(e.fieldName);return S(_c,{multiple:!0,freeSolo:!0,id:e.fieldName,value:n.value,options:n.value,onChange:(i,a)=>{o.setValue(a)},renderTags:(i,a)=>i.map((s,l)=>Sx(Wl,{label:s,...a({index:l}),key:l})),onBlur:n.onBlur,renderInput:i=>S(dn,{...i,id:"exerciseAliases",variant:"standard",label:t("exercises.alternativeNames"),error:r.touched&&!!r.error,helperText:r.touched&&r.error,value:n.value})})}function eIt(e){const[t]=je(),[n,r,o]=us(e.fieldName);return S(_c,{multiple:!0,id:e.fieldName,options:e.options.map(i=>i.id),getOptionLabel:i=>e.options.find(a=>a.id===i).translatedName,...n,onChange:(i,a)=>{o.setValue(a)},renderInput:i=>S(dn,{variant:"standard",label:t("exercises.equipment"),value:n.value,...i})})}function BH(e){const[t]=je(),[n,r]=us(e.fieldName);return S(dn,{fullWidth:!0,id:e.fieldName,label:t("name"),variant:"standard",error:r.touched&&!!r.error,helperText:r.touched&&r.error,...n})}function tIt(e){const[t]=je(),[n,r]=us(e.fieldName);return Q(Fh,{fullWidth:!0,children:[S(jh,{id:"label-category",children:t("category")}),S(Lf,{labelId:"label-category",id:"category",label:t("category"),error:r.touched&&!!r.error,...n,children:e.options}),r.touched&&!!r.error&&S(aw,{error:!0,children:r.error})]})}const qhe=5,Whe=40,zH=e=>Ho().min(qhe,e("forms.valueTooShort")).max(Whe,e("forms.valueTooLong")).required(e("forms.fieldRequired")),VH=e=>sh().ensure().compact().of(Ho().min(qhe,e("forms.valueTooShort")).max(Whe,e("forms.valueTooLong"))),HH=e=>Ho().min(40,e("forms.valueTooShort")).required(e("forms.fieldRequired")),Khe=e=>sh().ensure().compact().of(Ho().min(15,e("forms.valueTooShort"))),nIt=e=>Do().required(e("forms.fieldRequired"));var Yhe=(e=>(e[e.SET_NOTIFICATION=0]="SET_NOTIFICATION",e))(Yhe||{}),Wn=(e=>(e[e.RESET=0]="RESET",e[e.SET_NAME_EN=1]="SET_NAME_EN",e[e.SET_ALIASES_EN=2]="SET_ALIASES_EN",e[e.SET_DESCRIPTION_EN=3]="SET_DESCRIPTION_EN",e[e.SET_NOTES_EN=4]="SET_NOTES_EN",e[e.SET_CATEGORY=5]="SET_CATEGORY",e[e.SET_EQUIPMENT=6]="SET_EQUIPMENT",e[e.SET_PRIMARY_MUSCLES=7]="SET_PRIMARY_MUSCLES",e[e.SET_MUSCLES_SECONDARY=8]="SET_MUSCLES_SECONDARY",e[e.SET_VARIATION_ID=9]="SET_VARIATION_ID",e[e.SET_NEW_VARIATION_BASE_ID=10]="SET_NEW_VARIATION_BASE_ID",e[e.SET_LANGUAGE=11]="SET_LANGUAGE",e[e.SET_NAME_I18N=12]="SET_NAME_I18N",e[e.SET_ALIASES_I18N=13]="SET_ALIASES_I18N",e[e.SET_DESCRIPTION_I18N=14]="SET_DESCRIPTION_I18N",e[e.SET_NOTES_I18N=15]="SET_NOTES_I18N",e[e.SET_IMAGES=16]="SET_IMAGES",e))(Wn||{});const vee=e=>({type:Yhe.SET_NOTIFICATION,payload:e}),bee={notification:{notify:!1,message:"",severity:void 0,title:"",type:void 0}},rIt=x.createContext([bee,()=>bee]),oIt=()=>x.useContext(rIt),iIt=e=>({type:Wn.SET_NAME_EN,payload:e}),aIt=e=>({type:Wn.SET_DESCRIPTION_EN,payload:e}),sIt=e=>({type:Wn.SET_NOTES_EN,payload:e}),lIt=e=>({type:Wn.SET_ALIASES_EN,payload:e}),cIt=e=>({type:Wn.SET_NAME_I18N,payload:e}),uIt=e=>({type:Wn.SET_DESCRIPTION_I18N,payload:e}),dIt=e=>({type:Wn.SET_NOTES_I18N,payload:e}),fIt=e=>({type:Wn.SET_ALIASES_I18N,payload:e}),pIt=e=>({type:Wn.SET_CATEGORY,payload:e}),hIt=e=>({type:Wn.SET_EQUIPMENT,payload:e}),mIt=e=>({type:Wn.SET_PRIMARY_MUSCLES,payload:e}),gIt=e=>({type:Wn.SET_MUSCLES_SECONDARY,payload:e}),yIt=e=>({type:Wn.SET_VARIATION_ID,payload:e}),vIt=e=>({type:Wn.SET_NEW_VARIATION_BASE_ID,payload:e}),bIt=e=>({type:Wn.SET_LANGUAGE,payload:e}),xIt=e=>({type:Wn.SET_IMAGES,payload:e}),SIt=(e,t)=>{if(t===void 0)return e;switch(t.type){case Wn.RESET:return BO;case Wn.SET_NAME_EN:return{...e,nameEn:t.payload};case Wn.SET_DESCRIPTION_EN:return{...e,descriptionEn:t.payload};case Wn.SET_NOTES_EN:return{...e,notesEn:t.payload};case Wn.SET_ALIASES_EN:return{...e,alternativeNamesEn:t.payload};case Wn.SET_CATEGORY:return{...e,category:t.payload};case Wn.SET_EQUIPMENT:return{...e,equipment:t.payload};case Wn.SET_PRIMARY_MUSCLES:return{...e,muscles:t.payload};case Wn.SET_MUSCLES_SECONDARY:return{...e,musclesSecondary:t.payload};case Wn.SET_VARIATION_ID:return{...e,variationId:t.payload};case Wn.SET_NEW_VARIATION_BASE_ID:return{...e,newVariationExerciseId:t.payload};case Wn.SET_LANGUAGE:return{...e,languageId:t.payload};case Wn.SET_NAME_I18N:return{...e,nameI18n:t.payload};case Wn.SET_DESCRIPTION_I18N:return{...e,descriptionI18n:t.payload};case Wn.SET_NOTES_I18N:return{...e,notesI18n:t.payload};case Wn.SET_ALIASES_I18N:return{...e,alternativeNamesI18n:t.payload};case Wn.SET_IMAGES:return{...e,images:t.payload};default:return e}},BO={category:null,muscles:[],musclesSecondary:[],variationId:null,newVariationExerciseId:null,languageId:null,equipment:[],nameEn:"",descriptionEn:"",alternativeNamesEn:[],notesEn:[],nameI18n:"",alternativeNamesI18n:[],descriptionI18n:"",notesI18n:[],images:[]},Qhe=x.createContext([BO,()=>BO]),wIt=({children:e})=>{const[t,n]=x.useReducer(SIt,BO);return S(Qhe.Provider,{value:[t,n],children:e})},Qv=()=>x.useContext(Qhe),CIt=({onContinue:e})=>{const[t]=je(),[n,r]=Qv(),[o,i]=x.useState(n.muscles),[a,s]=x.useState(n.musclesSecondary);x.useEffect(()=>{r(mIt(o))},[r,o]),x.useEffect(()=>{r(gIt(a))},[r,a]);const l=DP(),c=_v(),u=kP(),f=Wo({nameEn:zH(t),newAlternativeNameEn:VH(t),category:nIt(t)});return S(Ti,{initialValues:{nameEn:n.nameEn,newAlternativeNameEn:n.alternativeNamesEn,category:n.category!==null?n.category:"",muscles:n.muscles,equipment:n.equipment,musclesSecondary:n.musclesSecondary},validationSchema:f,onSubmit:h=>{r(iIt(h.nameEn)),r(pIt(h.category)),r(lIt(h.newAlternativeNameEn)),r(hIt(h.equipment)),e()},children:h=>Q(fi,{children:[Q(Ft,{spacing:2,children:[S(BH,{fieldName:"nameEn"}),S(jH,{fieldName:"newAlternativeNameEn"}),l.isLoading?Q(Zt,{children:[" ",S(Qa,{})," "]}):S(tIt,{fieldName:"category",options:l.data.map(m=>S(Jt,{value:m.id,children:m.translatedName},m.id))}),u.isLoading?Q(Zt,{children:[" ",S(Qa,{})," "]}):S(eIt,{fieldName:"equipment",options:u.data}),c.isLoading?Q(Zt,{children:[" ",S(Qa,{})," "]}):Q(Tt,{children:[S(_c,{multiple:!0,id:"muscles",options:c.data.map(m=>m.id),getOptionDisabled:m=>a.includes(m),getOptionLabel:m=>c.data.find(g=>g.id===m).getName(),value:o,onChange:(m,g)=>{i(g)},renderInput:m=>S(dn,{...m,variant:"standard",label:t("exercises.muscles"),value:h.getFieldProps("muscles").value,onChange:g=>{h.setFieldValue(h.getFieldProps("muscles").name,g.target.value)}})}),S(_c,{multiple:!0,id:"secondary-muscles",options:c.data.map(m=>m.id),getOptionDisabled:m=>o.includes(m),getOptionLabel:m=>c.data.find(g=>g.id===m).getName(),value:a,onChange:(m,g)=>{s(g)},renderInput:m=>S(dn,{...m,variant:"standard",label:t("exercises.secondaryMuscles"),value:h.getFieldProps("muscles").value})})]}),Q(me,{container:!0,children:[S(me,{display:"flex",justifyContent:"center",size:6,children:S(Ql,{primaryMuscles:o.map(m=>c.data.find(g=>g.id===m)),secondaryMuscles:a.map(m=>c.data.find(g=>g.id===m)),isFront:!0})}),S(me,{display:"flex",justifyContent:"center",size:6,children:S(Ql,{primaryMuscles:o.map(m=>c.data.find(g=>g.id===m)),secondaryMuscles:a.map(m=>c.data.find(g=>g.id===m)),isFront:!1})})]})]}),S(me,{container:!0,children:S(me,{display:"flex",justifyContent:"end",size:12,children:S(Zt,{sx:{mb:2},children:S("div",{children:S(ct,{variant:"contained",type:"submit",sx:{mt:1,mr:1},children:t("continue")})})})})})]})})};function EIt(e,t){const n=new Map;return e.forEach(r=>{const o=t(r),i=n.get(o);i?i.push(r):n.set(o,[r])}),n}const xee=({exercises:e})=>{const r=e[0].variationId,o=e[0].id,[i,a]=Qv(),[s,l]=x.useState(!1),[c,u]=x.useState(i.variationId),[f,h]=x.useState(i.newVariationExerciseId);x.useEffect(()=>{a(yIt(c))},[a,c]),x.useEffect(()=>{a(vIt(f))},[a,f]);const m=(y,v)=>()=>{y!==null?(v=null,y===i.variationId&&(y=null)):(y=null,v===i.newVariationExerciseId&&(v=null)),u(y),h(v)};let g;return r===null?g=i.newVariationExerciseId===o:g=r===i.variationId,S(Co,{disableGutters:!0,children:S(Fl,{onClick:m(r,o),children:Q(me,{container:!0,children:[S(me,{display:"flex",justifyContent:"start",alignItems:"center",size:{xs:12,sm:3},children:S(Y1e,{max:4,spacing:"small",children:e.map(y=>y.mainImage?S(Kl,{src:y.mainImage.url},y.id):S(Kl,{children:S(Ju,{})},y.id))})}),Q(me,{size:{xs:10,sm:7},children:[e.slice(0,s?e.length:5).map(y=>S("p",{style:{margin:0},children:y.getTranslation().name},y.id)),!s&&e.length>5?S(Du,{onMouseEnter:()=>l(!0)}):null]}),S(me,{display:"flex",justifyContent:"end",size:{xs:2,sm:2},children:S(qo,{edge:"start",checked:g,tabIndex:-1,disableRipple:!0},`variation-${r}`)}),S(me,{size:12,children:S(ji,{sx:{pt:1}})})]})})})},TIt=({onContinue:e,onBack:t})=>{const[n]=je(),r=ade(),[o,i]=x.useState("");let a=[],s=new Map;return r.isSuccess&&(a=r.data,o!==""&&(a=a.filter(l=>l.getTranslation().name.toLowerCase().includes(o.toLowerCase())))),s=EIt(a.filter(l=>l.variationId!==null),l=>l.variationId),Q(Tt,{children:[Q(me,{container:!0,children:[S(me,{size:{xs:12,sm:6},children:S(at,{children:n("exercises.whatVariationsExist")})}),S(me,{display:"flex",justifyContent:"end",size:{xs:12,sm:6},children:S(dn,{label:n("exercises.filterVariations"),variant:"standard",onChange:l=>i(l.target.value),InputProps:{startAdornment:S(So,{position:"start",children:S(yV,{})})}})})]}),r.isLoading?S(Er,{}):S(go,{elevation:2,sx:{mt:2},children:Q(ai,{style:{maxHeight:"400px",overflowY:"scroll"},children:[a.filter(l=>l.variationId===null).map(l=>S(xee,{exercises:[l]},"base-"+l.id)),[...s.keys()].map(l=>S(xee,{exercises:s.get(l)},"variation-"+l))]})}),Q(Ci,{severity:"info",variant:"filled",sx:{mt:2},children:[S(fh,{children:n("exercises.identicalExercise")}),n("exercises.identicalExercisePleaseDiscard")]}),S(me,{container:!0,children:S(me,{display:"flex",justifyContent:"end",size:12,children:S(Zt,{sx:{mb:2},children:Q("div",{children:[S(ct,{disabled:!1,onClick:t,sx:{mt:1,mr:1},children:n("goBack")}),S(ct,{variant:"contained",onClick:e,sx:{mt:1,mr:1},children:n("continue")})]})})})})]})};function OIt(e){const{t}=je(),[n,r]=J.useState(e.initial.toString()),o=DP(),i=Ra(),a=async s=>{r(s.target.value),await PB(e.exerciseId,{category:parseInt(s.target.value),license_author:i.data.username})};return o.isSuccess?Q(Fh,{fullWidth:!0,children:[S(jh,{id:"label-category",children:t("category")}),S(Lf,{labelId:"label-category",id:"category",label:t("category"),value:n,onChange:a,children:o.data.map(s=>S(Jt,{value:s.id,children:s.translatedName},s.id))})]}):null}function IIt(e){const{t}=je(),[n,r]=J.useState(e.initial),o=kP(),i=Ra(),a=async s=>{r(s),await PB(e.exerciseId,{equipment:s,license_author:i.data.username})};return o.isSuccess?S(_c,{multiple:!0,value:n,options:o.data.map(s=>s.id),getOptionLabel:s=>o.data.find(l=>l.id===s).translatedName,onChange:(s,l)=>a(l),renderInput:s=>S(dn,{variant:"standard",label:t("exercises.equipment"),value:n,...s})}):null}var Uo=function(){return Uo=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Uo.apply(this,arguments)};function iA(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function See(e){if(e){var t=e.textContent,n=/[\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC]/;e.style.direction=t&&n.test(t[0])?"rtl":"ltr"}}function Xhe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter(Boolean).join(" ")}function PIt(){if(document.selection)return document.selection.createRange().parentElement();var e=window.getSelection();if(e&&e.rangeCount>0)return e.getRangeAt(0).startContainer.parentNode||void 0}function wee(e){return e?e.replace(/&nbsp;|\u202F|\u00A0/g," ").replace(/<br \/>/g,"<br>"):""}function AIt(e){var t=document.createTextNode("");e.appendChild(t);var n=document.activeElement===e;if(t!==null&&t.nodeValue!==null&&n){var r=window.getSelection();if(r!==null){var o=document.createRange();o.setStart(t,t.nodeValue.length),o.collapse(!0),r.removeAllRanges(),r.addRange(o)}e instanceof HTMLElement&&e.focus()}}function Jhe(e,t){typeof t=="function"?t(e):typeof t=="object"&&t&&(t.current=e)}var MIt=J.memo(J.forwardRef(function(t,n){var r=t.className,o=t.disabled,i=t.tagName,a=t.value,s=a===void 0?"":a,l=t.placeholder,c=iA(t,["className","disabled","tagName","value","placeholder"]),u=J.useRef(null),f=J.useRef(s),h=J.useRef(c);return J.useEffect(function(){h.current=c;var m=u.current;m&&wee(f.current)!==wee(s)&&(f.current=s,m.innerHTML=s,AIt(m))}),J.useMemo(function(){function m(v){u.current=v,See(v),Jhe(v,n)}function g(v){var w,C,E=u.current;if(E){var I=E.innerHTML;I!==f.current&&((C=(w=h.current).onChange)===null||C===void 0||C.call(w,Uo(Uo({},v),{target:{value:I,name:c.name}}))),See(E),f.current=I}}var y=Xhe("rsw-ce",r);return J.createElement(i||"div",Uo(Uo({},c),{className:y,contentEditable:!o,dangerouslySetInnerHTML:{__html:s},onBlur:function(v){return(h.current.onBlur||g)(v)},onInput:g,onKeyDown:function(v){return(h.current.onKeyDown||g)(v)},onKeyUp:function(v){return(h.current.onKeyUp||g)(v)},placeholder:l,ref:m}))},[r,o,l,i])})),Zhe=J.createContext(void 0);function eme(e){var t=e.children,n=J.useState({htmlMode:!1,update:i}),r=n[0],o=n[1];function i(a){o(function(s){return Uo(Uo({},s),a)})}return J.createElement(Zhe.Provider,{value:r},t)}function nC(){var e=J.useContext(Zhe);if(!e)throw new Error("You should wrap your component by EditorProvider");return e}var Cee=[],P0=[];function RIt(e,t){if(e&&typeof document<"u"){var n,r=t.prepend===!0?"prepend":"append",o=t.singleTag===!0,i=typeof t.container=="string"?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(o){var a=Cee.indexOf(i);a===-1&&(a=Cee.push(i)-1,P0[a]={}),n=P0[a]&&P0[a][r]?P0[a][r]:P0[a][r]=s()}else n=s();e.charCodeAt(0)===65279&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function s(){var l=document.createElement("style");if(l.setAttribute("type","text/css"),t.attributes)for(var c=Object.keys(t.attributes),u=0;u<c.length;u++)l.setAttribute(c[u],t.attributes[c[u]]);var f=r==="prepend"?"afterbegin":"beforeend";return i.insertAdjacentElement(f,l),l}}var DIt=".rsw-editor{border:1px solid #ddd;border-radius:.375rem;display:flex;flex-direction:column;min-height:100px;overflow:hidden}.rsw-ce{flex:1 0 auto;padding:.5rem}.rsw-ce:focus{outline:1px solid #668}.rsw-ce[contentEditable=true]:empty:not(:focus):before{color:grey;content:attr(placeholder);pointer-events:none}.rsw-html{background:transparent;border:none;font-family:monospace,Courier New}.rsw-separator{align-self:stretch;border-right:1px solid #ddd;display:flex;margin:0 3px}.rsw-dd{box-sizing:border-box;outline:none}.rsw-btn{background:transparent;border:0;color:#222;cursor:pointer;font-size:1em;height:2em;outline:none;padding:0;width:2em}.rsw-btn:hover{background:#eaeaea}.rsw-btn[data-active=true]{background:#e0e0e0}.rsw-toolbar{align-items:center;background-color:#f5f5f5;border-bottom:1px solid #ddd;display:flex}";RIt(DIt,{});var tme=J.forwardRef(function(t,n){var r=t.autoFocus,o=t.children,i=t.containerProps,a=t.onSelect,s=iA(t,["autoFocus","children","containerProps","onSelect"]),l=nC();J.useEffect(function(){return document.addEventListener("click",c),function(){return document.removeEventListener("click",c)}});function c(m){var g;m.target!==l.$el&&(!((g=l.$el)===null||g===void 0)&&g.contains(m.target)||l.update({$selection:void 0}))}function u(m){a==null||a(m),l.update({$selection:PIt()})}function f(m){l.update({$el:m}),Jhe(m,n),r&&m&&l.$el===void 0&&m.focus()}var h=Xhe("rsw-editor",i==null?void 0:i.className);return l.htmlMode?J.createElement("div",Uo({},i,{className:h}),o,J.createElement("textarea",Uo({},s,{className:"rsw-ce rsw-html"}))):J.createElement("div",Uo({},i,{className:h}),o,J.createElement(MIt,Uo({},s,{ref:f,onSelect:u})))});function kIt(){return J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",style:{verticalAlign:"text-top"}},J.createElement("path",{fill:"currentColor",d:"M6.99938 12.998v-2H20.9994v2H6.99938zm0 6.0001v-2H20.9994v2H6.99938zm0-12.00001v-2H20.9994v2H6.99938zm-4 1v-3h-1v-1h2v4h-1zm-1 9.00001v-1h3v4h-3v-1h2v-.5h-1v-1h1v-.5h-2zM4.25 10c.41421 0 .75.3358.75.75 0 .2024-.08017.3861-.2105.521L3.11983 13H5v1H2v-.9218L4 11H2v-1h2.25z"}))}function _It(){return J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",style:{verticalAlign:"text-top"}},J.createElement("path",{fill:"currentColor",d:"M7 5h14v2H7V5zm0 8v-2h14v2H7zM4 4.50001c.83 0 1.5.66992 1.5 1.5 0 .83007-.67 1.5-1.5 1.5s-1.5-.66993-1.5-1.5c0-.83008.67-1.5 1.5-1.5zM4 10.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5-1.5-.67-1.5-1.5.67-1.5 1.5-1.5zM7 19v-2h14v2H7zm-3-2.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5-1.5-.67-1.5-1.5.67-1.5 1.5-1.5z"}))}var nme=Zc("Bold","𝐁","bold"),rme=Zc("Bullet list",J.createElement(_It,null),"insertUnorderedList"),$It=Zc("Clear formatting","T̲ₓ","removeFormat"),ome=Zc("Italic","𝑰","italic"),NIt=Zc("Strike through",J.createElement("s",null,"ab"),"strikeThrough"),LIt=Zc("Link","🔗",function(e){var t=e.$selection;(t==null?void 0:t.nodeName)==="A"?document.execCommand("unlink"):document.execCommand("createLink",!1,prompt("URL","")||void 0)}),ime=Zc("Numbered list",J.createElement(kIt,null),"insertOrderedList"),ame=Zc("Redo","↷","redo"),sme=Zc("Underline",J.createElement("span",{style:{textDecoration:"underline"}},"𝐔"),"underline"),lme=Zc("Undo","↶","undo");function Zc(e,t,n){return r.displayName=e.replace(/\s/g,""),r;function r(o){var i=nC(),a=i.$el,s=i.$selection,l=!1;typeof n=="string"&&(l=!!s&&document.queryCommandState(n));function c(u){u.preventDefault(),document.activeElement!==a&&(a==null||a.focus()),typeof n=="function"?n(i):document.execCommand(n)}return i.htmlMode?null:J.createElement("button",Uo({className:"rsw-btn","data-active":l,onMouseDown:c,tabIndex:-1,title:e,type:"button"},o),t)}}var FIt=jIt("Styles",[["Normal","formatBlock","DIV"],["𝗛𝗲𝗮𝗱𝗲𝗿 𝟭","formatBlock","H1"],["Header 2","formatBlock","H2"],["𝙲𝚘𝚍𝚎","formatBlock","PRE"]]);function jIt(e,t){return n.displayName=e,n;function n(r){var o=nC(),i=o.$el,a=o.$selection,s=o.htmlMode;if(s)return null;var l=t.findIndex(function(u){return u[1]==="formatBlock"&&(a==null?void 0:a.nodeName)===u[2]});return J.createElement(BIt,Uo({},r,{items:t,onChange:c,selected:l,tabIndex:-1,title:e}));function c(u){var f=u.target,h=f.value,m=parseInt(h,10),g=t[m]||[],y=g[1],v=g[2];u.preventDefault(),document.activeElement!==i&&(i==null||i.focus()),typeof y=="function"?y(o):y&&document.execCommand(y,!1,v),setTimeout(function(){return f.value=h},10)}}}function BIt(e){var t=e.items,n=e.selected,r=iA(e,["items","selected"]);return J.createElement("select",Uo({className:"rsw-dd"},r,{value:n}),J.createElement("option",{hidden:!0},r.title),t.map(function(o,i){return J.createElement("option",{key:o[2],value:i},o[0])}))}function zIt(e){var t=iA(e,[]),n=nC();function r(){n.update({htmlMode:!n.htmlMode})}return J.createElement("button",Uo({className:"rsw-btn","data-active":n.htmlMode,onClick:r,tabIndex:-1,title:"HTML mode",type:"button"},t),"</>")}function Pg(e){var t=nC();return t.htmlMode?null:J.createElement("div",Uo({className:"rsw-separator"},e))}function cme(e){return J.createElement("div",Uo({className:"rsw-toolbar"},e))}J.forwardRef(function(t,n){return J.createElement(eme,null,J.createElement(tme,Uo({},t,{ref:n}),t.children||J.createElement(cme,null,J.createElement(lme,null),J.createElement(ame,null),J.createElement(Pg,null),J.createElement(nme,null),J.createElement(ome,null),J.createElement(sme,null),J.createElement(NIt,null),J.createElement(Pg,null),J.createElement(ime,null),J.createElement(rme,null),J.createElement(Pg,null),J.createElement(LIt,null),J.createElement($It,null),J.createElement(zIt,null),J.createElement(Pg,null),J.createElement(FIt,null))))});function VIt(e){return S(eme,{children:S(tme,{...e,children:Q(cme,{children:[S(nme,{}),S(ome,{}),S(sme,{}),S(Pg,{}),S(rme,{}),S(ime,{}),S(Pg,{}),S(lme,{}),S(ame,{})]})})})}function UH(e){const[t,n,r]=us(e.fieldName);return Q(Tt,{children:[S("div",{"data-testid":"jodit-editor",children:S(VIt,{value:t.value,onChange:o=>r.setValue(o.target.value)})}),n.touched&&!!n.error&&S(aw,{error:!0,children:n.error})]})}const HIt=({exerciseId:e,image:t,canDelete:n})=>{const[r]=je(),o=alt(e);return Q(ho,{children:[S($c,{component:"img",image:t.url,sx:{height:120},alt:""}),S(ll,{children:n&&S(ct,{color:"primary",onClick:()=>o.mutate(t.id),children:r("delete")})})]})},UIt=({exerciseId:e})=>{const[t]=je(),n=Ra(),r=slt(e),o=async i=>{var s;if(!((s=i.target.files)!=null&&s.length))return;const[a]=i.target.files;n.isSuccess&&await r.mutate({exerciseId:e,image:a,imageData:{url:"",file:a,author:"",authorUrl:"",title:"",objectUrl:"",derivativeSourceUrl:"",style:""}})};return Q(ho,{children:[S($c,{children:S(Zt,{sx:{backgroundColor:"lightgray",height:120},display:"flex",alignItems:"center",justifyContent:"center",children:S(Jue,{sx:{fontSize:80,color:"gray"}})})}),S(ll,{children:Q(ct,{component:"label",children:[t("add"),S("input",{style:{display:"none"},id:"camera-input",type:"file",accept:"image/*",capture:"environment",onChange:o})]})})]})};function Eee(e){const{t}=je(),n=_v(),r=async o=>{e.setValue(o),await PB(e.exerciseId,e.isMain?{muscles:o}:{muscles_secondary:o})};return n.isSuccess?S(_c,{multiple:!0,options:n.data.map(o=>o.id),getOptionDisabled:o=>e.blocked.includes(o),getOptionLabel:o=>n.data.find(i=>i.id===o).getName(t),value:e.value,onChange:(o,i)=>r(i),renderInput:o=>S(dn,{...o,variant:"standard",label:t(e.isMain?"exercises.muscles":"exercises.secondaryMuscles"),value:e.value})}):null}const GIt=({video:e,canDelete:t})=>{const[n]=je();return Q(ho,{children:[S($c,{component:"video",src:e.url,sx:{height:120},controls:!0,preload:"metadata"}),S(ll,{children:t&&S(ct,{color:"primary",onClick:()=>O2e(e.id),children:n("delete")})})]})},qIt=({exerciseId:e})=>{const[t]=je(),n=Ra(),r=async o=>{var a;if(!((a=o.target.files)!=null&&a.length))return;const[i]=o.target.files;n.isSuccess&&await T2e(e,n.data.username,i)};return Q(ho,{children:[S($c,{children:S(Zt,{sx:{backgroundColor:"lightgray",height:120},display:"flex",alignItems:"center",justifyContent:"center",children:S(Jue,{sx:{fontSize:80,color:"gray"}})})}),S(ll,{children:Q(ct,{component:"label",children:[t("add"),S("input",{style:{display:"none"},id:"camera-input",type:"file",accept:"video/*",capture:"environment",onChange:r})]})})]})},WIt="check-permission",KIt=async e=>{const t=ft(WIt,{query:{permission:e}}),n=await it.get(t,{headers:ht()});return n.status===400?!1:n.data.result};function ef(e){return yr({queryKey:[l2e,e],queryFn:()=>KIt(e.valueOf())})}var Pu=(e=>(e.EDIT_EXERCISE="exercises.change_exercise",e.DELETE_EXERCISE="exercises.delete_exercise",e.ADD_IMAGE="exercises.add_exerciseimage",e.EDIT_IMAGE="exercises.change_exerciseimage",e.DELETE_IMAGE="exercises.delete_exerciseimage",e.ADD_VIDEO="exercises.add_exercisevideo",e.EDIT_VIDEO="exercises.change_exercisevideo",e.DELETE_VIDEO="exercises.delete_exercisevideo",e))(Pu||{});const YIt=({exerciseId:e,language:t})=>{const[n]=je(),[r,o]=x.useState(!1),[i,a]=x.useState([]),[s,l]=x.useState([]),c=rlt(e),u=olt(e),f=ilt(e),h=ef(Pu.ADD_IMAGE),m=ef(Pu.DELETE_IMAGE),g=ef(Pu.ADD_VIDEO),y=ef(Pu.DELETE_VIDEO),v=ef(Pu.EDIT_EXERCISE),w=_v(),C=Ra(),E=c.data;if(x.useEffect(()=>{c.data!==void 0&&(a(E.muscles.map(M=>M.id)),l(E.musclesSecondary.map(M=>M.id)))},[c.data]),c.isLoading||w.isLoading||c.isLoading||C.isLoading||h.isLoading||m.isLoading||g.isLoading||y.isLoading||v.isLoading)return S(Qa,{});const I=E.getTranslation(t),P=t.id!==(I==null?void 0:I.language)?new Dre(null,null,"","",t.id):I,R=E.getTranslation(),D=Wo({name:zH(n),alternativeNames:VH(n),description:HH(n)});return Q(Tt,{children:[S(Ti,{initialValues:{name:P.name,alternativeNames:P.aliases.map(M=>M.alias),description:P.description},enableReinitialize:!0,validationSchema:D,onSubmit:async M=>{const A=P.id?await f.mutateAsync({id:P.id,exerciseId:E.id,languageId:t.id,name:M.name,description:M.description,author:""}):await u.mutateAsync({exerciseId:E.id,languageId:t.id,name:M.name,description:M.description,author:C.data.username}),_=P.aliases.map(j=>j.alias),N=M.alternativeNames,B=N.filter(j=>!_.includes(j)),H=_.filter(j=>!N.includes(j));B.forEach(j=>{XN(A.id,j)}),H.forEach(j=>{E2e(P.aliases.find(L=>L.alias===j).id)}),o(!0)},children:S(fi,{children:Q(me,{container:!0,spacing:1,children:[r&&Q(me,{size:12,children:[S(Ci,{severity:"success",action:S(pn,{"aria-label":"close",size:"small",color:"inherit",onClick:()=>{o(!1)},children:S(cw,{fontSize:"inherit"})}),children:n("exercises.successfullyUpdated")}),S(yi,{})]}),S(me,{size:6,children:S(at,{variant:"h5",children:n("English")})}),S(me,{size:6,children:Q(at,{variant:"h5",children:[t.nameLong," (",t.nameShort,")"]})}),Q(me,{size:12,children:[S(yi,{}),S(at,{variant:"h6",children:n("name")})]}),Q(me,{size:6,children:[R.name,S("ul",{children:R.aliases.map(M=>S("li",{children:M.alias},M.id))})]}),Q(me,{size:6,children:[S(Zt,{mb:2,children:S(BH,{fieldName:"name"})}),S(jH,{fieldName:"alternativeNames"})]}),S(me,{size:12,children:S(yi,{})}),S(me,{size:12,children:S(at,{variant:"h6",children:n("exercises.description")})}),S(me,{size:{xs:12,md:6},children:S("div",{dangerouslySetInnerHTML:{__html:R.description}})}),S(me,{size:{xs:12,md:6},children:S(UH,{fieldName:"description"})}),v.data&&Q(Tt,{children:[S(me,{size:12,children:S(yi,{})}),S(me,{size:{xs:12,md:6},children:S(OIt,{exerciseId:E.id,initial:E.category.id})}),S(me,{size:{xs:12,md:6},children:S(IIt,{exerciseId:E.id,initial:E.equipment.map(M=>M.id)})})]}),Q(me,{size:12,children:[S(yi,{}),S(ct,{variant:"contained",type:"submit",sx:{mt:1,mr:1},disabled:c.isLoading||u.isPending||f.isPending,children:n("save")})]})]})})}),S(yi,{}),S(at,{variant:"h6",children:n("images")}),Q(me,{container:!0,spacing:2,mt:2,children:[h.data&&S(me,{size:{md:3},children:S(UIt,{exerciseId:E.id})},"add"),E.images.map(M=>S(me,{size:{md:3},children:S(HIt,{exerciseId:E.id,image:M,canDelete:m.data})},M.id))]}),S(yi,{}),S(at,{variant:"h6",children:n("videos")}),Q(me,{container:!0,spacing:2,mt:2,children:[g.data&&S(me,{size:{md:3},children:S(qIt,{exerciseId:E.id})},"add"),E.videos.map(M=>S(me,{size:{md:3},children:S(GIt,{video:M,canDelete:y.data})},M.id))]}),v.data&&Q(Tt,{children:[S(yi,{}),S(at,{variant:"h6",children:n("exercises.muscles")}),Q(me,{container:!0,spacing:1,mt:2,children:[S(me,{size:{xs:12,md:6},children:S(Eee,{exerciseId:E.id,value:i,setValue:a,blocked:s,isMain:!0})}),S(me,{size:{xs:12,md:6},children:S(Eee,{exerciseId:E.id,value:s,setValue:l,blocked:i,isMain:!1})}),S(me,{size:{sm:6},offset:{md:3},children:Q(me,{container:!0,children:[S(me,{display:"flex",justifyContent:"center",size:6,children:S(Ql,{primaryMuscles:i.map(M=>w.data.find(A=>A.id===M)),secondaryMuscles:s.map(M=>w.data.find(A=>A.id===M)),isFront:!0})}),S(me,{display:"flex",justifyContent:"center",size:6,children:S(Ql,{primaryMuscles:i.map(M=>w.data.find(A=>A.id===M)),secondaryMuscles:s.map(M=>w.data.find(A=>A.id===M)),isFront:!1})})]})})]})]})]})},QIt=({mainImage:e,sideImages:t})=>Q(me,{container:!0,spacing:1,children:[e&&S(me,{size:12,children:S(ho,{children:S($c,{component:"img",image:e.url,alt:""})})}),t.map(n=>S(me,{size:6,children:S(ho,{children:S($c,{component:"img",image:n.url,sx:{height:120},alt:""})})},n.id))]}),XIt=({videos:e})=>S(me,{container:!0,spacing:1,children:e.map(t=>S(me,{size:6,children:S(ho,{children:S($c,{component:"video",src:t.url,sx:{height:120},controls:!0,muted:!0,preload:"metadata"})})},t.id))});function GH(){var r,o;const e=Ra(),t=ef(Pu.EDIT_EXERCISE),n={canContribute:!1,anonymous:!0,emailVerified:!1,admin:!1};if(e.isSuccess&&t.isSuccess){if(e.data===null)return n;n.anonymous=!1,(r=e.data)!=null&&r.emailVerified&&(n.emailVerified=!0),t.data&&(n.admin=!0),(n.admin||(o=e.data)!=null&&o.isTrustworthy)&&(n.canContribute=!0)}return n}const JIt=({setEditMode:e})=>{const[t]=je();return Q(Zt,{mb:2,paddingY:2,sx:{width:"100%",backgroundColor:"#ebebeb",textAlign:"center"},children:[S(at,{variant:"h5",children:t("exercises.exerciseNotTranslated")}),S(at,{gutterBottom:!0,variant:"body1",component:"div",children:t("exercises.exerciseNotTranslatedBody")}),S(ct,{variant:"contained",onClick:()=>e(!0),children:t("exercises.translateExerciseNow")})]})},ZIt=({exercise:e,variations:t,language:n,setEditMode:r})=>{var l;const[o]=je(),i=GH(),a=e.getTranslation(n),s=n&&n.id!==a.language;return Q(me,{container:!0,children:[s&&i.canContribute&&S(me,{order:{xs:2,sm:1},size:{xs:12,sm:7,md:12},children:S(JIt,{setEditMode:r})}),Q(me,{order:{xs:2,sm:1},size:{xs:12,sm:7,md:8},children:[(a==null?void 0:a.aliases.length)>0&&Q(Tt,{children:[Q("p",{children:[o("exercises.alsoKnownAs"),"  ",(l=a==null?void 0:a.aliases)==null?void 0:l.map(c=>c.alias).join(", ")]}),S(yi,{})]}),S(at,{variant:"h5",children:o("exercises.description")}),S("div",{dangerouslySetInnerHTML:{__html:a==null?void 0:a.description}}),S(yi,{}),(a==null?void 0:a.notes.length)>0&&S(at,{variant:"h5",children:o("exercises.notes")}),S("ul",{children:a==null?void 0:a.notes.map(c=>S("li",{children:c.note},c.id))}),S(yi,{}),S(at,{variant:"h5",children:o("exercises.muscles")}),Q(me,{container:!0,children:[S(me,{order:{xs:1},size:{xs:6,md:3},children:S(Ql,{primaryMuscles:e.muscles,secondaryMuscles:e.musclesSecondary,isFront:!0})}),Q(me,{order:{xs:2,md:3},size:{xs:6,md:3},children:[S("h3",{children:o("exercises.primaryMuscles")}),S("ul",{children:e.muscles.map(c=>S("li",{children:c.getName()},c.id))})]}),S(me,{order:{xs:3,md:2},size:{xs:6,md:3},children:S(Ql,{primaryMuscles:e.muscles,secondaryMuscles:e.musclesSecondary,isFront:!1})}),Q(me,{order:{xs:4},size:{xs:6,md:3},children:[S("h3",{children:o("exercises.secondaryMuscles")}),S("ul",{children:e.musclesSecondary.map(c=>S("li",{children:c.getName()},c.id))})]})]}),S(yi,{})]}),Q(me,{order:{xs:1,sm:2},size:{xs:12,sm:5,md:4},children:[S(QIt,{mainImage:e.mainImage,sideImages:e.sideImages}),S(yi,{}),S(XIt,{videos:e.videos})]}),Q(me,{order:{xs:3},size:12,children:[S(ji,{}),S(yi,{}),t.length>0&&S(at,{variant:"h5",children:o("exercises.variations")}),S(me,{container:!0,spacing:2,children:t.map(c=>S(me,{size:{xs:6,md:2},children:S(Rde,{exercise:c,language:n},c.id)},c.id))})]}),S(me,{order:{xs:4},size:12,children:Q(at,{variant:"caption",display:"block",mt:2,children:["The text on this page is available under the ",S("a",{href:"https://creativecommons.org/licenses/by-sa/4.0/deed",children:"CC BY-SA 4 License"}),"."]})})]})};function ePt(e){var f,h;const[t,n]=J.useState(null),[r,o]=J.useState(null),[i]=je(),a=id(),s=()=>{o(null),n(null)},l=async()=>{var m;await x2e((m=e.currentExercise.getTranslation(e.currentLanguage))==null?void 0:m.id),e.onClose(),e.onChangeLanguage()},c=async(m=!1)=>{m?await pq(e.currentExercise.id,r==null?void 0:r.uuid):await pq(e.currentExercise.id),e.onClose(),a("../overview")},u=async m=>{const g=m!==void 0?m:t;if(g!==null)try{const y=await pv(g);o(y)}catch{o(null)}};return Q(Tt,{children:[S(ZE,{id:"alert-dialog-title",children:i("delete")}),Q(Ax,{children:[S("p",{children:i("exercises.deleteExerciseBody",{name:(f=e.currentExercise.getTranslation(e.currentLanguage))==null?void 0:f.name,language:(h=e.currentLanguage)==null?void 0:h.nameLong})}),S("p",{children:i("cannotBeUndone")}),S("p",{children:S("b",{children:i("exercises.replacements")})}),S("p",{children:i("exercises.replacementsInfoText")}),S("p",{children:i("exercises.replacementsSearch")}),S(Wy,{callback:m=>{m!==null&&(n(m.data.base_id),u(m.data.base_id))}}),S(dn,{"data-testid":"exercise-id-field",id:"foo",label:"Exercise ID",onBlur:()=>u(),onChange:async m=>{n(m.target.value!==""?parseInt(m.target.value):null)},value:t??"",InputProps:{endAdornment:S(So,{position:"start",children:S(pn,{onClick:()=>u(),children:S(Ist,{})})})},fullWidth:!0,variant:"standard"}),r===null&&S(Tt,{children:S("p",{children:S("i",{children:i("exercises.noReplacementSelected")})})}),r!==null&&Q(Tt,{children:[Q("p",{children:["Selected exercise for replacement:",S(Go,{title:i("copyToClipboard"),children:S(pn,{onClick:()=>navigator.clipboard.writeText(r.id.toString()),children:S(Nst,{})})})]}),Q(Co,{disablePadding:!0,children:[S(fB,{children:S(Kl,{children:r.mainImage?S(Kl,{alt:"",src:`${wB}${r.mainImage.url}`,variant:"rounded"}):S(Ju,{})})}),S(Wr,{primary:r.getTranslation().name,secondary:`${r.id} (${r.uuid})`}),S(pn,{onClick:s,children:S(_st,{})})]})]})]}),Q(Px,{children:[S(ct,{onClick:()=>e.onClose(),children:i("cancel")}),S(ct,{"data-testid":"button-delete-translation",size:"small",onClick:l,variant:"contained",children:i("exercises.deleteTranslation")}),S(ct,{"data-testid":"button-delete-all",size:"small",onClick:()=>c(),variant:"contained",children:i("exercises.deleteExerciseFull")}),S(ct,{"data-testid":"button-delete-and-replace",size:"small",disabled:r===null,onClick:()=>c(!0),variant:"contained",children:i("exercises.deleteExerciseReplace")})]})]})}const tPt="_root_l288f_1",nPt="_detail_language_l288f_4",rPt="_detail_l288f_4",oPt="_languages_l288f_28",iPt="_language_l288f_28",aPt="_header_l288f_52",sPt="_toolbar_l288f_55",Tp={root:tPt,detail_language:nPt,detail:rPt,languages:oPt,language:iPt,header:aPt,toolbar:sPt},lPt=({exercise:e,languages:t,changeLanguage:n,language:r,setEditMode:o,editMode:i})=>{var O,P,R;const[a,s]=x.useState(null),[l,c]=J.useState(!1),u=!!a,[f]=je(),h=ef(Pu.DELETE_EXERCISE),m=ef(Pu.EDIT_EXERCISE),g=Ra(),y=g.isSuccess&&g.data===null;let v=!1;g.isSuccess&&m.isSuccess&&(v=m.data||g.data!==null&&g.data.isTrustworthy);const w=D=>{s(D.currentTarget)},C=()=>{s(null)},E=D=>{n(D),C()},I=t.map(D=>Q(Jt,{onClick:()=>E(D),selected:(r==null?void 0:r.id)===D.id,children:[S(Wr,{children:D.nameLong}),S(nl,{children:e.availableLanguages.includes(D.id)?S(Kst,{}):S(Ko,{})})]},D.nameShort));return S(me,{container:!0,children:S(me,{size:12,children:Q("div",{className:Tp.root,children:[S(Ix,{open:l,onClose:()=>c(!1),children:S(ePt,{onClose:()=>c(!1),onChangeLanguage:()=>n(t[0]),currentExercise:e,currentLanguage:r})}),Q("div",{className:Tp.detail_language,children:[Q("div",{className:Tp.detail,children:[S(Ro,{to:"../overview",children:f("exercises.exercises")})," > ",(O=e.getTranslation(r))==null?void 0:O.name]}),S("div",{className:Tp.languages,children:Q("div",{className:Tp.language,children:[S(ct,{size:"small",id:"basic-button",onClick:w,startIcon:S(ode,{}),children:r==null?void 0:r.nameLong}),Q(ss,{id:"basic-menu",anchorEl:a,open:u,onClose:C,MenuListProps:{"aria-labelledby":"basic-button"},sx:{padding:20},children:[S(Jt,{disabled:!0,children:f("exercises.changeExerciseLanguage")}),S(ji,{}),I]})]})})]}),Q("div",{className:Tp.header,children:[S(at,{gutterBottom:!0,variant:"h2",margin:0,sx:{mt:2},children:(P=e.getTranslation(r))==null?void 0:P.name}),!y&&Q("nav",{className:Tp.toolbar,children:[h.isSuccess&&h.data&&(r==null?void 0:r.id)===((R=e.getTranslation(r))==null?void 0:R.language)&&S(ct,{onClick:()=>c(!0),children:f("delete")}),v&&S(ct,{onClick:()=>o(!0),disabled:i,children:"EDIT"}),S(ct,{onClick:()=>o(!1),disabled:!i,children:"VIEW"})]})]}),Q(Ft,{direction:"row",spacing:1,mt:2,children:[S(Wl,{label:e.category.translatedName,size:"small"}),e.equipment.map(D=>S(Wl,{label:D.translatedName,variant:"outlined",size:"small"},D.id))]})]})})})},yi=()=>S(Zt,{sx:{height:20}}),cPt=()=>{var g;const[e,t]=x.useState(t2e),[n,r]=x.useState(!1),{i18n:o}=je(),i=id(),a=Yc(),s=Ma(),l=parseInt(s.exerciseId??"");if(Number.isNaN(l))return S("p",{children:"Please pass an integer as the exercise id."});const c=yr({queryKey:[s2e,l],queryFn:()=>pv(l),enabled:a.isSuccess}),u=yr({queryKey:[a2e,(g=c.data)==null?void 0:g.variationId],queryFn:()=>{var y;return m2e((y=c.data)==null?void 0:y.variationId)},enabled:c.isSuccess});if(J.useEffect(()=>{if(a.data===void 0)return;const y=Gu(o.language,a.data);t(y)},[a.data]),c.isError||a.isError||u.isError)return i("/not-found"),null;const f=y=>{const v=Gu(y.nameShort,a.data);v!==void 0&&t(v)},h=u.isSuccess?u.data.filter(y=>y.id!==l):[];let m;return c.isSuccess&&a.isSuccess&&(m=n?S(YIt,{exerciseId:c.data.id,language:e}):S(ZIt,{exercise:c.data,language:e,variations:h,setEditMode:r})),Q(Tt,{children:[c.isSuccess&&a.isSuccess&&S(Uu,{children:S(lPt,{exercise:c.data,languages:a.data,changeLanguage:f,language:e,setEditMode:r,editMode:n})}),S(yi,{}),Q(Uu,{maxWidth:"lg",children:[c.isLoading&&a.isLoading&&S(Qa,{}),m]})]})};function ume(e){const[t]=je(),[n,r,o]=us(e.fieldName),[i,a]=x.useState(""),s=u=>{o.setValue(n.value.filter((f,h)=>h!==u))},l=(u,f)=>{n.value[u]=f,o.setValue(n.value)},c=()=>{n.value.push(i),o.setValue(n.value),a("")};return Q(Tt,{children:[S(me,{size:12,children:S(dn,{fullWidth:!0,label:t("exercises.newNote"),sx:{mb:3},variant:"standard",value:i,onChange:u=>a(u.target.value),error:r.touched&&!!r.error,helperText:r.touched&&r.error?r.error:t("exercises.notesHelpText"),InputProps:{endAdornment:S(So,{position:"end",children:S(pn,{onClick:c,children:S(Ko,{})})})}})}),n.value.map((u,f)=>S(dn,{fullWidth:!0,value:u,onChange:h=>l(f,h.target.value),sx:{mt:2},variant:"standard",error:r.touched&&!!r.error,InputProps:{endAdornment:S(So,{position:"end",children:S(pn,{onClick:()=>s(f),children:S(MP,{})})})}},f))]})}const uPt=({onContinue:e,onBack:t})=>{const[n]=je(),[r,o]=Qv(),i=Wo({description:HH(n),notes:Khe(n)});return S(Ti,{initialValues:{description:r.descriptionEn,notes:r.notesEn},validationSchema:i,onSubmit:a=>{o(aIt(a.description)),o(sIt(a.notes)),e()},children:S(fi,{children:Q(Ft,{children:[S(UH,{fieldName:"description"}),S(yi,{}),S(ume,{fieldName:"notes"}),S(me,{container:!0,children:S(me,{display:"flex",justifyContent:"end",size:12,children:S(Zt,{sx:{mb:2},children:Q("div",{children:[S(ct,{onClick:t,sx:{mt:1,mr:1},children:n("goBack")}),S(ct,{variant:"contained",type:"submit",sx:{mt:1,mr:1},children:n("continue")})]})})})})]})})})},dPt=({onContinue:e,onBack:t})=>{const[n]=je(),r=Yc(),[o,i]=Qv(),[a,s]=x.useState(o.languageId!==null),l=Wo(a?{description:HH(n),name:zH(n),alternativeNames:VH(n),notes:Khe(n),language:Do().required()}:{});return S(Ti,{initialValues:{name:o.nameI18n,alternativeNames:o.alternativeNamesI18n,description:o.descriptionI18n,language:o.languageId===null?"":o.languageId,notes:o.notesI18n},validationSchema:l,onSubmit:c=>{i(cIt(c.name)),i(uIt(c.description)),i(fIt(c.alternativeNames)),i(bIt(c.language===""?null:c.language)),i(dIt(c.notes)),e()},children:c=>Q(fi,{children:[Q(Ft,{spacing:2,children:[S(Mx,{children:S(os,{checked:a,onClick:()=>s(!a),control:S(qo,{}),label:n("exercises.translateExerciseNow")})}),a&&Q(Tt,{children:[r.isLoading?S(Zt,{children:S(Qa,{})}):Q(Fh,{fullWidth:!0,children:[S(jh,{id:"label-language",children:n("language")}),S(Lf,{labelId:"label-language",id:"language",value:c.getFieldProps("language").value,onChange:u=>{c.setFieldValue(c.getFieldProps("language").name,u.target.value)},label:n("language"),error:!!(c.touched.language&&c.errors.language),children:r.data.filter(u=>u.id!==bh).map(u=>Q(Jt,{value:u.id,children:[u.nameShort," - ",u.nameLong]},u.id))})]}),S(BH,{fieldName:"name"}),S(jH,{fieldName:"alternativeNames"}),S(UH,{fieldName:"description"}),S(yi,{}),S(ume,{fieldName:"notes"})]})]}),S(me,{container:!0,children:S(me,{display:"flex",justifyContent:"end",size:12,children:S(Zt,{sx:{mb:2},children:Q("div",{children:[S(ct,{onClick:t,sx:{mt:1,mr:1},children:n("goBack")}),S(ct,{variant:"contained",type:"submit",sx:{mt:1,mr:1},children:n("continue")})]})})})})]})})};function fPt(e){const[t]=je(),[n,r]=us(e.fieldName);return S(dn,{fullWidth:!0,id:e.fieldName,label:t("licenses.authors"),variant:"standard",error:r.touched&&!!r.error,helperText:r.touched&&r.error,...n})}function pPt(e){const[t]=je(),[n,r]=us(e.fieldName);return S(dn,{fullWidth:!0,id:e.fieldName,label:t("licenses.authorProfile"),variant:"standard",placeholder:"https://",error:r.touched&&!!r.error,helperText:r.touched&&r.error,...n})}function hPt(e){const[t]=je(),[n,r]=us(e.fieldName);return S(dn,{fullWidth:!0,id:e.fieldName,label:t("licenses.derivativeSourceUrl"),variant:"standard",placeholder:"https://",error:r.touched&&!!r.error,helperText:t("licenses.derivativeSourceUrlHelper")||r.touched&&r.error,...n})}function mPt(e){const[t]=je(),[n,r]=us(e.fieldName);return S(dn,{fullWidth:!0,id:e.fieldName,label:t("licenses.originalObjectUrl"),variant:"standard",placeholder:"https://",error:r.touched&&!!r.error,helperText:r.touched&&r.error,...n})}function gPt(e){const[t]=je(),[n,r]=us(e.fieldName);return S(dn,{fullWidth:!0,id:e.fieldName,label:t("licenses.originalTitle"),variant:"standard",error:r.touched&&!!r.error,helperText:r.touched&&r.error,...n})}function yPt(e){const[t]=je(),[n,r]=x.useState(Cu.PHOTO),[o,i,a]=us(e.fieldName);return Q(VMe,{value:n,exclusive:!0,fullWidth:!0,onChange:(l,c)=>{r(c),a.setValue(c)},"aria-label":"text alignment",children:[S(Zb,{value:Cu.PHOTO,children:Q(Ft,{justifyContent:"center",alignItems:"center",children:[S(Wst,{}),S(at,{variant:"caption",children:t("exercises.imageStylePhoto")})]})}),S(Zb,{value:Cu.THREE_D,children:Q(Ft,{justifyContent:"center",alignItems:"center",children:[S(zst,{}),S(at,{variant:"caption",children:t("exercises.imageStyle3D")})]})}),S(Zb,{value:Cu.LINE_ART,children:Q(Ft,{justifyContent:"center",alignItems:"center",children:[S(Vst,{}),S(at,{variant:"caption",children:t("exercises.imageStyleLine")})]})}),S(Zb,{value:Cu.LOW_POLY,children:Q(Ft,{justifyContent:"center",alignItems:"center",children:[S(Hst,{}),S(at,{variant:"caption",children:t("exercises.imageStyleLowPoly")})]})}),S(Zb,{value:Cu.OTHER,children:Q(Ft,{justifyContent:"center",alignItems:"center",children:[S(Ust,{}),S(at,{variant:"caption",children:t("exercises.imageStyleOther")})]})})]})}const vPt=({onContinue:e,onBack:t})=>{const[n]=je(),r=Ra(),[o,i]=Qv(),[a,s]=x.useState(o.images),[l,c]=x.useState(void 0),[u,f]=J.useState(!1),h=()=>f(!1);x.useEffect(()=>{i(xIt(a))},[i,a]);const m=C=>{var O;if(!((O=C.target.files)!=null&&O.length))return;const[E]=C.target.files,I=URL.createObjectURL(E);f(!0),c({url:I,file:E,author:"",authorUrl:"",title:"",derivativeSourceUrl:"",objectUrl:"",style:Cu.PHOTO.toString()})},g=C=>{s(a.concat({url:l==null?void 0:l.url,file:l==null?void 0:l.file,author:C.author,authorUrl:C.authorUrl,title:C.title,derivativeSourceUrl:C.derivativeSourceUrl,objectUrl:C.objectUrl,style:C.imageStyle.toString()})),h()},y=C=>{const E=a.filter(I=>I.url!==C);s(E)},v=()=>{e()};return Q("div",{children:[S(lv,{open:u,onClose:h,"aria-labelledby":"modal-modal-title","aria-describedby":"modal-modal-description",children:Q(Zt,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:600,bgcolor:"background.paper",boxShadow:24,p:4},children:[S(at,{id:"modal-modal-title",variant:"h6",component:"h2",children:n("exercises.imageDetails")}),Q(me,{container:!0,spacing:2,children:[S(me,{size:4,children:l&&S("img",{style:{width:"100%"},src:l.url,alt:"",loading:"lazy"})}),S(me,{size:8,children:S(Ti,{initialValues:{title:"",objectUrl:"",author:r.isSuccess?r.data.username:"",authorUrl:"",derivativeSourceUrl:"",imageStyle:Cu.PHOTO},onSubmit:C=>{console.log(C),g(C)},children:C=>Q(fi,{children:[Q(Ft,{spacing:2,children:[S(gPt,{fieldName:"title"}),S(mPt,{fieldName:"objectUrl"}),S(fPt,{fieldName:"author"}),S(pPt,{fieldName:"authorUrl"}),S(hPt,{fieldName:"derivativeSourceUrl"}),S(yPt,{fieldName:"imageStyle"}),Q(Ci,{icon:S(nde,{fontSize:"inherit"}),severity:"info",children:["By submitting this image, you agree to release it under the ",S("a",{href:"https://creativecommons.org/licenses/by-sa/4.0/",target:"_blank",rel:"noreferrer",children:"CC BY-SA 4.0"})," license. The image must be either your own work or the author must have released in under a license compatible with CC BY-SA 4.0."]})]}),S(Ft,{direction:"row",justifyContent:"end",sx:{mt:2},children:S(ct,{color:"primary",variant:"contained",type:"submit",sx:{mt:2},children:n("add")})})]})})})]})]})}),S(at,{children:n("exercises.compatibleImagesCC")}),Q(Ft,{direction:"row",justifyContent:"center",children:[Q("div",{children:[S("label",{htmlFor:"camera-input",children:S(Ast,{fontSize:"large",sx:{m:2}})}),S("input",{style:{display:"none"},id:"camera-input",type:"file",accept:"image/*",capture:"environment",onChange:m})]}),Q("div",{children:[S("label",{htmlFor:"image-input",children:S($st,{fontSize:"large",sx:{m:2}})}),S("input",{type:"file",accept:"image/*",name:"image-file",id:"image-input",style:{display:"none"},onChange:m})]})]}),S(Sne,{cols:3,style:{maxHeight:"400px"},children:a.map(C=>Q(wne,{children:[S("img",{style:{maxHeight:"400px",maxWidth:"400px"},src:C.url,alt:"",loading:"lazy"}),S(BOe,{title:C.title,subtitle:C.author,actionIcon:S(pn,{onClick:()=>y(C.url),sx:{color:"white"},children:S(Lst,{})})})]},C.url))}),S(at,{children:n("forms.supportedImageFormats")}),S(me,{container:!0,children:S(me,{display:"flex",justifyContent:"end",size:12,children:S(Zt,{sx:{mb:2},children:Q(Tt,{children:[S(ct,{onClick:t,sx:{mt:1,mr:1},children:n("goBack")}),S(ct,{variant:"contained",onClick:v,sx:{mt:1,mr:1},children:n("continue")})]})})})})]})},bPt="exercisecomment",Tee=async e=>{const t=new Rre,n=ft(bPt),r=await it.post(n,t.toJson(e),{headers:ht()});return t.fromJson(r.data)},xPt="variation",SPt=async()=>{const e=ft(xPt);return(await it.post(e,{},{headers:ht()})).data.id},wPt=({onBack:e})=>{const[t,n]=je(),[r]=Qv(),o=id(),i=DP(),a=Yc(),s=_v(),l=kP(),c=Ra(),[u,f]=x.useState("initial"),h=async()=>{f("loading");let g;r.newVariationExerciseId!==null?g=await SPt():g=r.variationId;const y=await g2e(r.category,r.equipment,r.muscles,r.musclesSecondary,g,c.data.username),v=await QN({exerciseId:y,languageId:bh,name:r.nameEn,description:r.descriptionEn,author:c.data.username});for(const w of r.alternativeNamesEn)await XN(v.id,w);for(const w of r.images)await jre({exerciseId:y,image:w.file,imageData:w});for(const w of r.notesEn)await Tee(new WN(null,v.id,w));if(r.languageId!==null){const w=await QN({exerciseId:y,languageId:r.languageId,name:r.nameI18n,description:r.descriptionI18n,author:c.data.username});for(const C of r.alternativeNamesI18n)await XN(w.id,C);for(const C of r.notesI18n)await Tee(new WN(null,w.id,C))}console.log("Exercise created"),f("done")},m=()=>{o(cn(Qt.EXERCISE_OVERVIEW,n.language))};return l.isLoading||a.isLoading||s.isLoading||i.isLoading?S(Er,{}):Q(Tt,{children:[S(at,{variant:"h6",children:t("exercises.step1HeaderBasics")}),S(Fc,{children:S(Nc,{children:Q(Lc,{children:[Q(ln,{children:[S(ke,{children:t("name")}),S(ke,{children:r.nameEn})]}),Q(ln,{children:[S(ke,{children:t("exercises.alternativeNames")}),S(ke,{children:r.alternativeNamesEn.join(", ")})]}),Q(ln,{children:[S(ke,{children:t("description")}),S(ke,{children:r.descriptionEn})]}),Q(ln,{children:[S(ke,{children:t("exercises.notes")}),S(ke,{children:r.notesEn.map(g=>Q(Tt,{children:[g,S("br",{})]}))})]}),Q(ln,{children:[S(ke,{children:t("category")}),S(ke,{children:i.data.find(g=>g.id===r.category).translatedName})]}),Q(ln,{children:[S(ke,{children:t("exercises.equipment")}),S(ke,{children:r.equipment.map(g=>l.data.find(y=>y.id===g).translatedName).join(", ")})]}),Q(ln,{children:[S(ke,{children:t("exercises.muscles")}),S(ke,{children:r.muscles.map(g=>s.data.find(y=>y.id===g).getName()).join(", ")})]}),Q(ln,{children:[S(ke,{children:t("exercises.secondaryMuscles")}),S(ke,{children:r.musclesSecondary.map(g=>s.data.find(y=>y.id===g).getName()).join(", ")})]}),Q(ln,{children:[S(ke,{children:t("exercises.variations")}),Q(ke,{children:[r.variationId," / ",r.newVariationExerciseId]})]})]})})}),r.images.length>0&&S(Sne,{cols:3,style:{maxHeight:"200px"},children:r.images.map(g=>S(wne,{children:S("img",{style:{maxHeight:"200px",maxWidth:"200px"},src:g.url,alt:"",loading:"lazy"})},g.url))}),r.languageId!==null&&Q(Tt,{children:[S(at,{variant:"h6",sx:{mt:3},children:a.data.find(g=>g.id===r.languageId).nameLong}),S(Fc,{children:S(Nc,{children:Q(Lc,{children:[Q(ln,{children:[S(ke,{children:t("name")}),S(ke,{children:r.nameI18n})]}),Q(ln,{children:[S(ke,{children:t("exercises.alternativeNames")}),S(ke,{children:r.alternativeNamesI18n.join(", ")})]}),Q(ln,{children:[S(ke,{children:t("description")}),S(ke,{children:r.descriptionI18n})]}),Q(ln,{children:[S(ke,{children:t("exercises.notes")}),S(ke,{children:r.notesI18n.map(g=>Q(Tt,{children:[g,S("br",{})]}))})]})]})})})]}),u!=="done"?S(Ci,{severity:"info",sx:{mt:2},children:t("exercises.checkInformationBeforeSubmitting")}):Q(Ci,{severity:"success",sx:{mt:2},children:[S(fh,{children:t("success")}),t("exercises.cacheWarning")]}),S(me,{container:!0,children:S(me,{display:"flex",justifyContent:"end",size:12,children:S(Zt,{sx:{mb:2},children:Q("div",{children:[u!=="done"&&S(ct,{onClick:e,sx:{mt:1,mr:1},children:t("goBack")}),u!=="done"&&S(ct,{variant:"contained",disabled:u!=="initial",onClick:h,sx:{mt:1,mr:1},color:"info",children:t("exercises.submitExercise")}),u==="done"&&Q(ct,{variant:"contained",onClick:m,sx:{mt:1,mr:1},color:"success",children:[t("overview"),S(Gst,{})]})]})})})})]})},CPt=()=>{const[e]=je(),[t,n]=J.useState(0),r=()=>{n(i=>i+1)},o=()=>{n(i=>i-1)};return S(wIt,{children:Q(Uu,{maxWidth:"md",children:[S(Ft,{direction:"row",children:S(at,{gutterBottom:!0,variant:"h3",component:"div",children:e("exercises.contributeExercise")})}),S(Zt,{children:Q(CAe,{activeStep:t,orientation:"vertical",children:[Q(Vm,{children:[S(Pp,{children:e("exercises.step1HeaderBasics")}),S(Hm,{children:S(CIt,{onContinue:r,onBack:o})})]},1),Q(Vm,{children:[S(Pp,{children:e("exercises.variations")}),S(Hm,{children:S(TIt,{onContinue:r,onBack:o})})]},2),Q(Vm,{children:[S(Pp,{children:e("description")}),S(Hm,{children:S(uPt,{onContinue:r,onBack:o})})]},3),Q(Vm,{children:[S(Pp,{children:e("translation")}),S(Hm,{children:S(dPt,{onContinue:r,onBack:o})})]},4),Q(Vm,{children:[S(Pp,{children:e("images")}),S(Hm,{children:S(vPt,{onContinue:r,onBack:o})})]},5),Q(Vm,{children:[S(Pp,{children:e("overview")}),S(Hm,{children:S(wPt,{onBack:o})})]},6)]})})]})})},EPt=()=>{const[e]=je(),t=GH();return Q(Uu,{maxWidth:"md",children:[S(at,{variant:"h3",children:e("exercises.notEnoughRightsHeader")}),Q(Zt,{marginTop:4,padding:4,sx:{width:"100%",backgroundColor:"#ebebeb",textAlign:"center"},children:[S(at,{mb:2,children:e("exercises.notEnoughRights",{days:n2e})}),!t.anonymous&&!t.emailVerified&&S(ct,{variant:"contained",href:"/user/preferences",endIcon:S(Ost,{}),children:e("preferences")})]})]})},TPt=()=>{const e=GH();return S(Tt,{children:e.canContribute?S(CPt,{}):S(EPt,{})})},OPt=()=>S("div",{children:"Add Weight Page"}),IPt=({day:e,currentMonth:t,currentDate:n,selectedDay:r,onClick:o})=>{const i=Lr(),a=Tf(i.breakpoints.down("sm")),s=Tf(i.breakpoints.down("md")),l=xa(e.date,r.date),c=xa(e.date,n),u=e.date.getTime()<=n.getTime(),f=e.date.getDay()===6||e.date.getDay()===0,h=()=>l||c?"white":u?f?"#E53945":"black":"gray",m=()=>a?35:s?40:50,g=()=>a?8:s?9:10,y=()=>e.measurements.length>0||e.weightEntry!==void 0||e.workoutSession!==void 0,v=()=>{u&&o(e)},w=m(),C=g();return Q("div",{style:{position:"relative",width:`${w}px`,height:`${w+C/2}px`,display:"flex",flexDirection:"column",alignItems:"center"},children:[S("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",width:`${w}px`,height:`${w}px`,fontSize:a?"0.8rem":s?"0.9rem":"1rem",color:l||c?"white":h(),backgroundColor:l?"#E53945":c?"#FEC107":"transparent",borderRadius:"50%",fontWeight:"bold",cursor:u?"pointer":"default",opacity:e.date.getMonth()!==t?.25:1},"data-testid":`day-${Jn(e.date)}`,onClick:v,children:e.date.getDate()}),y()&&S("div",{style:{width:`${C}px`,height:`${C}px`,backgroundColor:"black",borderRadius:"50%",position:"absolute",bottom:0,left:"50%",transform:"translateX(-50%)",zIndex:2}})]})},PPt=({days:e,currentMonth:t,currentDate:n,selectedDay:r,onDayClick:o})=>{const{i18n:i}=je(),a=Array.from({length:7},(s,l)=>new Date(1970,0,l+5).toLocaleString(i.language,{weekday:"short"}));return Q(me,{container:!0,spacing:1,rowSpacing:2,children:[a.map((s,l)=>S(me,{size:12/7,children:S(at,{variant:"body1",sx:{fontWeight:"bold",textAlign:"center"},children:s})},`weekday-${l}`)),e.map((s,l)=>S(me,{size:12/7,sx:{display:"flex",justifyContent:"center"},children:S(IPt,{day:s,currentMonth:t,currentDate:n,selectedDay:r,onClick:o})},`day-${l}`))]})},APt=({currentMonth:e,currentYear:t,onPrevMonth:n,onNextMonth:r})=>{const{i18n:o}=je(),i=Array.from({length:12},(a,s)=>new Date(2024,s,1).toLocaleString(o.language,{month:"long"}));return Q("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",paddingBottom:"3%"},children:[S(ct,{variant:"outlined",onClick:n,children:"<"}),Q(at,{variant:"h5",children:[i[e]," ",t]}),S(ct,{variant:"outlined",onClick:r,children:">"})]})};class MPt{constructor(t,n,r,o){this.name=t,this.unit=n,this.value=r,this.date=o}}const RPt=({selectedDay:e})=>{const[t]=je(),[n,r]=J.useState(!1),[o,i]=J.useState(!1),[a,s]=J.useState(!1);return Q(ho,{sx:{width:{xs:"auto",md:"45%"},height:{xs:"60%",md:"100%"},m:{xs:0,sm:1,md:2},p:{xs:1,sm:1.5,md:2}},children:[S(Jl,{title:Q(at,{variant:"h5",component:"div",sx:{fontWeight:"bold"},children:[t("entries")," - ",e.date.toLocaleDateString()]})}),S(Fi,{sx:{flex:1,height:"100%",overflow:"auto",display:"flex",flexDirection:"column",gap:2},children:Q(ai,{children:[e.weightEntry&&S(Co,{children:S(Wr,{primary:t("weight"),secondary:e.weightEntry.weight.toFixed(1),sx:{pl:2}})}),e.measurements.length===1&&S(Co,{children:S(Wr,{primary:t("measurements.measurements"),secondary:`${e.measurements[0].name}: ${e.measurements[0].value} ${e.measurements[0].unit}`,sx:{pl:2}})}),e.measurements.length>1&&Q(Tt,{children:[S(Co,{children:Q(Fl,{onClick:()=>r(!n),selected:n,children:[S(Wr,{primary:t("measurements.measurements")}),n?S(J0,{}):S(Du,{})]})}),S(aa,{in:n,timeout:"auto",unmountOnExit:!0,children:S(ai,{sx:{pl:4,pt:0},children:e.measurements.map((l,c)=>S(Co,{dense:!0,children:S(Wr,{primary:l.name,secondary:`${l.value} ${l.unit}`})},c))})})]}),e.workoutSession&&Q(Tt,{children:[S(Co,{children:Q(Fl,{onClick:()=>i(!o),selected:o,children:[S(Wr,{primary:t("routines.workoutSession"),secondary:e.workoutSession.textRepresentation,sx:{"& .MuiListItemText-secondary":{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}}),o?S(J0,{}):S(Du,{})]})}),S(aa,{in:o,timeout:"auto",unmountOnExit:!0,children:S(ai,{sx:{pl:4,pt:0},children:e.workoutSession.logs.map((l,c)=>{var u;return S(Co,{dense:!0,children:S(Wr,{primary:(u=l.exerciseObj)==null?void 0:u.getTranslation().name,secondary:`${l.repetitions} × ${l.weight} `})},c)})})})]}),e.nutritionLogs.length>0&&Q(Tt,{children:[S(Co,{children:Q(Fl,{onClick:()=>s(!a),selected:a,children:[S(Wr,{primary:t("nutrition.nutritionalDiary")}),a?S(J0,{}):S(Du,{})]})}),S(aa,{in:a,timeout:"auto",unmountOnExit:!0,children:S(ai,{sx:{pl:4,pt:0},children:e.nutritionLogs.map((l,c)=>{var u;return S(Co,{dense:!0,children:S(Wr,{primary:(u=l.ingredient)==null?void 0:u.name,secondary:`${l.amount} ${t("nutrition.gramShort")}`})},c)})})})]})]})})]})},DPt=()=>{const[e]=je(),t=new Date,[n,r]=x.useState(t.getMonth()),[o,i]=x.useState(t.getFullYear()),a=new Date(o,n,1),s=new Date(o,n+1,0),l=Bw(),c=Sst({filtersetQuerySessions:{date__gte:Jn(a),date__lte:Jn(s)},filtersetQueryLogs:{date__gte:Jn(a),date__lte:Jn(s)}}),u=kde({filtersetQueryEntries:{date__gte:Jn(a),date__lte:Jn(s)}}),f=nFe({filtersetQuery:{datetime__gte:Jn(a),datetime__lte:Jn(s)}}),h=l.isLoading||c.isLoading||u.isLoading||f.isLoading,m=l.isSuccess&&c.isSuccess&&u.isSuccess&&f.isSuccess,g=u.data,y=(g==null?void 0:g.flatMap(A=>A.entries.map(_=>new MPt(A.name,A.unit,_.value,_.date))))??[],v=(A,_)=>{var W,K,G;const N=new Date(A,_,1),B=[];let j=new Date(A,_,1).getDay();j=j===0?6:j-1;for(let q=0;q<j;q++)B.push({date:new Date(A,_,-j+q+1),weightEntry:void 0,measurements:[],nutritionLogs:[],workoutSession:void 0});for(;N.getMonth()===_;)B.push({date:new Date(N),weightEntry:(W=l.data)==null?void 0:W.find(q=>xa(q.date,N)),measurements:y.filter(q=>xa(q.date,N))||[],workoutSession:((K=c.data)==null?void 0:K.find(q=>xa(q.date,N)))||void 0,nutritionLogs:((G=f.data)==null?void 0:G.filter(q=>xa(q.datetime,N)))||[]}),N.setDate(N.getDate()+1);j=new Date(A,_+1,0).getDay();const V=j===0?0:7-j;for(let q=1;q<=V;q++)B.push({date:new Date(A,_+1,q),weightEntry:void 0,workoutSession:void 0,measurements:[],nutritionLogs:[]});return B},w={date:t,weightEntry:void 0,workoutSession:void 0,measurements:[],nutritionLogs:[]},C=x.useMemo(()=>v(o,n),[o,n,l.data,c.data,u.data,f.data]),[E,I]=x.useState(C.find(A=>xa(A.date,t))||w),O=Lr(),P=Tf(O.breakpoints.down("sm"));x.useEffect(()=>{if(m){const A=C.find(_=>xa(_.date,t));A&&I(A)}},[m]),x.useEffect(()=>{r(E.date.getMonth()),i(E.date.getFullYear())},[E]);const R=A=>{I(A)},D=()=>{n===0?(r(11),i(o-1)):r(n-1)},M=()=>{(n<t.getMonth()||o<t.getFullYear())&&(n===11?(r(0),i(o+1)):r(n+1))};return Q(Zt,{sx:{display:"flex",gap:2,flexDirection:{xs:"column",md:"row"},height:{xs:"auto",md:"calc(100vh - 130px)"},width:"100%"},children:[Q(ho,{sx:{width:{xs:"auto",md:"65%"},height:{xs:"auto",md:"100%"},m:{xs:0,sm:1,md:2},p:{xs:1,sm:1.5,md:2},display:"flex",flexDirection:"column"},children:[S(Jl,{sx:{"& .MuiCardHeader-content":{width:"100%"}},title:S("div",{style:{display:"flex",flexDirection:"column",width:"100%"},children:Q("div",{style:{display:"flex",alignItems:"center",marginBottom:"16px"},children:[S(Pst,{style:{width:P?"28px":"32px",height:P?"28px":"32px",marginRight:"12px"}}),S("span",{style:{fontSize:P?"1.5rem":"1.8rem",fontWeight:"bold"},children:e("calendar")})]})})}),Q(Fi,{sx:{overflow:"auto",flex:1,"&:last-child":{paddingBottom:2}},children:[S(APt,{currentMonth:n,currentYear:o,onPrevMonth:D,onNextMonth:M}),S(PPt,{days:C,currentMonth:n,currentDate:t,selectedDay:E,onDayClick:R})]})]}),h&&S(ho,{sx:{width:{xs:"auto",md:"65%"},height:{xs:"60%",md:"100%"},m:{xs:0,sm:1,md:2},p:{xs:1,sm:1.5,md:2}},children:S(Er,{})}),m&&S(RPt,{selectedDay:E})]})},kPt=()=>S("div",{children:S(DPt,{})}),_Pt=()=>S("div",{children:"Calories Calculator Page"}),$Pt=()=>S("div",{children:"Equipments Page"}),NPt=()=>S("div",{children:"Gallery Page"}),LPt=()=>S("div",{children:"Ingredients Page"}),FPt=()=>S("div",{children:"Login Page"}),jPt=()=>S("div",{children:"Preferences Page"}),BPt=()=>S("div",{children:"RestApi Page"}),zPt=({weight:e})=>{const t=$ct(),[n]=je(),[r,o]=J.useState(null),[i,a]=J.useState(!1),s=!!r,l=g=>{o(g.currentTarget)},c=()=>{u(),h()},u=()=>{o(null)},f=()=>{t.mutate(e.id),o(null)},h=()=>a(!0),m=()=>a(!1);return Q("div",{children:[S(ct,{onClick:l,children:S(Est,{})}),Q(ss,{anchorEl:r,open:s,onClose:u,MenuListProps:{"aria-labelledby":"basic-button"},children:[S(Jt,{onClick:c,children:n("edit")}),S(Jt,{onClick:f,children:n("delete")})]}),S(Bi,{title:n("edit"),isOpen:i,closeFn:m,children:S(Lv,{weightEntry:e,closeFn:m})})]})},VPt=()=>{const[e]=je(),[t,n]=J.useState(!1),r=()=>n(!0),o=()=>n(!1);return Q("div",{children:[S(Lh,{color:"primary","aria-label":"add",onClick:r,sx:{position:"fixed",bottom:"5rem",right:i=>i.spacing(2),zIndex:9},children:S(Ko,{})}),S(Bi,{title:e("add"),isOpen:t,closeFn:o,children:S(Lv,{closeFn:o})})]})},HPt=e=>e.map((t,n)=>n===0?{entry:t,change:0,days:Math.abs(t.date.getTime()-t.date.getTime())/(1e3*60*60*24)}:{entry:t,change:e[n].weight-e[n-1].weight,days:Math.abs(t.date.getTime()-e[n-1].date.getTime())/(1e3*60*60*24)}),UPt="WeightTable",dme={table:`${UPt}-table`},GPt=ae("div")(({theme:e})=>({[`&.${dme.table}`]:{"& .MuiPaper-root":{border:"1px solid #bababa"}}})),qPt=({weights:e})=>{const t=[10,50,100],[n]=je(),r=HPt(e),[o,i]=x.useState(t[0]),[a,s]=x.useState(0),l=(u,f)=>{s(f)},c=u=>{i(parseInt(u.target.value,10)),s(0)};return Q(GPt,{className:dme.table,children:[Q(Fc,{children:[Q(Nc,{sx:{minWidth:650},"aria-label":"simple table",children:[S(Ff,{children:Q(ln,{children:[S(ke,{align:"center",children:n("date")}),S(ke,{align:"center",children:n("weight")}),S(ke,{align:"center",children:n("difference")}),S(ke,{align:"center",children:n("days")}),S(ke,{align:"center"})]})}),S(Lc,{children:r.slice(a*o,a*o+o).map(u=>Q(ln,{sx:{"&:last-child td, &:last-child th":{border:0}},children:[S(ke,{component:"th",scope:"row",align:"center",children:u.entry.date.toLocaleDateString()}),S(ke,{align:"center",children:u.entry.weight}),S(ke,{align:"center",children:+u.change.toFixed(2)}),S(ke,{align:"center",children:u.days}),S(ke,{align:"center",children:S(zPt,{weight:u.entry})})]},u.entry.date.toLocaleDateString()))})]}),S(Lne,{rowsPerPageOptions:t,component:"div",count:r.length,rowsPerPage:o,page:a,onPageChange:l,onRowsPerPageChange:c})]}),S(VPt,{})]})},WPt=()=>{const[e]=je(),[t,n]=x.useState(!1),r=()=>n(!0),o=()=>n(!1);return Q("div",{children:[S(Lh,{color:"secondary","aria-label":"add",onClick:r,sx:{position:"fixed",bottom:"5rem",right:i=>i.spacing(2),zIndex:9},children:S(Ko,{})}),S(Bi,{title:e("add"),isOpen:t,closeFn:o,children:S(Lv,{closeFn:o})})]})},KPt=({currentFilter:e,onFilterChange:t})=>{const[n]=je(),r=Lr(),o=i=>{e!==i&&t(i)};return Q(sB,{variant:"outlined",sx:{mb:2},children:[S(ct,{onClick:()=>o(""),color:e===""?"primary":"inherit",variant:e===""?"contained":"outlined",sx:{fontFamily:r.typography.fontFamily},children:n("all")}),S(ct,{onClick:()=>o("lastYear"),color:e==="lastYear"?"primary":"inherit",variant:e==="lastYear"?"contained":"outlined",sx:{fontFamily:r.typography.fontFamily},children:n("lastYear")}),S(ct,{onClick:()=>o("lastHalfYear"),color:e==="lastHalfYear"?"primary":"inherit",variant:e==="lastHalfYear"?"contained":"outlined",sx:{fontFamily:r.typography.fontFamily},children:n("lastHalfYear")}),S(ct,{onClick:()=>o("lastMonth"),color:e==="lastMonth"?"primary":"inherit",variant:e==="lastMonth"?"contained":"outlined",sx:{fontFamily:r.typography.fontFamily},children:n("lastMonth")}),S(ct,{onClick:()=>o("lastWeek"),color:e==="lastWeek"?"primary":"inherit",variant:e==="lastWeek"?"contained":"outlined",sx:{fontFamily:r.typography.fontFamily},children:n("lastWeek")})]})},YPt=()=>{const[e]=je(),[t,n]=x.useState("lastYear"),r=Bw(t),o=i=>{n(i)};return r.isLoading?S(Er,{}):S(ds,{title:e("weight"),mainContent:Q(Ft,{spacing:2,children:[S(KPt,{currentFilter:t,onFilterChange:o}),r.data.length===0&&S(Bh,{}),r.data.length!==0&&Q(Tt,{children:[S(Ode,{weights:r.data}),S(Zt,{sx:{mt:4}}),S(qPt,{weights:r.data})]})]}),fab:S(WPt,{})})},QPt=()=>{const{i18n:e}=je(),[t,n]=J.useState(null);return Q(Tt,{children:[S(ct,{color:"inherit",onClick:r=>n(r.currentTarget),children:"Weight"}),S(ss,{anchorEl:t,open:!!t,onClose:()=>n(null),children:S(Jt,{component:Ro,to:cn(Qt.WEIGHT_OVERVIEW,e.language),children:"Weight overview"})})]})},XPt=()=>{const{i18n:e}=je(),[t,n]=J.useState(null);return Q(Tt,{children:[S(ct,{color:"inherit",onClick:r=>n(r.currentTarget),children:"Measurements"}),S(ss,{anchorEl:t,open:!!t,onClose:()=>n(null),children:S(Jt,{component:Ro,to:cn(Qt.MEASUREMENT_OVERVIEW,e.language),children:"Overview"})})]})},JPt=()=>{const{i18n:e}=je(),[t,n]=J.useState(null);return Q(Tt,{children:[S(ct,{color:"inherit",onClick:r=>n(r.currentTarget),children:"Nutrition"}),S(ss,{anchorEl:t,open:!!t,onClose:()=>n(null),children:S(Jt,{component:Ro,to:cn(Qt.NUTRITION_OVERVIEW,e.language),children:"Overview"})})]})},ZPt=()=>{const{i18n:e}=je(),[t,n]=J.useState(null);return Q(Tt,{children:[S(ct,{color:"inherit",onClick:r=>n(r.currentTarget),children:"Routines"}),Q(ss,{anchorEl:t,open:!!t,onClose:()=>n(null),children:[S(Jt,{component:Ro,to:cn(Qt.ROUTINE_OVERVIEW,e.language),children:"Routine overview"}),S(Jt,{component:Ro,to:cn(Qt.PRIVATE_TEMPLATE_OVERVIEW,e.language),children:"Private template overview"}),S(Jt,{component:Ro,to:cn(Qt.PUBLIC_TEMPLATE_OVERVIEW,e.language),children:"Public template overview"}),S(Jt,{component:Ro,to:cn(Qt.EXERCISE_OVERVIEW,e.language),children:"Exercise overview"}),S(Jt,{component:Ro,to:cn(Qt.EXERCISE_CONTRIBUTE,e.language),children:"Contribute exercise"}),S(Jt,{component:Ro,to:cn(Qt.CALENDAR,e.language),children:"Calendar"})]})]})},eAt=()=>S(jwe,{position:"static",children:Q(_ne,{children:[S(at,{variant:"h6",component:"div",mr:3,children:"wger"}),S(ZPt,{}),S(QPt,{}),S(XPt,{}),S(JPt,{})]})}),tAt=()=>S(YPt,{}),nAt=()=>S("div",{children:"Workout Page"}),G$=()=>S(cPt,{}),qH=()=>Q(Jlt,{children:[Q(Ht,{path:"/:lang",children:[Q(Ht,{path:"workout",children:[S(Ht,{path:"overview",element:S(nAt,{})}),S(Ht,{path:"gallery",element:S(NPt,{})})]}),Q(Ht,{path:"routine",children:[S(Ht,{index:!0,element:S(yee,{})}),S(Ht,{path:"overview",element:S(yee,{})}),S(Ht,{path:"calendar",element:S(kPt,{})}),S(Ht,{path:"add",element:S(iwt,{})}),Q(Ht,{path:":routineId",children:[S(Ht,{path:"day/:dayId",children:S(Ht,{path:"add-logs",element:S(FOt,{})})}),Q(Ht,{path:"edit",children:[S(Ht,{index:!0,element:S($Ot,{})}),S(Ht,{path:"progression/:slotId",element:S(jOt,{})})]}),S(Ht,{path:"view",element:S(lwt,{})}),S(Ht,{path:"table",element:S(uwt,{})}),S(Ht,{path:"logs",element:S(GOt,{})}),S(Ht,{path:"statistics",element:S(YOt,{})})]}),Q(Ht,{path:"templates",children:[S(Ht,{path:":routineId",children:S(Ht,{path:"view",element:S(BOt,{})})}),Q(Ht,{path:"overview",children:[S(Ht,{path:"private",element:S(XOt,{})}),S(Ht,{path:"public",element:S(JOt,{})})]})]})]}),Q(Ht,{path:"measurement",children:[S(Ht,{index:!0,element:S(OZ,{})}),S(Ht,{path:"overview",element:S(OZ,{})}),S(Ht,{path:"category/:categoryId",element:S(_St,{})})]}),Q(Ht,{path:"exercise",children:[S(Ht,{index:!0,element:S(aJ,{})}),S(Ht,{path:"overview",element:S(aJ,{})}),S(Ht,{path:":exerciseId",element:S(G$,{}),children:S(Ht,{path:"view",element:S(G$,{}),children:S(Ht,{path:":slug",element:S(G$,{})})})}),S(Ht,{path:"contribute",element:S(TPt,{})})]}),Q(Ht,{path:"weight",children:[S(Ht,{path:"overview",element:S(tAt,{})}),S(Ht,{path:"add",element:S(OPt,{})})]}),Q(Ht,{path:"nutrition",children:[S(Ht,{path:"overview",element:S(XSt,{})}),Q(Ht,{path:":planId",children:[S(Ht,{path:"view",element:S(QSt,{})}),S(Ht,{path:":date",element:S(IZ,{})}),S(Ht,{path:"diary",element:S(IZ,{})})]}),Q(Ht,{path:"calculator",children:[S(Ht,{path:"bmi",element:S(LSt,{})}),S(Ht,{path:"calories",element:S(_Pt,{})})]}),S(Ht,{path:"ingredient",children:S(Ht,{path:"overview",element:S(LPt,{})})})]}),Q(Ht,{path:"software",children:[S(Ht,{path:"about-us",element:S(ZOt,{})}),S(Ht,{path:"api",element:S(BPt,{})}),S(Ht,{path:"equipment",element:S($Pt,{})})]}),S(Ht,{path:"login",element:S(FPt,{})}),S(Ht,{path:"user",children:S(Ht,{path:"preferences",element:S(jPt,{})})})]}),S(Ht,{path:"/",element:S(Kct,{})}),S(Ht,{path:"*",element:S("main",{style:{padding:"1rem"},children:S("p",{children:"404, Page NOT FOUND"})})})]}),rAt="_notification_bbb61_1",Oee={notification:rAt},oAt=()=>{const[e,t]=oIt(),n=()=>{t(vee({notify:!1,message:"",severity:void 0,title:"",type:void 0}))},r=()=>{t(vee({notify:!1,message:"",severity:void 0,title:"",type:void 0,undo:!0}))};return e.notification.notify?e.notification.type==="delete"?Q(Ci,{className:Oee.notification,severity:e.notification.severity,action:S(ct,{color:"inherit",size:"small",onClick:r,children:"UNDO"}),variant:"filled",children:[S(fh,{children:e.notification.title}),S("strong",{children:e.notification.message})]}):Q(Ci,{className:Oee.notification,severity:e.notification.severity,onClose:()=>n(),variant:"filled",children:[S(fh,{children:e.notification.title}),S("strong",{children:e.notification.message})]}):null};function iAt(){return Q(me,{container:!0,children:[S(me,{size:12,children:S(eAt,{})}),S(me,{size:12,children:S(oAt,{})}),S(me,{size:12,children:S(qH,{})})]})}const Xv=new zxe({defaultOptions:{queries:{retry:3,staleTime:1e3*60*5,refetchOnMount:!0,refetchOnWindowFocus:!0,refetchOnReconnect:"always"}}}),aAt=e=>{const t=document.getElementById(e);if(t===null)return;const n=t.attachShadow({mode:"open"}),r=document.createElement("div"),o=document.createElement("style"),i=document.getElementById("react-css");if(i){const l=document.createElement("link");l.setAttribute("rel","stylesheet"),l.setAttribute("href",i.href),n.appendChild(i)}n.appendChild(r),n.appendChild(o);const a=Xee({key:"css",prepend:!0,container:o});em.createRoot(r).render(S(uve,{value:a,children:S(x.Suspense,{fallback:S(Qa,{}),children:S(jV,{children:S(Nh,{theme:kSt(r),children:S(av,{client:Xv,children:S(qH,{})})})})})}))},Iee=document.getElementById("root");Iee&&em.createRoot(Iee).render(S(J.StrictMode,{children:S(x.Suspense,{fallback:S(Qa,{}),children:S(jV,{children:S(Nh,{theme:tm,children:Q(av,{client:Xv,children:[S(iAt,{}),S(aSe,{})]})})})})}));const Pee=document.getElementById("react-page-no-shadow-dom");Pee&&em.createRoot(Pee).render(S(x.Suspense,{fallback:S(Qa,{}),children:S(jV,{children:S(Nh,{theme:tm,children:S(av,{client:Xv,children:S(qH,{})})})})}));aAt("react-page");const Aee=document.getElementById("react-weight-dashboard");Aee&&em.createRoot(Aee).render(S(x.Suspense,{fallback:S(Qa,{}),children:S(Nh,{theme:tm,children:S(av,{client:Xv,children:S(Ide,{})})})}));const Mee=document.getElementById("react-nutrition-dashboard");Mee&&em.createRoot(Mee).render(S(x.Suspense,{fallback:S(Qa,{}),children:S(Nh,{theme:tm,children:S(av,{client:Xv,children:S(Gue,{})})})}));const Ree=document.getElementById("react-routine-dashboard");Ree&&em.createRoot(Ree).render(S(x.Suspense,{fallback:S(Qa,{}),children:S(Nh,{theme:tm,children:S(av,{client:Xv,children:S(Ede,{})})})}));const Dee=document.getElementById("react-ingredient-search");Dee&&em.createRoot(Dee).render(S(x.Suspense,{fallback:S(Qa,{}),children:S(Nh,{theme:tm,children:S(Hct,{})})}));export{f1 as c,Gn as g};
+`)),mee=!0)},EOt=x.forwardRef(function(t,n){return COt(),k.jsx(ct,{ref:n,...t})}),TOt=e=>{const{t}=je(),n=ost(e.routineId),r=sst(e.routineId),[o,i]=x.useState(!1),[a,s]=x.useState(!1),[l,c]=x.useState(e.day.isRest),u=()=>{l?(c(!1),I({isRest:!1})):s(!0)},f=()=>s(!1),h=()=>{I({isRest:!l}),c(!l),s(!1)},m=()=>i(!0),g=()=>{e.setSelectedDayIndex(null),r.mutate(e.day.id),i(!1)},y=()=>i(!1),v=3,w=20,C=1e3,E=Wo().shape({name:Ho().max(w,t("forms.maxLength",{chars:w})).min(v,t("forms.minLength",{chars:v})).required("Name is required"),description:Ho().max(C,t("forms.maxLength",{chars:C})),isRest:Lu(),needsLogsToAdvance:Lu()}),I=O=>n.mutate({id:e.day.id,routine:e.routineId,...O.name!==void 0&&{name:O.name},...O.description!==void 0&&{description:O.description},...O.isRest!==void 0&&{is_rest:l},...O.needsLogsToAdvance!==void 0&&{need_logs_to_advance:O.needsLogsToAdvance}});return S(Tt,{children:S(Ti,{initialValues:{name:e.day.name,description:e.day.description,isRest:e.day.isRest,needsLogsToAdvance:e.day.needLogsToAdvance},validationSchema:E,onSubmit:(O,{setSubmitting:P})=>{I(O),P(!1)},initialTouched:{name:!0,description:!0,isRest:!0,needsLogsToAdvance:!0},children:O=>Q(fi,{children:[Q(me,{container:!0,spacing:2,children:[S(me,{size:{xs:12,sm:6},children:S(Xu,{fieldName:"name",title:"Name",fieldProps:{disabled:l}})}),S(me,{size:{xs:6,sm:2},children:S(os,{control:S(qo,{checked:l,onChange:u}),label:t("routines.restDay")})}),Q(me,{size:{xs:6,sm:4},children:[S(os,{disabled:l,control:S(qo,{checked:O.values.needsLogsToAdvance,...O.getFieldProps("needsLogsToAdvance")}),label:t("routines.needsLogsToAdvance")}),S(Go,{title:t("routines.needsLogsToAdvanceHelpText"),children:S(pn,{onClick:()=>{},children:S(IS,{fontSize:"small"})})})]}),S(me,{size:12,children:S(Xu,{fieldName:"description",title:"Description",fieldProps:{multiline:!0,rows:4,disabled:l}})}),Q(me,{size:8,children:[n.isPending?S(EOt,{loading:!0,variant:"contained",color:"primary",children:t("save")}):S(ct,{variant:"contained",color:"primary",type:"submit",disabled:l,children:t("save")})," ",S(ct,{variant:"outlined",startIcon:S(MP,{}),onClick:m,disabled:n.isPending,children:t("delete")})]}),S(me,{size:4,sx:{display:"flex",justifyContent:"flex-end"},children:S(owt,{routineId:e.routineId})})]}),Q(Ix,{open:a,onClose:f,children:[S(ZE,{children:t("routines.confirmRestDay")}),S(Ax,{children:t("routines.confirmRestDayHelpText")}),Q(Px,{children:[S(ct,{onClick:f,children:t("cancel")}),S(ct,{onClick:h,children:t("continue")})]})]}),S(XP,{title:t("deleteConfirmation",{name:e.day.getDisplayName()}),message:t("routines.deleteDayConfirmation"),isOpen:o,closeFn:y,deleteFn:g})]})})})},OOt=e=>{const{t}=je(),n=gst(e.routineId),[r,o]=x.useState(e.slot.comment),[i,a]=x.useState(!1),s=c=>{a(!0),o(c)},l=()=>{i&&(n.mutate({id:e.slot.id,comment:r}),a(!1))};return S(Tt,{children:S(dn,{label:t("comment"),variant:"standard",fullWidth:!0,size:"small",value:r,disabled:n.isPending,onChange:c=>s(c.target.value),onBlur:l,InputProps:{endAdornment:n.isPending&&S(gh,{})}})})};function Uhe(e){const t=[];if(!e)return t;for(const n in e)Object.hasOwn(e,n)&&t.push(...e[n]);return t}function H$(e){const t=Uhe(e);return t.length>0?t.join(" | "):""}const IOt={weight:{edit:kat,add:_at,delete:$at},"max-weight":{edit:Nat,add:Lat,delete:Fat},reps:{edit:jat,add:Bat,delete:zat},"max-reps":{edit:Vat,add:YX,delete:Hat},sets:{edit:Uat,add:Gat,delete:qat},"max-sets":{edit:Wat,add:Kat,delete:YX},rest:{edit:Jat,add:Zat,delete:est},"max-rest":{edit:tst,add:nst,delete:rst},rir:{edit:Yue,add:Que,delete:Xue},"max-rir":{edit:Yat,add:Qat,delete:Xat}},gee=e=>{var P,R,D,M,A,_,N;const{t}=je(),{edit:n,add:r,delete:o}=IOt[e.type],i=n(e.routineId),a=r(e.routineId),s=o(e.routineId),[l,c]=x.useState(((P=e.config)==null?void 0:P.value)||""),[u,f]=x.useState(null),[h,m]=x.useState(null),g=["sets","max-sets","rest","max-rest"].includes(e.type),y=g?parseInt:parseFloat;let v="";switch(e.type){case"weight":v=t("weight");break;case"max-weight":v="max "+t("weight");break;case"reps":v=t("server.repetitions");break;case"max-reps":v=t("server.max_reps");break;case"sets":v=t("routines.sets");break;case"max-sets":v="max "+t("routines.sets");break;case"rest":v=t("routines.restTime");break;case"max-rest":v="max "+t("routines.restTime");break;case"rir":v=t("routines.rir");break;case"max-rir":v="max "+t("routines.rir");break}const w=B=>{const H={slot_entry:e.slotEntryId,value:y(B)};B===""&&e.config?s.mutate(e.config.id):e.config?i.mutate({id:e.config.id,...H}):a.mutate({iteration:1,operation:Qi,step:"abs",requirements:null,...H})},C=B=>{if(c(B),B!==""&&Number.isNaN(y(B))){f(t(g?"forms.enterInteger":"forms.enterNumber"));return}else f(null);h&&clearTimeout(h),m(setTimeout(()=>w(B),$re))},E=i.isPending||a.isPending||s.isPending,I=i.isError||a.isError||s.isError,O=H$((D=(R=i.error)==null?void 0:R.response)==null?void 0:D.data)||H$((A=(M=a.error)==null?void 0:M.response)==null?void 0:A.data)||H$((N=(_=s.error)==null?void 0:_.response)==null?void 0:N.data);return S(dn,{slotProps:{input:{endAdornment:E&&S(gh,{})}},inputProps:{"data-testid":`${e.type}-field`},label:v,value:l,fullWidth:!0,variant:"standard",disabled:E,onChange:B=>C(B.target.value),error:!!u||I,helperText:u||O})},POt=e=>{const{setFieldValue:t}=AV(),{t:n}=je(),r=e.disabled??!1,[o,i]=x.useState(e.values),[a,s]=J.useState(null),l=u=>{o.includes(u)?i(o.filter(f=>f!==u)):i([...o,u])},c=async()=>{await t(e.fieldName,o),s(null)};return Q(Tt,{children:[S(pn,{disabled:r,onClick:u=>s(u.currentTarget),children:a?S(Tst,{fontSize:"small"}):S(Jst,{fontSize:"small"})}),Q(ss,{anchorEl:a,open:!!a,onClose:()=>s(null),children:[...JN.map((u,f)=>Q(Jt,{onClick:()=>l(u),children:[S(nl,{children:o.includes(u)?S(Rst,{fontSize:"small"}):S(Dst,{fontSize:"small"})}),S(Wr,{children:u})]},f)),S(ji,{}),S(Jt,{children:S(ct,{color:"primary",variant:"contained",type:"submit",size:"small",onClick:c,children:n("save")})})]})]})},AOt=e=>{var i;const t=Yue(e.routineId),n=Xue(e.routineId),r=Que(e.routineId),o=a=>{const s={value:parseFloat(a)};a===""&&e.config?n.mutate(e.config.id):e.config!==void 0?t.mutate({id:e.config.id,...s}):r.mutate({slot_entry:e.slotEntryId,iteration:1,operation:Qi,...s})};return S(dn,{fullWidth:!0,select:!0,label:"RiR",variant:"standard",defaultValue:"",value:(i=e.config)==null?void 0:i.value,disabled:t.isPending,onChange:a=>o(a.target.value),children:Hre.map(a=>S(Jt,{value:a.value,children:a.label},a.value))})};function MOt(e){let t="";for(;e>0;)e--,t=String.fromCharCode(97+e%26)+t,e=Math.floor(e/26);return t}const wl=(e,t,n,r)=>t.length>0?S(gee,{config:t[0],type:e,routineId:n}):S(gee,{type:e,routineId:n,slotEntryId:r}),ROt=e=>{const{t}=je();return Q(Tt,{children:[e.slot.entries.length===0&&Q(Ci,{severity:"warning",children:[S(fh,{children:t("routines.setHasNoExercises")}),t("nothingHereYetAction")]}),e.slot.entries.map((n,r)=>S(DOt,{slotEntry:n,routineId:e.routineId,simpleMode:e.simpleMode,index:r,total:e.slot.entries.length},n.id))]})},DOt=e=>{var g;const{t,i18n:n}=je(),[r,o]=x.useState(!1),i=()=>o(!r),a=Yc(),s=Nw(e.routineId),l=fst(e.routineId),c=s.isPending||l.isPending,u=y=>{y!==null&&(s.mutate({id:e.slotEntry.id,exercise:y.data.base_id}),o(!1))};let f;a.isSuccess&&(f=Gu(n.language,a.data));const h=()=>e.simpleMode?Q(J.Fragment,{children:[S(me,{size:{xs:12,sm:2},children:wl("sets",e.slotEntry.nrOfSetsConfigs,e.routineId,e.slotEntry.id)},`sets-config-${e.slotEntry.id}`),S(me,{size:{xs:12,sm:3},children:wl("weight",e.slotEntry.weightConfigs,e.routineId,e.slotEntry.id)},`weight-config-${e.slotEntry.id}`),S(me,{size:{xs:12,sm:3},children:wl("reps",e.slotEntry.repetitionsConfigs,e.routineId,e.slotEntry.id)},`reps-config-${e.slotEntry.id}`)]}):Q(J.Fragment,{children:[S(me,{size:{xs:6,sm:1},children:wl("sets",e.slotEntry.nrOfSetsConfigs,e.routineId,e.slotEntry.id)}),S(me,{size:{xs:6,sm:1},children:wl("max-sets",e.slotEntry.maxNrOfSetsConfigs,e.routineId,e.slotEntry.id)}),S(me,{size:{xs:6,sm:2},children:S(ewt,{routineId:e.routineId,slotEntry:e.slotEntry})}),S(me,{size:{xs:12,sm:2},children:S(AOt,{routineId:e.routineId,config:e.slotEntry.rirConfigs.length>0?e.slotEntry.rirConfigs[0]:void 0,slotEntryId:e.slotEntry.id})}),S(me,{size:{xs:6,sm:1},children:wl("rest",e.slotEntry.restTimeConfigs,e.routineId,e.slotEntry.id)}),S(me,{size:{xs:6,sm:1},children:wl("max-rest",e.slotEntry.maxRestTimeConfigs,e.routineId,e.slotEntry.id)}),S(me,{size:{xs:6,sm:2},offset:{sm:4},children:wl("weight",e.slotEntry.weightConfigs,e.routineId,e.slotEntry.id)}),S(me,{size:{xs:6,sm:2},children:wl("max-weight",e.slotEntry.maxWeightConfigs,e.routineId,e.slotEntry.id)}),S(me,{size:{xs:12,sm:4},children:S(nwt,{slotEntry:e.slotEntry,routineId:e.routineId})}),S(me,{size:{xs:6,sm:2},offset:{sm:4},children:wl("reps",e.slotEntry.repetitionsConfigs,e.routineId,e.slotEntry.id)}),S(me,{size:{xs:6,sm:2},children:wl("max-reps",e.slotEntry.maxRepetitionsConfigs,e.routineId,e.slotEntry.id)}),S(me,{size:{xs:12,sm:4},children:S(twt,{slotEntry:e.slotEntry,routineId:e.routineId})})]}),m=e.total>1?MOt(e.index+1)+") ":"";return S(J.Fragment,{children:Q(me,{container:!0,paddingTop:1,spacing:1,children:[Q(me,{size:{xs:3,sm:1},alignContent:"center",children:[S(pn,{size:"small",onClick:i,disabled:c,children:r?S(Fst,{}):S(DV,{})}),S(pn,{size:"small",onClick:()=>l.mutate(e.slotEntry.id),disabled:c,children:S(OS,{})})]}),S(me,{size:{xs:9,sm:3},alignContent:"center",children:Q(at,{variant:"body1",children:[m," ",(g=e.slotEntry.exercise)==null?void 0:g.getTranslation(f).name]})}),r&&Q(J.Fragment,{children:[S(me,{size:{xs:12,sm:8},children:S(Wy,{callback:u})}),S(me,{size:{xs:12,sm:4}})]}),e.slotEntry.hasProgressionRules?S(me,{size:8,children:S(Ci,{severity:"info",variant:"standard",sx:{mt:2},children:t("routines.exerciseHasProgression")})}):h()]})})},kOt=e=>{const{t}=je(),n=Kc(e.routineId),r=ist(e.routineId),o=ast(e.routineId),i=u=>({background:u?"lightblue":void 0}),a=(u,f)=>({backgroundColor:"white",margin:4,...f,opacity:1}),s=()=>{e.setSelectedDayIndex(null)},l=u=>{if(!u.destination)return;const f=Array.from(n.data.days),[h]=f.splice(u.source.index,1);f.splice(u.destination.index,0,h),e.setSelectedDayIndex(u.destination.index),n.data.days=f,r.mutate(f.map((m,g)=>({id:m.id,order:g+1})))},c=async()=>{const u={routine:e.routineId,name:`${t("routines.newDay")} ${n.data.days.length+1}`,order:n.data.days.length+1,is_rest:!1,need_logs_to_advance:!1};await o.mutateAsync(u),e.setSelectedDayIndex(n.data.days.length)};return n.isLoading?S(Er,{}):Q(me,{container:!0,direction:"row",spacing:1,children:[S(me,{size:12,children:S(Ft,{direction:"row",children:Q(khe,{onDragEnd:l,onDragStart:s,children:[S(Hhe,{droppableId:"dayDroppable",direction:"horizontal",children:(u,f)=>Q(Fne,{ref:u.innerRef,...u.droppableProps,value:e.selectedDayIndex,variant:"scrollable",scrollButtons:"auto",style:i(f.isDraggingOver),children:[n.data.days.map((h,m)=>S(Fhe,{draggableId:h.id.toString(),index:m,children:(g,y)=>S(DN,{ref:g.innerRef,...g.draggableProps,...g.dragHandleProps,style:a(y.isDragging,g.draggableProps.style??{}),label:h.getDisplayName(),value:h.id,icon:S(tde,{}),iconPosition:"start",onClick:()=>e.setSelectedDayIndex(m)})},h.id)),u.placeholder]})}),S(ct,{startIcon:o.isPending?S(gh,{}):S(Ko,{}),onClick:c,disabled:o.isPending,children:t("routines.addDay")})]})})}),n.data.days.length===0&&S(me,{size:12,children:Q(Ci,{severity:"info",children:[S(fh,{children:t("routines.routineHasNoDays")}),t("nothingHereYetAction")]})})]})},_Ot=e=>{const[t,n]=je(),r=vst(e.routineId),o=dst(e.routineId),i=mst(e.routineId),a=yst(e.routineId),s=Ra(),l=Lr(),[c,u]=x.useState(!1),[f,h]=x.useState(null),[m,g]=x.useState(null),[y,v]=x.useState(!0),w=(M,A)=>{m!==null&&(A==="timeout"?(r.mutate(m.id),g(null)):A!=="clickaway"&&(e.day.slots=[...e.day.slots,m].sort((_,N)=>_.order-N.order),g(null))),u(!1)},C=M=>{const A=e.day.slots.findIndex(_=>_.id===M);if(A!==-1){const _=[...e.day.slots],[N]=_.splice(A,1);e.day.slots=_,g(N),u(!0)}},E=M=>{if(e.day.slots.find(_=>_.id===M)===void 0){console.info(`Could not find slot with id ${M} to add config`);return}h(f===M?null:M)},I=()=>i.mutate({day:e.day.id,order:e.day.slots.length+1}),O=8,P=M=>{if(!M.destination)return;const A=Array.from(e.day.slots),[_]=A.splice(M.source.index,1);A.splice(M.destination.index,0,_),a.mutate(A.map((N,B)=>({id:N.id,order:B+1}))),e.day.slots=A},R=M=>({background:M?"lightblue":void 0}),D=(M,A)=>({border:M?`1px solid ${l.palette.grey[900]}`:`1px solid ${l.palette.grey[300]}`,backgroundColor:"white",marginBottom:O,...A});return Q(Tt,{children:[S(TOt,{routineId:e.routineId,day:e.day,setSelectedDayIndex:e.setSelectedDayIndex},`day-form-${e.day.id}`),!e.day.isRest&&e.day.slots.length>0&&Q(Tt,{children:[S(Zt,{height:40}),S(os,{control:S(qo,{checked:y,onChange:()=>v(!y)}),label:t("routines.simpleMode")})]}),S(Zt,{height:20}),S(khe,{onDragEnd:P,children:S(Hhe,{droppableId:"setDroppable",direction:"vertical",children:(M,A)=>S("div",{...M.droppableProps,ref:M.innerRef,style:R(A.isDraggingOver),children:e.day.slots.map((_,N)=>Q(J.Fragment,{children:[S(Fhe,{draggableId:_.id.toString(),index:N,children:(B,H)=>Q(me,{container:!0,padding:1,ref:B.innerRef,...B.draggableProps,style:D(H.isDragging,B.draggableProps.style??{}),children:[S(me,{sx:{backgroundColor:l.palette.common.white},size:12,children:Q(me,{container:!0,justifyContent:"space-between",alignItems:"center",children:[S(me,{children:Q(at,{variant:"h6",children:[S(pn,{...B.dragHandleProps,children:S(tde,{})}),S(pn,{onClick:()=>C(_.id),children:S(MP,{})}),_.entries.length>1?t("routines.supersetNr",{number:N+1}):t("routines.exerciseNr",{number:N+1})]})}),S(me,{children:_.entries.length>0&&Q(sB,{variant:"outlined",children:[S(ct,{onClick:()=>E(_.id),size:"small",disabled:o.isPending,startIcon:o.isPending?S(gh,{}):S(Ko,{}),children:t("routines.addSuperset")}),_.entries.length>0&&S(ct,{startIcon:S(elt,{}),component:Ro,size:"small",to:cn(Qt.ROUTINE_EDIT_PROGRESSION,n.language,{id:e.routineId,id2:_.id}),children:t("routines.editProgression")})]})})]})}),!y&&Q(me,{size:12,children:[S(OOt,{routineId:e.routineId,slot:_},`slot-form-${_.id}`),S(Zt,{height:10})]}),S(me,{size:12,children:S(ROt,{slot:_,routineId:e.routineId,simpleMode:y})}),(f===_.id||_.entries.length===0)&&Q(me,{size:12,children:[S(Zt,{height:20}),S(Wy,{callback:j=>{j!==null&&(o.mutate({slot:_.id,exercise:j.data.base_id,type:"normal",order:_.entries.length+1,weight_unit:s.data.useMetric?o2e:i2e}),h(null))}})]})]})},_.id),S(Zt,{height:0,children:M.placeholder})]},`slot-${_.id}-${N}`))})})}),S(dI,{open:c,autoHideDuration:EI,onClose:w,children:S(Ci,{severity:"success",variant:"filled",sx:{width:"100%"},action:S(ct,{color:"warning",variant:"contained",size:"small",onClick:w,children:t("undo")}),children:"Set successfully deleted"})}),!e.day.isRest&&S(ct,{variant:"contained",color:"primary",startIcon:i.isPending?S(gh,{}):S(Ko,{}),onClick:I,children:t("routines.addExercise")})]})},$Ot=()=>{var c;const{t:e,i18n:t}=je(),n=Lr(),r=Ra(),o=Ma(),i=o.routineId?parseInt(o.routineId):0,a=Kc(i),[s,l]=x.useState(null);return a.isLoading||r.isLoading?S(Er,{}):a.isError?Q("p",{children:["Error: ",a.error.message]}):(s===null&&a.data.days.length>0&&l(0),Q(Vw,{title:e("editName",{name:(c=a.data)==null?void 0:c.name}),backToUrl:cn(Qt.ROUTINE_DETAIL,t.language,{id:i}),children:[Q(me,{container:!0,children:[S(me,{size:12,children:S(mH,{routine:a.data})}),Q(me,{size:12,children:[S(Zt,{height:20}),S(kOt,{routineId:i,selectedDayIndex:s,setSelectedDayIndex:l})]}),s!==null&&S(Tt,{children:S(me,{size:12,sx:{backgroundColor:n.palette.grey[100],padding:1},children:S(Zt,{children:S(_Ot,{day:a.data.days[s],routineId:i,setSelectedDayIndex:l})})})})]}),a.data.days.length>0&&Q(Ft,{spacing:2,sx:{mt:2},children:[S(Zt,{height:40}),S(at,{variant:"h4",children:e("routines.resultingRoutine")}),S(ji,{}),Q(Zt,{children:[S(Rct,{}),S(Zt,{height:20}),S(Mpe,{routine:a.data})]})]})]}))},NOt=({initialSession:e,dayId:t,routineId:n,selectedDate:r,setSelectedDate:o})=>{let i;const[a,s]=je(),[l,c]=J.useState(e),u=xst(),f=wst(l==null?void 0:l.id),h=bst(n,{routine:n,date:Zn(r.toJSDate()),day:t}),m=u.isPending||f.isPending||h.isLoading,g=Wo({notes:Ho().max(Wq,a("forms.maxLength",{chars:Wq})),date:Xs().required(),start:Xs().nullable(),end:Xs().nullable().min(AP("start"),a("forms.endBeforeStart")),fitInWeek:Lu()});return x.useEffect(()=>{h.data?(i.setValues({notes:h.data.notes||"",impression:h.data.impression||cg,date:h.data.date,start:h.data.timeStart?xt.fromJSDate(h.data.timeStart):null,end:h.data.timeEnd?xt.fromJSDate(h.data.timeEnd):null}),c(h.data)):h.isSuccess&&!h.data&&(i.setValues({notes:"",impression:cg,date:(e==null?void 0:e.date)||xt.now().toJSDate(),start:e!=null&&e.timeStart?xt.fromJSDate(e.timeStart):null,end:e!=null&&e.timeEnd?xt.fromJSDate(e.timeEnd):null}),c(void 0))},[h.data,h.isSuccess,e,r]),S(Ti,{enableReinitialize:!0,initialValues:{notes:l!==void 0?l.notes:"",date:l!==void 0?l.date:new Date,start:l!==void 0&&l.timeStart!==null?xt.fromJSDate(l.timeStart):null,end:l!==void 0&&l.timeEnd!==null?xt.fromJSDate(l.timeEnd):null,impression:l!==void 0?l.impression:cg},innerRef:y=>i=y,validationSchema:g,onSubmit:async y=>{const v={day:t,routine:n,date:Zn(r.toJSDate()),notes:y.notes,impression:y.impression,time_start:y.start?Dx(y.start.toJSDate()):null,time_end:y.end?Dx(y.end.toJSDate()):null};l!==void 0?await f.mutateAsync({...v,id:l.id}):await u.mutateAsync(v)},children:y=>S(fi,{children:Q(me,{container:!0,spacing:2,children:[S(me,{size:{xs:12,sm:6},children:S(Ys,{dateAdapter:zl,adapterLocale:s.language,children:S(Ih,{value:r,defaultValue:xt.now(),label:a("date"),onChange:v=>{v&&(y.setFieldValue("date",v),o(v))},disableFuture:!0,slotProps:{textField:{variant:"standard",fullWidth:!0,error:y.touched.date&&!!y.errors.date}}})})}),S(me,{size:{xs:6,sm:3},children:S(Ys,{dateAdapter:zl,adapterLocale:s.language,children:S(HF,{label:a("start"),...y.getFieldProps("start"),onChange:v=>{v&&y.setFieldValue("start",v)},slotProps:{textField:{variant:"standard",fullWidth:!0,error:y.touched.start&&!!y.errors.start,helperText:y.touched.start&&y.errors.start}}})})}),S(me,{size:{xs:6,sm:3},children:S(Ys,{dateAdapter:zl,adapterLocale:s.language,children:S(HF,{label:a("end"),...y.getFieldProps("end"),onChange:v=>{v&&y.setFieldValue("end",v)},slotProps:{textField:{variant:"standard",fullWidth:!0,error:y.touched.end&&!!y.errors.end,helperText:y.touched.end&&y.errors.end}}})})}),S(me,{size:12,children:S(Xu,{fieldName:"notes",title:a("notes"),fieldProps:{multiline:!0,rows:4}})}),Q(me,{size:12,children:[S(at,{variant:"caption",children:a("routines.impression")}),Q(sB,{fullWidth:!0,color:"primary",children:[Q(ct,{size:"small",color:"info",variant:y.values.impression===uL?"contained":"outlined",onClick:()=>y.setFieldValue("impression",uL),children:[S(Xst,{}),a("routines.impressionBad")]}),Q(ct,{size:"small",color:"info",variant:y.values.impression===cg?"contained":"outlined",onClick:()=>y.setFieldValue("impression",cg),children:[S(Yst,{}),a("routines.impressionNeutral")]}),Q(ct,{size:"small",color:"info",variant:y.values.impression===dL?"contained":"outlined",onClick:()=>y.setFieldValue("impression",dL),children:[S(Qst,{}),a("routines.impressionGood")]})]})]}),S(me,{size:12,display:"flex",justifyContent:"end",children:S(ct,{disabled:m,color:"primary",variant:"contained",type:"submit",sx:{mt:2},children:a("submit")})})]})})})},LOt=({dayId:e,routineId:t,selectedDate:n})=>{const{t:r,i18n:o}=je(),[i,a]=x.useState(!1),s=Kc(t),l=ust(t),c=Yc(),u=()=>a(!1),[f,h]=x.useState(null);let m;if(c.isSuccess&&(m=Gu(o.language,c.data)),s.isLoading)return S(Er,{});const g=s.data,y=(g==null?void 0:g.getDayData(e,n.toJSDate()))??[],v=y.length===0,w=Wo({logs:sh().of(Wo().shape({rir:Do().nullable(),repetitions:Do().typeError(r("forms.enterNumber")).nullable(),weight:Do().typeError(r("forms.enterNumber")).nullable()}))}),C=async P=>{const R=v?null:y[0].iteration,D=P.logs.filter(M=>M.rir!==""||M.repetitions!==""||M.weight!=="").map(M=>{var A,_,N;return{date:n.toISO(),iteration:R,exercise:(A=M.exercise)==null?void 0:A.id,day:e,routine:t,slot_entry:M.slotEntry,rir:M.rir!==""?M.rir:null,rir_target:M.rirTarget!==""?M.rirTarget:null,repetitions_unit:(_=M.repetitionsUnit)==null?void 0:_.id,repetitions:M.repetitions!==""?M.repetitions:null,repetitions_target:M.repetitionsTarget!==""?M.repetitionsTarget:null,weight_unit:(N=M.weightUnit)==null?void 0:N.id,weight:M.weight!==""?M.weight:null,weight_target:M.weightTarget!==""?M.weightTarget:null}});await l.mutateAsync(D),a(!0)},E=async(P,R)=>{if(P===null)return;const D=R.values.logs.map(M=>f===M.exercise.id?{...M,weight:"",weightTarget:"",repetitions:"",repetitionsTarget:"",rir:"",rirTarget:"",exercise:P.exercise}:M);await R.setValues({...R.values,logs:D}),h(null)},I={logs:[]},O=v?g.dayDataCurrentIteration.filter(P=>{var R;return((R=P.day)==null?void 0:R.id)===e}):y;for(const P of O)for(const R of P.slots)for(const D of R.setConfigs)for(let M=0;M<D.nrOfSets;M++)I.logs.push({exercise:D.exercise,repetitionsUnit:D.repetitionsUnit,weightUnit:D.weightUnit,slotEntry:D.slotEntryId,rir:!v&&D.rir!==null?D.rir:"",rirTarget:!v&&D.rir!==null?D.rir:"",repetitions:!v&&D.repetitions!==null?D.repetitions:"",repetitionsTarget:!v&&D.repetitions!==null?D.repetitions:"",weight:!v&&D.weight!==null?D.weight:"",weightTarget:!v&&D.weight!==null?D.weight:""});return Q(Tt,{children:[v&&S(Ci,{severity:"info",sx:{marginTop:2},children:r("routines.weightLogNotPlanned")}),S(Ti,{enableReinitialize:!0,initialValues:I,validationSchema:w,onSubmit:C,children:P=>Q(fi,{children:[S(Due,{name:"logs",children:({insert:R,remove:D})=>S(Tt,{children:P.values.logs.map((M,A)=>{var _,N,B,H;return Q(me,{container:!0,spacing:1,sx:{mt:2},children:[(A===0||A>0&&P.values.logs[A-1].exercise.id!=P.values.logs[A].exercise.id)&&Q(Tt,{children:[Q(me,{size:12,children:[f!==P.values.logs[A].exercise.id&&S(at,{variant:"h6",children:(_=P.values.logs[A].exercise)==null?void 0:_.getTranslation(m).name}),f===P.values.logs[A].exercise.id&&S(Wy,{loadExercise:!0,callback:j=>E(j,P)})]}),Q(me,{size:12,children:[Q(ct,{type:"button",size:"small",onClick:()=>R(A,{exercise:P.values.logs[A].exercise,repetitions:P.values.logs[A].repetitions,weight:P.values.logs[A].weight}),children:[S(Ko,{}),r("routines.addAdditionalLog")]}),Q(ct,{type:"button",size:"small",onClick:()=>{f===P.values.logs[A].exercise.id?h(null):h(P.values.logs[A].exercise.id)},children:[S(tlt,{}),r("exercises.swapExercise")]}),Q(ct,{type:"button",size:"small",onClick:async()=>await P.setValues({...P.values,logs:P.values.logs.filter(j=>j.exercise.id!==P.values.logs[A].exercise.id)}),children:[S(OS,{}),r("delete")]})]})]}),S(me,{size:4,children:S(Xu,{fieldName:`logs.${A}.repetitions`,title:r("server.repetitions"),fieldProps:{slotProps:{input:{endAdornment:S(So,{position:"end",children:((N=P.values.logs[A].repetitionsUnit)==null?void 0:N.id)!==r2e?S(at,{variant:"caption",children:(B=P.values.logs[A].repetitionsUnit)==null?void 0:B.name}):null})}}}})}),S(me,{size:4,children:S(Xu,{fieldName:`logs.${A}.weight`,title:r("weight"),fieldProps:{slotProps:{input:{endAdornment:S(So,{position:"end",children:S(at,{variant:"caption",children:(H=P.values.logs[A].weightUnit)==null?void 0:H.name})})}}}})}),S(me,{size:3,children:S(dn,{fullWidth:!0,select:!0,label:r("routines.rir"),variant:"standard",...P.getFieldProps(`logs.${A}.rir`),children:Hre.map(j=>S(Jt,{value:j.value,children:j.label},j.value))})}),S(me,{size:1,children:S(pn,{size:"small",onClick:()=>D(A),children:S(OS,{})})})]},A)})})}),S(me,{container:!0,spacing:2,children:S(me,{size:12,display:"flex",justifyContent:"end",children:S(ct,{color:"primary",disabled:!P.isValid||P.isSubmitting||l.isPending,variant:"contained",type:"submit",sx:{mt:2},children:r("submit")})})})]})}),S(dI,{open:i,autoHideDuration:EI,onClose:u,children:S(Ci,{onClose:u,severity:"success",sx:{width:"100%"},children:r("success")})})]})},FOt=()=>{const e=Ma(),{t,i18n:n}=je(),[r,o]=x.useState(xt.now()),i=parseInt(e.routineId??"");if(Number.isNaN(i))return S("p",{children:"Please pass an integer as the routine id."});const a=parseInt(e.dayId??"");return Number.isNaN(a)?S("p",{children:"Please pass an integer as the day id."}):S(ds,{title:t("routines.addWeightLog"),backToUrl:cn(Qt.ROUTINE_DETAIL,n.language,{id:i}),mainContent:Q(Ft,{children:[S(NOt,{routineId:i,dayId:a,selectedDate:r,setSelectedDate:o}),S(at,{variant:"h5",children:t("exercises.exercises")}),S(at,{variant:"body2",children:t("routines.impressionHelpText")}),S(LOt,{routineId:i,dayId:a,selectedDate:r})]})})},Ghe=e=>{var t,n,r;return(t=e.mutationQuery)!=null&&t.isError?S(Tt,{children:Q(Ci,{severity:"error",sx:{mb:1},children:[S(fh,{children:(n=e.mutationQuery.error)==null?void 0:n.message}),S("ul",{children:Uhe((r=e.mutationQuery.error.response)==null?void 0:r.data).map((o,i)=>S("li",{children:o},i))})]})}):null},I0=e=>{var y,v;const{t}=je(),[n,r]=x.useState(!0),[o,i]=x.useState([]),a=Dat(e.routineId),s=e.forceInteger??!1;let l,c,u="";switch(e.type){case"weight":l=St.WEIGHT_CONFIG,c=St.MAX_WEIGHT_CONFIG,u=t("weight");break;case"reps":l=St.REPETITIONS_CONFIG,c=St.MAX_REPS_CONFIG,u=t("server.repetitions");break;case"sets":l=St.NR_OF_SETS_CONFIG,c=St.MAX_NR_OF_SETS_CONFIG,u=t("routines.sets");break;case"rest":l=St.REST_CONFIG,c=St.MAX_REST_CONFIG,u=t("routines.restTime");break;case"rir":l=St.RIR_CONFIG,c=St.MAX_RIR_CONFIG,u=t("routines.rir");break}const f=Wo({entries:sh().of(Wo().shape({edited:Lu(),iteration:Do().required(),value:Do().when("forceInteger",{is:!0,then:w=>w.integer(t("forms.enterInteger")).typeError(t("forms.enterNumber")),otherwise:w=>w.typeError(t("forms.enterNumber")).nullable().notRequired()}),valueMax:Do().typeError(t("forms.enterNumber")).nullable().when("forceInteger",{is:!0,then:w=>w.integer(t("forms.enterInteger")).typeError(t("forms.enterNumber")),otherwise:w=>w.typeError(t("forms.enterNumber")).nullable().notRequired()}).when("operation",{is:Qi,then:w=>w.min(AP("value"),t("forms.maxLessThanMin")),otherwise:w=>w}),operation:Ho().required(),operationMax:Ho().required(),requirements:sh().of(Ho().oneOf(JN)),requirementsMax:sh().of(Ho().oneOf(JN)),repeat:Lu(),repeatMax:Lu()})).test("inter-entry-validation","Your error message here",function(w){const{createError:C}=this,E=w;for(let I=0;I<E.length;I++){const O=E[I];if(O.iteration>1&&O.operation!==Qi){let P=!1,R=!1;for(let D=0;D<I;D++)E[D].operation===Qi&&E[D].value!==""&&E[D].edited&&(P=!0),E[D].operation===Qi&&E[D].valueMax!==""&&E[D].edited&&(R=!0);if(!P)return C({path:`entries[${I}].value`,message:t("routines.progressionNeedsReplace")});if(!R)return C({path:`entries[${I}].valueMax`,message:t("routines.progressionNeedsReplace")})}}return!0})}),h=(w,C)=>({forceInteger:s,edited:C,iteration:w,id:null,idMax:null,value:"",valueMax:"",operation:Qi,operationMax:Qi,step:"abs",stepMax:"abs",requirements:[],requirementsMax:[],repeat:!1,repeatMax:!1}),m={entries:[]};for(const w of e.iterations){const C=e.configs.find(I=>I.iteration===w),E=e.configsMax.find(I=>I.iteration===w);C===void 0?m.entries.push(h(w,!1)):m.entries.push({forceInteger:s,edited:!0,id:C.id,idMax:E===void 0?null:E.id,iteration:w,value:String(C.value),valueMax:E===void 0?"":String(E.value),operation:C.operation,operationMax:E===void 0?Qi:C.operation,step:C.step,stepMax:E===void 0?"abs":E.step,requirements:((y=C.requirements)==null?void 0:y.rules)??[],requirementsMax:E===void 0?[]:((v=E.requirements)==null?void 0:v.rules)??[],repeat:C.repeat,repeatMax:E===void 0?!1:C.repeat})}const g=w=>{const C=w.entries.filter(M=>M.edited),E=C.filter(M=>M.id!==null).map(M=>({id:M.id,slot_entry:e.slotEntryId,value:M.value,iteration:M.iteration,operation:M.operation,step:M.step,repeat:M.repeat,requirements:{rules:M.requirements??[]}})),I=C.filter(M=>M.id===null&&M.value!=="").map(M=>({slot_entry:e.slotEntryId,value:M.value,iteration:M.iteration,operation:M.operation,step:M.step,repeat:M.repeat,requirements:{rules:M.requirements??[]}})),O=e.configs.filter(M=>o.includes(M.iteration)).map(M=>M.id);C.forEach(M=>{M.value===""&&M.id!==null&&!O.includes(M.id)&&O.push(M.id)});const P=C.filter(M=>M.idMax!==null&&M.valueMax!=="").map(M=>({id:M.idMax,slot_entry:e.slotEntryId,value:M.valueMax,iteration:M.iteration,operation:M.operation,step:M.step,repeat:M.repeat,requirements:{rules:M.requirements??[]}})),R=C.filter(M=>M.idMax===null&&M.valueMax!=="").map(M=>({iteration:M.iteration,slot_entry:e.slotEntryId,value:M.valueMax,operation:M.operation,step:M.stepMax,repeat:M.repeat,requirements:{rules:M.requirements??[]}})),D=e.configsMax.filter(M=>o.includes(M.iteration)).map(M=>M.id);C.forEach(M=>{M.valueMax===""&&M.idMax!==null&&!O.includes(M.idMax)&&D.push(M.idMax)}),a.mutate({values:{toAdd:I,toDelete:O,toEdit:E,apiPath:l},maxValues:{toAdd:R,toDelete:D,toEdit:P,apiPath:c}})};return S(Tt,{children:Q(Ft,{sx:{width:"100%"},children:[S(at,{variant:"h6",children:u}),S(Ti,{enableReinitialize:!0,initialValues:m,validationSchema:f,onSubmit:(w,{setSubmitting:C})=>{g(w),C(!1)},children:w=>S(fi,{children:Q(me,{container:!0,spacing:1,children:[S(me,{size:4,offset:2,textAlign:"center",children:t("value")}),S(me,{size:6,children:Q(me,{container:!0,spacing:1,children:[S(me,{size:3,children:t("routines.operation")}),S(me,{size:3,children:t("routines.step")}),Q(me,{size:3,textAlign:"center",children:[t("routines.requirements"),S("br",{}),S(Go,{title:t("routines.requirementsHelpText"),children:S(pn,{onClick:()=>{},children:S(IS,{fontSize:"small"})})})]}),Q(me,{size:3,textAlign:"center",children:[t("routines.repeat"),S("br",{}),S(Go,{title:t("routines.repeatHelpText"),children:S(pn,{onClick:()=>{},children:S(IS,{fontSize:"small"})})})]})]})}),S(me,{size:12,children:S(ji,{})}),S(Due,{name:"entries",validateOnChange:!0,children:({insert:C,remove:E})=>S(Tt,{children:w.values.entries.map((I,O)=>Q(J.Fragment,{children:[Q(me,{size:2,display:"flex",justifyContent:"space-around",alignItems:"center",children:[e.cycleLength===7?t("routines.weekNr",{number:I.iteration}):t("routines.workoutNr",{number:I.iteration}),I.edited?S(pn,{disabled:I.iteration===1&&w.values.entries.filter(P=>P.edited&&P.iteration!==1).length>0,size:"small",onClick:()=>{I.id!==null&&i([...o,I.iteration]),E(O),C(O,h(I.iteration,!1))},children:S(MP,{})}):S(pn,{size:"small",onClick:()=>{E(O),C(O,h(I.iteration,!0))},children:S(Ko,{})})]}),S(me,{size:2,children:I.edited&&S(Xu,{fieldName:`entries.${O}.value`,title:t("min"),fullwidth:!0})}),S(me,{size:2,children:I.edited&&S(Xu,{fieldName:`entries.${O}.valueMax`,title:t("max"),fullwidth:!0})}),S(me,{size:6,children:Q(me,{container:!0,spacing:1,children:[S(me,{size:3,children:I.edited&&S(dn,{disabled:I.iteration===1,fullWidth:!0,select:!0,label:t("routines.operation"),variant:"standard",...w.getFieldProps(`entries.${O}.operation`),onChange:async P=>{w.handleChange(P),P.target.value===Qi&&(await w.setFieldValue(`entries.${O}.requirements`,[]),await w.setFieldValue(`entries.${O}.repeat`,!1))},children:M2e.map(P=>S(Jt,{value:P.value,children:P.label},P.value))})}),S(me,{size:3,children:I.edited&&Q(dn,{disabled:I.iteration===1||I.operation===Qi,fullWidth:!0,select:!0,label:t("routines.step"),variant:"standard",...w.getFieldProps(`entries.${O}.step`),children:[A2e.map(P=>S(Jt,{value:P.value,children:P.label},P.value)),(I.iteration===1||I.operation===Qi)&&S(Jt,{value:"na",children:"n/a"},"na")]})}),Q(me,{size:3,textAlign:"center",children:[I.edited&&S(POt,{disabled:I.iteration===1||I.operation===Qi,values:I.requirements,fieldName:`entries.${O}.requirements`}),I.requirements.length>=0&&S("br",{}),I.requirements.length>=0&&I.requirements.map((P,R)=>Q(at,{variant:"caption",children:[P,"  "]},R))]}),S(me,{size:3,textAlign:"center",children:I.edited&&S(qo,{checked:w.values.entries[O].repeat,...w.getFieldProps(`entries.${O}.repeat`),disabled:I.iteration===1||I.operation===Qi})})]})})]},O))})}),a.isError&&S(me,{size:12,children:S(Ghe,{mutationQuery:a})}),S(me,{size:12,display:"flex",justifyContent:"end",children:S(ct,{color:"primary",disabled:!w.isValid||w.isSubmitting||!w.dirty,variant:"contained",type:"submit",sx:{mt:2},children:t("save")})}),S(me,{size:12,children:S(Zt,{height:20})})]})})})]})})},jOt=()=>{const{t:e,i18n:t}=je(),n=Ma(),r=n.routineId?parseInt(n.routineId):-1,o=n.slotId?parseInt(n.slotId):-1,i=Kc(r),a=Yc();if(i.isLoading)return S(Er,{});const s=i.data;let l;a.isSuccess&&(l=Gu(t.language,a.data));let c=null;for(const f of s.days){const h=f.slots.find(m=>m.id===o);if(h){c=h;break}}if(c===null)return S("p",{children:"Slot not found!"});const u=Object.keys(s.groupedDayDataByIteration).map(Number);return S(Tt,{children:S(Vw,{title:e("routines.editProgression"),backToUrl:cn(Qt.ROUTINE_EDIT,t.language,{id:r}),children:c.entries.map(f=>{var h;return Q(J.Fragment,{children:[S(at,{variant:"h5",gutterBottom:!0,children:(h=f.exercise)==null?void 0:h.getTranslation(l).name}),Q(me,{container:!0,spacing:1,children:[S(me,{size:2,display:"flex",alignItems:"end",children:S(at,{variant:"body2",children:e("routines.rounding")})}),S(me,{size:5,children:S(RO,{routineId:r,entryId:f.id,initialValue:f.weightRounding,rounding:"weight",editProfile:!1})}),S(me,{size:5,children:S(RO,{routineId:r,entryId:f.id,initialValue:f.repetitionRounding,rounding:"reps",editProfile:!1})}),S(I0,{type:"sets",configs:f.nrOfSetsConfigs,configsMax:f.maxNrOfSetsConfigs,slotEntryId:f.id,routineId:r,iterations:u,forceInteger:!0,cycleLength:s.cycleLength}),S(I0,{type:"weight",configs:f.weightConfigs,configsMax:f.maxWeightConfigs,slotEntryId:f.id,routineId:r,iterations:u,cycleLength:s.cycleLength}),S(I0,{type:"reps",configs:f.repetitionsConfigs,configsMax:f.maxRepetitionsConfigs,slotEntryId:f.id,routineId:r,iterations:u,cycleLength:s.cycleLength}),S(I0,{type:"rir",configs:f.rirConfigs,configsMax:f.maxRirConfigs,slotEntryId:f.id,routineId:r,iterations:u,cycleLength:s.cycleLength}),S(I0,{type:"rest",configs:f.restTimeConfigs,configsMax:f.maxRestTimeConfigs,slotEntryId:f.id,routineId:r,iterations:u,cycleLength:s.cycleLength})]})]},f.id)})})})},BOt=()=>{const{t:e,i18n:t}=je(),n=Ma(),r=parseInt(n.routineId??"");if(Number.isNaN(r))return S("p",{children:"Please pass an integer as the routine id."});const o=Kc(r),i=o.data;return S(RP,{query:o,child:o.isSuccess&&S(ds,{title:i!=null&&i.isPublic?e("routines.publicTemplate"):e("routines.template"),subTitle:i.name,mainContent:Q(Ft,{spacing:2,children:[Q(at,{variant:"subtitle1",children:[i.start.toLocaleDateString()," - ",i.end.toLocaleDateString()," (",i.durationText,")"]}),i.description!==""&&S(at,{variant:"body2",sx:{whiteSpace:"pre-line"},children:i==null?void 0:i.description}),S(ct,{component:"a",href:cn(Qt.ROUTINE_COPY,t.language,{id:r}),variant:"contained",children:e("routines.copyAndUseTemplate")}),i.dayDataCurrentIteration.filter(a=>a.day!==null).map((a,s)=>S(BV,{dayData:a,routineId:r,readOnly:!0},`dayDetails-${s}`))]}),sideBar:Q(Ft,{children:[S(Zt,{height:40}),Q(me,{container:!0,children:[S(me,{size:6,children:S(Ql,{primaryMuscles:i.mainMuscles.filter(a=>a.isFront),secondaryMuscles:i.secondaryMuscles.filter(a=>a.isFront),isFront:!0})}),S(me,{size:6,children:S(Ql,{primaryMuscles:i.mainMuscles.filter(a=>!a.isFront),secondaryMuscles:i.secondaryMuscles.filter(a=>!a.isFront),isFront:!1})})]})]})})})},zOt=e=>{const{t}=je(),n=e.logEntries??[],r=lst(e.routineId),o=cst(e.routineId),i=n.map(E=>({id:E.id,date:E.date,repetitions:E.repetitions,weight:E.weight,rir:E.rir,entry:E})),[a,s]=J.useState(i),[l,c]=J.useState({}),u=(E,I)=>{E.reason===ks.rowFocusOut&&(I.defaultMuiPrevented=!0)},f=E=>()=>{c({...l,[E]:{mode:zn.Edit}})},h=E=>()=>{c({...l,[E]:{mode:zn.View}})},m=E=>()=>{r.mutate(E),s(a.filter(I=>I.id!==E))},g=E=>()=>{c({...l,[E]:{mode:zn.View,ignoreModifications:!0}}),a.find(O=>O.id===E).isNew&&s(a.filter(O=>O.id!==E))},y=E=>{const I=E.entry;I!==void 0&&(I.date=E.date,I.repetitions=E.repetitions,I.weight=E.weight,I.rir=E.rir,o.mutate(I));const O={...E,isNew:!1};return s(a.map(P=>P.id===E.id?O:P)),O},v=E=>{c(E)},w=[{field:"date",type:"dateTime",flex:1,editable:!0,disableColumnMenu:!0,headerName:t("date"),valueFormatter:E=>E==null?"":`${E.toLocaleDateString()}`},{field:"repetitions",type:"number",disableColumnMenu:!0,editable:!0,headerName:t("routines.reps")},{field:"weight",type:"number",disableColumnMenu:!0,editable:!0,headerName:t("weight")},{field:"rir",type:"singleSelect",disableColumnMenu:!0,editable:!0,headerName:t("routines.rir"),getOptionValue:E=>E.value,getOptionLabel:E=>E.label,valueOptions:Vre},{field:"actions",type:"actions",headerName:"Actions",width:100,cellClassName:"actions",getActions:({id:E})=>{var O;return((O=l[E])==null?void 0:O.mode)===zn.Edit?[S(mf,{icon:S(ide,{}),sx:{color:"primary.main"},label:t("save"),onClick:h(E)}),S(mf,{icon:S(Mst,{}),label:t("cancel"),className:"textPrimary",onClick:g(E),color:"inherit"})]:[S(mf,{icon:S(DV,{}),label:t("edit"),className:"textPrimary",onClick:f(E),color:"inherit"}),S(mf,{icon:S(OS,{}),label:t("delete"),onClick:m(E),color:"inherit"})]}}],C={pagination:{paginationModel:{pageSize:5}}};return Q(Tt,{children:[S(at,{variant:"h6",sx:{mt:4},children:e.exercise.getTranslation().name}),Q(me,{container:!0,spacing:2,children:[Q(me,{size:{xs:12,md:6},children:[S(Ghe,{mutationQuery:o}),S(Cpe,{initialState:C,pageSizeOptions:YN.pageSizeOptions,disableRowSelectionOnClick:!0,rows:a,columns:w,editMode:"row",rowModesModel:l,onRowModesModelChange:v,onRowEditStop:u,processRowUpdate:y})]}),S(me,{size:{xs:12,md:6},children:S(UOt,{data:n},e.exercise.id)})]})]})},VOt=e=>e.map(t=>({id:t.id,value:t.weight,time:t.date.getTime(),entry:t})),HOt=({active:e,payload:t,label:n})=>{var r,o,i;if(e){let a="";return(r=t==null?void 0:t[1].payload)!=null&&r.entry.rir&&(a=`, ${(o=t==null?void 0:t[1].payload)==null?void 0:o.entry.rir} RiR`),S(ho,{children:Q(Fi,{children:[S(at,{variant:"body1",children:xt.fromMillis(t==null?void 0:t[0].value).toLocaleString(xt.DATE_MED)}),Q(at,{variant:"body2",children:[(i=t==null?void 0:t[1].payload)==null?void 0:i.entry.repetitions," × ",t==null?void 0:t[1].value,t==null?void 0:t[1].unit,a]})]})})}return null},UOt=e=>{const t=e.data.reduce(function(r,o){return r.set(o.repetitions,r.get(o.repetitions)||[]),r.get(o.repetitions).push(o),r},new Map),n=Zw(t.size);return S(Zt,{children:S(nd,{width:"100%",height:250,children:Q(fYe,{children:[S(ls,{dataKey:"time",domain:["auto","auto"],name:"Time",tickFormatter:r=>xt.fromMillis(r).toLocaleString(xt.DATE_MED),type:"number"}),S(cs,{domain:["auto","auto"],dataKey:"value",name:"Value",unit:"kg"}),Array.from(t).map(([r,o])=>{const i=n.next().value,a=VOt(o);return S(Iw,{data:a,fill:i,line:{stroke:i},lineType:"joint",lineJointType:"monotoneX",name:r==null?void 0:r.toString()},r)}),S(ba,{content:S(HOt,{})}),S(Uf,{strokeDasharray:"3 3"}),S(Oc,{})]})})})},GOt=()=>{const e=Ma(),t=e.routineId?parseInt(e.routineId):0,[n,r]=je(),o=Wue(t),i=Kc(t);if(o.isLoading||i.isLoading)return S(Er,{});let a=new Map;return a=o.data.reduce((s,l)=>(l.logs.forEach(c=>{const u=c.exerciseId;s.set(u,s.get(u)||[]),s.get(u).push(c)}),s),a),Q(Vw,{title:n("routines.logsHeader"),backToUrl:cn(Qt.ROUTINE_DETAIL,r.language,{id:t}),optionsMenu:S(Go,{title:n("routines.statsOverview"),children:S(pn,{component:"a",href:cn(Qt.ROUTINE_STATS_OVERVIEW,r.language,{id:t}),children:S(Zue,{})})}),children:[S(at,{variant:"body1",children:n("routines.logsFilterNote")}),i.data.dayDataCurrentIteration.filter(s=>s.day!==null&&!s.day.isRest).map((s,l)=>Q(J.Fragment,{children:[Q(Ft,{direction:{xs:"column",sm:"row"},justifyContent:"space-between",alignItems:"center",sx:{mt:4},children:[S(at,{variant:"h4",children:s.day.name}),S(ct,{component:Ro,to:cn(Qt.ROUTINE_ADD_LOG,r.language,{id:t,id2:s.day.id}),variant:"contained",children:n("routines.addLogToDay")})]}),s.slots.map(c=>c.exercises.map(u=>S(zOt,{routineId:t,exercise:u,logEntries:a.get(u.id)},u.id)))]},l))]})};var Dp=(e=>(e.Volume="volume",e.Sets="sets",e.Intensity="intensity",e))(Dp||{}),kp=(e=>(e.Mesocycle="mesocycle",e.Weekly="weekly",e.Iteration="iteration",e.Daily="daily",e))(kp||{}),G0=(e=>(e.Exercises="exercises",e.Muscles="muscles",e.Total="total",e))(G0||{});const U$=({label:e,options:t,value:n,onChange:r})=>Q(Fh,{fullWidth:!0,children:[S(jh,{id:`${e}-label`,children:e}),S(Lf,{labelId:`${e}-label`,id:`${e}-select`,value:n,label:e,onChange:r,children:t.map(o=>S(Jt,{value:o.value,children:o.label},o.value))})]});function qOt(e,t,n,r,o){switch(r){case"exercises":{const i=Object.keys(o.exercises).map(s=>{var l,c;return(c=(l=e.find(u=>u.id===parseInt(s)))==null?void 0:l.getTranslation(t))==null?void 0:c.name}),a=Object.keys(o.exercises).map(Number);return{headers:i,data:a.map(s=>o.exercises[s])}}case"muscles":{const i=Object.keys(o.muscle).map(s=>{var l;return((l=n.find(c=>c.id===parseInt(s)))==null?void 0:l.translatedName)??""}),a=Object.keys(o.muscle).map(Number);return{headers:i,data:a.map(s=>o.muscle[s])}}case"total":return{headers:[hr.t("total")],data:[o.total]};default:return{headers:[],data:[]}}}const WOt=(e,t,n,r,o,i,a,s)=>{const l={},c=e[t];let u=[],f=[];const h=(y,v)=>qOt(o,a,i,y,v);f=(y=>{let v=[];switch(n){case"mesocycle":v=h(r,c.mesocycle).headers;break;case"iteration":for(const w in y.iteration)v=v.concat(h(r,y.iteration[w]).headers);break;case"weekly":for(const w in y.weekly)v=v.concat(h(r,y.weekly[w]).headers);break;case"daily":for(const w in y.daily)v=v.concat(h(r,y.daily[w]).headers);break}return[...new Set(v)]})(c),f.forEach(y=>{l[y]=0});function g(y,v){f.map(C=>y[h(r,v).headers.indexOf(C)]).forEach((C,E)=>{C!==void 0&&(l[f[E]]+=C)})}switch(n){case"mesocycle":{const{data:y}=h(r,c.mesocycle);u=[{key:hr.t("total"),values:f.map(v=>y[f.indexOf(v)])}];break}case"iteration":{u=Object.entries(c.iteration).map(([y,v])=>{const{data:w}=h(r,v);return g(w,v),{key:`iteration ${y}`,values:f.map(C=>w[h(r,v).headers.indexOf(C)])}});break}case"weekly":{u=Object.entries(c.weekly).map(([y,v])=>{const{data:w}=h(r,v);return g(w,v),{key:`week ${y}`,values:f.map(C=>w[h(r,v).headers.indexOf(C)])}});break}case"daily":{u=Object.entries(c.daily).map(([y,v])=>{const{data:w}=h(r,v);return g(w,v),{key:new Date(y).toLocaleDateString(s),values:f.map(C=>w[h(r,v).headers.indexOf(C)])}});break}}return{headers:f,data:u,totals:l}};function KOt(e){const t=[];return e.headers.forEach(n=>{t.push({name:n,data:[]})}),e.data.forEach(n=>{n.values.forEach((r,o)=>{var a;const i=e.headers[o];i&&((a=t.find(s=>s.name===i))==null||a.data.push({category:n.key.toString(),value:r}))})}),t}const YOt=()=>{const e=Lr(),[t,n]=je(),r=Ma(),[o,i]=x.useState(Dp.Volume),[a,s]=x.useState(kp.Daily),[l,c]=x.useState(G0.Exercises),u=parseInt(r.routineId??"");if(Number.isNaN(u))return S("p",{children:"Please pass an integer as the routine id."});const f=Kc(u),h=Tat(u),m=_v(),g=Yc();if(h.isLoading||f.isLoading||m.isLoading||g.isLoading)return S(Er,{});const y=Gu(n.language,g.data),v=f.data,w=[{value:Dp.Volume,label:t("routines.volume")},{value:Dp.Sets,label:t("routines.sets")},{value:Dp.Intensity,label:t("routines.intensity")}],C=[{value:kp.Mesocycle,label:t("routines.currentRoutine")},{value:kp.Weekly,label:t("routines.weekly")},{value:kp.Iteration,label:t("routines.iteration")},{value:kp.Daily,label:t("routines.daily")}],E=[{value:G0.Exercises,label:t("exercises.exercises")},{value:G0.Muscles,label:t("exercises.muscles")},{value:G0.Total,label:t("total")}],I=_=>{i(_.target.value)},O=_=>{s(_.target.value)},P=_=>{c(_.target.value)},R=WOt(h.data,o,a,l,v.exercises,m.data,y,n.language),D=KOt(R),M=()=>S(Fc,{children:Q(Nc,{size:"small",children:[S(Ff,{children:Q(ln,{children:[S(ke,{}),R.headers.map(_=>S(ke,{sx:{textAlign:"right"},children:_},_))]})}),Q(Lc,{children:[R.data.map(_=>Q(ln,{children:[S(ke,{children:_.key}),_.values.map((N,B)=>S(ke,{sx:{textAlign:"right"},children:(N==null?void 0:N.toFixed(o===Dp.Intensity?2:0))||""},B))]},_.key)),a!==kp.Mesocycle&&Q(ln,{children:[S(ke,{sx:{fontWeight:"bold",backgroundColor:e.palette.grey.A200},children:t("total")}),R.headers.map(_=>{var N;return S(ke,{sx:{fontWeight:"bold",backgroundColor:e.palette.grey.A200,textAlign:"right"},children:(N=R.totals[_==null?void 0:_.toString()])==null?void 0:N.toFixed(o===Dp.Intensity?2:0)},_)})]})]})]})}),A=Zw(D.length);return S(Vw,{title:`${t("routines.statsOverview")} - ${v.name}`,backToUrl:cn(Qt.ROUTINE_DETAIL,n.language,{id:u}),optionsMenu:S(Go,{title:t("routines.logsOverview"),children:S(pn,{component:"a",href:cn(Qt.ROUTINE_LOGS_OVERVIEW,n.language,{id:u}),children:S(Zue,{})})}),children:Q(me,{container:!0,spacing:1,children:[S(me,{size:2,offset:3,children:S(U$,{label:"type",options:w,value:o,onChange:I})}),S(me,{size:2,children:S(U$,{label:"sub type",options:C,value:a,onChange:O})}),S(me,{size:2,children:S(U$,{label:"group by",options:E,value:l,onChange:P})}),S(me,{size:12,children:S(Zt,{width:"100%",height:400,children:S(nd,{width:"100%",height:"100%",children:Q(qz,{width:500,height:300,children:[S(Uf,{strokeDasharray:"3 3"}),S(ls,{dataKey:"category",type:"category",allowDuplicatedCategory:!1}),S(cs,{dataKey:"value"}),S(ba,{formatter:_=>Number.isInteger(_)?_.toFixed(0):_.toFixed(2)}),S(Oc,{layout:"vertical",verticalAlign:"middle",align:"right",wrapperStyle:{paddingLeft:"20px"}}),D.map(_=>S(qh,{dataKey:"value",data:_.data,name:_.name,stroke:A.next().value},_.name))]})})})}),Q(me,{size:12,children:[S(Zt,{height:20}),M()]})]})})},QOt=()=>{const[e]=je(),[t,n]=J.useState(!1),r=()=>n(!0),o=()=>n(!1);return Q("div",{children:[S(Lh,{color:"secondary","aria-label":"add",onClick:r,sx:{position:"fixed",bottom:"5rem",right:i=>i.spacing(2),zIndex:9},children:S(Ko,{})}),S(Bi,{title:e("add"),isOpen:t,closeFn:o,children:S(mH,{closeFn:o})})]})},FH=e=>{const[t,n]=je(),r=e.showTemplateChip??!0,o=e.linkDestination??Qt.ROUTINE_DETAIL,i=cn(o,n.language,{id:e.routine.id}),a=e.routine.name!==""?e.routine.name:t("routines.routine"),s=e.routine.isTemplate&&r?S(Wl,{color:"info",size:"small",label:t("routines.template")}):null;return Q(Tt,{children:[S(Co,{sx:{p:0},children:Q(Fl,{component:"a",href:i,children:[S(Wr,{primary:Q(Tt,{children:[a," ",s]}),secondary:`${e.routine.durationText} (${e.routine.start.toLocaleDateString()} - ${e.routine.end.toLocaleDateString()})`}),S(ede,{})]})}),S(ji,{component:"li"})]})},yee=()=>{const e=Oat(),[t]=je();return e.isLoading?S(Er,{}):S(ds,{title:t("routines.routines"),mainContent:S(Tt,{children:e.data.length===0?S(Bh,{}):S(go,{children:S(ai,{sx:{py:0},children:e.data.map(n=>S(FH,{routine:n},n.id))},"abc")})}),fab:S(QOt,{})})},XOt=()=>{const e=Iat(),[t]=je();return e.isLoading?S(Er,{}):S(ds,{title:t("routines.templates"),mainContent:S(Tt,{children:e.data.length===0?S(Bh,{}):S(go,{children:S(ai,{sx:{py:0},children:e.data.map(n=>S(FH,{routine:n,showTemplateChip:!1,linkDestination:Qt.TEMPLATE_DETAIL},n.id))},"abc")})})})},JOt=()=>{const e=Pat(),[t]=je();return e.isLoading?S(Er,{}):S(ds,{title:t("routines.publicTemplates"),mainContent:S(Tt,{children:e.data.length===0?S(Bh,{}):S(go,{children:S(ai,{sx:{py:0},children:e.data.map(n=>S(FH,{routine:n,linkDestination:Qt.TEMPLATE_DETAIL,showTemplateChip:!1},n.id))},"abc")})})})},ZOt=()=>S("div",{children:"About Page"});function jH(e){const[t]=je(),[n,r,o]=us(e.fieldName);return S(_c,{multiple:!0,freeSolo:!0,id:e.fieldName,value:n.value,options:n.value,onChange:(i,a)=>{o.setValue(a)},renderTags:(i,a)=>i.map((s,l)=>Sx(Wl,{label:s,...a({index:l}),key:l})),onBlur:n.onBlur,renderInput:i=>S(dn,{...i,id:"exerciseAliases",variant:"standard",label:t("exercises.alternativeNames"),error:r.touched&&!!r.error,helperText:r.touched&&r.error,value:n.value})})}function eIt(e){const[t]=je(),[n,r,o]=us(e.fieldName);return S(_c,{multiple:!0,id:e.fieldName,options:e.options.map(i=>i.id),getOptionLabel:i=>e.options.find(a=>a.id===i).translatedName,...n,onChange:(i,a)=>{o.setValue(a)},renderInput:i=>S(dn,{variant:"standard",label:t("exercises.equipment"),value:n.value,...i})})}function BH(e){const[t]=je(),[n,r]=us(e.fieldName);return S(dn,{fullWidth:!0,id:e.fieldName,label:t("name"),variant:"standard",error:r.touched&&!!r.error,helperText:r.touched&&r.error,...n})}function tIt(e){const[t]=je(),[n,r]=us(e.fieldName);return Q(Fh,{fullWidth:!0,children:[S(jh,{id:"label-category",children:t("category")}),S(Lf,{labelId:"label-category",id:"category",label:t("category"),error:r.touched&&!!r.error,...n,children:e.options}),r.touched&&!!r.error&&S(aw,{error:!0,children:r.error})]})}const qhe=5,Whe=40,zH=e=>Ho().min(qhe,e("forms.valueTooShort")).max(Whe,e("forms.valueTooLong")).required(e("forms.fieldRequired")),VH=e=>sh().ensure().compact().of(Ho().min(qhe,e("forms.valueTooShort")).max(Whe,e("forms.valueTooLong"))),HH=e=>Ho().min(40,e("forms.valueTooShort")).required(e("forms.fieldRequired")),Khe=e=>sh().ensure().compact().of(Ho().min(15,e("forms.valueTooShort"))),nIt=e=>Do().required(e("forms.fieldRequired"));var Yhe=(e=>(e[e.SET_NOTIFICATION=0]="SET_NOTIFICATION",e))(Yhe||{}),Wn=(e=>(e[e.RESET=0]="RESET",e[e.SET_NAME_EN=1]="SET_NAME_EN",e[e.SET_ALIASES_EN=2]="SET_ALIASES_EN",e[e.SET_DESCRIPTION_EN=3]="SET_DESCRIPTION_EN",e[e.SET_NOTES_EN=4]="SET_NOTES_EN",e[e.SET_CATEGORY=5]="SET_CATEGORY",e[e.SET_EQUIPMENT=6]="SET_EQUIPMENT",e[e.SET_PRIMARY_MUSCLES=7]="SET_PRIMARY_MUSCLES",e[e.SET_MUSCLES_SECONDARY=8]="SET_MUSCLES_SECONDARY",e[e.SET_VARIATION_ID=9]="SET_VARIATION_ID",e[e.SET_NEW_VARIATION_BASE_ID=10]="SET_NEW_VARIATION_BASE_ID",e[e.SET_LANGUAGE=11]="SET_LANGUAGE",e[e.SET_NAME_I18N=12]="SET_NAME_I18N",e[e.SET_ALIASES_I18N=13]="SET_ALIASES_I18N",e[e.SET_DESCRIPTION_I18N=14]="SET_DESCRIPTION_I18N",e[e.SET_NOTES_I18N=15]="SET_NOTES_I18N",e[e.SET_IMAGES=16]="SET_IMAGES",e))(Wn||{});const vee=e=>({type:Yhe.SET_NOTIFICATION,payload:e}),bee={notification:{notify:!1,message:"",severity:void 0,title:"",type:void 0}},rIt=x.createContext([bee,()=>bee]),oIt=()=>x.useContext(rIt),iIt=e=>({type:Wn.SET_NAME_EN,payload:e}),aIt=e=>({type:Wn.SET_DESCRIPTION_EN,payload:e}),sIt=e=>({type:Wn.SET_NOTES_EN,payload:e}),lIt=e=>({type:Wn.SET_ALIASES_EN,payload:e}),cIt=e=>({type:Wn.SET_NAME_I18N,payload:e}),uIt=e=>({type:Wn.SET_DESCRIPTION_I18N,payload:e}),dIt=e=>({type:Wn.SET_NOTES_I18N,payload:e}),fIt=e=>({type:Wn.SET_ALIASES_I18N,payload:e}),pIt=e=>({type:Wn.SET_CATEGORY,payload:e}),hIt=e=>({type:Wn.SET_EQUIPMENT,payload:e}),mIt=e=>({type:Wn.SET_PRIMARY_MUSCLES,payload:e}),gIt=e=>({type:Wn.SET_MUSCLES_SECONDARY,payload:e}),yIt=e=>({type:Wn.SET_VARIATION_ID,payload:e}),vIt=e=>({type:Wn.SET_NEW_VARIATION_BASE_ID,payload:e}),bIt=e=>({type:Wn.SET_LANGUAGE,payload:e}),xIt=e=>({type:Wn.SET_IMAGES,payload:e}),SIt=(e,t)=>{if(t===void 0)return e;switch(t.type){case Wn.RESET:return BO;case Wn.SET_NAME_EN:return{...e,nameEn:t.payload};case Wn.SET_DESCRIPTION_EN:return{...e,descriptionEn:t.payload};case Wn.SET_NOTES_EN:return{...e,notesEn:t.payload};case Wn.SET_ALIASES_EN:return{...e,alternativeNamesEn:t.payload};case Wn.SET_CATEGORY:return{...e,category:t.payload};case Wn.SET_EQUIPMENT:return{...e,equipment:t.payload};case Wn.SET_PRIMARY_MUSCLES:return{...e,muscles:t.payload};case Wn.SET_MUSCLES_SECONDARY:return{...e,musclesSecondary:t.payload};case Wn.SET_VARIATION_ID:return{...e,variationId:t.payload};case Wn.SET_NEW_VARIATION_BASE_ID:return{...e,newVariationExerciseId:t.payload};case Wn.SET_LANGUAGE:return{...e,languageId:t.payload};case Wn.SET_NAME_I18N:return{...e,nameI18n:t.payload};case Wn.SET_DESCRIPTION_I18N:return{...e,descriptionI18n:t.payload};case Wn.SET_NOTES_I18N:return{...e,notesI18n:t.payload};case Wn.SET_ALIASES_I18N:return{...e,alternativeNamesI18n:t.payload};case Wn.SET_IMAGES:return{...e,images:t.payload};default:return e}},BO={category:null,muscles:[],musclesSecondary:[],variationId:null,newVariationExerciseId:null,languageId:null,equipment:[],nameEn:"",descriptionEn:"",alternativeNamesEn:[],notesEn:[],nameI18n:"",alternativeNamesI18n:[],descriptionI18n:"",notesI18n:[],images:[]},Qhe=x.createContext([BO,()=>BO]),wIt=({children:e})=>{const[t,n]=x.useReducer(SIt,BO);return S(Qhe.Provider,{value:[t,n],children:e})},Qv=()=>x.useContext(Qhe),CIt=({onContinue:e})=>{const[t]=je(),[n,r]=Qv(),[o,i]=x.useState(n.muscles),[a,s]=x.useState(n.musclesSecondary);x.useEffect(()=>{r(mIt(o))},[r,o]),x.useEffect(()=>{r(gIt(a))},[r,a]);const l=DP(),c=_v(),u=kP(),f=Wo({nameEn:zH(t),newAlternativeNameEn:VH(t),category:nIt(t)});return S(Ti,{initialValues:{nameEn:n.nameEn,newAlternativeNameEn:n.alternativeNamesEn,category:n.category!==null?n.category:"",muscles:n.muscles,equipment:n.equipment,musclesSecondary:n.musclesSecondary},validationSchema:f,onSubmit:h=>{r(iIt(h.nameEn)),r(pIt(h.category)),r(lIt(h.newAlternativeNameEn)),r(hIt(h.equipment)),e()},children:h=>Q(fi,{children:[Q(Ft,{spacing:2,children:[S(BH,{fieldName:"nameEn"}),S(jH,{fieldName:"newAlternativeNameEn"}),l.isLoading?Q(Zt,{children:[" ",S(Qa,{})," "]}):S(tIt,{fieldName:"category",options:l.data.map(m=>S(Jt,{value:m.id,children:m.translatedName},m.id))}),u.isLoading?Q(Zt,{children:[" ",S(Qa,{})," "]}):S(eIt,{fieldName:"equipment",options:u.data}),c.isLoading?Q(Zt,{children:[" ",S(Qa,{})," "]}):Q(Tt,{children:[S(_c,{multiple:!0,id:"muscles",options:c.data.map(m=>m.id),getOptionDisabled:m=>a.includes(m),getOptionLabel:m=>c.data.find(g=>g.id===m).getName(),value:o,onChange:(m,g)=>{i(g)},renderInput:m=>S(dn,{...m,variant:"standard",label:t("exercises.muscles"),value:h.getFieldProps("muscles").value,onChange:g=>{h.setFieldValue(h.getFieldProps("muscles").name,g.target.value)}})}),S(_c,{multiple:!0,id:"secondary-muscles",options:c.data.map(m=>m.id),getOptionDisabled:m=>o.includes(m),getOptionLabel:m=>c.data.find(g=>g.id===m).getName(),value:a,onChange:(m,g)=>{s(g)},renderInput:m=>S(dn,{...m,variant:"standard",label:t("exercises.secondaryMuscles"),value:h.getFieldProps("muscles").value})})]}),Q(me,{container:!0,children:[S(me,{display:"flex",justifyContent:"center",size:6,children:S(Ql,{primaryMuscles:o.map(m=>c.data.find(g=>g.id===m)),secondaryMuscles:a.map(m=>c.data.find(g=>g.id===m)),isFront:!0})}),S(me,{display:"flex",justifyContent:"center",size:6,children:S(Ql,{primaryMuscles:o.map(m=>c.data.find(g=>g.id===m)),secondaryMuscles:a.map(m=>c.data.find(g=>g.id===m)),isFront:!1})})]})]}),S(me,{container:!0,children:S(me,{display:"flex",justifyContent:"end",size:12,children:S(Zt,{sx:{mb:2},children:S("div",{children:S(ct,{variant:"contained",type:"submit",sx:{mt:1,mr:1},children:t("continue")})})})})})]})})};function EIt(e,t){const n=new Map;return e.forEach(r=>{const o=t(r),i=n.get(o);i?i.push(r):n.set(o,[r])}),n}const xee=({exercises:e})=>{const r=e[0].variationId,o=e[0].id,[i,a]=Qv(),[s,l]=x.useState(!1),[c,u]=x.useState(i.variationId),[f,h]=x.useState(i.newVariationExerciseId);x.useEffect(()=>{a(yIt(c))},[a,c]),x.useEffect(()=>{a(vIt(f))},[a,f]);const m=(y,v)=>()=>{y!==null?(v=null,y===i.variationId&&(y=null)):(y=null,v===i.newVariationExerciseId&&(v=null)),u(y),h(v)};let g;return r===null?g=i.newVariationExerciseId===o:g=r===i.variationId,S(Co,{disableGutters:!0,children:S(Fl,{onClick:m(r,o),children:Q(me,{container:!0,children:[S(me,{display:"flex",justifyContent:"start",alignItems:"center",size:{xs:12,sm:3},children:S(Y1e,{max:4,spacing:"small",children:e.map(y=>y.mainImage?S(Kl,{src:y.mainImage.url},y.id):S(Kl,{children:S(Ju,{})},y.id))})}),Q(me,{size:{xs:10,sm:7},children:[e.slice(0,s?e.length:5).map(y=>S("p",{style:{margin:0},children:y.getTranslation().name},y.id)),!s&&e.length>5?S(Du,{onMouseEnter:()=>l(!0)}):null]}),S(me,{display:"flex",justifyContent:"end",size:{xs:2,sm:2},children:S(qo,{edge:"start",checked:g,tabIndex:-1,disableRipple:!0},`variation-${r}`)}),S(me,{size:12,children:S(ji,{sx:{pt:1}})})]})})})},TIt=({onContinue:e,onBack:t})=>{const[n]=je(),r=ade(),[o,i]=x.useState("");let a=[],s=new Map;return r.isSuccess&&(a=r.data,o!==""&&(a=a.filter(l=>l.getTranslation().name.toLowerCase().includes(o.toLowerCase())))),s=EIt(a.filter(l=>l.variationId!==null),l=>l.variationId),Q(Tt,{children:[Q(me,{container:!0,children:[S(me,{size:{xs:12,sm:6},children:S(at,{children:n("exercises.whatVariationsExist")})}),S(me,{display:"flex",justifyContent:"end",size:{xs:12,sm:6},children:S(dn,{label:n("exercises.filterVariations"),variant:"standard",onChange:l=>i(l.target.value),InputProps:{startAdornment:S(So,{position:"start",children:S(yV,{})})}})})]}),r.isLoading?S(Er,{}):S(go,{elevation:2,sx:{mt:2},children:Q(ai,{style:{maxHeight:"400px",overflowY:"scroll"},children:[a.filter(l=>l.variationId===null).map(l=>S(xee,{exercises:[l]},"base-"+l.id)),[...s.keys()].map(l=>S(xee,{exercises:s.get(l)},"variation-"+l))]})}),Q(Ci,{severity:"info",variant:"filled",sx:{mt:2},children:[S(fh,{children:n("exercises.identicalExercise")}),n("exercises.identicalExercisePleaseDiscard")]}),S(me,{container:!0,children:S(me,{display:"flex",justifyContent:"end",size:12,children:S(Zt,{sx:{mb:2},children:Q("div",{children:[S(ct,{disabled:!1,onClick:t,sx:{mt:1,mr:1},children:n("goBack")}),S(ct,{variant:"contained",onClick:e,sx:{mt:1,mr:1},children:n("continue")})]})})})})]})};function OIt(e){const{t}=je(),[n,r]=J.useState(e.initial.toString()),o=DP(),i=Ra(),a=async s=>{r(s.target.value),await PB(e.exerciseId,{category:parseInt(s.target.value),license_author:i.data.username})};return o.isSuccess?Q(Fh,{fullWidth:!0,children:[S(jh,{id:"label-category",children:t("category")}),S(Lf,{labelId:"label-category",id:"category",label:t("category"),value:n,onChange:a,children:o.data.map(s=>S(Jt,{value:s.id,children:s.translatedName},s.id))})]}):null}function IIt(e){const{t}=je(),[n,r]=J.useState(e.initial),o=kP(),i=Ra(),a=async s=>{r(s),await PB(e.exerciseId,{equipment:s,license_author:i.data.username})};return o.isSuccess?S(_c,{multiple:!0,value:n,options:o.data.map(s=>s.id),getOptionLabel:s=>o.data.find(l=>l.id===s).translatedName,onChange:(s,l)=>a(l),renderInput:s=>S(dn,{variant:"standard",label:t("exercises.equipment"),value:n,...s})}):null}var Uo=function(){return Uo=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Uo.apply(this,arguments)};function iA(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function See(e){if(e){var t=e.textContent,n=/[\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC]/;e.style.direction=t&&n.test(t[0])?"rtl":"ltr"}}function Xhe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter(Boolean).join(" ")}function PIt(){if(document.selection)return document.selection.createRange().parentElement();var e=window.getSelection();if(e&&e.rangeCount>0)return e.getRangeAt(0).startContainer.parentNode||void 0}function wee(e){return e?e.replace(/&nbsp;|\u202F|\u00A0/g," ").replace(/<br \/>/g,"<br>"):""}function AIt(e){var t=document.createTextNode("");e.appendChild(t);var n=document.activeElement===e;if(t!==null&&t.nodeValue!==null&&n){var r=window.getSelection();if(r!==null){var o=document.createRange();o.setStart(t,t.nodeValue.length),o.collapse(!0),r.removeAllRanges(),r.addRange(o)}e instanceof HTMLElement&&e.focus()}}function Jhe(e,t){typeof t=="function"?t(e):typeof t=="object"&&t&&(t.current=e)}var MIt=J.memo(J.forwardRef(function(t,n){var r=t.className,o=t.disabled,i=t.tagName,a=t.value,s=a===void 0?"":a,l=t.placeholder,c=iA(t,["className","disabled","tagName","value","placeholder"]),u=J.useRef(null),f=J.useRef(s),h=J.useRef(c);return J.useEffect(function(){h.current=c;var m=u.current;m&&wee(f.current)!==wee(s)&&(f.current=s,m.innerHTML=s,AIt(m))}),J.useMemo(function(){function m(v){u.current=v,See(v),Jhe(v,n)}function g(v){var w,C,E=u.current;if(E){var I=E.innerHTML;I!==f.current&&((C=(w=h.current).onChange)===null||C===void 0||C.call(w,Uo(Uo({},v),{target:{value:I,name:c.name}}))),See(E),f.current=I}}var y=Xhe("rsw-ce",r);return J.createElement(i||"div",Uo(Uo({},c),{className:y,contentEditable:!o,dangerouslySetInnerHTML:{__html:s},onBlur:function(v){return(h.current.onBlur||g)(v)},onInput:g,onKeyDown:function(v){return(h.current.onKeyDown||g)(v)},onKeyUp:function(v){return(h.current.onKeyUp||g)(v)},placeholder:l,ref:m}))},[r,o,l,i])})),Zhe=J.createContext(void 0);function eme(e){var t=e.children,n=J.useState({htmlMode:!1,update:i}),r=n[0],o=n[1];function i(a){o(function(s){return Uo(Uo({},s),a)})}return J.createElement(Zhe.Provider,{value:r},t)}function nC(){var e=J.useContext(Zhe);if(!e)throw new Error("You should wrap your component by EditorProvider");return e}var Cee=[],P0=[];function RIt(e,t){if(e&&typeof document<"u"){var n,r=t.prepend===!0?"prepend":"append",o=t.singleTag===!0,i=typeof t.container=="string"?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(o){var a=Cee.indexOf(i);a===-1&&(a=Cee.push(i)-1,P0[a]={}),n=P0[a]&&P0[a][r]?P0[a][r]:P0[a][r]=s()}else n=s();e.charCodeAt(0)===65279&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function s(){var l=document.createElement("style");if(l.setAttribute("type","text/css"),t.attributes)for(var c=Object.keys(t.attributes),u=0;u<c.length;u++)l.setAttribute(c[u],t.attributes[c[u]]);var f=r==="prepend"?"afterbegin":"beforeend";return i.insertAdjacentElement(f,l),l}}var DIt=".rsw-editor{border:1px solid #ddd;border-radius:.375rem;display:flex;flex-direction:column;min-height:100px;overflow:hidden}.rsw-ce{flex:1 0 auto;padding:.5rem}.rsw-ce:focus{outline:1px solid #668}.rsw-ce[contentEditable=true]:empty:not(:focus):before{color:grey;content:attr(placeholder);pointer-events:none}.rsw-html{background:transparent;border:none;font-family:monospace,Courier New}.rsw-separator{align-self:stretch;border-right:1px solid #ddd;display:flex;margin:0 3px}.rsw-dd{box-sizing:border-box;outline:none}.rsw-btn{background:transparent;border:0;color:#222;cursor:pointer;font-size:1em;height:2em;outline:none;padding:0;width:2em}.rsw-btn:hover{background:#eaeaea}.rsw-btn[data-active=true]{background:#e0e0e0}.rsw-toolbar{align-items:center;background-color:#f5f5f5;border-bottom:1px solid #ddd;display:flex}";RIt(DIt,{});var tme=J.forwardRef(function(t,n){var r=t.autoFocus,o=t.children,i=t.containerProps,a=t.onSelect,s=iA(t,["autoFocus","children","containerProps","onSelect"]),l=nC();J.useEffect(function(){return document.addEventListener("click",c),function(){return document.removeEventListener("click",c)}});function c(m){var g;m.target!==l.$el&&(!((g=l.$el)===null||g===void 0)&&g.contains(m.target)||l.update({$selection:void 0}))}function u(m){a==null||a(m),l.update({$selection:PIt()})}function f(m){l.update({$el:m}),Jhe(m,n),r&&m&&l.$el===void 0&&m.focus()}var h=Xhe("rsw-editor",i==null?void 0:i.className);return l.htmlMode?J.createElement("div",Uo({},i,{className:h}),o,J.createElement("textarea",Uo({},s,{className:"rsw-ce rsw-html"}))):J.createElement("div",Uo({},i,{className:h}),o,J.createElement(MIt,Uo({},s,{ref:f,onSelect:u})))});function kIt(){return J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",style:{verticalAlign:"text-top"}},J.createElement("path",{fill:"currentColor",d:"M6.99938 12.998v-2H20.9994v2H6.99938zm0 6.0001v-2H20.9994v2H6.99938zm0-12.00001v-2H20.9994v2H6.99938zm-4 1v-3h-1v-1h2v4h-1zm-1 9.00001v-1h3v4h-3v-1h2v-.5h-1v-1h1v-.5h-2zM4.25 10c.41421 0 .75.3358.75.75 0 .2024-.08017.3861-.2105.521L3.11983 13H5v1H2v-.9218L4 11H2v-1h2.25z"}))}function _It(){return J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",style:{verticalAlign:"text-top"}},J.createElement("path",{fill:"currentColor",d:"M7 5h14v2H7V5zm0 8v-2h14v2H7zM4 4.50001c.83 0 1.5.66992 1.5 1.5 0 .83007-.67 1.5-1.5 1.5s-1.5-.66993-1.5-1.5c0-.83008.67-1.5 1.5-1.5zM4 10.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5-1.5-.67-1.5-1.5.67-1.5 1.5-1.5zM7 19v-2h14v2H7zm-3-2.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5-1.5-.67-1.5-1.5.67-1.5 1.5-1.5z"}))}var nme=Zc("Bold","𝐁","bold"),rme=Zc("Bullet list",J.createElement(_It,null),"insertUnorderedList"),$It=Zc("Clear formatting","T̲ₓ","removeFormat"),ome=Zc("Italic","𝑰","italic"),NIt=Zc("Strike through",J.createElement("s",null,"ab"),"strikeThrough"),LIt=Zc("Link","🔗",function(e){var t=e.$selection;(t==null?void 0:t.nodeName)==="A"?document.execCommand("unlink"):document.execCommand("createLink",!1,prompt("URL","")||void 0)}),ime=Zc("Numbered list",J.createElement(kIt,null),"insertOrderedList"),ame=Zc("Redo","↷","redo"),sme=Zc("Underline",J.createElement("span",{style:{textDecoration:"underline"}},"𝐔"),"underline"),lme=Zc("Undo","↶","undo");function Zc(e,t,n){return r.displayName=e.replace(/\s/g,""),r;function r(o){var i=nC(),a=i.$el,s=i.$selection,l=!1;typeof n=="string"&&(l=!!s&&document.queryCommandState(n));function c(u){u.preventDefault(),document.activeElement!==a&&(a==null||a.focus()),typeof n=="function"?n(i):document.execCommand(n)}return i.htmlMode?null:J.createElement("button",Uo({className:"rsw-btn","data-active":l,onMouseDown:c,tabIndex:-1,title:e,type:"button"},o),t)}}var FIt=jIt("Styles",[["Normal","formatBlock","DIV"],["𝗛𝗲𝗮𝗱𝗲𝗿 𝟭","formatBlock","H1"],["Header 2","formatBlock","H2"],["𝙲𝚘𝚍𝚎","formatBlock","PRE"]]);function jIt(e,t){return n.displayName=e,n;function n(r){var o=nC(),i=o.$el,a=o.$selection,s=o.htmlMode;if(s)return null;var l=t.findIndex(function(u){return u[1]==="formatBlock"&&(a==null?void 0:a.nodeName)===u[2]});return J.createElement(BIt,Uo({},r,{items:t,onChange:c,selected:l,tabIndex:-1,title:e}));function c(u){var f=u.target,h=f.value,m=parseInt(h,10),g=t[m]||[],y=g[1],v=g[2];u.preventDefault(),document.activeElement!==i&&(i==null||i.focus()),typeof y=="function"?y(o):y&&document.execCommand(y,!1,v),setTimeout(function(){return f.value=h},10)}}}function BIt(e){var t=e.items,n=e.selected,r=iA(e,["items","selected"]);return J.createElement("select",Uo({className:"rsw-dd"},r,{value:n}),J.createElement("option",{hidden:!0},r.title),t.map(function(o,i){return J.createElement("option",{key:o[2],value:i},o[0])}))}function zIt(e){var t=iA(e,[]),n=nC();function r(){n.update({htmlMode:!n.htmlMode})}return J.createElement("button",Uo({className:"rsw-btn","data-active":n.htmlMode,onClick:r,tabIndex:-1,title:"HTML mode",type:"button"},t),"</>")}function Pg(e){var t=nC();return t.htmlMode?null:J.createElement("div",Uo({className:"rsw-separator"},e))}function cme(e){return J.createElement("div",Uo({className:"rsw-toolbar"},e))}J.forwardRef(function(t,n){return J.createElement(eme,null,J.createElement(tme,Uo({},t,{ref:n}),t.children||J.createElement(cme,null,J.createElement(lme,null),J.createElement(ame,null),J.createElement(Pg,null),J.createElement(nme,null),J.createElement(ome,null),J.createElement(sme,null),J.createElement(NIt,null),J.createElement(Pg,null),J.createElement(ime,null),J.createElement(rme,null),J.createElement(Pg,null),J.createElement(LIt,null),J.createElement($It,null),J.createElement(zIt,null),J.createElement(Pg,null),J.createElement(FIt,null))))});function VIt(e){return S(eme,{children:S(tme,{...e,children:Q(cme,{children:[S(nme,{}),S(ome,{}),S(sme,{}),S(Pg,{}),S(rme,{}),S(ime,{}),S(Pg,{}),S(lme,{}),S(ame,{})]})})})}function UH(e){const[t,n,r]=us(e.fieldName);return Q(Tt,{children:[S("div",{"data-testid":"jodit-editor",children:S(VIt,{value:t.value,onChange:o=>r.setValue(o.target.value)})}),n.touched&&!!n.error&&S(aw,{error:!0,children:n.error})]})}const HIt=({exerciseId:e,image:t,canDelete:n})=>{const[r]=je(),o=alt(e);return Q(ho,{children:[S($c,{component:"img",image:t.url,sx:{height:120},alt:""}),S(ll,{children:n&&S(ct,{color:"primary",onClick:()=>o.mutate(t.id),children:r("delete")})})]})},UIt=({exerciseId:e})=>{const[t]=je(),n=Ra(),r=slt(e),o=async i=>{var s;if(!((s=i.target.files)!=null&&s.length))return;const[a]=i.target.files;n.isSuccess&&await r.mutate({exerciseId:e,image:a,imageData:{url:"",file:a,author:"",authorUrl:"",title:"",objectUrl:"",derivativeSourceUrl:"",style:""}})};return Q(ho,{children:[S($c,{children:S(Zt,{sx:{backgroundColor:"lightgray",height:120},display:"flex",alignItems:"center",justifyContent:"center",children:S(Jue,{sx:{fontSize:80,color:"gray"}})})}),S(ll,{children:Q(ct,{component:"label",children:[t("add"),S("input",{style:{display:"none"},id:"camera-input",type:"file",accept:"image/*",capture:"environment",onChange:o})]})})]})};function Eee(e){const{t}=je(),n=_v(),r=async o=>{e.setValue(o),await PB(e.exerciseId,e.isMain?{muscles:o}:{muscles_secondary:o})};return n.isSuccess?S(_c,{multiple:!0,options:n.data.map(o=>o.id),getOptionDisabled:o=>e.blocked.includes(o),getOptionLabel:o=>n.data.find(i=>i.id===o).getName(t),value:e.value,onChange:(o,i)=>r(i),renderInput:o=>S(dn,{...o,variant:"standard",label:t(e.isMain?"exercises.muscles":"exercises.secondaryMuscles"),value:e.value})}):null}const GIt=({video:e,canDelete:t})=>{const[n]=je();return Q(ho,{children:[S($c,{component:"video",src:e.url,sx:{height:120},controls:!0,preload:"metadata"}),S(ll,{children:t&&S(ct,{color:"primary",onClick:()=>O2e(e.id),children:n("delete")})})]})},qIt=({exerciseId:e})=>{const[t]=je(),n=Ra(),r=async o=>{var a;if(!((a=o.target.files)!=null&&a.length))return;const[i]=o.target.files;n.isSuccess&&await T2e(e,n.data.username,i)};return Q(ho,{children:[S($c,{children:S(Zt,{sx:{backgroundColor:"lightgray",height:120},display:"flex",alignItems:"center",justifyContent:"center",children:S(Jue,{sx:{fontSize:80,color:"gray"}})})}),S(ll,{children:Q(ct,{component:"label",children:[t("add"),S("input",{style:{display:"none"},id:"camera-input",type:"file",accept:"video/*",capture:"environment",onChange:r})]})})]})},WIt="check-permission",KIt=async e=>{const t=ft(WIt,{query:{permission:e}}),n=await it.get(t,{headers:ht()});return n.status===400?!1:n.data.result};function ef(e){return yr({queryKey:[l2e,e],queryFn:()=>KIt(e.valueOf())})}var Pu=(e=>(e.EDIT_EXERCISE="exercises.change_exercise",e.DELETE_EXERCISE="exercises.delete_exercise",e.ADD_IMAGE="exercises.add_exerciseimage",e.EDIT_IMAGE="exercises.change_exerciseimage",e.DELETE_IMAGE="exercises.delete_exerciseimage",e.ADD_VIDEO="exercises.add_exercisevideo",e.EDIT_VIDEO="exercises.change_exercisevideo",e.DELETE_VIDEO="exercises.delete_exercisevideo",e))(Pu||{});const YIt=({exerciseId:e,language:t})=>{const[n]=je(),[r,o]=x.useState(!1),[i,a]=x.useState([]),[s,l]=x.useState([]),c=rlt(e),u=olt(e),f=ilt(e),h=ef(Pu.ADD_IMAGE),m=ef(Pu.DELETE_IMAGE),g=ef(Pu.ADD_VIDEO),y=ef(Pu.DELETE_VIDEO),v=ef(Pu.EDIT_EXERCISE),w=_v(),C=Ra(),E=c.data;if(x.useEffect(()=>{c.data!==void 0&&(a(E.muscles.map(M=>M.id)),l(E.musclesSecondary.map(M=>M.id)))},[c.data]),c.isLoading||w.isLoading||c.isLoading||C.isLoading||h.isLoading||m.isLoading||g.isLoading||y.isLoading||v.isLoading)return S(Qa,{});const I=E.getTranslation(t),P=t.id!==(I==null?void 0:I.language)?new Dre(null,null,"","",t.id):I,R=E.getTranslation(),D=Wo({name:zH(n),alternativeNames:VH(n),description:HH(n)});return Q(Tt,{children:[S(Ti,{initialValues:{name:P.name,alternativeNames:P.aliases.map(M=>M.alias),description:P.description},enableReinitialize:!0,validationSchema:D,onSubmit:async M=>{const A=P.id?await f.mutateAsync({id:P.id,exerciseId:E.id,languageId:t.id,name:M.name,description:M.description,author:""}):await u.mutateAsync({exerciseId:E.id,languageId:t.id,name:M.name,description:M.description,author:C.data.username}),_=P.aliases.map(j=>j.alias),N=M.alternativeNames,B=N.filter(j=>!_.includes(j)),H=_.filter(j=>!N.includes(j));B.forEach(j=>{XN(A.id,j)}),H.forEach(j=>{E2e(P.aliases.find(L=>L.alias===j).id)}),o(!0)},children:S(fi,{children:Q(me,{container:!0,spacing:1,children:[r&&Q(me,{size:12,children:[S(Ci,{severity:"success",action:S(pn,{"aria-label":"close",size:"small",color:"inherit",onClick:()=>{o(!1)},children:S(cw,{fontSize:"inherit"})}),children:n("exercises.successfullyUpdated")}),S(yi,{})]}),S(me,{size:6,children:S(at,{variant:"h5",children:n("English")})}),S(me,{size:6,children:Q(at,{variant:"h5",children:[t.nameLong," (",t.nameShort,")"]})}),Q(me,{size:12,children:[S(yi,{}),S(at,{variant:"h6",children:n("name")})]}),Q(me,{size:6,children:[R.name,S("ul",{children:R.aliases.map(M=>S("li",{children:M.alias},M.id))})]}),Q(me,{size:6,children:[S(Zt,{mb:2,children:S(BH,{fieldName:"name"})}),S(jH,{fieldName:"alternativeNames"})]}),S(me,{size:12,children:S(yi,{})}),S(me,{size:12,children:S(at,{variant:"h6",children:n("exercises.description")})}),S(me,{size:{xs:12,md:6},children:S("div",{dangerouslySetInnerHTML:{__html:R.description}})}),S(me,{size:{xs:12,md:6},children:S(UH,{fieldName:"description"})}),v.data&&Q(Tt,{children:[S(me,{size:12,children:S(yi,{})}),S(me,{size:{xs:12,md:6},children:S(OIt,{exerciseId:E.id,initial:E.category.id})}),S(me,{size:{xs:12,md:6},children:S(IIt,{exerciseId:E.id,initial:E.equipment.map(M=>M.id)})})]}),Q(me,{size:12,children:[S(yi,{}),S(ct,{variant:"contained",type:"submit",sx:{mt:1,mr:1},disabled:c.isLoading||u.isPending||f.isPending,children:n("save")})]})]})})}),S(yi,{}),S(at,{variant:"h6",children:n("images")}),Q(me,{container:!0,spacing:2,mt:2,children:[h.data&&S(me,{size:{md:3},children:S(UIt,{exerciseId:E.id})},"add"),E.images.map(M=>S(me,{size:{md:3},children:S(HIt,{exerciseId:E.id,image:M,canDelete:m.data})},M.id))]}),S(yi,{}),S(at,{variant:"h6",children:n("videos")}),Q(me,{container:!0,spacing:2,mt:2,children:[g.data&&S(me,{size:{md:3},children:S(qIt,{exerciseId:E.id})},"add"),E.videos.map(M=>S(me,{size:{md:3},children:S(GIt,{video:M,canDelete:y.data})},M.id))]}),v.data&&Q(Tt,{children:[S(yi,{}),S(at,{variant:"h6",children:n("exercises.muscles")}),Q(me,{container:!0,spacing:1,mt:2,children:[S(me,{size:{xs:12,md:6},children:S(Eee,{exerciseId:E.id,value:i,setValue:a,blocked:s,isMain:!0})}),S(me,{size:{xs:12,md:6},children:S(Eee,{exerciseId:E.id,value:s,setValue:l,blocked:i,isMain:!1})}),S(me,{size:{sm:6},offset:{md:3},children:Q(me,{container:!0,children:[S(me,{display:"flex",justifyContent:"center",size:6,children:S(Ql,{primaryMuscles:i.map(M=>w.data.find(A=>A.id===M)),secondaryMuscles:s.map(M=>w.data.find(A=>A.id===M)),isFront:!0})}),S(me,{display:"flex",justifyContent:"center",size:6,children:S(Ql,{primaryMuscles:i.map(M=>w.data.find(A=>A.id===M)),secondaryMuscles:s.map(M=>w.data.find(A=>A.id===M)),isFront:!1})})]})})]})]})]})},QIt=({mainImage:e,sideImages:t})=>Q(me,{container:!0,spacing:1,children:[e&&S(me,{size:12,children:S(ho,{children:S($c,{component:"img",image:e.url,alt:""})})}),t.map(n=>S(me,{size:6,children:S(ho,{children:S($c,{component:"img",image:n.url,sx:{height:120},alt:""})})},n.id))]}),XIt=({videos:e})=>S(me,{container:!0,spacing:1,children:e.map(t=>S(me,{size:6,children:S(ho,{children:S($c,{component:"video",src:t.url,sx:{height:120},controls:!0,muted:!0,preload:"metadata"})})},t.id))});function GH(){var r,o;const e=Ra(),t=ef(Pu.EDIT_EXERCISE),n={canContribute:!1,anonymous:!0,emailVerified:!1,admin:!1};if(e.isSuccess&&t.isSuccess){if(e.data===null)return n;n.anonymous=!1,(r=e.data)!=null&&r.emailVerified&&(n.emailVerified=!0),t.data&&(n.admin=!0),(n.admin||(o=e.data)!=null&&o.isTrustworthy)&&(n.canContribute=!0)}return n}const JIt=({setEditMode:e})=>{const[t]=je();return Q(Zt,{mb:2,paddingY:2,sx:{width:"100%",backgroundColor:"#ebebeb",textAlign:"center"},children:[S(at,{variant:"h5",children:t("exercises.exerciseNotTranslated")}),S(at,{gutterBottom:!0,variant:"body1",component:"div",children:t("exercises.exerciseNotTranslatedBody")}),S(ct,{variant:"contained",onClick:()=>e(!0),children:t("exercises.translateExerciseNow")})]})},ZIt=({exercise:e,variations:t,language:n,setEditMode:r})=>{var l;const[o]=je(),i=GH(),a=e.getTranslation(n),s=n&&n.id!==a.language;return Q(me,{container:!0,children:[s&&i.canContribute&&S(me,{order:{xs:2,sm:1},size:{xs:12,sm:7,md:12},children:S(JIt,{setEditMode:r})}),Q(me,{order:{xs:2,sm:1},size:{xs:12,sm:7,md:8},children:[(a==null?void 0:a.aliases.length)>0&&Q(Tt,{children:[Q("p",{children:[o("exercises.alsoKnownAs"),"  ",(l=a==null?void 0:a.aliases)==null?void 0:l.map(c=>c.alias).join(", ")]}),S(yi,{})]}),S(at,{variant:"h5",children:o("exercises.description")}),S("div",{dangerouslySetInnerHTML:{__html:a==null?void 0:a.description}}),S(yi,{}),(a==null?void 0:a.notes.length)>0&&S(at,{variant:"h5",children:o("exercises.notes")}),S("ul",{children:a==null?void 0:a.notes.map(c=>S("li",{children:c.note},c.id))}),S(yi,{}),S(at,{variant:"h5",children:o("exercises.muscles")}),Q(me,{container:!0,children:[S(me,{order:{xs:1},size:{xs:6,md:3},children:S(Ql,{primaryMuscles:e.muscles,secondaryMuscles:e.musclesSecondary,isFront:!0})}),Q(me,{order:{xs:2,md:3},size:{xs:6,md:3},children:[S("h3",{children:o("exercises.primaryMuscles")}),S("ul",{children:e.muscles.map(c=>S("li",{children:c.getName()},c.id))})]}),S(me,{order:{xs:3,md:2},size:{xs:6,md:3},children:S(Ql,{primaryMuscles:e.muscles,secondaryMuscles:e.musclesSecondary,isFront:!1})}),Q(me,{order:{xs:4},size:{xs:6,md:3},children:[S("h3",{children:o("exercises.secondaryMuscles")}),S("ul",{children:e.musclesSecondary.map(c=>S("li",{children:c.getName()},c.id))})]})]}),S(yi,{})]}),Q(me,{order:{xs:1,sm:2},size:{xs:12,sm:5,md:4},children:[S(QIt,{mainImage:e.mainImage,sideImages:e.sideImages}),S(yi,{}),S(XIt,{videos:e.videos})]}),Q(me,{order:{xs:3},size:12,children:[S(ji,{}),S(yi,{}),t.length>0&&S(at,{variant:"h5",children:o("exercises.variations")}),S(me,{container:!0,spacing:2,children:t.map(c=>S(me,{size:{xs:6,md:2},children:S(Rde,{exercise:c,language:n},c.id)},c.id))})]}),S(me,{order:{xs:4},size:12,children:Q(at,{variant:"caption",display:"block",mt:2,children:["The text on this page is available under the ",S("a",{href:"https://creativecommons.org/licenses/by-sa/4.0/deed",children:"CC BY-SA 4 License"}),"."]})})]})};function ePt(e){var f,h;const[t,n]=J.useState(null),[r,o]=J.useState(null),[i]=je(),a=id(),s=()=>{o(null),n(null)},l=async()=>{var m;await x2e((m=e.currentExercise.getTranslation(e.currentLanguage))==null?void 0:m.id),e.onClose(),e.onChangeLanguage()},c=async(m=!1)=>{m?await pq(e.currentExercise.id,r==null?void 0:r.uuid):await pq(e.currentExercise.id),e.onClose(),a("../overview")},u=async m=>{const g=m!==void 0?m:t;if(g!==null)try{const y=await pv(g);o(y)}catch{o(null)}};return Q(Tt,{children:[S(ZE,{id:"alert-dialog-title",children:i("delete")}),Q(Ax,{children:[S("p",{children:i("exercises.deleteExerciseBody",{name:(f=e.currentExercise.getTranslation(e.currentLanguage))==null?void 0:f.name,language:(h=e.currentLanguage)==null?void 0:h.nameLong})}),S("p",{children:i("cannotBeUndone")}),S("p",{children:S("b",{children:i("exercises.replacements")})}),S("p",{children:i("exercises.replacementsInfoText")}),S("p",{children:i("exercises.replacementsSearch")}),S(Wy,{callback:m=>{m!==null&&(n(m.data.base_id),u(m.data.base_id))}}),S(dn,{"data-testid":"exercise-id-field",id:"foo",label:"Exercise ID",onBlur:()=>u(),onChange:async m=>{n(m.target.value!==""?parseInt(m.target.value):null)},value:t??"",InputProps:{endAdornment:S(So,{position:"start",children:S(pn,{onClick:()=>u(),children:S(Ist,{})})})},fullWidth:!0,variant:"standard"}),r===null&&S(Tt,{children:S("p",{children:S("i",{children:i("exercises.noReplacementSelected")})})}),r!==null&&Q(Tt,{children:[Q("p",{children:["Selected exercise for replacement:",S(Go,{title:i("copyToClipboard"),children:S(pn,{onClick:()=>navigator.clipboard.writeText(r.id.toString()),children:S(Nst,{})})})]}),Q(Co,{disablePadding:!0,children:[S(fB,{children:S(Kl,{children:r.mainImage?S(Kl,{alt:"",src:`${wB}${r.mainImage.url}`,variant:"rounded"}):S(Ju,{})})}),S(Wr,{primary:r.getTranslation().name,secondary:`${r.id} (${r.uuid})`}),S(pn,{onClick:s,children:S(_st,{})})]})]})]}),Q(Px,{children:[S(ct,{onClick:()=>e.onClose(),children:i("cancel")}),S(ct,{"data-testid":"button-delete-translation",size:"small",onClick:l,variant:"contained",children:i("exercises.deleteTranslation")}),S(ct,{"data-testid":"button-delete-all",size:"small",onClick:()=>c(),variant:"contained",children:i("exercises.deleteExerciseFull")}),S(ct,{"data-testid":"button-delete-and-replace",size:"small",disabled:r===null,onClick:()=>c(!0),variant:"contained",children:i("exercises.deleteExerciseReplace")})]})]})}const tPt="_root_l288f_1",nPt="_detail_language_l288f_4",rPt="_detail_l288f_4",oPt="_languages_l288f_28",iPt="_language_l288f_28",aPt="_header_l288f_52",sPt="_toolbar_l288f_55",Tp={root:tPt,detail_language:nPt,detail:rPt,languages:oPt,language:iPt,header:aPt,toolbar:sPt},lPt=({exercise:e,languages:t,changeLanguage:n,language:r,setEditMode:o,editMode:i})=>{var O,P,R;const[a,s]=x.useState(null),[l,c]=J.useState(!1),u=!!a,[f]=je(),h=ef(Pu.DELETE_EXERCISE),m=ef(Pu.EDIT_EXERCISE),g=Ra(),y=g.isSuccess&&g.data===null;let v=!1;g.isSuccess&&m.isSuccess&&(v=m.data||g.data!==null&&g.data.isTrustworthy);const w=D=>{s(D.currentTarget)},C=()=>{s(null)},E=D=>{n(D),C()},I=t.map(D=>Q(Jt,{onClick:()=>E(D),selected:(r==null?void 0:r.id)===D.id,children:[S(Wr,{children:D.nameLong}),S(nl,{children:e.availableLanguages.includes(D.id)?S(Kst,{}):S(Ko,{})})]},D.nameShort));return S(me,{container:!0,children:S(me,{size:12,children:Q("div",{className:Tp.root,children:[S(Ix,{open:l,onClose:()=>c(!1),children:S(ePt,{onClose:()=>c(!1),onChangeLanguage:()=>n(t[0]),currentExercise:e,currentLanguage:r})}),Q("div",{className:Tp.detail_language,children:[Q("div",{className:Tp.detail,children:[S(Ro,{to:"../overview",children:f("exercises.exercises")})," > ",(O=e.getTranslation(r))==null?void 0:O.name]}),S("div",{className:Tp.languages,children:Q("div",{className:Tp.language,children:[S(ct,{size:"small",id:"basic-button",onClick:w,startIcon:S(ode,{}),children:r==null?void 0:r.nameLong}),Q(ss,{id:"basic-menu",anchorEl:a,open:u,onClose:C,MenuListProps:{"aria-labelledby":"basic-button"},sx:{padding:20},children:[S(Jt,{disabled:!0,children:f("exercises.changeExerciseLanguage")}),S(ji,{}),I]})]})})]}),Q("div",{className:Tp.header,children:[S(at,{gutterBottom:!0,variant:"h2",margin:0,sx:{mt:2},children:(P=e.getTranslation(r))==null?void 0:P.name}),!y&&Q("nav",{className:Tp.toolbar,children:[h.isSuccess&&h.data&&(r==null?void 0:r.id)===((R=e.getTranslation(r))==null?void 0:R.language)&&S(ct,{onClick:()=>c(!0),children:f("delete")}),v&&S(ct,{onClick:()=>o(!0),disabled:i,children:"EDIT"}),S(ct,{onClick:()=>o(!1),disabled:!i,children:"VIEW"})]})]}),Q(Ft,{direction:"row",spacing:1,mt:2,children:[S(Wl,{label:e.category.translatedName,size:"small"}),e.equipment.map(D=>S(Wl,{label:D.translatedName,variant:"outlined",size:"small"},D.id))]})]})})})},yi=()=>S(Zt,{sx:{height:20}}),cPt=()=>{var g;const[e,t]=x.useState(t2e),[n,r]=x.useState(!1),{i18n:o}=je(),i=id(),a=Yc(),s=Ma(),l=parseInt(s.exerciseId??"");if(Number.isNaN(l))return S("p",{children:"Please pass an integer as the exercise id."});const c=yr({queryKey:[s2e,l],queryFn:()=>pv(l),enabled:a.isSuccess}),u=yr({queryKey:[a2e,(g=c.data)==null?void 0:g.variationId],queryFn:()=>{var y;return m2e((y=c.data)==null?void 0:y.variationId)},enabled:c.isSuccess});if(J.useEffect(()=>{if(a.data===void 0)return;const y=Gu(o.language,a.data);t(y)},[a.data]),c.isError||a.isError||u.isError)return i("/not-found"),null;const f=y=>{const v=Gu(y.nameShort,a.data);v!==void 0&&t(v)},h=u.isSuccess?u.data.filter(y=>y.id!==l):[];let m;return c.isSuccess&&a.isSuccess&&(m=n?S(YIt,{exerciseId:c.data.id,language:e}):S(ZIt,{exercise:c.data,language:e,variations:h,setEditMode:r})),Q(Tt,{children:[c.isSuccess&&a.isSuccess&&S(Uu,{children:S(lPt,{exercise:c.data,languages:a.data,changeLanguage:f,language:e,setEditMode:r,editMode:n})}),S(yi,{}),Q(Uu,{maxWidth:"lg",children:[c.isLoading&&a.isLoading&&S(Qa,{}),m]})]})};function ume(e){const[t]=je(),[n,r,o]=us(e.fieldName),[i,a]=x.useState(""),s=u=>{o.setValue(n.value.filter((f,h)=>h!==u))},l=(u,f)=>{n.value[u]=f,o.setValue(n.value)},c=()=>{n.value.push(i),o.setValue(n.value),a("")};return Q(Tt,{children:[S(me,{size:12,children:S(dn,{fullWidth:!0,label:t("exercises.newNote"),sx:{mb:3},variant:"standard",value:i,onChange:u=>a(u.target.value),error:r.touched&&!!r.error,helperText:r.touched&&r.error?r.error:t("exercises.notesHelpText"),InputProps:{endAdornment:S(So,{position:"end",children:S(pn,{onClick:c,children:S(Ko,{})})})}})}),n.value.map((u,f)=>S(dn,{fullWidth:!0,value:u,onChange:h=>l(f,h.target.value),sx:{mt:2},variant:"standard",error:r.touched&&!!r.error,InputProps:{endAdornment:S(So,{position:"end",children:S(pn,{onClick:()=>s(f),children:S(MP,{})})})}},f))]})}const uPt=({onContinue:e,onBack:t})=>{const[n]=je(),[r,o]=Qv(),i=Wo({description:HH(n),notes:Khe(n)});return S(Ti,{initialValues:{description:r.descriptionEn,notes:r.notesEn},validationSchema:i,onSubmit:a=>{o(aIt(a.description)),o(sIt(a.notes)),e()},children:S(fi,{children:Q(Ft,{children:[S(UH,{fieldName:"description"}),S(yi,{}),S(ume,{fieldName:"notes"}),S(me,{container:!0,children:S(me,{display:"flex",justifyContent:"end",size:12,children:S(Zt,{sx:{mb:2},children:Q("div",{children:[S(ct,{onClick:t,sx:{mt:1,mr:1},children:n("goBack")}),S(ct,{variant:"contained",type:"submit",sx:{mt:1,mr:1},children:n("continue")})]})})})})]})})})},dPt=({onContinue:e,onBack:t})=>{const[n]=je(),r=Yc(),[o,i]=Qv(),[a,s]=x.useState(o.languageId!==null),l=Wo(a?{description:HH(n),name:zH(n),alternativeNames:VH(n),notes:Khe(n),language:Do().required()}:{});return S(Ti,{initialValues:{name:o.nameI18n,alternativeNames:o.alternativeNamesI18n,description:o.descriptionI18n,language:o.languageId===null?"":o.languageId,notes:o.notesI18n},validationSchema:l,onSubmit:c=>{i(cIt(c.name)),i(uIt(c.description)),i(fIt(c.alternativeNames)),i(bIt(c.language===""?null:c.language)),i(dIt(c.notes)),e()},children:c=>Q(fi,{children:[Q(Ft,{spacing:2,children:[S(Mx,{children:S(os,{checked:a,onClick:()=>s(!a),control:S(qo,{}),label:n("exercises.translateExerciseNow")})}),a&&Q(Tt,{children:[r.isLoading?S(Zt,{children:S(Qa,{})}):Q(Fh,{fullWidth:!0,children:[S(jh,{id:"label-language",children:n("language")}),S(Lf,{labelId:"label-language",id:"language",value:c.getFieldProps("language").value,onChange:u=>{c.setFieldValue(c.getFieldProps("language").name,u.target.value)},label:n("language"),error:!!(c.touched.language&&c.errors.language),children:r.data.filter(u=>u.id!==bh).map(u=>Q(Jt,{value:u.id,children:[u.nameShort," - ",u.nameLong]},u.id))})]}),S(BH,{fieldName:"name"}),S(jH,{fieldName:"alternativeNames"}),S(UH,{fieldName:"description"}),S(yi,{}),S(ume,{fieldName:"notes"})]})]}),S(me,{container:!0,children:S(me,{display:"flex",justifyContent:"end",size:12,children:S(Zt,{sx:{mb:2},children:Q("div",{children:[S(ct,{onClick:t,sx:{mt:1,mr:1},children:n("goBack")}),S(ct,{variant:"contained",type:"submit",sx:{mt:1,mr:1},children:n("continue")})]})})})})]})})};function fPt(e){const[t]=je(),[n,r]=us(e.fieldName);return S(dn,{fullWidth:!0,id:e.fieldName,label:t("licenses.authors"),variant:"standard",error:r.touched&&!!r.error,helperText:r.touched&&r.error,...n})}function pPt(e){const[t]=je(),[n,r]=us(e.fieldName);return S(dn,{fullWidth:!0,id:e.fieldName,label:t("licenses.authorProfile"),variant:"standard",placeholder:"https://",error:r.touched&&!!r.error,helperText:r.touched&&r.error,...n})}function hPt(e){const[t]=je(),[n,r]=us(e.fieldName);return S(dn,{fullWidth:!0,id:e.fieldName,label:t("licenses.derivativeSourceUrl"),variant:"standard",placeholder:"https://",error:r.touched&&!!r.error,helperText:t("licenses.derivativeSourceUrlHelper")||r.touched&&r.error,...n})}function mPt(e){const[t]=je(),[n,r]=us(e.fieldName);return S(dn,{fullWidth:!0,id:e.fieldName,label:t("licenses.originalObjectUrl"),variant:"standard",placeholder:"https://",error:r.touched&&!!r.error,helperText:r.touched&&r.error,...n})}function gPt(e){const[t]=je(),[n,r]=us(e.fieldName);return S(dn,{fullWidth:!0,id:e.fieldName,label:t("licenses.originalTitle"),variant:"standard",error:r.touched&&!!r.error,helperText:r.touched&&r.error,...n})}function yPt(e){const[t]=je(),[n,r]=x.useState(Cu.PHOTO),[o,i,a]=us(e.fieldName);return Q(VMe,{value:n,exclusive:!0,fullWidth:!0,onChange:(l,c)=>{r(c),a.setValue(c)},"aria-label":"text alignment",children:[S(Zb,{value:Cu.PHOTO,children:Q(Ft,{justifyContent:"center",alignItems:"center",children:[S(Wst,{}),S(at,{variant:"caption",children:t("exercises.imageStylePhoto")})]})}),S(Zb,{value:Cu.THREE_D,children:Q(Ft,{justifyContent:"center",alignItems:"center",children:[S(zst,{}),S(at,{variant:"caption",children:t("exercises.imageStyle3D")})]})}),S(Zb,{value:Cu.LINE_ART,children:Q(Ft,{justifyContent:"center",alignItems:"center",children:[S(Vst,{}),S(at,{variant:"caption",children:t("exercises.imageStyleLine")})]})}),S(Zb,{value:Cu.LOW_POLY,children:Q(Ft,{justifyContent:"center",alignItems:"center",children:[S(Hst,{}),S(at,{variant:"caption",children:t("exercises.imageStyleLowPoly")})]})}),S(Zb,{value:Cu.OTHER,children:Q(Ft,{justifyContent:"center",alignItems:"center",children:[S(Ust,{}),S(at,{variant:"caption",children:t("exercises.imageStyleOther")})]})})]})}const vPt=({onContinue:e,onBack:t})=>{const[n]=je(),r=Ra(),[o,i]=Qv(),[a,s]=x.useState(o.images),[l,c]=x.useState(void 0),[u,f]=J.useState(!1),h=()=>f(!1);x.useEffect(()=>{i(xIt(a))},[i,a]);const m=C=>{var O;if(!((O=C.target.files)!=null&&O.length))return;const[E]=C.target.files,I=URL.createObjectURL(E);f(!0),c({url:I,file:E,author:"",authorUrl:"",title:"",derivativeSourceUrl:"",objectUrl:"",style:Cu.PHOTO.toString()})},g=C=>{s(a.concat({url:l==null?void 0:l.url,file:l==null?void 0:l.file,author:C.author,authorUrl:C.authorUrl,title:C.title,derivativeSourceUrl:C.derivativeSourceUrl,objectUrl:C.objectUrl,style:C.imageStyle.toString()})),h()},y=C=>{const E=a.filter(I=>I.url!==C);s(E)},v=()=>{e()};return Q("div",{children:[S(lv,{open:u,onClose:h,"aria-labelledby":"modal-modal-title","aria-describedby":"modal-modal-description",children:Q(Zt,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:600,bgcolor:"background.paper",boxShadow:24,p:4},children:[S(at,{id:"modal-modal-title",variant:"h6",component:"h2",children:n("exercises.imageDetails")}),Q(me,{container:!0,spacing:2,children:[S(me,{size:4,children:l&&S("img",{style:{width:"100%"},src:l.url,alt:"",loading:"lazy"})}),S(me,{size:8,children:S(Ti,{initialValues:{title:"",objectUrl:"",author:r.isSuccess?r.data.username:"",authorUrl:"",derivativeSourceUrl:"",imageStyle:Cu.PHOTO},onSubmit:C=>{console.log(C),g(C)},children:C=>Q(fi,{children:[Q(Ft,{spacing:2,children:[S(gPt,{fieldName:"title"}),S(mPt,{fieldName:"objectUrl"}),S(fPt,{fieldName:"author"}),S(pPt,{fieldName:"authorUrl"}),S(hPt,{fieldName:"derivativeSourceUrl"}),S(yPt,{fieldName:"imageStyle"}),Q(Ci,{icon:S(nde,{fontSize:"inherit"}),severity:"info",children:["By submitting this image, you agree to release it under the ",S("a",{href:"https://creativecommons.org/licenses/by-sa/4.0/",target:"_blank",rel:"noreferrer",children:"CC BY-SA 4.0"})," license. The image must be either your own work or the author must have released in under a license compatible with CC BY-SA 4.0."]})]}),S(Ft,{direction:"row",justifyContent:"end",sx:{mt:2},children:S(ct,{color:"primary",variant:"contained",type:"submit",sx:{mt:2},children:n("add")})})]})})})]})]})}),S(at,{children:n("exercises.compatibleImagesCC")}),Q(Ft,{direction:"row",justifyContent:"center",children:[Q("div",{children:[S("label",{htmlFor:"camera-input",children:S(Ast,{fontSize:"large",sx:{m:2}})}),S("input",{style:{display:"none"},id:"camera-input",type:"file",accept:"image/*",capture:"environment",onChange:m})]}),Q("div",{children:[S("label",{htmlFor:"image-input",children:S($st,{fontSize:"large",sx:{m:2}})}),S("input",{type:"file",accept:"image/*",name:"image-file",id:"image-input",style:{display:"none"},onChange:m})]})]}),S(Sne,{cols:3,style:{maxHeight:"400px"},children:a.map(C=>Q(wne,{children:[S("img",{style:{maxHeight:"400px",maxWidth:"400px"},src:C.url,alt:"",loading:"lazy"}),S(BOe,{title:C.title,subtitle:C.author,actionIcon:S(pn,{onClick:()=>y(C.url),sx:{color:"white"},children:S(Lst,{})})})]},C.url))}),S(at,{children:n("forms.supportedImageFormats")}),S(me,{container:!0,children:S(me,{display:"flex",justifyContent:"end",size:12,children:S(Zt,{sx:{mb:2},children:Q(Tt,{children:[S(ct,{onClick:t,sx:{mt:1,mr:1},children:n("goBack")}),S(ct,{variant:"contained",onClick:v,sx:{mt:1,mr:1},children:n("continue")})]})})})})]})},bPt="exercisecomment",Tee=async e=>{const t=new Rre,n=ft(bPt),r=await it.post(n,t.toJson(e),{headers:ht()});return t.fromJson(r.data)},xPt="variation",SPt=async()=>{const e=ft(xPt);return(await it.post(e,{},{headers:ht()})).data.id},wPt=({onBack:e})=>{const[t,n]=je(),[r]=Qv(),o=id(),i=DP(),a=Yc(),s=_v(),l=kP(),c=Ra(),[u,f]=x.useState("initial"),h=async()=>{f("loading");let g;r.newVariationExerciseId!==null?g=await SPt():g=r.variationId;const y=await g2e(r.category,r.equipment,r.muscles,r.musclesSecondary,g,c.data.username),v=await QN({exerciseId:y,languageId:bh,name:r.nameEn,description:r.descriptionEn,author:c.data.username});for(const w of r.alternativeNamesEn)await XN(v.id,w);for(const w of r.images)await jre({exerciseId:y,image:w.file,imageData:w});for(const w of r.notesEn)await Tee(new WN(null,v.id,w));if(r.languageId!==null){const w=await QN({exerciseId:y,languageId:r.languageId,name:r.nameI18n,description:r.descriptionI18n,author:c.data.username});for(const C of r.alternativeNamesI18n)await XN(w.id,C);for(const C of r.notesI18n)await Tee(new WN(null,w.id,C))}console.log("Exercise created"),f("done")},m=()=>{o(cn(Qt.EXERCISE_OVERVIEW,n.language))};return l.isLoading||a.isLoading||s.isLoading||i.isLoading?S(Er,{}):Q(Tt,{children:[S(at,{variant:"h6",children:t("exercises.step1HeaderBasics")}),S(Fc,{children:S(Nc,{children:Q(Lc,{children:[Q(ln,{children:[S(ke,{children:t("name")}),S(ke,{children:r.nameEn})]}),Q(ln,{children:[S(ke,{children:t("exercises.alternativeNames")}),S(ke,{children:r.alternativeNamesEn.join(", ")})]}),Q(ln,{children:[S(ke,{children:t("description")}),S(ke,{children:r.descriptionEn})]}),Q(ln,{children:[S(ke,{children:t("exercises.notes")}),S(ke,{children:r.notesEn.map(g=>Q(Tt,{children:[g,S("br",{})]}))})]}),Q(ln,{children:[S(ke,{children:t("category")}),S(ke,{children:i.data.find(g=>g.id===r.category).translatedName})]}),Q(ln,{children:[S(ke,{children:t("exercises.equipment")}),S(ke,{children:r.equipment.map(g=>l.data.find(y=>y.id===g).translatedName).join(", ")})]}),Q(ln,{children:[S(ke,{children:t("exercises.muscles")}),S(ke,{children:r.muscles.map(g=>s.data.find(y=>y.id===g).getName()).join(", ")})]}),Q(ln,{children:[S(ke,{children:t("exercises.secondaryMuscles")}),S(ke,{children:r.musclesSecondary.map(g=>s.data.find(y=>y.id===g).getName()).join(", ")})]}),Q(ln,{children:[S(ke,{children:t("exercises.variations")}),Q(ke,{children:[r.variationId," / ",r.newVariationExerciseId]})]})]})})}),r.images.length>0&&S(Sne,{cols:3,style:{maxHeight:"200px"},children:r.images.map(g=>S(wne,{children:S("img",{style:{maxHeight:"200px",maxWidth:"200px"},src:g.url,alt:"",loading:"lazy"})},g.url))}),r.languageId!==null&&Q(Tt,{children:[S(at,{variant:"h6",sx:{mt:3},children:a.data.find(g=>g.id===r.languageId).nameLong}),S(Fc,{children:S(Nc,{children:Q(Lc,{children:[Q(ln,{children:[S(ke,{children:t("name")}),S(ke,{children:r.nameI18n})]}),Q(ln,{children:[S(ke,{children:t("exercises.alternativeNames")}),S(ke,{children:r.alternativeNamesI18n.join(", ")})]}),Q(ln,{children:[S(ke,{children:t("description")}),S(ke,{children:r.descriptionI18n})]}),Q(ln,{children:[S(ke,{children:t("exercises.notes")}),S(ke,{children:r.notesI18n.map(g=>Q(Tt,{children:[g,S("br",{})]}))})]})]})})})]}),u!=="done"?S(Ci,{severity:"info",sx:{mt:2},children:t("exercises.checkInformationBeforeSubmitting")}):Q(Ci,{severity:"success",sx:{mt:2},children:[S(fh,{children:t("success")}),t("exercises.cacheWarning")]}),S(me,{container:!0,children:S(me,{display:"flex",justifyContent:"end",size:12,children:S(Zt,{sx:{mb:2},children:Q("div",{children:[u!=="done"&&S(ct,{onClick:e,sx:{mt:1,mr:1},children:t("goBack")}),u!=="done"&&S(ct,{variant:"contained",disabled:u!=="initial",onClick:h,sx:{mt:1,mr:1},color:"info",children:t("exercises.submitExercise")}),u==="done"&&Q(ct,{variant:"contained",onClick:m,sx:{mt:1,mr:1},color:"success",children:[t("overview"),S(Gst,{})]})]})})})})]})},CPt=()=>{const[e]=je(),[t,n]=J.useState(0),r=()=>{n(i=>i+1)},o=()=>{n(i=>i-1)};return S(wIt,{children:Q(Uu,{maxWidth:"md",children:[S(Ft,{direction:"row",children:S(at,{gutterBottom:!0,variant:"h3",component:"div",children:e("exercises.contributeExercise")})}),S(Zt,{children:Q(CAe,{activeStep:t,orientation:"vertical",children:[Q(Vm,{children:[S(Pp,{children:e("exercises.step1HeaderBasics")}),S(Hm,{children:S(CIt,{onContinue:r,onBack:o})})]},1),Q(Vm,{children:[S(Pp,{children:e("exercises.variations")}),S(Hm,{children:S(TIt,{onContinue:r,onBack:o})})]},2),Q(Vm,{children:[S(Pp,{children:e("description")}),S(Hm,{children:S(uPt,{onContinue:r,onBack:o})})]},3),Q(Vm,{children:[S(Pp,{children:e("translation")}),S(Hm,{children:S(dPt,{onContinue:r,onBack:o})})]},4),Q(Vm,{children:[S(Pp,{children:e("images")}),S(Hm,{children:S(vPt,{onContinue:r,onBack:o})})]},5),Q(Vm,{children:[S(Pp,{children:e("overview")}),S(Hm,{children:S(wPt,{onBack:o})})]},6)]})})]})})},EPt=()=>{const[e]=je(),t=GH();return Q(Uu,{maxWidth:"md",children:[S(at,{variant:"h3",children:e("exercises.notEnoughRightsHeader")}),Q(Zt,{marginTop:4,padding:4,sx:{width:"100%",backgroundColor:"#ebebeb",textAlign:"center"},children:[S(at,{mb:2,children:e("exercises.notEnoughRights",{days:n2e})}),!t.anonymous&&!t.emailVerified&&S(ct,{variant:"contained",href:"/user/preferences",endIcon:S(Ost,{}),children:e("preferences")})]})]})},TPt=()=>{const e=GH();return S(Tt,{children:e.canContribute?S(CPt,{}):S(EPt,{})})},OPt=()=>S("div",{children:"Add Weight Page"}),IPt=({day:e,currentMonth:t,currentDate:n,selectedDay:r,onClick:o})=>{const i=Lr(),a=Tf(i.breakpoints.down("sm")),s=Tf(i.breakpoints.down("md")),l=xa(e.date,r.date),c=xa(e.date,n),u=e.date.getTime()<=n.getTime(),f=e.date.getDay()===6||e.date.getDay()===0,h=()=>l||c?"white":u?f?"#E53945":"black":"gray",m=()=>a?35:s?40:50,g=()=>a?8:s?9:10,y=()=>e.measurements.length>0||e.weightEntry!==void 0||e.workoutSession!==void 0,v=()=>{u&&o(e)},w=m(),C=g();return Q("div",{style:{position:"relative",width:`${w}px`,height:`${w+C/2}px`,display:"flex",flexDirection:"column",alignItems:"center"},children:[S("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",width:`${w}px`,height:`${w}px`,fontSize:a?"0.8rem":s?"0.9rem":"1rem",color:l||c?"white":h(),backgroundColor:l?"#E53945":c?"#FEC107":"transparent",borderRadius:"50%",fontWeight:"bold",cursor:u?"pointer":"default",opacity:e.date.getMonth()!==t?.25:1},"data-testid":`day-${Zn(e.date)}`,onClick:v,children:e.date.getDate()}),y()&&S("div",{style:{width:`${C}px`,height:`${C}px`,backgroundColor:"black",borderRadius:"50%",position:"absolute",bottom:0,left:"50%",transform:"translateX(-50%)",zIndex:2}})]})},PPt=({days:e,currentMonth:t,currentDate:n,selectedDay:r,onDayClick:o})=>{const{i18n:i}=je(),a=Array.from({length:7},(s,l)=>new Date(1970,0,l+5).toLocaleString(i.language,{weekday:"short"}));return Q(me,{container:!0,spacing:1,rowSpacing:2,children:[a.map((s,l)=>S(me,{size:12/7,children:S(at,{variant:"body1",sx:{fontWeight:"bold",textAlign:"center"},children:s})},`weekday-${l}`)),e.map((s,l)=>S(me,{size:12/7,sx:{display:"flex",justifyContent:"center"},children:S(IPt,{day:s,currentMonth:t,currentDate:n,selectedDay:r,onClick:o})},`day-${l}`))]})},APt=({currentMonth:e,currentYear:t,onPrevMonth:n,onNextMonth:r})=>{const{i18n:o}=je(),i=Array.from({length:12},(a,s)=>new Date(2024,s,1).toLocaleString(o.language,{month:"long"}));return Q("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",paddingBottom:"3%"},children:[S(ct,{variant:"outlined",onClick:n,children:"<"}),Q(at,{variant:"h5",children:[i[e]," ",t]}),S(ct,{variant:"outlined",onClick:r,children:">"})]})};class MPt{constructor(t,n,r,o){this.name=t,this.unit=n,this.value=r,this.date=o}}const RPt=({selectedDay:e})=>{const[t]=je(),[n,r]=J.useState(!1),[o,i]=J.useState(!1),[a,s]=J.useState(!1);return Q(ho,{sx:{width:{xs:"auto",md:"45%"},height:{xs:"60%",md:"100%"},m:{xs:0,sm:1,md:2},p:{xs:1,sm:1.5,md:2}},children:[S(Jl,{title:Q(at,{variant:"h5",component:"div",sx:{fontWeight:"bold"},children:[t("entries")," - ",e.date.toLocaleDateString()]})}),S(Fi,{sx:{flex:1,height:"100%",overflow:"auto",display:"flex",flexDirection:"column",gap:2},children:Q(ai,{children:[e.weightEntry&&S(Co,{children:S(Wr,{primary:t("weight"),secondary:e.weightEntry.weight.toFixed(1),sx:{pl:2}})}),e.measurements.length===1&&S(Co,{children:S(Wr,{primary:t("measurements.measurements"),secondary:`${e.measurements[0].name}: ${e.measurements[0].value} ${e.measurements[0].unit}`,sx:{pl:2}})}),e.measurements.length>1&&Q(Tt,{children:[S(Co,{children:Q(Fl,{onClick:()=>r(!n),selected:n,children:[S(Wr,{primary:t("measurements.measurements")}),n?S(J0,{}):S(Du,{})]})}),S(aa,{in:n,timeout:"auto",unmountOnExit:!0,children:S(ai,{sx:{pl:4,pt:0},children:e.measurements.map((l,c)=>S(Co,{dense:!0,children:S(Wr,{primary:l.name,secondary:`${l.value} ${l.unit}`})},c))})})]}),e.workoutSession&&Q(Tt,{children:[S(Co,{children:Q(Fl,{onClick:()=>i(!o),selected:o,children:[S(Wr,{primary:t("routines.workoutSession"),secondary:e.workoutSession.textRepresentation,sx:{"& .MuiListItemText-secondary":{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}}),o?S(J0,{}):S(Du,{})]})}),S(aa,{in:o,timeout:"auto",unmountOnExit:!0,children:S(ai,{sx:{pl:4,pt:0},children:e.workoutSession.logs.map((l,c)=>{var u;return S(Co,{dense:!0,children:S(Wr,{primary:(u=l.exerciseObj)==null?void 0:u.getTranslation().name,secondary:`${l.repetitions} × ${l.weight} `})},c)})})})]}),e.nutritionLogs.length>0&&Q(Tt,{children:[S(Co,{children:Q(Fl,{onClick:()=>s(!a),selected:a,children:[S(Wr,{primary:t("nutrition.nutritionalDiary")}),a?S(J0,{}):S(Du,{})]})}),S(aa,{in:a,timeout:"auto",unmountOnExit:!0,children:S(ai,{sx:{pl:4,pt:0},children:e.nutritionLogs.map((l,c)=>{var u;return S(Co,{dense:!0,children:S(Wr,{primary:(u=l.ingredient)==null?void 0:u.name,secondary:`${l.amount} ${t("nutrition.gramShort")}`})},c)})})})]})]})})]})},DPt=()=>{const[e]=je(),t=new Date,[n,r]=x.useState(t.getMonth()),[o,i]=x.useState(t.getFullYear()),a=new Date(o,n,1),s=new Date(o,n+1,0),l=Bw(),c=Sst({filtersetQuerySessions:{date__gte:Zn(a),date__lte:Zn(s)},filtersetQueryLogs:{date__gte:Zn(a),date__lte:Zn(s)}}),u=kde({filtersetQueryEntries:{date__gte:Zn(a),date__lte:Zn(s)}}),f=nFe({filtersetQuery:{datetime__gte:Zn(a),datetime__lte:Zn(s)}}),h=l.isLoading||c.isLoading||u.isLoading||f.isLoading,m=l.isSuccess&&c.isSuccess&&u.isSuccess&&f.isSuccess,g=u.data,y=(g==null?void 0:g.flatMap(A=>A.entries.map(_=>new MPt(A.name,A.unit,_.value,_.date))))??[],v=(A,_)=>{var W,K,G;const N=new Date(A,_,1),B=[];let j=new Date(A,_,1).getDay();j=j===0?6:j-1;for(let q=0;q<j;q++)B.push({date:new Date(A,_,-j+q+1),weightEntry:void 0,measurements:[],nutritionLogs:[],workoutSession:void 0});for(;N.getMonth()===_;)B.push({date:new Date(N),weightEntry:(W=l.data)==null?void 0:W.find(q=>xa(q.date,N)),measurements:y.filter(q=>xa(q.date,N))||[],workoutSession:((K=c.data)==null?void 0:K.find(q=>xa(q.date,N)))||void 0,nutritionLogs:((G=f.data)==null?void 0:G.filter(q=>xa(q.datetime,N)))||[]}),N.setDate(N.getDate()+1);j=new Date(A,_+1,0).getDay();const V=j===0?0:7-j;for(let q=1;q<=V;q++)B.push({date:new Date(A,_+1,q),weightEntry:void 0,workoutSession:void 0,measurements:[],nutritionLogs:[]});return B},w={date:t,weightEntry:void 0,workoutSession:void 0,measurements:[],nutritionLogs:[]},C=x.useMemo(()=>v(o,n),[o,n,l.data,c.data,u.data,f.data]),[E,I]=x.useState(C.find(A=>xa(A.date,t))||w),O=Lr(),P=Tf(O.breakpoints.down("sm"));x.useEffect(()=>{if(m){const A=C.find(_=>xa(_.date,t));A&&I(A)}},[m]),x.useEffect(()=>{r(E.date.getMonth()),i(E.date.getFullYear())},[E]);const R=A=>{I(A)},D=()=>{n===0?(r(11),i(o-1)):r(n-1)},M=()=>{(n<t.getMonth()||o<t.getFullYear())&&(n===11?(r(0),i(o+1)):r(n+1))};return Q(Zt,{sx:{display:"flex",gap:2,flexDirection:{xs:"column",md:"row"},height:{xs:"auto",md:"calc(100vh - 130px)"},width:"100%"},children:[Q(ho,{sx:{width:{xs:"auto",md:"65%"},height:{xs:"auto",md:"100%"},m:{xs:0,sm:1,md:2},p:{xs:1,sm:1.5,md:2},display:"flex",flexDirection:"column"},children:[S(Jl,{sx:{"& .MuiCardHeader-content":{width:"100%"}},title:S("div",{style:{display:"flex",flexDirection:"column",width:"100%"},children:Q("div",{style:{display:"flex",alignItems:"center",marginBottom:"16px"},children:[S(Pst,{style:{width:P?"28px":"32px",height:P?"28px":"32px",marginRight:"12px"}}),S("span",{style:{fontSize:P?"1.5rem":"1.8rem",fontWeight:"bold"},children:e("calendar")})]})})}),Q(Fi,{sx:{overflow:"auto",flex:1,"&:last-child":{paddingBottom:2}},children:[S(APt,{currentMonth:n,currentYear:o,onPrevMonth:D,onNextMonth:M}),S(PPt,{days:C,currentMonth:n,currentDate:t,selectedDay:E,onDayClick:R})]})]}),h&&S(ho,{sx:{width:{xs:"auto",md:"65%"},height:{xs:"60%",md:"100%"},m:{xs:0,sm:1,md:2},p:{xs:1,sm:1.5,md:2}},children:S(Er,{})}),m&&S(RPt,{selectedDay:E})]})},kPt=()=>S("div",{children:S(DPt,{})}),_Pt=()=>S("div",{children:"Calories Calculator Page"}),$Pt=()=>S("div",{children:"Equipments Page"}),NPt=()=>S("div",{children:"Gallery Page"}),LPt=()=>S("div",{children:"Ingredients Page"}),FPt=()=>S("div",{children:"Login Page"}),jPt=()=>S("div",{children:"Preferences Page"}),BPt=()=>S("div",{children:"RestApi Page"}),zPt=({weight:e})=>{const t=$ct(),[n]=je(),[r,o]=J.useState(null),[i,a]=J.useState(!1),s=!!r,l=g=>{o(g.currentTarget)},c=()=>{u(),h()},u=()=>{o(null)},f=()=>{t.mutate(e.id),o(null)},h=()=>a(!0),m=()=>a(!1);return Q("div",{children:[S(ct,{onClick:l,children:S(Est,{})}),Q(ss,{anchorEl:r,open:s,onClose:u,MenuListProps:{"aria-labelledby":"basic-button"},children:[S(Jt,{onClick:c,children:n("edit")}),S(Jt,{onClick:f,children:n("delete")})]}),S(Bi,{title:n("edit"),isOpen:i,closeFn:m,children:S(Lv,{weightEntry:e,closeFn:m})})]})},VPt=()=>{const[e]=je(),[t,n]=J.useState(!1),r=()=>n(!0),o=()=>n(!1);return Q("div",{children:[S(Lh,{color:"primary","aria-label":"add",onClick:r,sx:{position:"fixed",bottom:"5rem",right:i=>i.spacing(2),zIndex:9},children:S(Ko,{})}),S(Bi,{title:e("add"),isOpen:t,closeFn:o,children:S(Lv,{closeFn:o})})]})},HPt=e=>e.map((t,n)=>n===0?{entry:t,change:0,days:Math.abs(t.date.getTime()-t.date.getTime())/(1e3*60*60*24)}:{entry:t,change:e[n].weight-e[n-1].weight,days:Math.abs(t.date.getTime()-e[n-1].date.getTime())/(1e3*60*60*24)}),UPt="WeightTable",dme={table:`${UPt}-table`},GPt=ae("div")(({theme:e})=>({[`&.${dme.table}`]:{"& .MuiPaper-root":{border:"1px solid #bababa"}}})),qPt=({weights:e})=>{const t=[10,50,100],[n]=je(),r=HPt(e),[o,i]=x.useState(t[0]),[a,s]=x.useState(0),l=(u,f)=>{s(f)},c=u=>{i(parseInt(u.target.value,10)),s(0)};return Q(GPt,{className:dme.table,children:[Q(Fc,{children:[Q(Nc,{sx:{minWidth:650},"aria-label":"simple table",children:[S(Ff,{children:Q(ln,{children:[S(ke,{align:"center",children:n("date")}),S(ke,{align:"center",children:n("weight")}),S(ke,{align:"center",children:n("difference")}),S(ke,{align:"center",children:n("days")}),S(ke,{align:"center"})]})}),S(Lc,{children:r.slice(a*o,a*o+o).map(u=>Q(ln,{sx:{"&:last-child td, &:last-child th":{border:0}},children:[S(ke,{component:"th",scope:"row",align:"center",children:u.entry.date.toLocaleDateString()}),S(ke,{align:"center",children:u.entry.weight}),S(ke,{align:"center",children:+u.change.toFixed(2)}),S(ke,{align:"center",children:u.days}),S(ke,{align:"center",children:S(zPt,{weight:u.entry})})]},u.entry.date.toLocaleDateString()))})]}),S(Lne,{rowsPerPageOptions:t,component:"div",count:r.length,rowsPerPage:o,page:a,onPageChange:l,onRowsPerPageChange:c})]}),S(VPt,{})]})},WPt=()=>{const[e]=je(),[t,n]=x.useState(!1),r=()=>n(!0),o=()=>n(!1);return Q("div",{children:[S(Lh,{color:"secondary","aria-label":"add",onClick:r,sx:{position:"fixed",bottom:"5rem",right:i=>i.spacing(2),zIndex:9},children:S(Ko,{})}),S(Bi,{title:e("add"),isOpen:t,closeFn:o,children:S(Lv,{closeFn:o})})]})},KPt=({currentFilter:e,onFilterChange:t})=>{const[n]=je(),r=Lr(),o=i=>{e!==i&&t(i)};return Q(sB,{variant:"outlined",sx:{mb:2},children:[S(ct,{onClick:()=>o(""),color:e===""?"primary":"inherit",variant:e===""?"contained":"outlined",sx:{fontFamily:r.typography.fontFamily},children:n("all")}),S(ct,{onClick:()=>o("lastYear"),color:e==="lastYear"?"primary":"inherit",variant:e==="lastYear"?"contained":"outlined",sx:{fontFamily:r.typography.fontFamily},children:n("lastYear")}),S(ct,{onClick:()=>o("lastHalfYear"),color:e==="lastHalfYear"?"primary":"inherit",variant:e==="lastHalfYear"?"contained":"outlined",sx:{fontFamily:r.typography.fontFamily},children:n("lastHalfYear")}),S(ct,{onClick:()=>o("lastMonth"),color:e==="lastMonth"?"primary":"inherit",variant:e==="lastMonth"?"contained":"outlined",sx:{fontFamily:r.typography.fontFamily},children:n("lastMonth")}),S(ct,{onClick:()=>o("lastWeek"),color:e==="lastWeek"?"primary":"inherit",variant:e==="lastWeek"?"contained":"outlined",sx:{fontFamily:r.typography.fontFamily},children:n("lastWeek")})]})},YPt=()=>{const[e]=je(),[t,n]=x.useState("lastYear"),r=Bw(t),o=i=>{n(i)};return r.isLoading?S(Er,{}):S(ds,{title:e("weight"),mainContent:Q(Ft,{spacing:2,children:[S(KPt,{currentFilter:t,onFilterChange:o}),r.data.length===0&&S(Bh,{}),r.data.length!==0&&Q(Tt,{children:[S(Ode,{weights:r.data}),S(Zt,{sx:{mt:4}}),S(qPt,{weights:r.data})]})]}),fab:S(WPt,{})})},QPt=()=>{const{i18n:e}=je(),[t,n]=J.useState(null);return Q(Tt,{children:[S(ct,{color:"inherit",onClick:r=>n(r.currentTarget),children:"Weight"}),S(ss,{anchorEl:t,open:!!t,onClose:()=>n(null),children:S(Jt,{component:Ro,to:cn(Qt.WEIGHT_OVERVIEW,e.language),children:"Weight overview"})})]})},XPt=()=>{const{i18n:e}=je(),[t,n]=J.useState(null);return Q(Tt,{children:[S(ct,{color:"inherit",onClick:r=>n(r.currentTarget),children:"Measurements"}),S(ss,{anchorEl:t,open:!!t,onClose:()=>n(null),children:S(Jt,{component:Ro,to:cn(Qt.MEASUREMENT_OVERVIEW,e.language),children:"Overview"})})]})},JPt=()=>{const{i18n:e}=je(),[t,n]=J.useState(null);return Q(Tt,{children:[S(ct,{color:"inherit",onClick:r=>n(r.currentTarget),children:"Nutrition"}),S(ss,{anchorEl:t,open:!!t,onClose:()=>n(null),children:S(Jt,{component:Ro,to:cn(Qt.NUTRITION_OVERVIEW,e.language),children:"Overview"})})]})},ZPt=()=>{const{i18n:e}=je(),[t,n]=J.useState(null);return Q(Tt,{children:[S(ct,{color:"inherit",onClick:r=>n(r.currentTarget),children:"Routines"}),Q(ss,{anchorEl:t,open:!!t,onClose:()=>n(null),children:[S(Jt,{component:Ro,to:cn(Qt.ROUTINE_OVERVIEW,e.language),children:"Routine overview"}),S(Jt,{component:Ro,to:cn(Qt.PRIVATE_TEMPLATE_OVERVIEW,e.language),children:"Private template overview"}),S(Jt,{component:Ro,to:cn(Qt.PUBLIC_TEMPLATE_OVERVIEW,e.language),children:"Public template overview"}),S(Jt,{component:Ro,to:cn(Qt.EXERCISE_OVERVIEW,e.language),children:"Exercise overview"}),S(Jt,{component:Ro,to:cn(Qt.EXERCISE_CONTRIBUTE,e.language),children:"Contribute exercise"}),S(Jt,{component:Ro,to:cn(Qt.CALENDAR,e.language),children:"Calendar"})]})]})},eAt=()=>S(jwe,{position:"static",children:Q(_ne,{children:[S(at,{variant:"h6",component:"div",mr:3,children:"wger"}),S(ZPt,{}),S(QPt,{}),S(XPt,{}),S(JPt,{})]})}),tAt=()=>S(YPt,{}),nAt=()=>S("div",{children:"Workout Page"}),G$=()=>S(cPt,{}),qH=()=>Q(Jlt,{children:[Q(Ht,{path:"/:lang",children:[Q(Ht,{path:"workout",children:[S(Ht,{path:"overview",element:S(nAt,{})}),S(Ht,{path:"gallery",element:S(NPt,{})})]}),Q(Ht,{path:"routine",children:[S(Ht,{index:!0,element:S(yee,{})}),S(Ht,{path:"overview",element:S(yee,{})}),S(Ht,{path:"calendar",element:S(kPt,{})}),S(Ht,{path:"add",element:S(iwt,{})}),Q(Ht,{path:":routineId",children:[S(Ht,{path:"day/:dayId",children:S(Ht,{path:"add-logs",element:S(FOt,{})})}),Q(Ht,{path:"edit",children:[S(Ht,{index:!0,element:S($Ot,{})}),S(Ht,{path:"progression/:slotId",element:S(jOt,{})})]}),S(Ht,{path:"view",element:S(lwt,{})}),S(Ht,{path:"table",element:S(uwt,{})}),S(Ht,{path:"logs",element:S(GOt,{})}),S(Ht,{path:"statistics",element:S(YOt,{})})]}),Q(Ht,{path:"templates",children:[S(Ht,{path:":routineId",children:S(Ht,{path:"view",element:S(BOt,{})})}),Q(Ht,{path:"overview",children:[S(Ht,{path:"private",element:S(XOt,{})}),S(Ht,{path:"public",element:S(JOt,{})})]})]})]}),Q(Ht,{path:"measurement",children:[S(Ht,{index:!0,element:S(OZ,{})}),S(Ht,{path:"overview",element:S(OZ,{})}),S(Ht,{path:"category/:categoryId",element:S(_St,{})})]}),Q(Ht,{path:"exercise",children:[S(Ht,{index:!0,element:S(aJ,{})}),S(Ht,{path:"overview",element:S(aJ,{})}),S(Ht,{path:":exerciseId",element:S(G$,{}),children:S(Ht,{path:"view",element:S(G$,{}),children:S(Ht,{path:":slug",element:S(G$,{})})})}),S(Ht,{path:"contribute",element:S(TPt,{})})]}),Q(Ht,{path:"weight",children:[S(Ht,{path:"overview",element:S(tAt,{})}),S(Ht,{path:"add",element:S(OPt,{})})]}),Q(Ht,{path:"nutrition",children:[S(Ht,{path:"overview",element:S(XSt,{})}),Q(Ht,{path:":planId",children:[S(Ht,{path:"view",element:S(QSt,{})}),S(Ht,{path:":date",element:S(IZ,{})}),S(Ht,{path:"diary",element:S(IZ,{})})]}),Q(Ht,{path:"calculator",children:[S(Ht,{path:"bmi",element:S(LSt,{})}),S(Ht,{path:"calories",element:S(_Pt,{})})]}),S(Ht,{path:"ingredient",children:S(Ht,{path:"overview",element:S(LPt,{})})})]}),Q(Ht,{path:"software",children:[S(Ht,{path:"about-us",element:S(ZOt,{})}),S(Ht,{path:"api",element:S(BPt,{})}),S(Ht,{path:"equipment",element:S($Pt,{})})]}),S(Ht,{path:"login",element:S(FPt,{})}),S(Ht,{path:"user",children:S(Ht,{path:"preferences",element:S(jPt,{})})})]}),S(Ht,{path:"/",element:S(Kct,{})}),S(Ht,{path:"*",element:S("main",{style:{padding:"1rem"},children:S("p",{children:"404, Page NOT FOUND"})})})]}),rAt="_notification_bbb61_1",Oee={notification:rAt},oAt=()=>{const[e,t]=oIt(),n=()=>{t(vee({notify:!1,message:"",severity:void 0,title:"",type:void 0}))},r=()=>{t(vee({notify:!1,message:"",severity:void 0,title:"",type:void 0,undo:!0}))};return e.notification.notify?e.notification.type==="delete"?Q(Ci,{className:Oee.notification,severity:e.notification.severity,action:S(ct,{color:"inherit",size:"small",onClick:r,children:"UNDO"}),variant:"filled",children:[S(fh,{children:e.notification.title}),S("strong",{children:e.notification.message})]}):Q(Ci,{className:Oee.notification,severity:e.notification.severity,onClose:()=>n(),variant:"filled",children:[S(fh,{children:e.notification.title}),S("strong",{children:e.notification.message})]}):null};function iAt(){return Q(me,{container:!0,children:[S(me,{size:12,children:S(eAt,{})}),S(me,{size:12,children:S(oAt,{})}),S(me,{size:12,children:S(qH,{})})]})}const Xv=new zxe({defaultOptions:{queries:{retry:3,staleTime:1e3*60*5,refetchOnMount:!0,refetchOnWindowFocus:!0,refetchOnReconnect:"always"}}}),aAt=e=>{const t=document.getElementById(e);if(t===null)return;const n=t.attachShadow({mode:"open"}),r=document.createElement("div"),o=document.createElement("style"),i=document.getElementById("react-css");if(i){const l=document.createElement("link");l.setAttribute("rel","stylesheet"),l.setAttribute("href",i.href),n.appendChild(i)}n.appendChild(r),n.appendChild(o);const a=Xee({key:"css",prepend:!0,container:o});em.createRoot(r).render(S(uve,{value:a,children:S(x.Suspense,{fallback:S(Qa,{}),children:S(jV,{children:S(Nh,{theme:kSt(r),children:S(av,{client:Xv,children:S(qH,{})})})})})}))},Iee=document.getElementById("root");Iee&&em.createRoot(Iee).render(S(J.StrictMode,{children:S(x.Suspense,{fallback:S(Qa,{}),children:S(jV,{children:S(Nh,{theme:tm,children:Q(av,{client:Xv,children:[S(iAt,{}),S(aSe,{})]})})})})}));const Pee=document.getElementById("react-page-no-shadow-dom");Pee&&em.createRoot(Pee).render(S(x.Suspense,{fallback:S(Qa,{}),children:S(jV,{children:S(Nh,{theme:tm,children:S(av,{client:Xv,children:S(qH,{})})})})}));aAt("react-page");const Aee=document.getElementById("react-weight-dashboard");Aee&&em.createRoot(Aee).render(S(x.Suspense,{fallback:S(Qa,{}),children:S(Nh,{theme:tm,children:S(av,{client:Xv,children:S(Ide,{})})})}));const Mee=document.getElementById("react-nutrition-dashboard");Mee&&em.createRoot(Mee).render(S(x.Suspense,{fallback:S(Qa,{}),children:S(Nh,{theme:tm,children:S(av,{client:Xv,children:S(Gue,{})})})}));const Ree=document.getElementById("react-routine-dashboard");Ree&&em.createRoot(Ree).render(S(x.Suspense,{fallback:S(Qa,{}),children:S(Nh,{theme:tm,children:S(av,{client:Xv,children:S(Ede,{})})})}));const Dee=document.getElementById("react-ingredient-search");Dee&&em.createRoot(Dee).render(S(x.Suspense,{fallback:S(Qa,{}),children:S(Nh,{theme:tm,children:S(Hct,{})})}));export{f1 as c,Gn as g};