From 755297e5b0f0c9f89e940e40506934cea8b12e48 Mon Sep 17 00:00:00 2001 From: Admin Date: Mon, 18 May 2026 10:06:59 +0700 Subject: [PATCH] update(ui) add responsive for tracking --- TrackingToolWebAU/README.md | 4 +++- .../static/assets/{index-CEkaj5WK.js => index-CZPaGL7L.js} | 2 +- TrackingToolWebAU/static/index.html | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) rename TrackingToolWebAU/static/assets/{index-CEkaj5WK.js => index-CZPaGL7L.js} (82%) diff --git a/TrackingToolWebAU/README.md b/TrackingToolWebAU/README.md index 716eedd..2dcdb2f 100644 --- a/TrackingToolWebAU/README.md +++ b/TrackingToolWebAU/README.md @@ -4,7 +4,9 @@ Run client: npm run dev or npm run build && npm run preview Run server uvicorn main:app --reload -nohup uvicorn main:app --host 172.16.6.38 --port 8080 > log.log 2>&1 & +nohup uvicorn main:app --host 172.16.6.38 --port 8081 > log.log 2>&1 & + +pm2 start ps aux | grep uvicorn diff --git a/TrackingToolWebAU/static/assets/index-CEkaj5WK.js b/TrackingToolWebAU/static/assets/index-CZPaGL7L.js similarity index 82% rename from TrackingToolWebAU/static/assets/index-CEkaj5WK.js rename to TrackingToolWebAU/static/assets/index-CZPaGL7L.js index cf8fde3..d3af509 100644 --- a/TrackingToolWebAU/static/assets/index-CEkaj5WK.js +++ b/TrackingToolWebAU/static/assets/index-CZPaGL7L.js @@ -58,7 +58,7 @@ Arguments: `+Array.prototype.slice.call(s).join("")+` `)}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,...r){const s=new this(t);return r.forEach(o=>s.set(o)),s}static accessor(t){const s=(this[V0]=this[V0]={accessors:{}}).accessors,o=this.prototype;function u(f){const h=jl(f);s[h]||(YM(o,f),s[h]=!0)}return Y.isArray(t)?t.forEach(u):u(t),this}};Cn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Y.reduceDescriptors(Cn.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(s){this[r]=s}}});Y.freezeMethods(Cn);function ph(e,t){const r=this||ro,s=t||r,o=Cn.from(s.headers);let u=s.data;return Y.forEach(e,function(h){u=h.call(r,u,o.normalize(),t?t.status:void 0)}),o.normalize(),u}function gS(e){return!!(e&&e.__CANCEL__)}function Yi(e,t,r){je.call(this,e??"canceled",je.ERR_CANCELED,t,r),this.name="CanceledError"}Y.inherits(Yi,je,{__CANCEL__:!0});function yS(e,t,r){const s=r.config.validateStatus;!r.status||!s||s(r.status)?e(r):t(new je("Request failed with status code "+r.status,[je.ERR_BAD_REQUEST,je.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function HM(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function VM(e,t){e=e||10;const r=new Array(e),s=new Array(e);let o=0,u=0,f;return t=t!==void 0?t:1e3,function(p){const m=Date.now(),v=s[u];f||(f=m),r[o]=p,s[o]=m;let g=u,_=0;for(;g!==o;)_+=r[g++],g=g%e;if(o=(o+1)%e,o===u&&(u=(u+1)%e),m-f{r=v,o=null,u&&(clearTimeout(u),u=null),e(...m)};return[(...m)=>{const v=Date.now(),g=v-r;g>=s?f(m,v):(o=m,u||(u=setTimeout(()=>{u=null,f(o)},s-g)))},()=>o&&f(o)]}const Ju=(e,t,r=3)=>{let s=0;const o=VM(50,250);return BM(u=>{const f=u.loaded,h=u.lengthComputable?u.total:void 0,p=f-s,m=o(p),v=f<=h;s=f;const g={loaded:f,total:h,progress:h?f/h:void 0,bytes:p,rate:m||void 0,estimated:m&&h&&v?(h-f)/m:void 0,event:u,lengthComputable:h!=null,[t?"download":"upload"]:!0};e(g)},r)},B0=(e,t)=>{const r=e!=null;return[s=>t[0]({lengthComputable:r,total:e,loaded:s}),t[1]]},Z0=e=>(...t)=>Y.asap(()=>e(...t)),ZM=ln.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,ln.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(ln.origin),ln.navigator&&/(msie|trident)/i.test(ln.navigator.userAgent)):()=>!0,FM=ln.hasStandardBrowserEnv?{write(e,t,r,s,o,u,f){if(typeof document>"u")return;const h=[`${e}=${encodeURIComponent(t)}`];Y.isNumber(r)&&h.push(`expires=${new Date(r).toUTCString()}`),Y.isString(s)&&h.push(`path=${s}`),Y.isString(o)&&h.push(`domain=${o}`),u===!0&&h.push("secure"),Y.isString(f)&&h.push(`SameSite=${f}`),document.cookie=h.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function $M(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function qM(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function vS(e,t,r){let s=!$M(t);return e&&(s||r==!1)?qM(e,t):t}const F0=e=>e instanceof Cn?{...e}:e;function bs(e,t){t=t||{};const r={};function s(m,v,g,_){return Y.isPlainObject(m)&&Y.isPlainObject(v)?Y.merge.call({caseless:_},m,v):Y.isPlainObject(v)?Y.merge({},v):Y.isArray(v)?v.slice():v}function o(m,v,g,_){if(Y.isUndefined(v)){if(!Y.isUndefined(m))return s(void 0,m,g,_)}else return s(m,v,g,_)}function u(m,v){if(!Y.isUndefined(v))return s(void 0,v)}function f(m,v){if(Y.isUndefined(v)){if(!Y.isUndefined(m))return s(void 0,m)}else return s(void 0,v)}function h(m,v,g){if(g in t)return s(m,v);if(g in e)return s(void 0,m)}const p={url:u,method:u,data:u,baseURL:f,transformRequest:f,transformResponse:f,paramsSerializer:f,timeout:f,timeoutMessage:f,withCredentials:f,withXSRFToken:f,adapter:f,responseType:f,xsrfCookieName:f,xsrfHeaderName:f,onUploadProgress:f,onDownloadProgress:f,decompress:f,maxContentLength:f,maxBodyLength:f,beforeRedirect:f,transport:f,httpAgent:f,httpsAgent:f,cancelToken:f,socketPath:f,responseEncoding:f,validateStatus:h,headers:(m,v,g)=>o(F0(m),F0(v),g,!0)};return Y.forEach(Object.keys({...e,...t}),function(v){const g=p[v]||o,_=g(e[v],t[v],v);Y.isUndefined(_)&&g!==h||(r[v]=_)}),r}const bS=e=>{const t=bs({},e);let{data:r,withXSRFToken:s,xsrfHeaderName:o,xsrfCookieName:u,headers:f,auth:h}=t;if(t.headers=f=Cn.from(f),t.url=hS(vS(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),h&&f.set("Authorization","Basic "+btoa((h.username||"")+":"+(h.password?unescape(encodeURIComponent(h.password)):""))),Y.isFormData(r)){if(ln.hasStandardBrowserEnv||ln.hasStandardBrowserWebWorkerEnv)f.setContentType(void 0);else if(Y.isFunction(r.getHeaders)){const p=r.getHeaders(),m=["content-type","content-length"];Object.entries(p).forEach(([v,g])=>{m.includes(v.toLowerCase())&&f.set(v,g)})}}if(ln.hasStandardBrowserEnv&&(s&&Y.isFunction(s)&&(s=s(t)),s||s!==!1&&ZM(t.url))){const p=o&&u&&FM.read(u);p&&f.set(o,p)}return t},GM=typeof XMLHttpRequest<"u",XM=GM&&function(e){return new Promise(function(r,s){const o=bS(e);let u=o.data;const f=Cn.from(o.headers).normalize();let{responseType:h,onUploadProgress:p,onDownloadProgress:m}=o,v,g,_,N,T;function x(){N&&N(),T&&T(),o.cancelToken&&o.cancelToken.unsubscribe(v),o.signal&&o.signal.removeEventListener("abort",v)}let O=new XMLHttpRequest;O.open(o.method.toUpperCase(),o.url,!0),O.timeout=o.timeout;function z(){if(!O)return;const q=Cn.from("getAllResponseHeaders"in O&&O.getAllResponseHeaders()),J={data:!h||h==="text"||h==="json"?O.responseText:O.response,status:O.status,statusText:O.statusText,headers:q,config:e,request:O};yS(function(P){r(P),x()},function(P){s(P),x()},J),O=null}"onloadend"in O?O.onloadend=z:O.onreadystatechange=function(){!O||O.readyState!==4||O.status===0&&!(O.responseURL&&O.responseURL.indexOf("file:")===0)||setTimeout(z)},O.onabort=function(){O&&(s(new je("Request aborted",je.ECONNABORTED,e,O)),O=null)},O.onerror=function(B){const J=B&&B.message?B.message:"Network Error",ie=new je(J,je.ERR_NETWORK,e,O);ie.event=B||null,s(ie),O=null},O.ontimeout=function(){let B=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const J=o.transitional||mS;o.timeoutErrorMessage&&(B=o.timeoutErrorMessage),s(new je(B,J.clarifyTimeoutError?je.ETIMEDOUT:je.ECONNABORTED,e,O)),O=null},u===void 0&&f.setContentType(null),"setRequestHeader"in O&&Y.forEach(f.toJSON(),function(B,J){O.setRequestHeader(J,B)}),Y.isUndefined(o.withCredentials)||(O.withCredentials=!!o.withCredentials),h&&h!=="json"&&(O.responseType=o.responseType),m&&([_,T]=Ju(m,!0),O.addEventListener("progress",_)),p&&O.upload&&([g,N]=Ju(p),O.upload.addEventListener("progress",g),O.upload.addEventListener("loadend",N)),(o.cancelToken||o.signal)&&(v=q=>{O&&(s(!q||q.type?new Yi(null,e,O):q),O.abort(),O=null)},o.cancelToken&&o.cancelToken.subscribe(v),o.signal&&(o.signal.aborted?v():o.signal.addEventListener("abort",v)));const X=HM(o.url);if(X&&ln.protocols.indexOf(X)===-1){s(new je("Unsupported protocol "+X+":",je.ERR_BAD_REQUEST,e));return}O.send(u||null)})},IM=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let s=new AbortController,o;const u=function(m){if(!o){o=!0,h();const v=m instanceof Error?m:this.reason;s.abort(v instanceof je?v:new Yi(v instanceof Error?v.message:v))}};let f=t&&setTimeout(()=>{f=null,u(new je(`timeout ${t} of ms exceeded`,je.ETIMEDOUT))},t);const h=()=>{e&&(f&&clearTimeout(f),f=null,e.forEach(m=>{m.unsubscribe?m.unsubscribe(u):m.removeEventListener("abort",u)}),e=null)};e.forEach(m=>m.addEventListener("abort",u));const{signal:p}=s;return p.unsubscribe=()=>Y.asap(h),p}},QM=function*(e,t){let r=e.byteLength;if(r{const o=WM(e,t);let u=0,f,h=p=>{f||(f=!0,s&&s(p))};return new ReadableStream({async pull(p){try{const{done:m,value:v}=await o.next();if(m){h(),p.close();return}let g=v.byteLength;if(r){let _=u+=g;r(_)}p.enqueue(new Uint8Array(v))}catch(m){throw h(m),m}},cancel(p){return h(p),o.return()}},{highWaterMark:2})},q0=64*1024,{isFunction:Du}=Y,KM=(({Request:e,Response:t})=>({Request:e,Response:t}))(Y.global),{ReadableStream:G0,TextEncoder:X0}=Y.global,I0=(e,...t)=>{try{return!!e(...t)}catch{return!1}},JM=e=>{e=Y.merge.call({skipUndefined:!0},KM,e);const{fetch:t,Request:r,Response:s}=e,o=t?Du(t):typeof fetch=="function",u=Du(r),f=Du(s);if(!o)return!1;const h=o&&Du(G0),p=o&&(typeof X0=="function"?(T=>x=>T.encode(x))(new X0):async T=>new Uint8Array(await new r(T).arrayBuffer())),m=u&&h&&I0(()=>{let T=!1;const x=new r(ln.origin,{body:new G0,method:"POST",get duplex(){return T=!0,"half"}}).headers.has("Content-Type");return T&&!x}),v=f&&h&&I0(()=>Y.isReadableStream(new s("").body)),g={stream:v&&(T=>T.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(T=>{!g[T]&&(g[T]=(x,O)=>{let z=x&&x[T];if(z)return z.call(x);throw new je(`Response type '${T}' is not supported`,je.ERR_NOT_SUPPORT,O)})});const _=async T=>{if(T==null)return 0;if(Y.isBlob(T))return T.size;if(Y.isSpecCompliantForm(T))return(await new r(ln.origin,{method:"POST",body:T}).arrayBuffer()).byteLength;if(Y.isArrayBufferView(T)||Y.isArrayBuffer(T))return T.byteLength;if(Y.isURLSearchParams(T)&&(T=T+""),Y.isString(T))return(await p(T)).byteLength},N=async(T,x)=>{const O=Y.toFiniteNumber(T.getContentLength());return O??_(x)};return async T=>{let{url:x,method:O,data:z,signal:X,cancelToken:q,timeout:B,onDownloadProgress:J,onUploadProgress:ie,responseType:P,headers:te,withCredentials:_e="same-origin",fetchOptions:Ue}=bS(T),Ce=t||fetch;P=P?(P+"").toLowerCase():"text";let ce=IM([X,q&&q.toAbortSignal()],B),he=null;const Ee=ce&&ce.unsubscribe&&(()=>{ce.unsubscribe()});let Te;try{if(ie&&m&&O!=="get"&&O!=="head"&&(Te=await N(te,z))!==0){let A=new r(x,{method:"POST",body:z,duplex:"half"}),$;if(Y.isFormData(z)&&($=A.headers.get("content-type"))&&te.setContentType($),A.body){const[F,ee]=B0(Te,Ju(Z0(ie)));z=$0(A.body,q0,F,ee)}}Y.isString(_e)||(_e=_e?"include":"omit");const R=u&&"credentials"in r.prototype,K={...Ue,signal:ce,method:O.toUpperCase(),headers:te.normalize().toJSON(),body:z,duplex:"half",credentials:R?_e:void 0};he=u&&new r(x,K);let I=await(u?Ce(he,Ue):Ce(x,K));const Ae=v&&(P==="stream"||P==="response");if(v&&(J||Ae&&Ee)){const A={};["status","statusText","headers"].forEach(oe=>{A[oe]=I[oe]});const $=Y.toFiniteNumber(I.headers.get("content-length")),[F,ee]=J&&B0($,Ju(Z0(J),!0))||[];I=new s($0(I.body,q0,F,()=>{ee&&ee(),Ee&&Ee()}),A)}P=P||"text";let De=await g[Y.findKey(g,P)||"text"](I,T);return!Ae&&Ee&&Ee(),await new Promise((A,$)=>{yS(A,$,{data:De,headers:Cn.from(I.headers),status:I.status,statusText:I.statusText,config:T,request:he})})}catch(R){throw Ee&&Ee(),R&&R.name==="TypeError"&&/Load failed|fetch/i.test(R.message)?Object.assign(new je("Network Error",je.ERR_NETWORK,T,he),{cause:R.cause||R}):je.from(R,R&&R.code,T,he)}}},e4=new Map,_S=e=>{let t=e&&e.env||{};const{fetch:r,Request:s,Response:o}=t,u=[s,o,r];let f=u.length,h=f,p,m,v=e4;for(;h--;)p=u[h],m=v.get(p),m===void 0&&v.set(p,m=h?new Map:JM(t)),v=m;return m};_S();const Lm={http:yM,xhr:XM,fetch:{get:_S}};Y.forEach(Lm,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Q0=e=>`- ${e}`,t4=e=>Y.isFunction(e)||e===null||e===!1;function n4(e,t){e=Y.isArray(e)?e:[e];const{length:r}=e;let s,o;const u={};for(let f=0;f`adapter ${p} `+(m===!1?"is not supported by the environment":"is not available in the build"));let h=r?f.length>1?`since : `+f.map(Q0).join(` `):" "+Q0(f[0]):"as no adapter specified";throw new je("There is no suitable adapter to dispatch the request "+h,"ERR_NOT_SUPPORT")}return o}const SS={getAdapter:n4,adapters:Lm};function gh(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Yi(null,e)}function W0(e){return gh(e),e.headers=Cn.from(e.headers),e.data=ph.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),SS.getAdapter(e.adapter||ro.adapter,e)(e).then(function(s){return gh(e),s.data=ph.call(e,e.transformResponse,s),s.headers=Cn.from(s.headers),s},function(s){return gS(s)||(gh(e),s&&s.response&&(s.response.data=ph.call(e,e.transformResponse,s.response),s.response.headers=Cn.from(s.response.headers))),Promise.reject(s)})}const wS="1.13.2",Tc={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Tc[e]=function(s){return typeof s===e||"a"+(t<1?"n ":" ")+e}});const P0={};Tc.transitional=function(t,r,s){function o(u,f){return"[Axios v"+wS+"] Transitional option '"+u+"'"+f+(s?". "+s:"")}return(u,f,h)=>{if(t===!1)throw new je(o(f," has been removed"+(r?" in "+r:"")),je.ERR_DEPRECATED);return r&&!P0[f]&&(P0[f]=!0,console.warn(o(f," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(u,f,h):!0}};Tc.spelling=function(t){return(r,s)=>(console.warn(`${s} is likely a misspelling of ${t}`),!0)};function a4(e,t,r){if(typeof e!="object")throw new je("options must be an object",je.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let o=s.length;for(;o-- >0;){const u=s[o],f=t[u];if(f){const h=e[u],p=h===void 0||f(h,u,e);if(p!==!0)throw new je("option "+u+" must be "+p,je.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new je("Unknown option "+u,je.ERR_BAD_OPTION)}}const Fu={assertOptions:a4,validators:Tc},Ea=Fu.validators;let gs=class{constructor(t){this.defaults=t||{},this.interceptors={request:new H0,response:new H0}}async request(t,r){try{return await this._request(t,r)}catch(s){if(s instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const u=o.stack?o.stack.replace(/^.+\n/,""):"";try{s.stack?u&&!String(s.stack).endsWith(u.replace(/^.+\n.+\n/,""))&&(s.stack+=` -`+u):s.stack=u}catch{}}throw s}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=bs(this.defaults,r);const{transitional:s,paramsSerializer:o,headers:u}=r;s!==void 0&&Fu.assertOptions(s,{silentJSONParsing:Ea.transitional(Ea.boolean),forcedJSONParsing:Ea.transitional(Ea.boolean),clarifyTimeoutError:Ea.transitional(Ea.boolean)},!1),o!=null&&(Y.isFunction(o)?r.paramsSerializer={serialize:o}:Fu.assertOptions(o,{encode:Ea.function,serialize:Ea.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Fu.assertOptions(r,{baseUrl:Ea.spelling("baseURL"),withXsrfToken:Ea.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let f=u&&Y.merge(u.common,u[r.method]);u&&Y.forEach(["delete","get","head","post","put","patch","common"],T=>{delete u[T]}),r.headers=Cn.concat(f,u);const h=[];let p=!0;this.interceptors.request.forEach(function(x){typeof x.runWhen=="function"&&x.runWhen(r)===!1||(p=p&&x.synchronous,h.unshift(x.fulfilled,x.rejected))});const m=[];this.interceptors.response.forEach(function(x){m.push(x.fulfilled,x.rejected)});let v,g=0,_;if(!p){const T=[W0.bind(this),void 0];for(T.unshift(...h),T.push(...m),_=T.length,v=Promise.resolve(r);g<_;)v=v.then(T[g++],T[g++]);return v}_=h.length;let N=r;for(;g<_;){const T=h[g++],x=h[g++];try{N=T(N)}catch(O){x.call(this,O);break}}try{v=W0.call(this,N)}catch(T){return Promise.reject(T)}for(g=0,_=m.length;g<_;)v=v.then(m[g++],m[g++]);return v}getUri(t){t=bs(this.defaults,t);const r=vS(t.baseURL,t.url,t.allowAbsoluteUrls);return hS(r,t.params,t.paramsSerializer)}};Y.forEach(["delete","get","head","options"],function(t){gs.prototype[t]=function(r,s){return this.request(bs(s||{},{method:t,url:r,data:(s||{}).data}))}});Y.forEach(["post","put","patch"],function(t){function r(s){return function(u,f,h){return this.request(bs(h||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:u,data:f}))}}gs.prototype[t]=r(),gs.prototype[t+"Form"]=r(!0)});let r4=class xS{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(u){r=u});const s=this;this.promise.then(o=>{if(!s._listeners)return;let u=s._listeners.length;for(;u-- >0;)s._listeners[u](o);s._listeners=null}),this.promise.then=o=>{let u;const f=new Promise(h=>{s.subscribe(h),u=h}).then(o);return f.cancel=function(){s.unsubscribe(u)},f},t(function(u,f,h){s.reason||(s.reason=new Yi(u,f,h),r(s.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 r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=s=>{t.abort(s)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new xS(function(o){t=o}),cancel:t}}};function s4(e){return function(r){return e.apply(null,r)}}function i4(e){return Y.isObject(e)&&e.isAxiosError===!0}const Bh={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Bh).forEach(([e,t])=>{Bh[t]=e});function ES(e){const t=new gs(e),r=tS(gs.prototype.request,t);return Y.extend(r,gs.prototype,t,{allOwnKeys:!0}),Y.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return ES(bs(e,o))},r}const Dt=ES(ro);Dt.Axios=gs;Dt.CanceledError=Yi;Dt.CancelToken=r4;Dt.isCancel=gS;Dt.VERSION=wS;Dt.toFormData=Ec;Dt.AxiosError=je;Dt.Cancel=Dt.CanceledError;Dt.all=function(t){return Promise.all(t)};Dt.spread=s4;Dt.isAxiosError=i4;Dt.mergeConfig=bs;Dt.AxiosHeaders=Cn;Dt.formToJSON=e=>pS(Y.isHTMLForm(e)?new FormData(e):e);Dt.getAdapter=SS.getAdapter;Dt.HttpStatusCode=Bh;Dt.default=Dt;const{Axios:J5,AxiosError:ej,CanceledError:tj,isCancel:nj,CancelToken:aj,VERSION:rj,all:sj,Cancel:ij,isAxiosError:lj,spread:oj,toFormData:uj,AxiosHeaders:cj,HttpStatusCode:fj,formToJSON:dj,getAdapter:hj,mergeConfig:mj}=Dt,bi=Dt.create({baseURL:"http://127.0.0.1:8000"});class l4{async logs(){return await bi({method:"GET",url:"logs"})}async users(){return await bi({method:"GET",url:"users"})}async register({file:t,user:r}){const s=new FormData;s.append("file",t,"frame.jpg");for(const[o,u]of Object.entries(r))s.append(o,u);return await bi({headers:{"Content-Type":"multipart/form-data"},method:"POST",url:"/register",data:s})}async registerSimple({user:t}){const r=new FormData;for(const[s,o]of Object.entries(t))r.append(s,o);return await bi({headers:{"Content-Type":"multipart/form-data"},method:"POST",url:"/register-simple",data:r})}async deleteUser(t){return await bi({method:"DELETE",url:`/users/${t}`})}async checkin({file:t}){const r=new FormData;return r.append("file",t,"frame.jpg"),await bi({headers:{"Content-Type":"multipart/form-data"},method:"POST",url:"/checkin",data:r})}}const Ni=new l4;function o4(e,t=[]){let r=[];function s(u,f){const h=w.createContext(f);h.displayName=u+"Context";const p=r.length;r=[...r,f];const m=g=>{const{scope:_,children:N,...T}=g,x=_?.[e]?.[p]||h,O=w.useMemo(()=>T,Object.values(T));return S.jsx(x.Provider,{value:O,children:N})};m.displayName=u+"Provider";function v(g,_){const N=_?.[e]?.[p]||h,T=w.useContext(N);if(T)return T;if(f!==void 0)return f;throw new Error(`\`${g}\` must be used within \`${u}\``)}return[m,v]}const o=()=>{const u=r.map(f=>w.createContext(f));return function(h){const p=h?.[e]||u;return w.useMemo(()=>({[`__scope${e}`]:{...h,[e]:p}}),[h,p])}};return o.scopeName=e,[s,u4(o,...t)]}function u4(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const s=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(u){const f=s.reduce((h,{useScope:p,scopeName:m})=>{const g=p(u)[`__scope${m}`];return{...h,...g}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:f}),[f])}};return r.scopeName=t.scopeName,r}var c4=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ym=c4.reduce((e,t)=>{const r=Nm(`Primitive.${t}`),s=w.forwardRef((o,u)=>{const{asChild:f,...h}=o,p=f?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(p,{...h,ref:u})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{}),yh={exports:{}},vh={};var K0;function f4(){if(K0)return vh;K0=1;var e=Xl();function t(g,_){return g===_&&(g!==0||1/g===1/_)||g!==g&&_!==_}var r=typeof Object.is=="function"?Object.is:t,s=e.useState,o=e.useEffect,u=e.useLayoutEffect,f=e.useDebugValue;function h(g,_){var N=_(),T=s({inst:{value:N,getSnapshot:_}}),x=T[0].inst,O=T[1];return u(function(){x.value=N,x.getSnapshot=_,p(x)&&O({inst:x})},[g,N,_]),o(function(){return p(x)&&O({inst:x}),g(function(){p(x)&&O({inst:x})})},[g]),f(N),N}function p(g){var _=g.getSnapshot;g=g.value;try{var N=_();return!r(g,N)}catch{return!0}}function m(g,_){return _()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:h;return vh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,vh}var J0;function d4(){return J0||(J0=1,yh.exports=f4()),yh.exports}var h4=d4();function m4(){return h4.useSyncExternalStore(p4,()=>!0,()=>!1)}function p4(){return()=>{}}var Hm="Avatar",[g4]=o4(Hm),[y4,TS]=g4(Hm),OS=w.forwardRef((e,t)=>{const{__scopeAvatar:r,...s}=e,[o,u]=w.useState("idle");return S.jsx(y4,{scope:r,imageLoadingStatus:o,onImageLoadingStatusChange:u,children:S.jsx(Ym.span,{...s,ref:t})})});OS.displayName=Hm;var AS="AvatarImage",DS=w.forwardRef((e,t)=>{const{__scopeAvatar:r,src:s,onLoadingStatusChange:o=()=>{},...u}=e,f=TS(AS,r),h=v4(s,u),p=ys(m=>{o(m),f.onImageLoadingStatusChange(m)});return Fr(()=>{h!=="idle"&&p(h)},[h,p]),h==="loaded"?S.jsx(Ym.img,{...u,ref:t,src:s}):null});DS.displayName=AS;var CS="AvatarFallback",RS=w.forwardRef((e,t)=>{const{__scopeAvatar:r,delayMs:s,...o}=e,u=TS(CS,r),[f,h]=w.useState(s===void 0);return w.useEffect(()=>{if(s!==void 0){const p=window.setTimeout(()=>h(!0),s);return()=>window.clearTimeout(p)}},[s]),f&&u.imageLoadingStatus!=="loaded"?S.jsx(Ym.span,{...o,ref:t}):null});RS.displayName=CS;function eb(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function v4(e,{referrerPolicy:t,crossOrigin:r}){const s=m4(),o=w.useRef(null),u=s?(o.current||(o.current=new window.Image),o.current):null,[f,h]=w.useState(()=>eb(u,e));return Fr(()=>{h(eb(u,e))},[u,e]),Fr(()=>{const p=g=>()=>{h(g)};if(!u)return;const m=p("loaded"),v=p("error");return u.addEventListener("load",m),u.addEventListener("error",v),t&&(u.referrerPolicy=t),typeof r=="string"&&(u.crossOrigin=r),()=>{u.removeEventListener("load",m),u.removeEventListener("error",v)}},[u,r,t]),f}var b4=OS,_4=DS,S4=RS;function w4(e){const t=Qe.c(8);let r,s;t[0]!==e?({className:r,...s}=e,t[0]=e,t[1]=r,t[2]=s):(r=t[1],s=t[2]);let o;t[3]!==r?(o=ot("relative flex size-8 shrink-0 overflow-hidden rounded-full",r),t[3]=r,t[4]=o):o=t[4];let u;return t[5]!==s||t[6]!==o?(u=S.jsx(b4,{"data-slot":"avatar",className:o,...s}),t[5]=s,t[6]=o,t[7]=u):u=t[7],u}function x4(e){const t=Qe.c(8);let r,s;t[0]!==e?({className:r,...s}=e,t[0]=e,t[1]=r,t[2]=s):(r=t[1],s=t[2]);let o;t[3]!==r?(o=ot("aspect-square size-full",r),t[3]=r,t[4]=o):o=t[4];let u;return t[5]!==s||t[6]!==o?(u=S.jsx(_4,{"data-slot":"avatar-image",className:o,...s}),t[5]=s,t[6]=o,t[7]=u):u=t[7],u}function E4(e){const t=Qe.c(8);let r,s;t[0]!==e?({className:r,...s}=e,t[0]=e,t[1]=r,t[2]=s):(r=t[1],s=t[2]);let o;t[3]!==r?(o=ot("bg-muted flex size-full items-center justify-center rounded-full",r),t[3]=r,t[4]=o):o=t[4];let u;return t[5]!==s||t[6]!==o?(u=S.jsx(S4,{"data-slot":"avatar-fallback",className:o,...s}),t[5]=s,t[6]=o,t[7]=u):u=t[7],u}const NS=z_(e=>({currentUser:null,setCurrentUser:t=>e(()=>({currentUser:t}))}));function T4(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const O4=e=>{switch(e){case"success":return C4;case"info":return N4;case"warning":return R4;case"error":return M4;default:return null}},A4=Array(12).fill(0),D4=({visible:e,className:t})=>Z.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Z.createElement("div",{className:"sonner-spinner"},A4.map((r,s)=>Z.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),C4=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Z.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),R4=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Z.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),N4=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Z.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),M4=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Z.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),z4=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Z.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Z.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),k4=()=>{const[e,t]=Z.useState(document.hidden);return Z.useEffect(()=>{const r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e};let Zh=1;class j4{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const r=this.subscribers.indexOf(t);this.subscribers.splice(r,1)}),this.publish=t=>{this.subscribers.forEach(r=>r(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var r;const{message:s,...o}=t,u=typeof t?.id=="number"||((r=t.id)==null?void 0:r.length)>0?t.id:Zh++,f=this.toasts.find(p=>p.id===u),h=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(u)&&this.dismissedToasts.delete(u),f?this.toasts=this.toasts.map(p=>p.id===u?(this.publish({...p,...t,id:u,title:s}),{...p,...t,id:u,dismissible:h,title:s}):p):this.addToast({title:s,...o,dismissible:h,id:u}),u},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:t,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(s=>s({id:r.id,dismiss:!0}))}),t),this.message=(t,r)=>this.create({...r,message:t}),this.error=(t,r)=>this.create({...r,message:t,type:"error"}),this.success=(t,r)=>this.create({...r,type:"success",message:t}),this.info=(t,r)=>this.create({...r,type:"info",message:t}),this.warning=(t,r)=>this.create({...r,type:"warning",message:t}),this.loading=(t,r)=>this.create({...r,type:"loading",message:t}),this.promise=(t,r)=>{if(!r)return;let s;r.loading!==void 0&&(s=this.create({...r,promise:t,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const o=Promise.resolve(t instanceof Function?t():t);let u=s!==void 0,f;const h=o.then(async m=>{if(f=["resolve",m],Z.isValidElement(m))u=!1,this.create({id:s,type:"default",message:m});else if(L4(m)&&!m.ok){u=!1;const g=typeof r.error=="function"?await r.error(`HTTP error! status: ${m.status}`):r.error,_=typeof r.description=="function"?await r.description(`HTTP error! status: ${m.status}`):r.description,T=typeof g=="object"&&!Z.isValidElement(g)?g:{message:g};this.create({id:s,type:"error",description:_,...T})}else if(m instanceof Error){u=!1;const g=typeof r.error=="function"?await r.error(m):r.error,_=typeof r.description=="function"?await r.description(m):r.description,T=typeof g=="object"&&!Z.isValidElement(g)?g:{message:g};this.create({id:s,type:"error",description:_,...T})}else if(r.success!==void 0){u=!1;const g=typeof r.success=="function"?await r.success(m):r.success,_=typeof r.description=="function"?await r.description(m):r.description,T=typeof g=="object"&&!Z.isValidElement(g)?g:{message:g};this.create({id:s,type:"success",description:_,...T})}}).catch(async m=>{if(f=["reject",m],r.error!==void 0){u=!1;const v=typeof r.error=="function"?await r.error(m):r.error,g=typeof r.description=="function"?await r.description(m):r.description,N=typeof v=="object"&&!Z.isValidElement(v)?v:{message:v};this.create({id:s,type:"error",description:g,...N})}}).finally(()=>{u&&(this.dismiss(s),s=void 0),r.finally==null||r.finally.call(r)}),p=()=>new Promise((m,v)=>h.then(()=>f[0]==="reject"?v(f[1]):m(f[1])).catch(v));return typeof s!="string"&&typeof s!="number"?{unwrap:p}:Object.assign(s,{unwrap:p})},this.custom=(t,r)=>{const s=r?.id||Zh++;return this.create({jsx:t(s),id:s,...r}),s},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const On=new j4,U4=(e,t)=>{const r=t?.id||Zh++;return On.addToast({title:e,...t,id:r}),r},L4=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Y4=U4,H4=()=>On.toasts,V4=()=>On.getActiveToasts(),la=Object.assign(Y4,{success:On.success,info:On.info,warning:On.warning,error:On.error,custom:On.custom,message:On.message,promise:On.promise,dismiss:On.dismiss,loading:On.loading},{getHistory:H4,getToasts:V4});T4("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Cu(e){return e.label!==void 0}const B4=3,Z4="24px",F4="16px",tb=4e3,$4=356,q4=14,G4=45,X4=200;function Ta(...e){return e.filter(Boolean).join(" ")}function I4(e){const[t,r]=e.split("-"),s=[];return t&&s.push(t),r&&s.push(r),s}const Q4=e=>{var t,r,s,o,u,f,h,p,m;const{invert:v,toast:g,unstyled:_,interacting:N,setHeights:T,visibleToasts:x,heights:O,index:z,toasts:X,expanded:q,removeToast:B,defaultRichColors:J,closeButton:ie,style:P,cancelButtonStyle:te,actionButtonStyle:_e,className:Ue="",descriptionClassName:Ce="",duration:ce,position:he,gap:Ee,expandByDefault:Te,classNames:R,icons:K,closeButtonAriaLabel:I="Close toast"}=e,[Ae,De]=Z.useState(null),[A,$]=Z.useState(null),[F,ee]=Z.useState(!1),[oe,Se]=Z.useState(!1),[be,Re]=Z.useState(!1),[Ve,jt]=Z.useState(!1),[un,Ft]=Z.useState(!1),[Ts,hn]=Z.useState(0),[cr,fr]=Z.useState(0),za=Z.useRef(g.duration||ce||tb),Os=Z.useRef(null),an=Z.useRef(null),D=z===0,U=z+1<=x,V=g.type,le=g.dismissible!==!1,ae=g.className||"",se=g.descriptionClassName||"",ye=Z.useMemo(()=>O.findIndex(Ne=>Ne.toastId===g.id)||0,[O,g.id]),Xe=Z.useMemo(()=>{var Ne;return(Ne=g.closeButton)!=null?Ne:ie},[g.closeButton,ie]),Ie=Z.useMemo(()=>g.duration||ce||tb,[g.duration,ce]),$t=Z.useRef(0),mn=Z.useRef(0),Rn=Z.useRef(0),ya=Z.useRef(null),[na,Ut]=he.split("-"),Nn=Z.useMemo(()=>O.reduce((Ne,gt,qt)=>qt>=ye?Ne:Ne+gt.height,0),[O,ye]),Lt=k4(),Vi=g.invert||v,dr=V==="loading";mn.current=Z.useMemo(()=>ye*Ee+Nn,[ye,Nn]),Z.useEffect(()=>{za.current=Ie},[Ie]),Z.useEffect(()=>{ee(!0)},[]),Z.useEffect(()=>{const Ne=an.current;if(Ne){const gt=Ne.getBoundingClientRect().height;return fr(gt),T(qt=>[{toastId:g.id,height:gt,position:g.position},...qt]),()=>T(qt=>qt.filter(rn=>rn.toastId!==g.id))}},[T,g.id]),Z.useLayoutEffect(()=>{if(!F)return;const Ne=an.current,gt=Ne.style.height;Ne.style.height="auto";const qt=Ne.getBoundingClientRect().height;Ne.style.height=gt,fr(qt),T(rn=>rn.find(_t=>_t.toastId===g.id)?rn.map(_t=>_t.toastId===g.id?{..._t,height:qt}:_t):[{toastId:g.id,height:qt,position:g.position},...rn])},[F,g.title,g.description,T,g.id,g.jsx,g.action,g.cancel]);const va=Z.useCallback(()=>{Se(!0),hn(mn.current),T(Ne=>Ne.filter(gt=>gt.toastId!==g.id)),setTimeout(()=>{B(g)},X4)},[g,B,T,mn]);Z.useEffect(()=>{if(g.promise&&V==="loading"||g.duration===1/0||g.type==="loading")return;let Ne;return q||N||Lt?(()=>{if(Rn.current<$t.current){const rn=new Date().getTime()-$t.current;za.current=za.current-rn}Rn.current=new Date().getTime()})():(()=>{za.current!==1/0&&($t.current=new Date().getTime(),Ne=setTimeout(()=>{g.onAutoClose==null||g.onAutoClose.call(g,g),va()},za.current))})(),()=>clearTimeout(Ne)},[q,N,g,V,Lt,va]),Z.useEffect(()=>{g.delete&&(va(),g.onDismiss==null||g.onDismiss.call(g,g))},[va,g.delete]);function As(){var Ne;if(K?.loading){var gt;return Z.createElement("div",{className:Ta(R?.loader,g==null||(gt=g.classNames)==null?void 0:gt.loader,"sonner-loader"),"data-visible":V==="loading"},K.loading)}return Z.createElement(D4,{className:Ta(R?.loader,g==null||(Ne=g.classNames)==null?void 0:Ne.loader),visible:V==="loading"})}const Ds=g.icon||K?.[V]||O4(V);var qr,ba;return Z.createElement("li",{tabIndex:0,ref:an,className:Ta(Ue,ae,R?.toast,g==null||(t=g.classNames)==null?void 0:t.toast,R?.default,R?.[V],g==null||(r=g.classNames)==null?void 0:r[V]),"data-sonner-toast":"","data-rich-colors":(qr=g.richColors)!=null?qr:J,"data-styled":!(g.jsx||g.unstyled||_),"data-mounted":F,"data-promise":!!g.promise,"data-swiped":un,"data-removed":oe,"data-visible":U,"data-y-position":na,"data-x-position":Ut,"data-index":z,"data-front":D,"data-swiping":be,"data-dismissible":le,"data-type":V,"data-invert":Vi,"data-swipe-out":Ve,"data-swipe-direction":A,"data-expanded":!!(q||Te&&F),"data-testid":g.testId,style:{"--index":z,"--toasts-before":z,"--z-index":X.length-z,"--offset":`${oe?Ts:mn.current}px`,"--initial-height":Te?"auto":`${cr}px`,...P,...g.style},onDragEnd:()=>{Re(!1),De(null),ya.current=null},onPointerDown:Ne=>{Ne.button!==2&&(dr||!le||(Os.current=new Date,hn(mn.current),Ne.target.setPointerCapture(Ne.pointerId),Ne.target.tagName!=="BUTTON"&&(Re(!0),ya.current={x:Ne.clientX,y:Ne.clientY})))},onPointerUp:()=>{var Ne,gt,qt;if(Ve||!le)return;ya.current=null;const rn=Number(((Ne=an.current)==null?void 0:Ne.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),hr=Number(((gt=an.current)==null?void 0:gt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),_t=new Date().getTime()-((qt=Os.current)==null?void 0:qt.getTime()),pn=Ae==="x"?rn:hr,Gr=Math.abs(pn)/_t;if(Math.abs(pn)>=G4||Gr>.11){hn(mn.current),g.onDismiss==null||g.onDismiss.call(g,g),$(Ae==="x"?rn>0?"right":"left":hr>0?"down":"up"),va(),jt(!0);return}else{var gn,yn;(gn=an.current)==null||gn.style.setProperty("--swipe-amount-x","0px"),(yn=an.current)==null||yn.style.setProperty("--swipe-amount-y","0px")}Ft(!1),Re(!1),De(null)},onPointerMove:Ne=>{var gt,qt,rn;if(!ya.current||!le||((gt=window.getSelection())==null?void 0:gt.toString().length)>0)return;const _t=Ne.clientY-ya.current.y,pn=Ne.clientX-ya.current.x;var Gr;const gn=(Gr=e.swipeDirections)!=null?Gr:I4(he);!Ae&&(Math.abs(pn)>1||Math.abs(_t)>1)&&De(Math.abs(pn)>Math.abs(_t)?"x":"y");let yn={x:0,y:0};const Cs=aa=>1/(1.5+Math.abs(aa)/20);if(Ae==="y"){if(gn.includes("top")||gn.includes("bottom"))if(gn.includes("top")&&_t<0||gn.includes("bottom")&&_t>0)yn.y=_t;else{const aa=_t*Cs(_t);yn.y=Math.abs(aa)0)yn.x=pn;else{const aa=pn*Cs(pn);yn.x=Math.abs(aa)0||Math.abs(yn.y)>0)&&Ft(!0),(qt=an.current)==null||qt.style.setProperty("--swipe-amount-x",`${yn.x}px`),(rn=an.current)==null||rn.style.setProperty("--swipe-amount-y",`${yn.y}px`)}},Xe&&!g.jsx&&V!=="loading"?Z.createElement("button",{"aria-label":I,"data-disabled":dr,"data-close-button":!0,onClick:dr||!le?()=>{}:()=>{va(),g.onDismiss==null||g.onDismiss.call(g,g)},className:Ta(R?.closeButton,g==null||(s=g.classNames)==null?void 0:s.closeButton)},(ba=K?.close)!=null?ba:z4):null,(V||g.icon||g.promise)&&g.icon!==null&&(K?.[V]!==null||g.icon)?Z.createElement("div",{"data-icon":"",className:Ta(R?.icon,g==null||(o=g.classNames)==null?void 0:o.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||As():null,g.type!=="loading"?Ds:null):null,Z.createElement("div",{"data-content":"",className:Ta(R?.content,g==null||(u=g.classNames)==null?void 0:u.content)},Z.createElement("div",{"data-title":"",className:Ta(R?.title,g==null||(f=g.classNames)==null?void 0:f.title)},g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title),g.description?Z.createElement("div",{"data-description":"",className:Ta(Ce,se,R?.description,g==null||(h=g.classNames)==null?void 0:h.description)},typeof g.description=="function"?g.description():g.description):null),Z.isValidElement(g.cancel)?g.cancel:g.cancel&&Cu(g.cancel)?Z.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||te,onClick:Ne=>{Cu(g.cancel)&&le&&(g.cancel.onClick==null||g.cancel.onClick.call(g.cancel,Ne),va())},className:Ta(R?.cancelButton,g==null||(p=g.classNames)==null?void 0:p.cancelButton)},g.cancel.label):null,Z.isValidElement(g.action)?g.action:g.action&&Cu(g.action)?Z.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||_e,onClick:Ne=>{Cu(g.action)&&(g.action.onClick==null||g.action.onClick.call(g.action,Ne),!Ne.defaultPrevented&&va())},className:Ta(R?.actionButton,g==null||(m=g.classNames)==null?void 0:m.actionButton)},g.action.label):null)};function nb(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function W4(e,t){const r={};return[e,t].forEach((s,o)=>{const u=o===1,f=u?"--mobile-offset":"--offset",h=u?F4:Z4;function p(m){["top","right","bottom","left"].forEach(v=>{r[`${f}-${v}`]=typeof m=="number"?`${m}px`:m})}typeof s=="number"||typeof s=="string"?p(s):typeof s=="object"?["top","right","bottom","left"].forEach(m=>{s[m]===void 0?r[`${f}-${m}`]=h:r[`${f}-${m}`]=typeof s[m]=="number"?`${s[m]}px`:s[m]}):p(h)}),r}const P4=Z.forwardRef(function(t,r){const{id:s,invert:o,position:u="bottom-right",hotkey:f=["altKey","KeyT"],expand:h,closeButton:p,className:m,offset:v,mobileOffset:g,theme:_="light",richColors:N,duration:T,style:x,visibleToasts:O=B4,toastOptions:z,dir:X=nb(),gap:q=q4,icons:B,containerAriaLabel:J="Notifications"}=t,[ie,P]=Z.useState([]),te=Z.useMemo(()=>s?ie.filter(F=>F.toasterId===s):ie.filter(F=>!F.toasterId),[ie,s]),_e=Z.useMemo(()=>Array.from(new Set([u].concat(te.filter(F=>F.position).map(F=>F.position)))),[te,u]),[Ue,Ce]=Z.useState([]),[ce,he]=Z.useState(!1),[Ee,Te]=Z.useState(!1),[R,K]=Z.useState(_!=="system"?_:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),I=Z.useRef(null),Ae=f.join("+").replace(/Key/g,"").replace(/Digit/g,""),De=Z.useRef(null),A=Z.useRef(!1),$=Z.useCallback(F=>{P(ee=>{var oe;return(oe=ee.find(Se=>Se.id===F.id))!=null&&oe.delete||On.dismiss(F.id),ee.filter(({id:Se})=>Se!==F.id)})},[]);return Z.useEffect(()=>On.subscribe(F=>{if(F.dismiss){requestAnimationFrame(()=>{P(ee=>ee.map(oe=>oe.id===F.id?{...oe,delete:!0}:oe))});return}setTimeout(()=>{Hb.flushSync(()=>{P(ee=>{const oe=ee.findIndex(Se=>Se.id===F.id);return oe!==-1?[...ee.slice(0,oe),{...ee[oe],...F},...ee.slice(oe+1)]:[F,...ee]})})})}),[ie]),Z.useEffect(()=>{if(_!=="system"){K(_);return}if(_==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?K("dark"):K("light")),typeof window>"u")return;const F=window.matchMedia("(prefers-color-scheme: dark)");try{F.addEventListener("change",({matches:ee})=>{K(ee?"dark":"light")})}catch{F.addListener(({matches:oe})=>{try{K(oe?"dark":"light")}catch(Se){console.error(Se)}})}},[_]),Z.useEffect(()=>{ie.length<=1&&he(!1)},[ie]),Z.useEffect(()=>{const F=ee=>{var oe;if(f.every(Re=>ee[Re]||ee.code===Re)){var be;he(!0),(be=I.current)==null||be.focus()}ee.code==="Escape"&&(document.activeElement===I.current||(oe=I.current)!=null&&oe.contains(document.activeElement))&&he(!1)};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[f]),Z.useEffect(()=>{if(I.current)return()=>{De.current&&(De.current.focus({preventScroll:!0}),De.current=null,A.current=!1)}},[I.current]),Z.createElement("section",{ref:r,"aria-label":`${J} ${Ae}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},_e.map((F,ee)=>{var oe;const[Se,be]=F.split("-");return te.length?Z.createElement("ol",{key:F,dir:X==="auto"?nb():X,tabIndex:-1,ref:I,className:m,"data-sonner-toaster":!0,"data-sonner-theme":R,"data-y-position":Se,"data-x-position":be,style:{"--front-toast-height":`${((oe=Ue[0])==null?void 0:oe.height)||0}px`,"--width":`${$4}px`,"--gap":`${q}px`,...x,...W4(v,g)},onBlur:Re=>{A.current&&!Re.currentTarget.contains(Re.relatedTarget)&&(A.current=!1,De.current&&(De.current.focus({preventScroll:!0}),De.current=null))},onFocus:Re=>{Re.target instanceof HTMLElement&&Re.target.dataset.dismissible==="false"||A.current||(A.current=!0,De.current=Re.relatedTarget)},onMouseEnter:()=>he(!0),onMouseMove:()=>he(!0),onMouseLeave:()=>{Ee||he(!1)},onDragEnd:()=>he(!1),onPointerDown:Re=>{Re.target instanceof HTMLElement&&Re.target.dataset.dismissible==="false"||Te(!0)},onPointerUp:()=>Te(!1)},te.filter(Re=>!Re.position&&ee===0||Re.position===F).map((Re,Ve)=>{var jt,un;return Z.createElement(Q4,{key:Re.id,icons:B,index:Ve,toast:Re,defaultRichColors:N,duration:(jt=z?.duration)!=null?jt:T,className:z?.className,descriptionClassName:z?.descriptionClassName,invert:o,visibleToasts:O,closeButton:(un=z?.closeButton)!=null?un:p,interacting:Ee,position:F,style:z?.style,unstyled:z?.unstyled,classNames:z?.classNames,cancelButtonStyle:z?.cancelButtonStyle,actionButtonStyle:z?.actionButtonStyle,closeButtonAriaLabel:z?.closeButtonAriaLabel,removeToast:$,toasts:te.filter(Ft=>Ft.position==Re.position),heights:Ue.filter(Ft=>Ft.position==Re.position),setHeights:Ce,expandByDefault:h,gap:q,expanded:ce,swipeDirections:t.swipeDirections})})):null}))});function K4({value:e}){const[t,r]=w.useState([]),{currentUser:s,setCurrentUser:o}=NS(),{refreshUsers:u,setRefreshUsers:f}=lr(),h=M_(),p=async()=>{try{const{data:g}=await Ni.users();r(g)}catch(g){console.log(g)}},m=async(g,_)=>{if(_.stopPropagation(),!!await h({title:"Xóa người dùng",message:`Bạn có chắc muốn xóa "${g.name}"? Toàn bộ lịch sử điểm danh sẽ bị xóa theo.`,confirmText:"Xóa",cancelText:"Hủy",variant:"destructive"}))try{await Ni.deleteUser(g.id),la.success(`Đã xóa ${g.name}`),s?.id===g.id&&o(null),r(T=>T.filter(x=>x.id!==g.id))}catch{la.error("Xóa thất bại")}},v=g=>{s&&g.id===s.id?o(null):o(g)};return w.useEffect(()=>{p()},[]),w.useEffect(()=>{u&&(p(),f(!1))},[u]),S.jsxs(eS,{value:e,className:"flex-1 min-h-0 overflow-hidden",children:[S.jsx("div",{className:"flex flex-col gap-2 p-3 sm:p-4 space-y-2 overflow-y-auto h-full",children:t.map(g=>S.jsxs("div",{className:ot("flex items-center gap-2 sm:gap-3 p-3 sm:p-4 rounded-xl border shadow-sm bg-card cursor-pointer transition-all duration-200 hover:shadow-md hover:scale-[1.01] select-none",s?.id===g.id&&"bg-blue-50 dark:bg-blue-950 border-blue-500 shadow-md"),onClick:()=>v(g),children:[S.jsxs(w4,{className:"size-10 sm:size-12 shrink-0",children:[S.jsx(x4,{src:`https://ms.prology.net/image/storage/${g?.avatar}`||""}),S.jsx(E4,{children:g.name.charAt(0)})]}),S.jsxs("div",{className:"flex-1 min-w-0",children:[S.jsx("h4",{className:"font-semibold text-sm sm:text-base text-gray-900 dark:text-gray-100 truncate",children:g.name}),S.jsx("p",{className:"text-xs sm:text-sm text-gray-600 dark:text-gray-400 truncate",children:g.email})]}),S.jsx(nn,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 text-red-500 hover:text-red-700 hover:bg-red-50 dark:hover:bg-red-950",onClick:_=>m(g,_),children:S.jsx(QT,{className:"h-4 w-4"})})]},g.id))}),t.length<=0&&S.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-400",children:[S.jsx(S1,{className:"size-16 mb-3"}),S.jsx("p",{children:"Chưa có dữ liệu điểm danh"})]})]})}function J4(e){const t=Qe.c(12),{isSidebarOpen:r,onClose:s}=e,o=r?"translate-x-0":"-translate-x-full";let u;t[0]!==o?(u=ot("fixed left-0 top-0 h-screen w-[85vw] max-w-sm lg:w-96 lg:max-w-none bg-white border-r border-gray-200 shadow-xl transition-transform duration-300 ease-in-out z-30",o),t[0]=o,t[1]=u):u=t[1];let f;t[2]===Symbol.for("react.memo_cache_sentinel")?(f=S.jsx(K_,{className:"grid flex-1 grid-cols-1",children:S.jsxs(J_,{value:"users",className:"flex items-center gap-1 text-xs",children:[S.jsx(S1,{className:"size-3.5"}),"User"]})}),t[2]=f):f=t[2];let h;t[3]===Symbol.for("react.memo_cache_sentinel")?(h=S.jsx(nm,{className:"size-4"}),t[3]=h):h=t[3];let p;t[4]!==s?(p=S.jsxs("div",{className:"border-b p-3 sm:p-4 flex items-center gap-2",children:[f,S.jsx(nn,{variant:"ghost",size:"icon",className:"lg:hidden size-8 shrink-0",onClick:s,children:h})]}),t[4]=s,t[5]=p):p=t[5];let m;t[6]===Symbol.for("react.memo_cache_sentinel")?(m=S.jsx(K4,{value:"users"}),t[6]=m):m=t[6];let v;t[7]!==p?(v=S.jsx("div",{className:"h-full flex flex-col",children:S.jsxs(P_,{defaultValue:"users",className:"flex-1 flex flex-col min-h-0",children:[p,m]})}),t[7]=p,t[8]=v):v=t[8];let g;return t[9]!==u||t[10]!==v?(g=S.jsx("div",{className:u,children:v}),t[9]=u,t[10]=v,t[11]=g):g=t[11],g}const ez=R_("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function tz(e){const t=Qe.c(12);let r,s,o,u;t[0]!==e?({className:r,variant:u,asChild:o,...s}=e,t[0]=e,t[1]=r,t[2]=s,t[3]=o,t[4]=u):(r=t[1],s=t[2],o=t[3],u=t[4]);const h=(o===void 0?!1:o)?Mm:"span";let p;t[5]!==r||t[6]!==u?(p=ot(ez({variant:u}),r),t[5]=r,t[6]=u,t[7]=p):p=t[7];let m;return t[8]!==h||t[9]!==s||t[10]!==p?(m=S.jsx(h,{"data-slot":"badge",className:p,...s}),t[8]=h,t[9]=s,t[10]=p,t[11]=m):m=t[11],m}function nz({value:e}){const[t,r]=w.useState([]),{refreshLog:s,setRefreshLog:o}=lr(),u=async()=>{try{const{data:f}=await Ni.logs();r(f),o(!1)}catch(f){console.log(f)}};return w.useEffect(()=>{u()},[]),w.useEffect(()=>{s&&u()},[s]),S.jsx(eS,{value:e,className:"flex-1 min-h-0 overflow-hidden",children:S.jsx("div",{className:"flex flex-col gap-2 p-3 sm:p-4 space-y-2 overflow-y-auto h-full",children:t.length===0?S.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-400",children:[S.jsx(v1,{className:"size-16 mb-3"}),S.jsx("p",{children:"Chưa có dữ liệu điểm danh"})]}):t.map((f,h)=>S.jsxs("div",{className:ot("p-3 rounded-lg border transition-all duration-200",h===0?"bg-blue-50 border-blue-200":"bg-gray-50 border-gray-200"),children:[S.jsxs("div",{className:"flex items-center justify-between mb-1",children:[S.jsx("span",{className:"font-medium text-gray-900",children:f.name}),S.jsx(tz,{className:"capitalize",variant:f.status==="check out"?"destructive":"secondary",children:f.status})]}),S.jsx("p",{className:"text-sm text-gray-600",children:A_(f.time)})]},h))})})}function az(e){const t=Qe.c(14),{isSidebarOpen:r,onClose:s}=e,o=r?"translate-x-0":"translate-x-full";let u;t[0]!==o?(u=ot("fixed right-0 top-0 h-screen w-[85vw] max-w-sm lg:w-96 lg:max-w-none bg-white border-l border-gray-200 shadow-xl transition-transform duration-300 ease-in-out z-30",o),t[0]=o,t[1]=u):u=t[1];let f;t[2]===Symbol.for("react.memo_cache_sentinel")?(f=S.jsx(nm,{className:"size-4"}),t[2]=f):f=t[2];let h;t[3]!==s?(h=S.jsx(nn,{variant:"ghost",size:"icon",className:"lg:hidden size-8 shrink-0",onClick:s,children:f}),t[3]=s,t[4]=h):h=t[4];let p;t[5]===Symbol.for("react.memo_cache_sentinel")?(p=S.jsx(K_,{className:"grid flex-1 grid-cols-1",children:S.jsxs(J_,{value:"logs",className:"flex items-center gap-1 text-xs",children:[S.jsx(v1,{className:"size-3.5"}),"Log"]})}),t[5]=p):p=t[5];let m;t[6]!==h?(m=S.jsxs("div",{className:"border-b p-3 sm:p-4 flex items-center gap-2",children:[h,p]}),t[6]=h,t[7]=m):m=t[7];let v;t[8]===Symbol.for("react.memo_cache_sentinel")?(v=S.jsx(nz,{value:"logs"}),t[8]=v):v=t[8];let g;t[9]!==m?(g=S.jsx("div",{className:"h-full flex flex-col",children:S.jsxs(P_,{value:"logs",defaultValue:"features",className:"flex-1 flex flex-col min-h-0",children:[m,v]})}),t[9]=m,t[10]=g):g=t[10];let _;return t[11]!==u||t[12]!==g?(_=S.jsx("div",{className:u,children:g}),t[11]=u,t[12]=g,t[13]=_):_=t[13],_}function rz(e){const t=Qe.c(19),{children:r,onClose:s}=e,[o,u]=w.useState(!1),{setIsCountDown:f}=lr();let h;t[0]!==s?(h=()=>{u(!1),s?.()},t[0]=s,t[1]=h):h=t[1];const p=h;let m;t[2]!==p||t[3]!==f?(m=()=>{f(!0),p()},t[2]=p,t[3]=f,t[4]=m):m=t[4];const v=m;let g;t[5]!==r?(g=S.jsx(D_,{children:r}),t[5]=r,t[6]=g):g=t[6];let _;t[7]===Symbol.for("react.memo_cache_sentinel")?(_=S.jsxs(Dm,{children:[S.jsx("div",{className:"flex items-center justify-center mb-4",children:S.jsx("div",{className:"rounded-full border p-3",children:S.jsx(tm,{className:"w-6 h-6 "})})}),S.jsx(Cm,{className:"text-center text-lg",children:"Thông báo quan trọng"}),S.jsx(Rm,{className:"text-center text-base pt-2",children:"Để có kết quả tốt nhất bạn hay nhìn thẳng vào camera nhé"})]}),t[7]=_):_=t[7];let N;t[8]!==p?(N=S.jsx(nn,{variant:"outline",onClick:p,className:"min-w-32 bg-transparent",children:"Hủy"}),t[8]=p,t[9]=N):N=t[9];let T;t[10]!==v?(T=S.jsx(nn,{onClick:v,className:"min-w-32",children:"Tiếp tục"}),t[10]=v,t[11]=T):T=t[11];let x;t[12]!==N||t[13]!==T?(x=S.jsxs(Am,{className:"w-[95vw] max-w-md sm:max-w-md",children:[_,S.jsxs("div",{className:"flex justify-center gap-3 pt-4",children:[N,T]})]}),t[12]=N,t[13]=T,t[14]=x):x=t[14];let O;return t[15]!==o||t[16]!==g||t[17]!==x?(O=S.jsxs(Om,{open:o,onOpenChange:u,children:[g,x]}),t[15]=o,t[16]=g,t[17]=x,t[18]=O):O=t[18],O}var so=e=>e.type==="checkbox",ms=e=>e instanceof Date,An=e=>e==null;const MS=e=>typeof e=="object";var kt=e=>!An(e)&&!Array.isArray(e)&&MS(e)&&!ms(e),zS=e=>kt(e)&&e.target?so(e.target)?e.target.checked:e.target.value:e,sz=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,kS=(e,t)=>e.has(sz(t)),iz=e=>{const t=e.constructor&&e.constructor.prototype;return kt(t)&&t.hasOwnProperty("isPrototypeOf")},Vm=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Vt(e){let t;const r=Array.isArray(e),s=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(Vm&&(e instanceof Blob||s))&&(r||kt(e)))if(t=r?[]:Object.create(Object.getPrototypeOf(e)),!r&&!iz(e))t=e;else for(const o in e)e.hasOwnProperty(o)&&(t[o]=Vt(e[o]));else return e;return t}var Oc=e=>/^\w*$/.test(e),Et=e=>e===void 0,Bm=e=>Array.isArray(e)?e.filter(Boolean):[],Zm=e=>Bm(e.replace(/["|']|\]/g,"").split(/\.|\[/)),ue=(e,t,r)=>{if(!t||!kt(e))return r;const s=(Oc(t)?[t]:Zm(t)).reduce((o,u)=>An(o)?o:o[u],e);return Et(s)||s===e?Et(e[t])?r:e[t]:s},Hn=e=>typeof e=="boolean",rt=(e,t,r)=>{let s=-1;const o=Oc(t)?[t]:Zm(t),u=o.length,f=u-1;for(;++sZ.useContext(Fm),lz=e=>{const{children:t,...r}=e;return Z.createElement(Fm.Provider,{value:r},t)};var jS=(e,t,r,s=!0)=>{const o={defaultValues:t._defaultValues};for(const u in e)Object.defineProperty(o,u,{get:()=>{const f=u;return t._proxyFormState[f]!==oa.all&&(t._proxyFormState[f]=!s||oa.all),r&&(r[f]=!0),e[f]}});return o};const $m=typeof window<"u"?Z.useLayoutEffect:Z.useEffect;function US(e){const t=Ac(),{control:r=t.control,disabled:s,name:o,exact:u}=e||{},[f,h]=Z.useState(r._formState),p=Z.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return $m(()=>r._subscribe({name:o,formState:p.current,exact:u,callback:m=>{!s&&h({...r._formState,...m})}}),[o,s,u]),Z.useEffect(()=>{p.current.isValid&&r._setValid(!0)},[r]),Z.useMemo(()=>jS(f,r,p.current,!1),[f,r])}var Vn=e=>typeof e=="string",Fh=(e,t,r,s,o)=>Vn(e)?(s&&t.watch.add(e),ue(r,e,o)):Array.isArray(e)?e.map(u=>(s&&t.watch.add(u),ue(r,u))):(s&&(t.watchAll=!0),r),$h=e=>An(e)||!MS(e);function ua(e,t,r=new WeakSet){if($h(e)||$h(t))return Object.is(e,t);if(ms(e)&&ms(t))return e.getTime()===t.getTime();const s=Object.keys(e),o=Object.keys(t);if(s.length!==o.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const u of s){const f=e[u];if(!o.includes(u))return!1;if(u!=="ref"){const h=t[u];if(ms(f)&&ms(h)||kt(f)&&kt(h)||Array.isArray(f)&&Array.isArray(h)?!ua(f,h,r):!Object.is(f,h))return!1}}return!0}function oz(e){const t=Ac(),{control:r=t.control,name:s,defaultValue:o,disabled:u,exact:f,compute:h}=e||{},p=Z.useRef(o),m=Z.useRef(h),v=Z.useRef(void 0),g=Z.useRef(r),_=Z.useRef(s);m.current=h;const[N,T]=Z.useState(()=>{const B=r._getWatch(s,p.current);return m.current?m.current(B):B}),x=Z.useCallback(B=>{const J=Fh(s,r._names,B||r._formValues,!1,p.current);return m.current?m.current(J):J},[r._formValues,r._names,s]),O=Z.useCallback(B=>{if(!u){const J=Fh(s,r._names,B||r._formValues,!1,p.current);if(m.current){const ie=m.current(J);ua(ie,v.current)||(T(ie),v.current=ie)}else T(J)}},[r._formValues,r._names,u,s]);$m(()=>((g.current!==r||!ua(_.current,s))&&(g.current=r,_.current=s,O()),r._subscribe({name:s,formState:{values:!0},exact:f,callback:B=>{O(B.values)}})),[r,f,s,O]),Z.useEffect(()=>r._removeUnmounted());const z=g.current!==r,X=_.current,q=Z.useMemo(()=>{if(u)return null;const B=!z&&!ua(X,s);return z||B?x():null},[u,z,s,X,x]);return q!==null?q:N}function uz(e){const t=Ac(),{name:r,disabled:s,control:o=t.control,shouldUnregister:u,defaultValue:f,exact:h=!0}=e,p=kS(o._names.array,r),m=Z.useMemo(()=>ue(o._formValues,r,ue(o._defaultValues,r,f)),[o,r,f]),v=oz({control:o,name:r,defaultValue:m,exact:h}),g=US({control:o,name:r,exact:h}),_=Z.useRef(e),N=Z.useRef(void 0),T=Z.useRef(o.register(r,{...e.rules,value:v,...Hn(e.disabled)?{disabled:e.disabled}:{}}));_.current=e;const x=Z.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!ue(g.errors,r)},isDirty:{enumerable:!0,get:()=>!!ue(g.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!ue(g.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!ue(g.validatingFields,r)},error:{enumerable:!0,get:()=>ue(g.errors,r)}}),[g,r]),O=Z.useCallback(B=>T.current.onChange({target:{value:zS(B),name:r},type:ec.CHANGE}),[r]),z=Z.useCallback(()=>T.current.onBlur({target:{value:ue(o._formValues,r),name:r},type:ec.BLUR}),[r,o._formValues]),X=Z.useCallback(B=>{const J=ue(o._fields,r);J&&B&&(J._f.ref={focus:()=>B.focus&&B.focus(),select:()=>B.select&&B.select(),setCustomValidity:ie=>B.setCustomValidity(ie),reportValidity:()=>B.reportValidity()})},[o._fields,r]),q=Z.useMemo(()=>({name:r,value:v,...Hn(s)||g.disabled?{disabled:g.disabled||s}:{},onChange:O,onBlur:z,ref:X}),[r,s,g.disabled,O,z,X,v]);return Z.useEffect(()=>{const B=o._options.shouldUnregister||u,J=N.current;J&&J!==r&&!p&&o.unregister(J),o.register(r,{..._.current.rules,...Hn(_.current.disabled)?{disabled:_.current.disabled}:{}});const ie=(P,te)=>{const _e=ue(o._fields,P);_e&&_e._f&&(_e._f.mount=te)};if(ie(r,!0),B){const P=Vt(ue(o._options.defaultValues,r,_.current.defaultValue));rt(o._defaultValues,r,P),Et(ue(o._formValues,r))&&rt(o._formValues,r,P)}return!p&&o.register(r),N.current=r,()=>{(p?B&&!o._state.action:B)?o.unregister(r):ie(r,!1)}},[r,o,p,u]),Z.useEffect(()=>{o._setDisabledField({disabled:s,name:r})},[s,r,o]),Z.useMemo(()=>({field:q,formState:g,fieldState:x}),[q,g,x])}const cz=e=>e.render(uz(e));var qm=(e,t,r,s,o)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[s]:o||!0}}:{},Hl=e=>Array.isArray(e)?e:[e],ab=()=>{let e=[];return{get observers(){return e},next:o=>{for(const u of e)u.next&&u.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(u=>u!==o)}}),unsubscribe:()=>{e=[]}}};function LS(e,t){const r={};for(const s in e)if(e.hasOwnProperty(s)){const o=e[s],u=t[s];if(o&&kt(o)&&u){const f=LS(o,u);kt(f)&&(r[s]=f)}else e[s]&&(r[s]=u)}return r}var fn=e=>kt(e)&&!Object.keys(e).length,Gm=e=>e.type==="file",ca=e=>typeof e=="function",tc=e=>{if(!Vm)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},YS=e=>e.type==="select-multiple",Xm=e=>e.type==="radio",fz=e=>Xm(e)||so(e),bh=e=>tc(e)&&e.isConnected;function dz(e,t){const r=t.slice(0,-1).length;let s=0;for(;s{for(const t in e)if(ca(e[t]))return!0;return!1};function HS(e){return Array.isArray(e)||kt(e)&&!mz(e)}function qh(e,t={}){for(const r in e){const s=e[r];HS(s)?(t[r]=Array.isArray(s)?[]:{},qh(s,t[r])):Et(s)||(t[r]=!0)}return t}function wi(e,t,r){r||(r=qh(t));for(const s in e){const o=e[s];if(HS(o))Et(t)||$h(r[s])?r[s]=qh(o,Array.isArray(o)?[]:{}):wi(o,An(t)?{}:t[s],r[s]);else{const u=t[s];r[s]=!ua(o,u)}}return r}const rb={value:!1,isValid:!1},sb={value:!0,isValid:!0};var VS=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Et(e[0].attributes.value)?Et(e[0].value)||e[0].value===""?sb:{value:e[0].value,isValid:!0}:sb:rb}return rb},BS=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:s})=>Et(e)?e:t?e===""?NaN:e&&+e:r&&Vn(e)?new Date(e):s?s(e):e;const ib={isValid:!1,value:null};var ZS=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,ib):ib;function lb(e){const t=e.ref;return Gm(t)?t.files:Xm(t)?ZS(e.refs).value:YS(t)?[...t.selectedOptions].map(({value:r})=>r):so(t)?VS(e.refs).value:BS(Et(t.value)?e.ref.value:t.value,e)}var pz=(e,t,r,s)=>{const o={};for(const u of e){const f=ue(t,u);f&&rt(o,u,f._f)}return{criteriaMode:r,names:[...e],fields:o,shouldUseNativeValidation:s}},nc=e=>e instanceof RegExp,Ul=e=>Et(e)?e:nc(e)?e.source:kt(e)?nc(e.value)?e.value.source:e.value:e,ob=e=>({isOnSubmit:!e||e===oa.onSubmit,isOnBlur:e===oa.onBlur,isOnChange:e===oa.onChange,isOnAll:e===oa.all,isOnTouch:e===oa.onTouched});const ub="AsyncFunction";var gz=e=>!!e&&!!e.validate&&!!(ca(e.validate)&&e.validate.constructor.name===ub||kt(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===ub)),yz=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),cb=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(s=>e.startsWith(s)&&/^\.\w+/.test(e.slice(s.length))));const Vl=(e,t,r,s)=>{for(const o of r||Object.keys(e)){const u=ue(e,o);if(u){const{_f:f,...h}=u;if(f){if(f.refs&&f.refs[0]&&t(f.refs[0],o)&&!s)return!0;if(f.ref&&t(f.ref,f.name)&&!s)return!0;if(Vl(h,t))break}else if(kt(h)&&Vl(h,t))break}}};function fb(e,t,r){const s=ue(e,r);if(s||Oc(r))return{error:s,name:r};const o=r.split(".");for(;o.length;){const u=o.join("."),f=ue(t,u),h=ue(e,u);if(f&&!Array.isArray(f)&&r!==u)return{name:r};if(h&&h.type)return{name:u,error:h};if(h&&h.root&&h.root.type)return{name:`${u}.root`,error:h.root};o.pop()}return{name:r}}var vz=(e,t,r,s)=>{r(e);const{name:o,...u}=e;return fn(u)||Object.keys(u).length>=Object.keys(t).length||Object.keys(u).find(f=>t[f]===(!s||oa.all))},bz=(e,t,r)=>!e||!t||e===t||Hl(e).some(s=>s&&(r?s===t:s.startsWith(t)||t.startsWith(s))),_z=(e,t,r,s,o)=>o.isOnAll?!1:!r&&o.isOnTouch?!(t||e):(r?s.isOnBlur:o.isOnBlur)?!e:(r?s.isOnChange:o.isOnChange)?e:!0,Sz=(e,t)=>!Bm(ue(e,t)).length&&zt(e,t),wz=(e,t,r)=>{const s=Hl(ue(e,r));return rt(s,"root",t[r]),rt(e,r,s),e};function db(e,t,r="validate"){if(Vn(e)||Array.isArray(e)&&e.every(Vn)||Hn(e)&&!e)return{type:r,message:Vn(e)?e:"",ref:t}}var _i=e=>kt(e)&&!nc(e)?e:{value:e,message:""},hb=async(e,t,r,s,o,u)=>{const{ref:f,refs:h,required:p,maxLength:m,minLength:v,min:g,max:_,pattern:N,validate:T,name:x,valueAsNumber:O,mount:z}=e._f,X=ue(r,x);if(!z||t.has(x))return{};const q=h?h[0]:f,B=ce=>{o&&q.reportValidity&&(q.setCustomValidity(Hn(ce)?"":ce||""),q.reportValidity())},J={},ie=Xm(f),P=so(f),te=ie||P,_e=(O||Gm(f))&&Et(f.value)&&Et(X)||tc(f)&&f.value===""||X===""||Array.isArray(X)&&!X.length,Ue=qm.bind(null,x,s,J),Ce=(ce,he,Ee,Te=er.maxLength,R=er.minLength)=>{const K=ce?he:Ee;J[x]={type:ce?Te:R,message:K,ref:f,...Ue(ce?Te:R,K)}};if(u?!Array.isArray(X)||!X.length:p&&(!te&&(_e||An(X))||Hn(X)&&!X||P&&!VS(h).isValid||ie&&!ZS(h).isValid)){const{value:ce,message:he}=Vn(p)?{value:!!p,message:p}:_i(p);if(ce&&(J[x]={type:er.required,message:he,ref:q,...Ue(er.required,he)},!s))return B(he),J}if(!_e&&(!An(g)||!An(_))){let ce,he;const Ee=_i(_),Te=_i(g);if(!An(X)&&!isNaN(X)){const R=f.valueAsNumber||X&&+X;An(Ee.value)||(ce=R>Ee.value),An(Te.value)||(he=Rnew Date(new Date().toDateString()+" "+De),I=f.type=="time",Ae=f.type=="week";Vn(Ee.value)&&X&&(ce=I?K(X)>K(Ee.value):Ae?X>Ee.value:R>new Date(Ee.value)),Vn(Te.value)&&X&&(he=I?K(X)+ce.value,Te=!An(he.value)&&X.length<+he.value;if((Ee||Te)&&(Ce(Ee,ce.message,he.message),!s))return B(J[x].message),J}if(N&&!_e&&Vn(X)){const{value:ce,message:he}=_i(N);if(nc(ce)&&!X.match(ce)&&(J[x]={type:er.pattern,message:he,ref:f,...Ue(er.pattern,he)},!s))return B(he),J}if(T){if(ca(T)){const ce=await T(X,r),he=db(ce,q);if(he&&(J[x]={...he,...Ue(er.validate,he.message)},!s))return B(he.message),J}else if(kt(T)){let ce={};for(const he in T){if(!fn(ce)&&!s)break;const Ee=db(await T[he](X,r),q,he);Ee&&(ce={...Ee,...Ue(he,Ee.message)},B(Ee.message),s&&(J[x]=ce))}if(!fn(ce)&&(J[x]={ref:q,...ce},!s))return J}}return B(!0),J};const xz={mode:oa.onSubmit,reValidateMode:oa.onChange,shouldFocusError:!0};function Ez(e={}){let t={...xz,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:ca(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},s={},o=kt(t.defaultValues)||kt(t.values)?Vt(t.defaultValues||t.values)||{}:{},u=t.shouldUnregister?{}:Vt(o),f={action:!1,mount:!1,watch:!1},h={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},p,m=0;const v={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let g={...v};const _={array:ab(),state:ab()},N=t.criteriaMode===oa.all,T=D=>U=>{clearTimeout(m),m=setTimeout(D,U)},x=async D=>{if(!t.disabled&&(v.isValid||g.isValid||D)){const U=t.resolver?fn((await P()).errors):await _e(s,!0);U!==r.isValid&&_.state.next({isValid:U})}},O=(D,U)=>{!t.disabled&&(v.isValidating||v.validatingFields||g.isValidating||g.validatingFields)&&((D||Array.from(h.mount)).forEach(V=>{V&&(U?rt(r.validatingFields,V,U):zt(r.validatingFields,V))}),_.state.next({validatingFields:r.validatingFields,isValidating:!fn(r.validatingFields)}))},z=(D,U=[],V,le,ae=!0,se=!0)=>{if(le&&V&&!t.disabled){if(f.action=!0,se&&Array.isArray(ue(s,D))){const ye=V(ue(s,D),le.argA,le.argB);ae&&rt(s,D,ye)}if(se&&Array.isArray(ue(r.errors,D))){const ye=V(ue(r.errors,D),le.argA,le.argB);ae&&rt(r.errors,D,ye),Sz(r.errors,D)}if((v.touchedFields||g.touchedFields)&&se&&Array.isArray(ue(r.touchedFields,D))){const ye=V(ue(r.touchedFields,D),le.argA,le.argB);ae&&rt(r.touchedFields,D,ye)}(v.dirtyFields||g.dirtyFields)&&(r.dirtyFields=wi(o,u)),_.state.next({name:D,isDirty:Ce(D,U),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else rt(u,D,U)},X=(D,U)=>{rt(r.errors,D,U),_.state.next({errors:r.errors})},q=D=>{r.errors=D,_.state.next({errors:r.errors,isValid:!1})},B=(D,U,V,le)=>{const ae=ue(s,D);if(ae){const se=ue(u,D,Et(V)?ue(o,D):V);Et(se)||le&&le.defaultChecked||U?rt(u,D,U?se:lb(ae._f)):Ee(D,se),f.mount&&!f.action&&x()}},J=(D,U,V,le,ae)=>{let se=!1,ye=!1;const Xe={name:D};if(!t.disabled){if(!V||le){(v.isDirty||g.isDirty)&&(ye=r.isDirty,r.isDirty=Xe.isDirty=Ce(),se=ye!==Xe.isDirty);const Ie=ua(ue(o,D),U);ye=!!ue(r.dirtyFields,D),Ie?zt(r.dirtyFields,D):rt(r.dirtyFields,D,!0),Xe.dirtyFields=r.dirtyFields,se=se||(v.dirtyFields||g.dirtyFields)&&ye!==!Ie}if(V){const Ie=ue(r.touchedFields,D);Ie||(rt(r.touchedFields,D,V),Xe.touchedFields=r.touchedFields,se=se||(v.touchedFields||g.touchedFields)&&Ie!==V)}se&&ae&&_.state.next(Xe)}return se?Xe:{}},ie=(D,U,V,le)=>{const ae=ue(r.errors,D),se=(v.isValid||g.isValid)&&Hn(U)&&r.isValid!==U;if(t.delayError&&V?(p=T(()=>X(D,V)),p(t.delayError)):(clearTimeout(m),p=null,V?rt(r.errors,D,V):zt(r.errors,D)),(V?!ua(ae,V):ae)||!fn(le)||se){const ye={...le,...se&&Hn(U)?{isValid:U}:{},errors:r.errors,name:D};r={...r,...ye},_.state.next(ye)}},P=async D=>{O(D,!0);const U=await t.resolver(u,t.context,pz(D||h.mount,s,t.criteriaMode,t.shouldUseNativeValidation));return O(D),U},te=async D=>{const{errors:U}=await P(D);if(D)for(const V of D){const le=ue(U,V);le?rt(r.errors,V,le):zt(r.errors,V)}else r.errors=U;return U},_e=async(D,U,V={valid:!0})=>{for(const le in D){const ae=D[le];if(ae){const{_f:se,...ye}=ae;if(se){const Xe=h.array.has(se.name),Ie=ae._f&&gz(ae._f);Ie&&v.validatingFields&&O([se.name],!0);const $t=await hb(ae,h.disabled,u,N,t.shouldUseNativeValidation&&!U,Xe);if(Ie&&v.validatingFields&&O([se.name]),$t[se.name]&&(V.valid=!1,U))break;!U&&(ue($t,se.name)?Xe?wz(r.errors,$t,se.name):rt(r.errors,se.name,$t[se.name]):zt(r.errors,se.name))}!fn(ye)&&await _e(ye,U,V)}}return V.valid},Ue=()=>{for(const D of h.unMount){const U=ue(s,D);U&&(U._f.refs?U._f.refs.every(V=>!bh(V)):!bh(U._f.ref))&&be(D)}h.unMount=new Set},Ce=(D,U)=>!t.disabled&&(D&&U&&rt(u,D,U),!ua(De(),o)),ce=(D,U,V)=>Fh(D,h,{...f.mount?u:Et(U)?o:Vn(D)?{[D]:U}:U},V,U),he=D=>Bm(ue(f.mount?u:o,D,t.shouldUnregister?ue(o,D,[]):[])),Ee=(D,U,V={})=>{const le=ue(s,D);let ae=U;if(le){const se=le._f;se&&(!se.disabled&&rt(u,D,BS(U,se)),ae=tc(se.ref)&&An(U)?"":U,YS(se.ref)?[...se.ref.options].forEach(ye=>ye.selected=ae.includes(ye.value)):se.refs?so(se.ref)?se.refs.forEach(ye=>{(!ye.defaultChecked||!ye.disabled)&&(Array.isArray(ae)?ye.checked=!!ae.find(Xe=>Xe===ye.value):ye.checked=ae===ye.value||!!ae)}):se.refs.forEach(ye=>ye.checked=ye.value===ae):Gm(se.ref)?se.ref.value="":(se.ref.value=ae,se.ref.type||_.state.next({name:D,values:Vt(u)})))}(V.shouldDirty||V.shouldTouch)&&J(D,ae,V.shouldTouch,V.shouldDirty,!0),V.shouldValidate&&Ae(D)},Te=(D,U,V)=>{for(const le in U){if(!U.hasOwnProperty(le))return;const ae=U[le],se=D+"."+le,ye=ue(s,se);(h.array.has(D)||kt(ae)||ye&&!ye._f)&&!ms(ae)?Te(se,ae,V):Ee(se,ae,V)}},R=(D,U,V={})=>{const le=ue(s,D),ae=h.array.has(D),se=Vt(U);rt(u,D,se),ae?(_.array.next({name:D,values:Vt(u)}),(v.isDirty||v.dirtyFields||g.isDirty||g.dirtyFields)&&V.shouldDirty&&_.state.next({name:D,dirtyFields:wi(o,u),isDirty:Ce(D,se)})):le&&!le._f&&!An(se)?Te(D,se,V):Ee(D,se,V),cb(D,h)&&_.state.next({...r,name:D}),_.state.next({name:f.mount?D:void 0,values:Vt(u)})},K=async D=>{f.mount=!0;const U=D.target;let V=U.name,le=!0;const ae=ue(s,V),se=Ie=>{le=Number.isNaN(Ie)||ms(Ie)&&isNaN(Ie.getTime())||ua(Ie,ue(u,V,Ie))},ye=ob(t.mode),Xe=ob(t.reValidateMode);if(ae){let Ie,$t;const mn=U.type?lb(ae._f):zS(D),Rn=D.type===ec.BLUR||D.type===ec.FOCUS_OUT,ya=!yz(ae._f)&&!t.resolver&&!ue(r.errors,V)&&!ae._f.deps||_z(Rn,ue(r.touchedFields,V),r.isSubmitted,Xe,ye),na=cb(V,h,Rn);rt(u,V,mn),Rn?(!U||!U.readOnly)&&(ae._f.onBlur&&ae._f.onBlur(D),p&&p(0)):ae._f.onChange&&ae._f.onChange(D);const Ut=J(V,mn,Rn),Nn=!fn(Ut)||na;if(!Rn&&_.state.next({name:V,type:D.type,values:Vt(u)}),ya)return(v.isValid||g.isValid)&&(t.mode==="onBlur"?Rn&&x():Rn||x()),Nn&&_.state.next({name:V,...na?{}:Ut});if(!Rn&&na&&_.state.next({...r}),t.resolver){const{errors:Lt}=await P([V]);if(se(mn),le){const Vi=fb(r.errors,s,V),dr=fb(Lt,s,Vi.name||V);Ie=dr.error,V=dr.name,$t=fn(Lt)}}else O([V],!0),Ie=(await hb(ae,h.disabled,u,N,t.shouldUseNativeValidation))[V],O([V]),se(mn),le&&(Ie?$t=!1:(v.isValid||g.isValid)&&($t=await _e(s,!0)));le&&(ae._f.deps&&(!Array.isArray(ae._f.deps)||ae._f.deps.length>0)&&Ae(ae._f.deps),ie(V,$t,Ie,Ut))}},I=(D,U)=>{if(ue(r.errors,U)&&D.focus)return D.focus(),1},Ae=async(D,U={})=>{let V,le;const ae=Hl(D);if(t.resolver){const se=await te(Et(D)?D:ae);V=fn(se),le=D?!ae.some(ye=>ue(se,ye)):V}else D?(le=(await Promise.all(ae.map(async se=>{const ye=ue(s,se);return await _e(ye&&ye._f?{[se]:ye}:ye)}))).every(Boolean),!(!le&&!r.isValid)&&x()):le=V=await _e(s);return _.state.next({...!Vn(D)||(v.isValid||g.isValid)&&V!==r.isValid?{}:{name:D},...t.resolver||!D?{isValid:V}:{},errors:r.errors}),U.shouldFocus&&!le&&Vl(s,I,D?ae:h.mount),le},De=(D,U)=>{let V={...f.mount?u:o};return U&&(V=LS(U.dirtyFields?r.dirtyFields:r.touchedFields,V)),Et(D)?V:Vn(D)?ue(V,D):D.map(le=>ue(V,le))},A=(D,U)=>({invalid:!!ue((U||r).errors,D),isDirty:!!ue((U||r).dirtyFields,D),error:ue((U||r).errors,D),isValidating:!!ue(r.validatingFields,D),isTouched:!!ue((U||r).touchedFields,D)}),$=D=>{D&&Hl(D).forEach(U=>zt(r.errors,U)),_.state.next({errors:D?r.errors:{}})},F=(D,U,V)=>{const le=(ue(s,D,{_f:{}})._f||{}).ref,ae=ue(r.errors,D)||{},{ref:se,message:ye,type:Xe,...Ie}=ae;rt(r.errors,D,{...Ie,...U,ref:le}),_.state.next({name:D,errors:r.errors,isValid:!1}),V&&V.shouldFocus&&le&&le.focus&&le.focus()},ee=(D,U)=>ca(D)?_.state.subscribe({next:V=>"values"in V&&D(ce(void 0,U),V)}):ce(D,U,!0),oe=D=>_.state.subscribe({next:U=>{bz(D.name,U.name,D.exact)&&vz(U,D.formState||v,za,D.reRenderRoot)&&D.callback({values:{...u},...r,...U,defaultValues:o})}}).unsubscribe,Se=D=>(f.mount=!0,g={...g,...D.formState},oe({...D,formState:g})),be=(D,U={})=>{for(const V of D?Hl(D):h.mount)h.mount.delete(V),h.array.delete(V),U.keepValue||(zt(s,V),zt(u,V)),!U.keepError&&zt(r.errors,V),!U.keepDirty&&zt(r.dirtyFields,V),!U.keepTouched&&zt(r.touchedFields,V),!U.keepIsValidating&&zt(r.validatingFields,V),!t.shouldUnregister&&!U.keepDefaultValue&&zt(o,V);_.state.next({values:Vt(u)}),_.state.next({...r,...U.keepDirty?{isDirty:Ce()}:{}}),!U.keepIsValid&&x()},Re=({disabled:D,name:U})=>{(Hn(D)&&f.mount||D||h.disabled.has(U))&&(D?h.disabled.add(U):h.disabled.delete(U))},Ve=(D,U={})=>{let V=ue(s,D);const le=Hn(U.disabled)||Hn(t.disabled);return rt(s,D,{...V||{},_f:{...V&&V._f?V._f:{ref:{name:D}},name:D,mount:!0,...U}}),h.mount.add(D),V?Re({disabled:Hn(U.disabled)?U.disabled:t.disabled,name:D}):B(D,!0,U.value),{...le?{disabled:U.disabled||t.disabled}:{},...t.progressive?{required:!!U.required,min:Ul(U.min),max:Ul(U.max),minLength:Ul(U.minLength),maxLength:Ul(U.maxLength),pattern:Ul(U.pattern)}:{},name:D,onChange:K,onBlur:K,ref:ae=>{if(ae){Ve(D,U),V=ue(s,D);const se=Et(ae.value)&&ae.querySelectorAll&&ae.querySelectorAll("input,select,textarea")[0]||ae,ye=fz(se),Xe=V._f.refs||[];if(ye?Xe.find(Ie=>Ie===se):se===V._f.ref)return;rt(s,D,{_f:{...V._f,...ye?{refs:[...Xe.filter(bh),se,...Array.isArray(ue(o,D))?[{}]:[]],ref:{type:se.type,name:D}}:{ref:se}}}),B(D,!1,void 0,se)}else V=ue(s,D,{}),V._f&&(V._f.mount=!1),(t.shouldUnregister||U.shouldUnregister)&&!(kS(h.array,D)&&f.action)&&h.unMount.add(D)}}},jt=()=>t.shouldFocusError&&Vl(s,I,h.mount),un=D=>{Hn(D)&&(_.state.next({disabled:D}),Vl(s,(U,V)=>{const le=ue(s,V);le&&(U.disabled=le._f.disabled||D,Array.isArray(le._f.refs)&&le._f.refs.forEach(ae=>{ae.disabled=le._f.disabled||D}))},0,!1))},Ft=(D,U)=>async V=>{let le;V&&(V.preventDefault&&V.preventDefault(),V.persist&&V.persist());let ae=Vt(u);if(_.state.next({isSubmitting:!0}),t.resolver){const{errors:se,values:ye}=await P();r.errors=se,ae=Vt(ye)}else await _e(s);if(h.disabled.size)for(const se of h.disabled)zt(ae,se);if(zt(r.errors,"root"),fn(r.errors)){_.state.next({errors:{}});try{await D(ae,V)}catch(se){le=se}}else U&&await U({...r.errors},V),jt(),setTimeout(jt);if(_.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:fn(r.errors)&&!le,submitCount:r.submitCount+1,errors:r.errors}),le)throw le},Ts=(D,U={})=>{ue(s,D)&&(Et(U.defaultValue)?R(D,Vt(ue(o,D))):(R(D,U.defaultValue),rt(o,D,Vt(U.defaultValue))),U.keepTouched||zt(r.touchedFields,D),U.keepDirty||(zt(r.dirtyFields,D),r.isDirty=U.defaultValue?Ce(D,Vt(ue(o,D))):Ce()),U.keepError||(zt(r.errors,D),v.isValid&&x()),_.state.next({...r}))},hn=(D,U={})=>{const V=D?Vt(D):o,le=Vt(V),ae=fn(D),se=ae?o:le;if(U.keepDefaultValues||(o=V),!U.keepValues){if(U.keepDirtyValues){const ye=new Set([...h.mount,...Object.keys(wi(o,u))]);for(const Xe of Array.from(ye))ue(r.dirtyFields,Xe)?rt(se,Xe,ue(u,Xe)):R(Xe,ue(se,Xe))}else{if(Vm&&Et(D))for(const ye of h.mount){const Xe=ue(s,ye);if(Xe&&Xe._f){const Ie=Array.isArray(Xe._f.refs)?Xe._f.refs[0]:Xe._f.ref;if(tc(Ie)){const $t=Ie.closest("form");if($t){$t.reset();break}}}}if(U.keepFieldsRef)for(const ye of h.mount)R(ye,ue(se,ye));else s={}}u=t.shouldUnregister?U.keepDefaultValues?Vt(o):{}:Vt(se),_.array.next({values:{...se}}),_.state.next({values:{...se}})}h={mount:U.keepDirtyValues?h.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},f.mount=!v.isValid||!!U.keepIsValid||!!U.keepDirtyValues||!t.shouldUnregister&&!fn(se),f.watch=!!t.shouldUnregister,f.action=!1,U.keepErrors||(r.errors={}),_.state.next({submitCount:U.keepSubmitCount?r.submitCount:0,isDirty:ae?!1:U.keepDirty?r.isDirty:!!(U.keepDefaultValues&&!ua(D,o)),isSubmitted:U.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:ae?{}:U.keepDirtyValues?U.keepDefaultValues&&u?wi(o,u):r.dirtyFields:U.keepDefaultValues&&D?wi(o,D):U.keepDirty?r.dirtyFields:{},touchedFields:U.keepTouched?r.touchedFields:{},errors:U.keepErrors?r.errors:{},isSubmitSuccessful:U.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},cr=(D,U)=>hn(ca(D)?D(u):D,U),fr=(D,U={})=>{const V=ue(s,D),le=V&&V._f;if(le){const ae=le.refs?le.refs[0]:le.ref;ae.focus&&(ae.focus(),U.shouldSelect&&ca(ae.select)&&ae.select())}},za=D=>{r={...r,...D}},an={control:{register:Ve,unregister:be,getFieldState:A,handleSubmit:Ft,setError:F,_subscribe:oe,_runSchema:P,_focusError:jt,_getWatch:ce,_getDirty:Ce,_setValid:x,_setFieldArray:z,_setDisabledField:Re,_setErrors:q,_getFieldArray:he,_reset:hn,_resetDefaultValues:()=>ca(t.defaultValues)&&t.defaultValues().then(D=>{cr(D,t.resetOptions),_.state.next({isLoading:!1})}),_removeUnmounted:Ue,_disableForm:un,_subjects:_,_proxyFormState:v,get _fields(){return s},get _formValues(){return u},get _state(){return f},set _state(D){f=D},get _defaultValues(){return o},get _names(){return h},set _names(D){h=D},get _formState(){return r},get _options(){return t},set _options(D){t={...t,...D}}},subscribe:Se,trigger:Ae,register:Ve,handleSubmit:Ft,watch:ee,setValue:R,getValues:De,reset:cr,resetField:Ts,clearErrors:$,unregister:be,setError:F,setFocus:fr,getFieldState:A};return{...an,formControl:an}}function Tz(e={}){const t=Z.useRef(void 0),r=Z.useRef(void 0),[s,o]=Z.useState({isDirty:!1,isValidating:!1,isLoading:ca(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:ca(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:s},e.defaultValues&&!ca(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:f,...h}=Ez(e);t.current={...h,formState:s}}const u=t.current.control;return u._options=e,$m(()=>{const f=u._subscribe({formState:u._proxyFormState,callback:()=>o({...u._formState}),reRenderRoot:!0});return o(h=>({...h,isReady:!0})),u._formState.isReady=!0,f},[u]),Z.useEffect(()=>u._disableForm(e.disabled),[u,e.disabled]),Z.useEffect(()=>{e.mode&&(u._options.mode=e.mode),e.reValidateMode&&(u._options.reValidateMode=e.reValidateMode)},[u,e.mode,e.reValidateMode]),Z.useEffect(()=>{e.errors&&(u._setErrors(e.errors),u._focusError())},[u,e.errors]),Z.useEffect(()=>{e.shouldUnregister&&u._subjects.state.next({values:u._getWatch()})},[u,e.shouldUnregister]),Z.useEffect(()=>{if(u._proxyFormState.isDirty){const f=u._getDirty();f!==s.isDirty&&u._subjects.state.next({isDirty:f})}},[u,s.isDirty]),Z.useEffect(()=>{var f;e.values&&!ua(e.values,r.current)?(u._reset(e.values,{keepFieldsRef:!0,...u._options.resetOptions}),!((f=u._options.resetOptions)===null||f===void 0)&&f.keepIsValid||u._setValid(),r.current=e.values,o(h=>({...h}))):u._resetDefaultValues()},[u,e.values]),Z.useEffect(()=>{u._state.mount||(u._setValid(),u._state.mount=!0),u._state.watch&&(u._state.watch=!1,u._subjects.state.next({...u._formState})),u._removeUnmounted()}),t.current.formState=jS(s,u),t.current}const mb=(e,t,r)=>{if(e&&"reportValidity"in e){const s=ue(r,t);e.setCustomValidity(s&&s.message||""),e.reportValidity()}},Gh=(e,t)=>{for(const r in t.fields){const s=t.fields[r];s&&s.ref&&"reportValidity"in s.ref?mb(s.ref,r,e):s&&s.refs&&s.refs.forEach(o=>mb(o,r,e))}},pb=(e,t)=>{t.shouldUseNativeValidation&&Gh(e,t);const r={};for(const s in e){const o=ue(t.fields,s),u=Object.assign(e[s]||{},{ref:o&&o.ref});if(Oz(t.names||Object.keys(e),s)){const f=Object.assign({},ue(r,s));rt(f,"root",u),rt(r,s,f)}else rt(r,s,u)}return r},Oz=(e,t)=>{const r=gb(t);return e.some(s=>gb(s).match(`^${r}\\.\\d+`))};function gb(e){return e.replace(/\]|\[/g,"")}function ne(e,t,r){function s(h,p){if(h._zod||Object.defineProperty(h,"_zod",{value:{def:p,constr:f,traits:new Set},enumerable:!1}),h._zod.traits.has(e))return;h._zod.traits.add(e),t(h,p);const m=f.prototype,v=Object.keys(m);for(let g=0;gr?.Parent&&h instanceof r.Parent?!0:h?._zod?.traits?.has(e)}),Object.defineProperty(f,"name",{value:e}),f}class Ci extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class FS extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const $S={};function _s(e){return $S}function Az(e){const t=Object.values(e).filter(s=>typeof s=="number");return Object.entries(e).filter(([s,o])=>t.indexOf(+s)===-1).map(([s,o])=>o)}function Xh(e,t){return typeof t=="bigint"?t.toString():t}function Im(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Qm(e){return e==null}function Wm(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}const yb=Symbol("evaluating");function ft(e,t,r){let s;Object.defineProperty(e,t,{get(){if(s!==yb)return s===void 0&&(s=yb,s=r()),s},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function xs(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Es(...e){const t={};for(const r of e){const s=Object.getOwnPropertyDescriptors(r);Object.assign(t,s)}return Object.defineProperties({},t)}function vb(e){return JSON.stringify(e)}function Dz(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const qS="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ac(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Cz=Im(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function ql(e){if(ac(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(ac(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function GS(e){return ql(e)?{...e}:Array.isArray(e)?[...e]:e}const Rz=new Set(["string","number","symbol"]);function Dc(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function $r(e,t,r){const s=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(s._zod.parent=e),s}function Me(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Nz(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function Mz(e,t){const r=e._zod.def,s=Es(e._zod.def,{get shape(){const o={};for(const u in t){if(!(u in r.shape))throw new Error(`Unrecognized key: "${u}"`);t[u]&&(o[u]=r.shape[u])}return xs(this,"shape",o),o},checks:[]});return $r(e,s)}function zz(e,t){const r=e._zod.def,s=Es(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const u in t){if(!(u in r.shape))throw new Error(`Unrecognized key: "${u}"`);t[u]&&delete o[u]}return xs(this,"shape",o),o},checks:[]});return $r(e,s)}function kz(e,t){if(!ql(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const o=Es(e._zod.def,{get shape(){const u={...e._zod.def.shape,...t};return xs(this,"shape",u),u},checks:[]});return $r(e,o)}function jz(e,t){if(!ql(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r={...e._zod.def,get shape(){const s={...e._zod.def.shape,...t};return xs(this,"shape",s),s},checks:e._zod.def.checks};return $r(e,r)}function Uz(e,t){const r=Es(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t._zod.def.shape};return xs(this,"shape",s),s},get catchall(){return t._zod.def.catchall},checks:[]});return $r(e,r)}function Lz(e,t,r){const s=Es(t._zod.def,{get shape(){const o=t._zod.def.shape,u={...o};if(r)for(const f in r){if(!(f in o))throw new Error(`Unrecognized key: "${f}"`);r[f]&&(u[f]=e?new e({type:"optional",innerType:o[f]}):o[f])}else for(const f in o)u[f]=e?new e({type:"optional",innerType:o[f]}):o[f];return xs(this,"shape",u),u},checks:[]});return $r(t,s)}function Yz(e,t,r){const s=Es(t._zod.def,{get shape(){const o=t._zod.def.shape,u={...o};if(r)for(const f in r){if(!(f in u))throw new Error(`Unrecognized key: "${f}"`);r[f]&&(u[f]=new e({type:"nonoptional",innerType:o[f]}))}else for(const f in o)u[f]=new e({type:"nonoptional",innerType:o[f]});return xs(this,"shape",u),u},checks:[]});return $r(t,s)}function Ei(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r{var s;return(s=r).path??(s.path=[]),r.path.unshift(e),r})}function Ru(e){return typeof e=="string"?e:e?.message}function Ss(e,t,r){const s={...e,path:e.path??[]};if(!e.message){const o=Ru(e.inst?._zod.def?.error?.(e))??Ru(t?.error?.(e))??Ru(r.customError?.(e))??Ru(r.localeError?.(e))??"Invalid input";s.message=o}return delete s.inst,delete s.continue,t?.reportInput||delete s.input,s}function Pm(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Gl(...e){const[t,r,s]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:s}:{...t}}const IS=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Xh,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Km=ne("$ZodError",IS),Cc=ne("$ZodError",IS,{Parent:Error});function Hz(e,t=r=>r.message){const r={},s=[];for(const o of e.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o))):s.push(t(o));return{formErrors:s,fieldErrors:r}}function Vz(e,t=r=>r.message){const r={_errors:[]},s=o=>{for(const u of o.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(f=>s({issues:f}));else if(u.code==="invalid_key")s({issues:u.issues});else if(u.code==="invalid_element")s({issues:u.issues});else if(u.path.length===0)r._errors.push(t(u));else{let f=r,h=0;for(;h(t,r,s,o)=>{const u=s?Object.assign(s,{async:!1}):{async:!1},f=t._zod.run({value:r,issues:[]},u);if(f instanceof Promise)throw new Ci;if(f.issues.length){const h=new(o?.Err??e)(f.issues.map(p=>Ss(p,u,_s())));throw qS(h,o?.callee),h}return f.value},Bz=Rc(Cc),Nc=e=>async(t,r,s,o)=>{const u=s?Object.assign(s,{async:!0}):{async:!0};let f=t._zod.run({value:r,issues:[]},u);if(f instanceof Promise&&(f=await f),f.issues.length){const h=new(o?.Err??e)(f.issues.map(p=>Ss(p,u,_s())));throw qS(h,o?.callee),h}return f.value},Zz=Nc(Cc),Mc=e=>(t,r,s)=>{const o=s?{...s,async:!1}:{async:!1},u=t._zod.run({value:r,issues:[]},o);if(u instanceof Promise)throw new Ci;return u.issues.length?{success:!1,error:new(e??Km)(u.issues.map(f=>Ss(f,o,_s())))}:{success:!0,data:u.value}},Fz=Mc(Cc),zc=e=>async(t,r,s)=>{const o=s?Object.assign(s,{async:!0}):{async:!0};let u=t._zod.run({value:r,issues:[]},o);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(f=>Ss(f,o,_s())))}:{success:!0,data:u.value}},$z=zc(Cc),qz=e=>(t,r,s)=>{const o=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return Rc(e)(t,r,o)},Gz=e=>(t,r,s)=>Rc(e)(t,r,s),Xz=e=>async(t,r,s)=>{const o=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return Nc(e)(t,r,o)},Iz=e=>async(t,r,s)=>Nc(e)(t,r,s),Qz=e=>(t,r,s)=>{const o=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return Mc(e)(t,r,o)},Wz=e=>(t,r,s)=>Mc(e)(t,r,s),Pz=e=>async(t,r,s)=>{const o=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return zc(e)(t,r,o)},Kz=e=>async(t,r,s)=>zc(e)(t,r,s),Jz=/^[cC][^\s-]{8,}$/,ek=/^[0-9a-z]+$/,tk=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,nk=/^[0-9a-vA-V]{20}$/,ak=/^[A-Za-z0-9]{27}$/,rk=/^[a-zA-Z0-9_-]{21}$/,sk=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ik=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,bb=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,lk=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ok="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function uk(){return new RegExp(ok,"u")}const ck=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,fk=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,dk=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,hk=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,mk=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,QS=/^[A-Za-z0-9_-]*$/,pk=/^\+(?:[0-9]){6,14}[0-9]$/,WS="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",gk=new RegExp(`^${WS}$`);function PS(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function yk(e){return new RegExp(`^${PS(e)}$`)}function vk(e){const t=PS({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const s=`${t}(?:${r.join("|")})`;return new RegExp(`^${WS}T(?:${s})$`)}const bk=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},_k=/^[^A-Z]*$/,Sk=/^[^a-z]*$/,Ma=ne("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),wk=ne("$ZodCheckMaxLength",(e,t)=>{var r;Ma.init(e,t),(r=e._zod.def).when??(r.when=s=>{const o=s.value;return!Qm(o)&&o.length!==void 0}),e._zod.onattach.push(s=>{const o=s._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum{const o=s.value;if(o.length<=t.maximum)return;const f=Pm(o);s.issues.push({origin:f,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),xk=ne("$ZodCheckMinLength",(e,t)=>{var r;Ma.init(e,t),(r=e._zod.def).when??(r.when=s=>{const o=s.value;return!Qm(o)&&o.length!==void 0}),e._zod.onattach.push(s=>{const o=s._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(s._zod.bag.minimum=t.minimum)}),e._zod.check=s=>{const o=s.value;if(o.length>=t.minimum)return;const f=Pm(o);s.issues.push({origin:f,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Ek=ne("$ZodCheckLengthEquals",(e,t)=>{var r;Ma.init(e,t),(r=e._zod.def).when??(r.when=s=>{const o=s.value;return!Qm(o)&&o.length!==void 0}),e._zod.onattach.push(s=>{const o=s._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=s=>{const o=s.value,u=o.length;if(u===t.length)return;const f=Pm(o),h=u>t.length;s.issues.push({origin:f,...h?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:s.value,inst:e,continue:!t.abort})}}),kc=ne("$ZodCheckStringFormat",(e,t)=>{var r,s;Ma.init(e,t),e._zod.onattach.push(o=>{const u=o._zod.bag;u.format=t.format,t.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(s=e._zod).check??(s.check=()=>{})}),Tk=ne("$ZodCheckRegex",(e,t)=>{kc.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ok=ne("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=_k),kc.init(e,t)}),Ak=ne("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Sk),kc.init(e,t)}),Dk=ne("$ZodCheckIncludes",(e,t)=>{Ma.init(e,t);const r=Dc(t.includes),s=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=s,e._zod.onattach.push(o=>{const u=o._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(s)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),Ck=ne("$ZodCheckStartsWith",(e,t)=>{Ma.init(e,t);const r=new RegExp(`^${Dc(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(s=>{const o=s._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=s=>{s.value.startsWith(t.prefix)||s.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:s.value,inst:e,continue:!t.abort})}}),Rk=ne("$ZodCheckEndsWith",(e,t)=>{Ma.init(e,t);const r=new RegExp(`.*${Dc(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(s=>{const o=s._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=s=>{s.value.endsWith(t.suffix)||s.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:s.value,inst:e,continue:!t.abort})}}),Nk=ne("$ZodCheckOverwrite",(e,t)=>{Ma.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class Mk{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const s=t.split(` +`+u):s.stack=u}catch{}}throw s}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=bs(this.defaults,r);const{transitional:s,paramsSerializer:o,headers:u}=r;s!==void 0&&Fu.assertOptions(s,{silentJSONParsing:Ea.transitional(Ea.boolean),forcedJSONParsing:Ea.transitional(Ea.boolean),clarifyTimeoutError:Ea.transitional(Ea.boolean)},!1),o!=null&&(Y.isFunction(o)?r.paramsSerializer={serialize:o}:Fu.assertOptions(o,{encode:Ea.function,serialize:Ea.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Fu.assertOptions(r,{baseUrl:Ea.spelling("baseURL"),withXsrfToken:Ea.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let f=u&&Y.merge(u.common,u[r.method]);u&&Y.forEach(["delete","get","head","post","put","patch","common"],T=>{delete u[T]}),r.headers=Cn.concat(f,u);const h=[];let p=!0;this.interceptors.request.forEach(function(x){typeof x.runWhen=="function"&&x.runWhen(r)===!1||(p=p&&x.synchronous,h.unshift(x.fulfilled,x.rejected))});const m=[];this.interceptors.response.forEach(function(x){m.push(x.fulfilled,x.rejected)});let v,g=0,_;if(!p){const T=[W0.bind(this),void 0];for(T.unshift(...h),T.push(...m),_=T.length,v=Promise.resolve(r);g<_;)v=v.then(T[g++],T[g++]);return v}_=h.length;let N=r;for(;g<_;){const T=h[g++],x=h[g++];try{N=T(N)}catch(O){x.call(this,O);break}}try{v=W0.call(this,N)}catch(T){return Promise.reject(T)}for(g=0,_=m.length;g<_;)v=v.then(m[g++],m[g++]);return v}getUri(t){t=bs(this.defaults,t);const r=vS(t.baseURL,t.url,t.allowAbsoluteUrls);return hS(r,t.params,t.paramsSerializer)}};Y.forEach(["delete","get","head","options"],function(t){gs.prototype[t]=function(r,s){return this.request(bs(s||{},{method:t,url:r,data:(s||{}).data}))}});Y.forEach(["post","put","patch"],function(t){function r(s){return function(u,f,h){return this.request(bs(h||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:u,data:f}))}}gs.prototype[t]=r(),gs.prototype[t+"Form"]=r(!0)});let r4=class xS{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(u){r=u});const s=this;this.promise.then(o=>{if(!s._listeners)return;let u=s._listeners.length;for(;u-- >0;)s._listeners[u](o);s._listeners=null}),this.promise.then=o=>{let u;const f=new Promise(h=>{s.subscribe(h),u=h}).then(o);return f.cancel=function(){s.unsubscribe(u)},f},t(function(u,f,h){s.reason||(s.reason=new Yi(u,f,h),r(s.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 r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=s=>{t.abort(s)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new xS(function(o){t=o}),cancel:t}}};function s4(e){return function(r){return e.apply(null,r)}}function i4(e){return Y.isObject(e)&&e.isAxiosError===!0}const Bh={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Bh).forEach(([e,t])=>{Bh[t]=e});function ES(e){const t=new gs(e),r=tS(gs.prototype.request,t);return Y.extend(r,gs.prototype,t,{allOwnKeys:!0}),Y.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return ES(bs(e,o))},r}const Dt=ES(ro);Dt.Axios=gs;Dt.CanceledError=Yi;Dt.CancelToken=r4;Dt.isCancel=gS;Dt.VERSION=wS;Dt.toFormData=Ec;Dt.AxiosError=je;Dt.Cancel=Dt.CanceledError;Dt.all=function(t){return Promise.all(t)};Dt.spread=s4;Dt.isAxiosError=i4;Dt.mergeConfig=bs;Dt.AxiosHeaders=Cn;Dt.formToJSON=e=>pS(Y.isHTMLForm(e)?new FormData(e):e);Dt.getAdapter=SS.getAdapter;Dt.HttpStatusCode=Bh;Dt.default=Dt;const{Axios:J5,AxiosError:ej,CanceledError:tj,isCancel:nj,CancelToken:aj,VERSION:rj,all:sj,Cancel:ij,isAxiosError:lj,spread:oj,toFormData:uj,AxiosHeaders:cj,HttpStatusCode:fj,formToJSON:dj,getAdapter:hj,mergeConfig:mj}=Dt,bi=Dt.create({baseURL:"/au/checkin"});class l4{async logs(){return await bi({method:"GET",url:"logs"})}async users(){return await bi({method:"GET",url:"users"})}async register({file:t,user:r}){const s=new FormData;s.append("file",t,"frame.jpg");for(const[o,u]of Object.entries(r))s.append(o,u);return await bi({headers:{"Content-Type":"multipart/form-data"},method:"POST",url:"/register",data:s})}async registerSimple({user:t}){const r=new FormData;for(const[s,o]of Object.entries(t))r.append(s,o);return await bi({headers:{"Content-Type":"multipart/form-data"},method:"POST",url:"/register-simple",data:r})}async deleteUser(t){return await bi({method:"DELETE",url:`/users/${t}`})}async checkin({file:t}){const r=new FormData;return r.append("file",t,"frame.jpg"),await bi({headers:{"Content-Type":"multipart/form-data"},method:"POST",url:"/checkin",data:r})}}const Ni=new l4;function o4(e,t=[]){let r=[];function s(u,f){const h=w.createContext(f);h.displayName=u+"Context";const p=r.length;r=[...r,f];const m=g=>{const{scope:_,children:N,...T}=g,x=_?.[e]?.[p]||h,O=w.useMemo(()=>T,Object.values(T));return S.jsx(x.Provider,{value:O,children:N})};m.displayName=u+"Provider";function v(g,_){const N=_?.[e]?.[p]||h,T=w.useContext(N);if(T)return T;if(f!==void 0)return f;throw new Error(`\`${g}\` must be used within \`${u}\``)}return[m,v]}const o=()=>{const u=r.map(f=>w.createContext(f));return function(h){const p=h?.[e]||u;return w.useMemo(()=>({[`__scope${e}`]:{...h,[e]:p}}),[h,p])}};return o.scopeName=e,[s,u4(o,...t)]}function u4(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const s=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(u){const f=s.reduce((h,{useScope:p,scopeName:m})=>{const g=p(u)[`__scope${m}`];return{...h,...g}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:f}),[f])}};return r.scopeName=t.scopeName,r}var c4=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ym=c4.reduce((e,t)=>{const r=Nm(`Primitive.${t}`),s=w.forwardRef((o,u)=>{const{asChild:f,...h}=o,p=f?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(p,{...h,ref:u})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{}),yh={exports:{}},vh={};var K0;function f4(){if(K0)return vh;K0=1;var e=Xl();function t(g,_){return g===_&&(g!==0||1/g===1/_)||g!==g&&_!==_}var r=typeof Object.is=="function"?Object.is:t,s=e.useState,o=e.useEffect,u=e.useLayoutEffect,f=e.useDebugValue;function h(g,_){var N=_(),T=s({inst:{value:N,getSnapshot:_}}),x=T[0].inst,O=T[1];return u(function(){x.value=N,x.getSnapshot=_,p(x)&&O({inst:x})},[g,N,_]),o(function(){return p(x)&&O({inst:x}),g(function(){p(x)&&O({inst:x})})},[g]),f(N),N}function p(g){var _=g.getSnapshot;g=g.value;try{var N=_();return!r(g,N)}catch{return!0}}function m(g,_){return _()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:h;return vh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,vh}var J0;function d4(){return J0||(J0=1,yh.exports=f4()),yh.exports}var h4=d4();function m4(){return h4.useSyncExternalStore(p4,()=>!0,()=>!1)}function p4(){return()=>{}}var Hm="Avatar",[g4]=o4(Hm),[y4,TS]=g4(Hm),OS=w.forwardRef((e,t)=>{const{__scopeAvatar:r,...s}=e,[o,u]=w.useState("idle");return S.jsx(y4,{scope:r,imageLoadingStatus:o,onImageLoadingStatusChange:u,children:S.jsx(Ym.span,{...s,ref:t})})});OS.displayName=Hm;var AS="AvatarImage",DS=w.forwardRef((e,t)=>{const{__scopeAvatar:r,src:s,onLoadingStatusChange:o=()=>{},...u}=e,f=TS(AS,r),h=v4(s,u),p=ys(m=>{o(m),f.onImageLoadingStatusChange(m)});return Fr(()=>{h!=="idle"&&p(h)},[h,p]),h==="loaded"?S.jsx(Ym.img,{...u,ref:t,src:s}):null});DS.displayName=AS;var CS="AvatarFallback",RS=w.forwardRef((e,t)=>{const{__scopeAvatar:r,delayMs:s,...o}=e,u=TS(CS,r),[f,h]=w.useState(s===void 0);return w.useEffect(()=>{if(s!==void 0){const p=window.setTimeout(()=>h(!0),s);return()=>window.clearTimeout(p)}},[s]),f&&u.imageLoadingStatus!=="loaded"?S.jsx(Ym.span,{...o,ref:t}):null});RS.displayName=CS;function eb(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function v4(e,{referrerPolicy:t,crossOrigin:r}){const s=m4(),o=w.useRef(null),u=s?(o.current||(o.current=new window.Image),o.current):null,[f,h]=w.useState(()=>eb(u,e));return Fr(()=>{h(eb(u,e))},[u,e]),Fr(()=>{const p=g=>()=>{h(g)};if(!u)return;const m=p("loaded"),v=p("error");return u.addEventListener("load",m),u.addEventListener("error",v),t&&(u.referrerPolicy=t),typeof r=="string"&&(u.crossOrigin=r),()=>{u.removeEventListener("load",m),u.removeEventListener("error",v)}},[u,r,t]),f}var b4=OS,_4=DS,S4=RS;function w4(e){const t=Qe.c(8);let r,s;t[0]!==e?({className:r,...s}=e,t[0]=e,t[1]=r,t[2]=s):(r=t[1],s=t[2]);let o;t[3]!==r?(o=ot("relative flex size-8 shrink-0 overflow-hidden rounded-full",r),t[3]=r,t[4]=o):o=t[4];let u;return t[5]!==s||t[6]!==o?(u=S.jsx(b4,{"data-slot":"avatar",className:o,...s}),t[5]=s,t[6]=o,t[7]=u):u=t[7],u}function x4(e){const t=Qe.c(8);let r,s;t[0]!==e?({className:r,...s}=e,t[0]=e,t[1]=r,t[2]=s):(r=t[1],s=t[2]);let o;t[3]!==r?(o=ot("aspect-square size-full",r),t[3]=r,t[4]=o):o=t[4];let u;return t[5]!==s||t[6]!==o?(u=S.jsx(_4,{"data-slot":"avatar-image",className:o,...s}),t[5]=s,t[6]=o,t[7]=u):u=t[7],u}function E4(e){const t=Qe.c(8);let r,s;t[0]!==e?({className:r,...s}=e,t[0]=e,t[1]=r,t[2]=s):(r=t[1],s=t[2]);let o;t[3]!==r?(o=ot("bg-muted flex size-full items-center justify-center rounded-full",r),t[3]=r,t[4]=o):o=t[4];let u;return t[5]!==s||t[6]!==o?(u=S.jsx(S4,{"data-slot":"avatar-fallback",className:o,...s}),t[5]=s,t[6]=o,t[7]=u):u=t[7],u}const NS=z_(e=>({currentUser:null,setCurrentUser:t=>e(()=>({currentUser:t}))}));function T4(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const O4=e=>{switch(e){case"success":return C4;case"info":return N4;case"warning":return R4;case"error":return M4;default:return null}},A4=Array(12).fill(0),D4=({visible:e,className:t})=>Z.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Z.createElement("div",{className:"sonner-spinner"},A4.map((r,s)=>Z.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),C4=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Z.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),R4=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Z.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),N4=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Z.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),M4=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Z.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),z4=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Z.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Z.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),k4=()=>{const[e,t]=Z.useState(document.hidden);return Z.useEffect(()=>{const r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e};let Zh=1;class j4{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const r=this.subscribers.indexOf(t);this.subscribers.splice(r,1)}),this.publish=t=>{this.subscribers.forEach(r=>r(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var r;const{message:s,...o}=t,u=typeof t?.id=="number"||((r=t.id)==null?void 0:r.length)>0?t.id:Zh++,f=this.toasts.find(p=>p.id===u),h=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(u)&&this.dismissedToasts.delete(u),f?this.toasts=this.toasts.map(p=>p.id===u?(this.publish({...p,...t,id:u,title:s}),{...p,...t,id:u,dismissible:h,title:s}):p):this.addToast({title:s,...o,dismissible:h,id:u}),u},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:t,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(s=>s({id:r.id,dismiss:!0}))}),t),this.message=(t,r)=>this.create({...r,message:t}),this.error=(t,r)=>this.create({...r,message:t,type:"error"}),this.success=(t,r)=>this.create({...r,type:"success",message:t}),this.info=(t,r)=>this.create({...r,type:"info",message:t}),this.warning=(t,r)=>this.create({...r,type:"warning",message:t}),this.loading=(t,r)=>this.create({...r,type:"loading",message:t}),this.promise=(t,r)=>{if(!r)return;let s;r.loading!==void 0&&(s=this.create({...r,promise:t,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const o=Promise.resolve(t instanceof Function?t():t);let u=s!==void 0,f;const h=o.then(async m=>{if(f=["resolve",m],Z.isValidElement(m))u=!1,this.create({id:s,type:"default",message:m});else if(L4(m)&&!m.ok){u=!1;const g=typeof r.error=="function"?await r.error(`HTTP error! status: ${m.status}`):r.error,_=typeof r.description=="function"?await r.description(`HTTP error! status: ${m.status}`):r.description,T=typeof g=="object"&&!Z.isValidElement(g)?g:{message:g};this.create({id:s,type:"error",description:_,...T})}else if(m instanceof Error){u=!1;const g=typeof r.error=="function"?await r.error(m):r.error,_=typeof r.description=="function"?await r.description(m):r.description,T=typeof g=="object"&&!Z.isValidElement(g)?g:{message:g};this.create({id:s,type:"error",description:_,...T})}else if(r.success!==void 0){u=!1;const g=typeof r.success=="function"?await r.success(m):r.success,_=typeof r.description=="function"?await r.description(m):r.description,T=typeof g=="object"&&!Z.isValidElement(g)?g:{message:g};this.create({id:s,type:"success",description:_,...T})}}).catch(async m=>{if(f=["reject",m],r.error!==void 0){u=!1;const v=typeof r.error=="function"?await r.error(m):r.error,g=typeof r.description=="function"?await r.description(m):r.description,N=typeof v=="object"&&!Z.isValidElement(v)?v:{message:v};this.create({id:s,type:"error",description:g,...N})}}).finally(()=>{u&&(this.dismiss(s),s=void 0),r.finally==null||r.finally.call(r)}),p=()=>new Promise((m,v)=>h.then(()=>f[0]==="reject"?v(f[1]):m(f[1])).catch(v));return typeof s!="string"&&typeof s!="number"?{unwrap:p}:Object.assign(s,{unwrap:p})},this.custom=(t,r)=>{const s=r?.id||Zh++;return this.create({jsx:t(s),id:s,...r}),s},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const On=new j4,U4=(e,t)=>{const r=t?.id||Zh++;return On.addToast({title:e,...t,id:r}),r},L4=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Y4=U4,H4=()=>On.toasts,V4=()=>On.getActiveToasts(),la=Object.assign(Y4,{success:On.success,info:On.info,warning:On.warning,error:On.error,custom:On.custom,message:On.message,promise:On.promise,dismiss:On.dismiss,loading:On.loading},{getHistory:H4,getToasts:V4});T4("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Cu(e){return e.label!==void 0}const B4=3,Z4="24px",F4="16px",tb=4e3,$4=356,q4=14,G4=45,X4=200;function Ta(...e){return e.filter(Boolean).join(" ")}function I4(e){const[t,r]=e.split("-"),s=[];return t&&s.push(t),r&&s.push(r),s}const Q4=e=>{var t,r,s,o,u,f,h,p,m;const{invert:v,toast:g,unstyled:_,interacting:N,setHeights:T,visibleToasts:x,heights:O,index:z,toasts:X,expanded:q,removeToast:B,defaultRichColors:J,closeButton:ie,style:P,cancelButtonStyle:te,actionButtonStyle:_e,className:Ue="",descriptionClassName:Ce="",duration:ce,position:he,gap:Ee,expandByDefault:Te,classNames:R,icons:K,closeButtonAriaLabel:I="Close toast"}=e,[Ae,De]=Z.useState(null),[A,$]=Z.useState(null),[F,ee]=Z.useState(!1),[oe,Se]=Z.useState(!1),[be,Re]=Z.useState(!1),[Ve,jt]=Z.useState(!1),[un,Ft]=Z.useState(!1),[Ts,hn]=Z.useState(0),[cr,fr]=Z.useState(0),za=Z.useRef(g.duration||ce||tb),Os=Z.useRef(null),an=Z.useRef(null),D=z===0,U=z+1<=x,V=g.type,le=g.dismissible!==!1,ae=g.className||"",se=g.descriptionClassName||"",ye=Z.useMemo(()=>O.findIndex(Ne=>Ne.toastId===g.id)||0,[O,g.id]),Xe=Z.useMemo(()=>{var Ne;return(Ne=g.closeButton)!=null?Ne:ie},[g.closeButton,ie]),Ie=Z.useMemo(()=>g.duration||ce||tb,[g.duration,ce]),$t=Z.useRef(0),mn=Z.useRef(0),Rn=Z.useRef(0),ya=Z.useRef(null),[na,Ut]=he.split("-"),Nn=Z.useMemo(()=>O.reduce((Ne,gt,qt)=>qt>=ye?Ne:Ne+gt.height,0),[O,ye]),Lt=k4(),Vi=g.invert||v,dr=V==="loading";mn.current=Z.useMemo(()=>ye*Ee+Nn,[ye,Nn]),Z.useEffect(()=>{za.current=Ie},[Ie]),Z.useEffect(()=>{ee(!0)},[]),Z.useEffect(()=>{const Ne=an.current;if(Ne){const gt=Ne.getBoundingClientRect().height;return fr(gt),T(qt=>[{toastId:g.id,height:gt,position:g.position},...qt]),()=>T(qt=>qt.filter(rn=>rn.toastId!==g.id))}},[T,g.id]),Z.useLayoutEffect(()=>{if(!F)return;const Ne=an.current,gt=Ne.style.height;Ne.style.height="auto";const qt=Ne.getBoundingClientRect().height;Ne.style.height=gt,fr(qt),T(rn=>rn.find(_t=>_t.toastId===g.id)?rn.map(_t=>_t.toastId===g.id?{..._t,height:qt}:_t):[{toastId:g.id,height:qt,position:g.position},...rn])},[F,g.title,g.description,T,g.id,g.jsx,g.action,g.cancel]);const va=Z.useCallback(()=>{Se(!0),hn(mn.current),T(Ne=>Ne.filter(gt=>gt.toastId!==g.id)),setTimeout(()=>{B(g)},X4)},[g,B,T,mn]);Z.useEffect(()=>{if(g.promise&&V==="loading"||g.duration===1/0||g.type==="loading")return;let Ne;return q||N||Lt?(()=>{if(Rn.current<$t.current){const rn=new Date().getTime()-$t.current;za.current=za.current-rn}Rn.current=new Date().getTime()})():(()=>{za.current!==1/0&&($t.current=new Date().getTime(),Ne=setTimeout(()=>{g.onAutoClose==null||g.onAutoClose.call(g,g),va()},za.current))})(),()=>clearTimeout(Ne)},[q,N,g,V,Lt,va]),Z.useEffect(()=>{g.delete&&(va(),g.onDismiss==null||g.onDismiss.call(g,g))},[va,g.delete]);function As(){var Ne;if(K?.loading){var gt;return Z.createElement("div",{className:Ta(R?.loader,g==null||(gt=g.classNames)==null?void 0:gt.loader,"sonner-loader"),"data-visible":V==="loading"},K.loading)}return Z.createElement(D4,{className:Ta(R?.loader,g==null||(Ne=g.classNames)==null?void 0:Ne.loader),visible:V==="loading"})}const Ds=g.icon||K?.[V]||O4(V);var qr,ba;return Z.createElement("li",{tabIndex:0,ref:an,className:Ta(Ue,ae,R?.toast,g==null||(t=g.classNames)==null?void 0:t.toast,R?.default,R?.[V],g==null||(r=g.classNames)==null?void 0:r[V]),"data-sonner-toast":"","data-rich-colors":(qr=g.richColors)!=null?qr:J,"data-styled":!(g.jsx||g.unstyled||_),"data-mounted":F,"data-promise":!!g.promise,"data-swiped":un,"data-removed":oe,"data-visible":U,"data-y-position":na,"data-x-position":Ut,"data-index":z,"data-front":D,"data-swiping":be,"data-dismissible":le,"data-type":V,"data-invert":Vi,"data-swipe-out":Ve,"data-swipe-direction":A,"data-expanded":!!(q||Te&&F),"data-testid":g.testId,style:{"--index":z,"--toasts-before":z,"--z-index":X.length-z,"--offset":`${oe?Ts:mn.current}px`,"--initial-height":Te?"auto":`${cr}px`,...P,...g.style},onDragEnd:()=>{Re(!1),De(null),ya.current=null},onPointerDown:Ne=>{Ne.button!==2&&(dr||!le||(Os.current=new Date,hn(mn.current),Ne.target.setPointerCapture(Ne.pointerId),Ne.target.tagName!=="BUTTON"&&(Re(!0),ya.current={x:Ne.clientX,y:Ne.clientY})))},onPointerUp:()=>{var Ne,gt,qt;if(Ve||!le)return;ya.current=null;const rn=Number(((Ne=an.current)==null?void 0:Ne.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),hr=Number(((gt=an.current)==null?void 0:gt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),_t=new Date().getTime()-((qt=Os.current)==null?void 0:qt.getTime()),pn=Ae==="x"?rn:hr,Gr=Math.abs(pn)/_t;if(Math.abs(pn)>=G4||Gr>.11){hn(mn.current),g.onDismiss==null||g.onDismiss.call(g,g),$(Ae==="x"?rn>0?"right":"left":hr>0?"down":"up"),va(),jt(!0);return}else{var gn,yn;(gn=an.current)==null||gn.style.setProperty("--swipe-amount-x","0px"),(yn=an.current)==null||yn.style.setProperty("--swipe-amount-y","0px")}Ft(!1),Re(!1),De(null)},onPointerMove:Ne=>{var gt,qt,rn;if(!ya.current||!le||((gt=window.getSelection())==null?void 0:gt.toString().length)>0)return;const _t=Ne.clientY-ya.current.y,pn=Ne.clientX-ya.current.x;var Gr;const gn=(Gr=e.swipeDirections)!=null?Gr:I4(he);!Ae&&(Math.abs(pn)>1||Math.abs(_t)>1)&&De(Math.abs(pn)>Math.abs(_t)?"x":"y");let yn={x:0,y:0};const Cs=aa=>1/(1.5+Math.abs(aa)/20);if(Ae==="y"){if(gn.includes("top")||gn.includes("bottom"))if(gn.includes("top")&&_t<0||gn.includes("bottom")&&_t>0)yn.y=_t;else{const aa=_t*Cs(_t);yn.y=Math.abs(aa)0)yn.x=pn;else{const aa=pn*Cs(pn);yn.x=Math.abs(aa)0||Math.abs(yn.y)>0)&&Ft(!0),(qt=an.current)==null||qt.style.setProperty("--swipe-amount-x",`${yn.x}px`),(rn=an.current)==null||rn.style.setProperty("--swipe-amount-y",`${yn.y}px`)}},Xe&&!g.jsx&&V!=="loading"?Z.createElement("button",{"aria-label":I,"data-disabled":dr,"data-close-button":!0,onClick:dr||!le?()=>{}:()=>{va(),g.onDismiss==null||g.onDismiss.call(g,g)},className:Ta(R?.closeButton,g==null||(s=g.classNames)==null?void 0:s.closeButton)},(ba=K?.close)!=null?ba:z4):null,(V||g.icon||g.promise)&&g.icon!==null&&(K?.[V]!==null||g.icon)?Z.createElement("div",{"data-icon":"",className:Ta(R?.icon,g==null||(o=g.classNames)==null?void 0:o.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||As():null,g.type!=="loading"?Ds:null):null,Z.createElement("div",{"data-content":"",className:Ta(R?.content,g==null||(u=g.classNames)==null?void 0:u.content)},Z.createElement("div",{"data-title":"",className:Ta(R?.title,g==null||(f=g.classNames)==null?void 0:f.title)},g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title),g.description?Z.createElement("div",{"data-description":"",className:Ta(Ce,se,R?.description,g==null||(h=g.classNames)==null?void 0:h.description)},typeof g.description=="function"?g.description():g.description):null),Z.isValidElement(g.cancel)?g.cancel:g.cancel&&Cu(g.cancel)?Z.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||te,onClick:Ne=>{Cu(g.cancel)&&le&&(g.cancel.onClick==null||g.cancel.onClick.call(g.cancel,Ne),va())},className:Ta(R?.cancelButton,g==null||(p=g.classNames)==null?void 0:p.cancelButton)},g.cancel.label):null,Z.isValidElement(g.action)?g.action:g.action&&Cu(g.action)?Z.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||_e,onClick:Ne=>{Cu(g.action)&&(g.action.onClick==null||g.action.onClick.call(g.action,Ne),!Ne.defaultPrevented&&va())},className:Ta(R?.actionButton,g==null||(m=g.classNames)==null?void 0:m.actionButton)},g.action.label):null)};function nb(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function W4(e,t){const r={};return[e,t].forEach((s,o)=>{const u=o===1,f=u?"--mobile-offset":"--offset",h=u?F4:Z4;function p(m){["top","right","bottom","left"].forEach(v=>{r[`${f}-${v}`]=typeof m=="number"?`${m}px`:m})}typeof s=="number"||typeof s=="string"?p(s):typeof s=="object"?["top","right","bottom","left"].forEach(m=>{s[m]===void 0?r[`${f}-${m}`]=h:r[`${f}-${m}`]=typeof s[m]=="number"?`${s[m]}px`:s[m]}):p(h)}),r}const P4=Z.forwardRef(function(t,r){const{id:s,invert:o,position:u="bottom-right",hotkey:f=["altKey","KeyT"],expand:h,closeButton:p,className:m,offset:v,mobileOffset:g,theme:_="light",richColors:N,duration:T,style:x,visibleToasts:O=B4,toastOptions:z,dir:X=nb(),gap:q=q4,icons:B,containerAriaLabel:J="Notifications"}=t,[ie,P]=Z.useState([]),te=Z.useMemo(()=>s?ie.filter(F=>F.toasterId===s):ie.filter(F=>!F.toasterId),[ie,s]),_e=Z.useMemo(()=>Array.from(new Set([u].concat(te.filter(F=>F.position).map(F=>F.position)))),[te,u]),[Ue,Ce]=Z.useState([]),[ce,he]=Z.useState(!1),[Ee,Te]=Z.useState(!1),[R,K]=Z.useState(_!=="system"?_:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),I=Z.useRef(null),Ae=f.join("+").replace(/Key/g,"").replace(/Digit/g,""),De=Z.useRef(null),A=Z.useRef(!1),$=Z.useCallback(F=>{P(ee=>{var oe;return(oe=ee.find(Se=>Se.id===F.id))!=null&&oe.delete||On.dismiss(F.id),ee.filter(({id:Se})=>Se!==F.id)})},[]);return Z.useEffect(()=>On.subscribe(F=>{if(F.dismiss){requestAnimationFrame(()=>{P(ee=>ee.map(oe=>oe.id===F.id?{...oe,delete:!0}:oe))});return}setTimeout(()=>{Hb.flushSync(()=>{P(ee=>{const oe=ee.findIndex(Se=>Se.id===F.id);return oe!==-1?[...ee.slice(0,oe),{...ee[oe],...F},...ee.slice(oe+1)]:[F,...ee]})})})}),[ie]),Z.useEffect(()=>{if(_!=="system"){K(_);return}if(_==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?K("dark"):K("light")),typeof window>"u")return;const F=window.matchMedia("(prefers-color-scheme: dark)");try{F.addEventListener("change",({matches:ee})=>{K(ee?"dark":"light")})}catch{F.addListener(({matches:oe})=>{try{K(oe?"dark":"light")}catch(Se){console.error(Se)}})}},[_]),Z.useEffect(()=>{ie.length<=1&&he(!1)},[ie]),Z.useEffect(()=>{const F=ee=>{var oe;if(f.every(Re=>ee[Re]||ee.code===Re)){var be;he(!0),(be=I.current)==null||be.focus()}ee.code==="Escape"&&(document.activeElement===I.current||(oe=I.current)!=null&&oe.contains(document.activeElement))&&he(!1)};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[f]),Z.useEffect(()=>{if(I.current)return()=>{De.current&&(De.current.focus({preventScroll:!0}),De.current=null,A.current=!1)}},[I.current]),Z.createElement("section",{ref:r,"aria-label":`${J} ${Ae}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},_e.map((F,ee)=>{var oe;const[Se,be]=F.split("-");return te.length?Z.createElement("ol",{key:F,dir:X==="auto"?nb():X,tabIndex:-1,ref:I,className:m,"data-sonner-toaster":!0,"data-sonner-theme":R,"data-y-position":Se,"data-x-position":be,style:{"--front-toast-height":`${((oe=Ue[0])==null?void 0:oe.height)||0}px`,"--width":`${$4}px`,"--gap":`${q}px`,...x,...W4(v,g)},onBlur:Re=>{A.current&&!Re.currentTarget.contains(Re.relatedTarget)&&(A.current=!1,De.current&&(De.current.focus({preventScroll:!0}),De.current=null))},onFocus:Re=>{Re.target instanceof HTMLElement&&Re.target.dataset.dismissible==="false"||A.current||(A.current=!0,De.current=Re.relatedTarget)},onMouseEnter:()=>he(!0),onMouseMove:()=>he(!0),onMouseLeave:()=>{Ee||he(!1)},onDragEnd:()=>he(!1),onPointerDown:Re=>{Re.target instanceof HTMLElement&&Re.target.dataset.dismissible==="false"||Te(!0)},onPointerUp:()=>Te(!1)},te.filter(Re=>!Re.position&&ee===0||Re.position===F).map((Re,Ve)=>{var jt,un;return Z.createElement(Q4,{key:Re.id,icons:B,index:Ve,toast:Re,defaultRichColors:N,duration:(jt=z?.duration)!=null?jt:T,className:z?.className,descriptionClassName:z?.descriptionClassName,invert:o,visibleToasts:O,closeButton:(un=z?.closeButton)!=null?un:p,interacting:Ee,position:F,style:z?.style,unstyled:z?.unstyled,classNames:z?.classNames,cancelButtonStyle:z?.cancelButtonStyle,actionButtonStyle:z?.actionButtonStyle,closeButtonAriaLabel:z?.closeButtonAriaLabel,removeToast:$,toasts:te.filter(Ft=>Ft.position==Re.position),heights:Ue.filter(Ft=>Ft.position==Re.position),setHeights:Ce,expandByDefault:h,gap:q,expanded:ce,swipeDirections:t.swipeDirections})})):null}))});function K4({value:e}){const[t,r]=w.useState([]),{currentUser:s,setCurrentUser:o}=NS(),{refreshUsers:u,setRefreshUsers:f}=lr(),h=M_(),p=async()=>{try{const{data:g}=await Ni.users();r(g)}catch(g){console.log(g)}},m=async(g,_)=>{if(_.stopPropagation(),!!await h({title:"Xóa người dùng",message:`Bạn có chắc muốn xóa "${g.name}"? Toàn bộ lịch sử điểm danh sẽ bị xóa theo.`,confirmText:"Xóa",cancelText:"Hủy",variant:"destructive"}))try{await Ni.deleteUser(g.id),la.success(`Đã xóa ${g.name}`),s?.id===g.id&&o(null),r(T=>T.filter(x=>x.id!==g.id))}catch{la.error("Xóa thất bại")}},v=g=>{s&&g.id===s.id?o(null):o(g)};return w.useEffect(()=>{p()},[]),w.useEffect(()=>{u&&(p(),f(!1))},[u]),S.jsxs(eS,{value:e,className:"flex-1 min-h-0 overflow-hidden",children:[S.jsx("div",{className:"flex flex-col gap-2 p-3 sm:p-4 space-y-2 overflow-y-auto h-full",children:t.map(g=>S.jsxs("div",{className:ot("flex items-center gap-2 sm:gap-3 p-3 sm:p-4 rounded-xl border shadow-sm bg-card cursor-pointer transition-all duration-200 hover:shadow-md hover:scale-[1.01] select-none",s?.id===g.id&&"bg-blue-50 dark:bg-blue-950 border-blue-500 shadow-md"),onClick:()=>v(g),children:[S.jsxs(w4,{className:"size-10 sm:size-12 shrink-0",children:[S.jsx(x4,{src:`https://ms.prology.net/image/storage/${g?.avatar}`||""}),S.jsx(E4,{children:g.name.charAt(0)})]}),S.jsxs("div",{className:"flex-1 min-w-0",children:[S.jsx("h4",{className:"font-semibold text-sm sm:text-base text-gray-900 dark:text-gray-100 truncate",children:g.name}),S.jsx("p",{className:"text-xs sm:text-sm text-gray-600 dark:text-gray-400 truncate",children:g.email})]}),S.jsx(nn,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 text-red-500 hover:text-red-700 hover:bg-red-50 dark:hover:bg-red-950",onClick:_=>m(g,_),children:S.jsx(QT,{className:"h-4 w-4"})})]},g.id))}),t.length<=0&&S.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-400",children:[S.jsx(S1,{className:"size-16 mb-3"}),S.jsx("p",{children:"Chưa có dữ liệu điểm danh"})]})]})}function J4(e){const t=Qe.c(12),{isSidebarOpen:r,onClose:s}=e,o=r?"translate-x-0":"-translate-x-full";let u;t[0]!==o?(u=ot("fixed left-0 top-0 h-screen w-[85vw] max-w-sm lg:w-96 lg:max-w-none bg-white border-r border-gray-200 shadow-xl transition-transform duration-300 ease-in-out z-30",o),t[0]=o,t[1]=u):u=t[1];let f;t[2]===Symbol.for("react.memo_cache_sentinel")?(f=S.jsx(K_,{className:"grid flex-1 grid-cols-1",children:S.jsxs(J_,{value:"users",className:"flex items-center gap-1 text-xs",children:[S.jsx(S1,{className:"size-3.5"}),"User"]})}),t[2]=f):f=t[2];let h;t[3]===Symbol.for("react.memo_cache_sentinel")?(h=S.jsx(nm,{className:"size-4"}),t[3]=h):h=t[3];let p;t[4]!==s?(p=S.jsxs("div",{className:"border-b p-3 sm:p-4 flex items-center gap-2",children:[f,S.jsx(nn,{variant:"ghost",size:"icon",className:"lg:hidden size-8 shrink-0",onClick:s,children:h})]}),t[4]=s,t[5]=p):p=t[5];let m;t[6]===Symbol.for("react.memo_cache_sentinel")?(m=S.jsx(K4,{value:"users"}),t[6]=m):m=t[6];let v;t[7]!==p?(v=S.jsx("div",{className:"h-full flex flex-col",children:S.jsxs(P_,{defaultValue:"users",className:"flex-1 flex flex-col min-h-0",children:[p,m]})}),t[7]=p,t[8]=v):v=t[8];let g;return t[9]!==u||t[10]!==v?(g=S.jsx("div",{className:u,children:v}),t[9]=u,t[10]=v,t[11]=g):g=t[11],g}const ez=R_("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function tz(e){const t=Qe.c(12);let r,s,o,u;t[0]!==e?({className:r,variant:u,asChild:o,...s}=e,t[0]=e,t[1]=r,t[2]=s,t[3]=o,t[4]=u):(r=t[1],s=t[2],o=t[3],u=t[4]);const h=(o===void 0?!1:o)?Mm:"span";let p;t[5]!==r||t[6]!==u?(p=ot(ez({variant:u}),r),t[5]=r,t[6]=u,t[7]=p):p=t[7];let m;return t[8]!==h||t[9]!==s||t[10]!==p?(m=S.jsx(h,{"data-slot":"badge",className:p,...s}),t[8]=h,t[9]=s,t[10]=p,t[11]=m):m=t[11],m}function nz({value:e}){const[t,r]=w.useState([]),{refreshLog:s,setRefreshLog:o}=lr(),u=async()=>{try{const{data:f}=await Ni.logs();r(f),o(!1)}catch(f){console.log(f)}};return w.useEffect(()=>{u()},[]),w.useEffect(()=>{s&&u()},[s]),S.jsx(eS,{value:e,className:"flex-1 min-h-0 overflow-hidden",children:S.jsx("div",{className:"flex flex-col gap-2 p-3 sm:p-4 space-y-2 overflow-y-auto h-full",children:t.length===0?S.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-400",children:[S.jsx(v1,{className:"size-16 mb-3"}),S.jsx("p",{children:"Chưa có dữ liệu điểm danh"})]}):t.map((f,h)=>S.jsxs("div",{className:ot("p-3 rounded-lg border transition-all duration-200",h===0?"bg-blue-50 border-blue-200":"bg-gray-50 border-gray-200"),children:[S.jsxs("div",{className:"flex items-center justify-between mb-1",children:[S.jsx("span",{className:"font-medium text-gray-900",children:f.name}),S.jsx(tz,{className:"capitalize",variant:f.status==="check out"?"destructive":"secondary",children:f.status})]}),S.jsx("p",{className:"text-sm text-gray-600",children:A_(f.time)})]},h))})})}function az(e){const t=Qe.c(14),{isSidebarOpen:r,onClose:s}=e,o=r?"translate-x-0":"translate-x-full";let u;t[0]!==o?(u=ot("fixed right-0 top-0 h-screen w-[85vw] max-w-sm lg:w-96 lg:max-w-none bg-white border-l border-gray-200 shadow-xl transition-transform duration-300 ease-in-out z-30",o),t[0]=o,t[1]=u):u=t[1];let f;t[2]===Symbol.for("react.memo_cache_sentinel")?(f=S.jsx(nm,{className:"size-4"}),t[2]=f):f=t[2];let h;t[3]!==s?(h=S.jsx(nn,{variant:"ghost",size:"icon",className:"lg:hidden size-8 shrink-0",onClick:s,children:f}),t[3]=s,t[4]=h):h=t[4];let p;t[5]===Symbol.for("react.memo_cache_sentinel")?(p=S.jsx(K_,{className:"grid flex-1 grid-cols-1",children:S.jsxs(J_,{value:"logs",className:"flex items-center gap-1 text-xs",children:[S.jsx(v1,{className:"size-3.5"}),"Log"]})}),t[5]=p):p=t[5];let m;t[6]!==h?(m=S.jsxs("div",{className:"border-b p-3 sm:p-4 flex items-center gap-2",children:[h,p]}),t[6]=h,t[7]=m):m=t[7];let v;t[8]===Symbol.for("react.memo_cache_sentinel")?(v=S.jsx(nz,{value:"logs"}),t[8]=v):v=t[8];let g;t[9]!==m?(g=S.jsx("div",{className:"h-full flex flex-col",children:S.jsxs(P_,{value:"logs",defaultValue:"features",className:"flex-1 flex flex-col min-h-0",children:[m,v]})}),t[9]=m,t[10]=g):g=t[10];let _;return t[11]!==u||t[12]!==g?(_=S.jsx("div",{className:u,children:g}),t[11]=u,t[12]=g,t[13]=_):_=t[13],_}function rz(e){const t=Qe.c(19),{children:r,onClose:s}=e,[o,u]=w.useState(!1),{setIsCountDown:f}=lr();let h;t[0]!==s?(h=()=>{u(!1),s?.()},t[0]=s,t[1]=h):h=t[1];const p=h;let m;t[2]!==p||t[3]!==f?(m=()=>{f(!0),p()},t[2]=p,t[3]=f,t[4]=m):m=t[4];const v=m;let g;t[5]!==r?(g=S.jsx(D_,{children:r}),t[5]=r,t[6]=g):g=t[6];let _;t[7]===Symbol.for("react.memo_cache_sentinel")?(_=S.jsxs(Dm,{children:[S.jsx("div",{className:"flex items-center justify-center mb-4",children:S.jsx("div",{className:"rounded-full border p-3",children:S.jsx(tm,{className:"w-6 h-6 "})})}),S.jsx(Cm,{className:"text-center text-lg",children:"Thông báo quan trọng"}),S.jsx(Rm,{className:"text-center text-base pt-2",children:"Để có kết quả tốt nhất bạn hay nhìn thẳng vào camera nhé"})]}),t[7]=_):_=t[7];let N;t[8]!==p?(N=S.jsx(nn,{variant:"outline",onClick:p,className:"min-w-32 bg-transparent",children:"Hủy"}),t[8]=p,t[9]=N):N=t[9];let T;t[10]!==v?(T=S.jsx(nn,{onClick:v,className:"min-w-32",children:"Tiếp tục"}),t[10]=v,t[11]=T):T=t[11];let x;t[12]!==N||t[13]!==T?(x=S.jsxs(Am,{className:"w-[95vw] max-w-md sm:max-w-md",children:[_,S.jsxs("div",{className:"flex justify-center gap-3 pt-4",children:[N,T]})]}),t[12]=N,t[13]=T,t[14]=x):x=t[14];let O;return t[15]!==o||t[16]!==g||t[17]!==x?(O=S.jsxs(Om,{open:o,onOpenChange:u,children:[g,x]}),t[15]=o,t[16]=g,t[17]=x,t[18]=O):O=t[18],O}var so=e=>e.type==="checkbox",ms=e=>e instanceof Date,An=e=>e==null;const MS=e=>typeof e=="object";var kt=e=>!An(e)&&!Array.isArray(e)&&MS(e)&&!ms(e),zS=e=>kt(e)&&e.target?so(e.target)?e.target.checked:e.target.value:e,sz=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,kS=(e,t)=>e.has(sz(t)),iz=e=>{const t=e.constructor&&e.constructor.prototype;return kt(t)&&t.hasOwnProperty("isPrototypeOf")},Vm=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Vt(e){let t;const r=Array.isArray(e),s=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(Vm&&(e instanceof Blob||s))&&(r||kt(e)))if(t=r?[]:Object.create(Object.getPrototypeOf(e)),!r&&!iz(e))t=e;else for(const o in e)e.hasOwnProperty(o)&&(t[o]=Vt(e[o]));else return e;return t}var Oc=e=>/^\w*$/.test(e),Et=e=>e===void 0,Bm=e=>Array.isArray(e)?e.filter(Boolean):[],Zm=e=>Bm(e.replace(/["|']|\]/g,"").split(/\.|\[/)),ue=(e,t,r)=>{if(!t||!kt(e))return r;const s=(Oc(t)?[t]:Zm(t)).reduce((o,u)=>An(o)?o:o[u],e);return Et(s)||s===e?Et(e[t])?r:e[t]:s},Hn=e=>typeof e=="boolean",rt=(e,t,r)=>{let s=-1;const o=Oc(t)?[t]:Zm(t),u=o.length,f=u-1;for(;++sZ.useContext(Fm),lz=e=>{const{children:t,...r}=e;return Z.createElement(Fm.Provider,{value:r},t)};var jS=(e,t,r,s=!0)=>{const o={defaultValues:t._defaultValues};for(const u in e)Object.defineProperty(o,u,{get:()=>{const f=u;return t._proxyFormState[f]!==oa.all&&(t._proxyFormState[f]=!s||oa.all),r&&(r[f]=!0),e[f]}});return o};const $m=typeof window<"u"?Z.useLayoutEffect:Z.useEffect;function US(e){const t=Ac(),{control:r=t.control,disabled:s,name:o,exact:u}=e||{},[f,h]=Z.useState(r._formState),p=Z.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return $m(()=>r._subscribe({name:o,formState:p.current,exact:u,callback:m=>{!s&&h({...r._formState,...m})}}),[o,s,u]),Z.useEffect(()=>{p.current.isValid&&r._setValid(!0)},[r]),Z.useMemo(()=>jS(f,r,p.current,!1),[f,r])}var Vn=e=>typeof e=="string",Fh=(e,t,r,s,o)=>Vn(e)?(s&&t.watch.add(e),ue(r,e,o)):Array.isArray(e)?e.map(u=>(s&&t.watch.add(u),ue(r,u))):(s&&(t.watchAll=!0),r),$h=e=>An(e)||!MS(e);function ua(e,t,r=new WeakSet){if($h(e)||$h(t))return Object.is(e,t);if(ms(e)&&ms(t))return e.getTime()===t.getTime();const s=Object.keys(e),o=Object.keys(t);if(s.length!==o.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const u of s){const f=e[u];if(!o.includes(u))return!1;if(u!=="ref"){const h=t[u];if(ms(f)&&ms(h)||kt(f)&&kt(h)||Array.isArray(f)&&Array.isArray(h)?!ua(f,h,r):!Object.is(f,h))return!1}}return!0}function oz(e){const t=Ac(),{control:r=t.control,name:s,defaultValue:o,disabled:u,exact:f,compute:h}=e||{},p=Z.useRef(o),m=Z.useRef(h),v=Z.useRef(void 0),g=Z.useRef(r),_=Z.useRef(s);m.current=h;const[N,T]=Z.useState(()=>{const B=r._getWatch(s,p.current);return m.current?m.current(B):B}),x=Z.useCallback(B=>{const J=Fh(s,r._names,B||r._formValues,!1,p.current);return m.current?m.current(J):J},[r._formValues,r._names,s]),O=Z.useCallback(B=>{if(!u){const J=Fh(s,r._names,B||r._formValues,!1,p.current);if(m.current){const ie=m.current(J);ua(ie,v.current)||(T(ie),v.current=ie)}else T(J)}},[r._formValues,r._names,u,s]);$m(()=>((g.current!==r||!ua(_.current,s))&&(g.current=r,_.current=s,O()),r._subscribe({name:s,formState:{values:!0},exact:f,callback:B=>{O(B.values)}})),[r,f,s,O]),Z.useEffect(()=>r._removeUnmounted());const z=g.current!==r,X=_.current,q=Z.useMemo(()=>{if(u)return null;const B=!z&&!ua(X,s);return z||B?x():null},[u,z,s,X,x]);return q!==null?q:N}function uz(e){const t=Ac(),{name:r,disabled:s,control:o=t.control,shouldUnregister:u,defaultValue:f,exact:h=!0}=e,p=kS(o._names.array,r),m=Z.useMemo(()=>ue(o._formValues,r,ue(o._defaultValues,r,f)),[o,r,f]),v=oz({control:o,name:r,defaultValue:m,exact:h}),g=US({control:o,name:r,exact:h}),_=Z.useRef(e),N=Z.useRef(void 0),T=Z.useRef(o.register(r,{...e.rules,value:v,...Hn(e.disabled)?{disabled:e.disabled}:{}}));_.current=e;const x=Z.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!ue(g.errors,r)},isDirty:{enumerable:!0,get:()=>!!ue(g.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!ue(g.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!ue(g.validatingFields,r)},error:{enumerable:!0,get:()=>ue(g.errors,r)}}),[g,r]),O=Z.useCallback(B=>T.current.onChange({target:{value:zS(B),name:r},type:ec.CHANGE}),[r]),z=Z.useCallback(()=>T.current.onBlur({target:{value:ue(o._formValues,r),name:r},type:ec.BLUR}),[r,o._formValues]),X=Z.useCallback(B=>{const J=ue(o._fields,r);J&&B&&(J._f.ref={focus:()=>B.focus&&B.focus(),select:()=>B.select&&B.select(),setCustomValidity:ie=>B.setCustomValidity(ie),reportValidity:()=>B.reportValidity()})},[o._fields,r]),q=Z.useMemo(()=>({name:r,value:v,...Hn(s)||g.disabled?{disabled:g.disabled||s}:{},onChange:O,onBlur:z,ref:X}),[r,s,g.disabled,O,z,X,v]);return Z.useEffect(()=>{const B=o._options.shouldUnregister||u,J=N.current;J&&J!==r&&!p&&o.unregister(J),o.register(r,{..._.current.rules,...Hn(_.current.disabled)?{disabled:_.current.disabled}:{}});const ie=(P,te)=>{const _e=ue(o._fields,P);_e&&_e._f&&(_e._f.mount=te)};if(ie(r,!0),B){const P=Vt(ue(o._options.defaultValues,r,_.current.defaultValue));rt(o._defaultValues,r,P),Et(ue(o._formValues,r))&&rt(o._formValues,r,P)}return!p&&o.register(r),N.current=r,()=>{(p?B&&!o._state.action:B)?o.unregister(r):ie(r,!1)}},[r,o,p,u]),Z.useEffect(()=>{o._setDisabledField({disabled:s,name:r})},[s,r,o]),Z.useMemo(()=>({field:q,formState:g,fieldState:x}),[q,g,x])}const cz=e=>e.render(uz(e));var qm=(e,t,r,s,o)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[s]:o||!0}}:{},Hl=e=>Array.isArray(e)?e:[e],ab=()=>{let e=[];return{get observers(){return e},next:o=>{for(const u of e)u.next&&u.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(u=>u!==o)}}),unsubscribe:()=>{e=[]}}};function LS(e,t){const r={};for(const s in e)if(e.hasOwnProperty(s)){const o=e[s],u=t[s];if(o&&kt(o)&&u){const f=LS(o,u);kt(f)&&(r[s]=f)}else e[s]&&(r[s]=u)}return r}var fn=e=>kt(e)&&!Object.keys(e).length,Gm=e=>e.type==="file",ca=e=>typeof e=="function",tc=e=>{if(!Vm)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},YS=e=>e.type==="select-multiple",Xm=e=>e.type==="radio",fz=e=>Xm(e)||so(e),bh=e=>tc(e)&&e.isConnected;function dz(e,t){const r=t.slice(0,-1).length;let s=0;for(;s{for(const t in e)if(ca(e[t]))return!0;return!1};function HS(e){return Array.isArray(e)||kt(e)&&!mz(e)}function qh(e,t={}){for(const r in e){const s=e[r];HS(s)?(t[r]=Array.isArray(s)?[]:{},qh(s,t[r])):Et(s)||(t[r]=!0)}return t}function wi(e,t,r){r||(r=qh(t));for(const s in e){const o=e[s];if(HS(o))Et(t)||$h(r[s])?r[s]=qh(o,Array.isArray(o)?[]:{}):wi(o,An(t)?{}:t[s],r[s]);else{const u=t[s];r[s]=!ua(o,u)}}return r}const rb={value:!1,isValid:!1},sb={value:!0,isValid:!0};var VS=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Et(e[0].attributes.value)?Et(e[0].value)||e[0].value===""?sb:{value:e[0].value,isValid:!0}:sb:rb}return rb},BS=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:s})=>Et(e)?e:t?e===""?NaN:e&&+e:r&&Vn(e)?new Date(e):s?s(e):e;const ib={isValid:!1,value:null};var ZS=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,ib):ib;function lb(e){const t=e.ref;return Gm(t)?t.files:Xm(t)?ZS(e.refs).value:YS(t)?[...t.selectedOptions].map(({value:r})=>r):so(t)?VS(e.refs).value:BS(Et(t.value)?e.ref.value:t.value,e)}var pz=(e,t,r,s)=>{const o={};for(const u of e){const f=ue(t,u);f&&rt(o,u,f._f)}return{criteriaMode:r,names:[...e],fields:o,shouldUseNativeValidation:s}},nc=e=>e instanceof RegExp,Ul=e=>Et(e)?e:nc(e)?e.source:kt(e)?nc(e.value)?e.value.source:e.value:e,ob=e=>({isOnSubmit:!e||e===oa.onSubmit,isOnBlur:e===oa.onBlur,isOnChange:e===oa.onChange,isOnAll:e===oa.all,isOnTouch:e===oa.onTouched});const ub="AsyncFunction";var gz=e=>!!e&&!!e.validate&&!!(ca(e.validate)&&e.validate.constructor.name===ub||kt(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===ub)),yz=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),cb=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(s=>e.startsWith(s)&&/^\.\w+/.test(e.slice(s.length))));const Vl=(e,t,r,s)=>{for(const o of r||Object.keys(e)){const u=ue(e,o);if(u){const{_f:f,...h}=u;if(f){if(f.refs&&f.refs[0]&&t(f.refs[0],o)&&!s)return!0;if(f.ref&&t(f.ref,f.name)&&!s)return!0;if(Vl(h,t))break}else if(kt(h)&&Vl(h,t))break}}};function fb(e,t,r){const s=ue(e,r);if(s||Oc(r))return{error:s,name:r};const o=r.split(".");for(;o.length;){const u=o.join("."),f=ue(t,u),h=ue(e,u);if(f&&!Array.isArray(f)&&r!==u)return{name:r};if(h&&h.type)return{name:u,error:h};if(h&&h.root&&h.root.type)return{name:`${u}.root`,error:h.root};o.pop()}return{name:r}}var vz=(e,t,r,s)=>{r(e);const{name:o,...u}=e;return fn(u)||Object.keys(u).length>=Object.keys(t).length||Object.keys(u).find(f=>t[f]===(!s||oa.all))},bz=(e,t,r)=>!e||!t||e===t||Hl(e).some(s=>s&&(r?s===t:s.startsWith(t)||t.startsWith(s))),_z=(e,t,r,s,o)=>o.isOnAll?!1:!r&&o.isOnTouch?!(t||e):(r?s.isOnBlur:o.isOnBlur)?!e:(r?s.isOnChange:o.isOnChange)?e:!0,Sz=(e,t)=>!Bm(ue(e,t)).length&&zt(e,t),wz=(e,t,r)=>{const s=Hl(ue(e,r));return rt(s,"root",t[r]),rt(e,r,s),e};function db(e,t,r="validate"){if(Vn(e)||Array.isArray(e)&&e.every(Vn)||Hn(e)&&!e)return{type:r,message:Vn(e)?e:"",ref:t}}var _i=e=>kt(e)&&!nc(e)?e:{value:e,message:""},hb=async(e,t,r,s,o,u)=>{const{ref:f,refs:h,required:p,maxLength:m,minLength:v,min:g,max:_,pattern:N,validate:T,name:x,valueAsNumber:O,mount:z}=e._f,X=ue(r,x);if(!z||t.has(x))return{};const q=h?h[0]:f,B=ce=>{o&&q.reportValidity&&(q.setCustomValidity(Hn(ce)?"":ce||""),q.reportValidity())},J={},ie=Xm(f),P=so(f),te=ie||P,_e=(O||Gm(f))&&Et(f.value)&&Et(X)||tc(f)&&f.value===""||X===""||Array.isArray(X)&&!X.length,Ue=qm.bind(null,x,s,J),Ce=(ce,he,Ee,Te=er.maxLength,R=er.minLength)=>{const K=ce?he:Ee;J[x]={type:ce?Te:R,message:K,ref:f,...Ue(ce?Te:R,K)}};if(u?!Array.isArray(X)||!X.length:p&&(!te&&(_e||An(X))||Hn(X)&&!X||P&&!VS(h).isValid||ie&&!ZS(h).isValid)){const{value:ce,message:he}=Vn(p)?{value:!!p,message:p}:_i(p);if(ce&&(J[x]={type:er.required,message:he,ref:q,...Ue(er.required,he)},!s))return B(he),J}if(!_e&&(!An(g)||!An(_))){let ce,he;const Ee=_i(_),Te=_i(g);if(!An(X)&&!isNaN(X)){const R=f.valueAsNumber||X&&+X;An(Ee.value)||(ce=R>Ee.value),An(Te.value)||(he=Rnew Date(new Date().toDateString()+" "+De),I=f.type=="time",Ae=f.type=="week";Vn(Ee.value)&&X&&(ce=I?K(X)>K(Ee.value):Ae?X>Ee.value:R>new Date(Ee.value)),Vn(Te.value)&&X&&(he=I?K(X)+ce.value,Te=!An(he.value)&&X.length<+he.value;if((Ee||Te)&&(Ce(Ee,ce.message,he.message),!s))return B(J[x].message),J}if(N&&!_e&&Vn(X)){const{value:ce,message:he}=_i(N);if(nc(ce)&&!X.match(ce)&&(J[x]={type:er.pattern,message:he,ref:f,...Ue(er.pattern,he)},!s))return B(he),J}if(T){if(ca(T)){const ce=await T(X,r),he=db(ce,q);if(he&&(J[x]={...he,...Ue(er.validate,he.message)},!s))return B(he.message),J}else if(kt(T)){let ce={};for(const he in T){if(!fn(ce)&&!s)break;const Ee=db(await T[he](X,r),q,he);Ee&&(ce={...Ee,...Ue(he,Ee.message)},B(Ee.message),s&&(J[x]=ce))}if(!fn(ce)&&(J[x]={ref:q,...ce},!s))return J}}return B(!0),J};const xz={mode:oa.onSubmit,reValidateMode:oa.onChange,shouldFocusError:!0};function Ez(e={}){let t={...xz,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:ca(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},s={},o=kt(t.defaultValues)||kt(t.values)?Vt(t.defaultValues||t.values)||{}:{},u=t.shouldUnregister?{}:Vt(o),f={action:!1,mount:!1,watch:!1},h={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},p,m=0;const v={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let g={...v};const _={array:ab(),state:ab()},N=t.criteriaMode===oa.all,T=D=>U=>{clearTimeout(m),m=setTimeout(D,U)},x=async D=>{if(!t.disabled&&(v.isValid||g.isValid||D)){const U=t.resolver?fn((await P()).errors):await _e(s,!0);U!==r.isValid&&_.state.next({isValid:U})}},O=(D,U)=>{!t.disabled&&(v.isValidating||v.validatingFields||g.isValidating||g.validatingFields)&&((D||Array.from(h.mount)).forEach(V=>{V&&(U?rt(r.validatingFields,V,U):zt(r.validatingFields,V))}),_.state.next({validatingFields:r.validatingFields,isValidating:!fn(r.validatingFields)}))},z=(D,U=[],V,le,ae=!0,se=!0)=>{if(le&&V&&!t.disabled){if(f.action=!0,se&&Array.isArray(ue(s,D))){const ye=V(ue(s,D),le.argA,le.argB);ae&&rt(s,D,ye)}if(se&&Array.isArray(ue(r.errors,D))){const ye=V(ue(r.errors,D),le.argA,le.argB);ae&&rt(r.errors,D,ye),Sz(r.errors,D)}if((v.touchedFields||g.touchedFields)&&se&&Array.isArray(ue(r.touchedFields,D))){const ye=V(ue(r.touchedFields,D),le.argA,le.argB);ae&&rt(r.touchedFields,D,ye)}(v.dirtyFields||g.dirtyFields)&&(r.dirtyFields=wi(o,u)),_.state.next({name:D,isDirty:Ce(D,U),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else rt(u,D,U)},X=(D,U)=>{rt(r.errors,D,U),_.state.next({errors:r.errors})},q=D=>{r.errors=D,_.state.next({errors:r.errors,isValid:!1})},B=(D,U,V,le)=>{const ae=ue(s,D);if(ae){const se=ue(u,D,Et(V)?ue(o,D):V);Et(se)||le&&le.defaultChecked||U?rt(u,D,U?se:lb(ae._f)):Ee(D,se),f.mount&&!f.action&&x()}},J=(D,U,V,le,ae)=>{let se=!1,ye=!1;const Xe={name:D};if(!t.disabled){if(!V||le){(v.isDirty||g.isDirty)&&(ye=r.isDirty,r.isDirty=Xe.isDirty=Ce(),se=ye!==Xe.isDirty);const Ie=ua(ue(o,D),U);ye=!!ue(r.dirtyFields,D),Ie?zt(r.dirtyFields,D):rt(r.dirtyFields,D,!0),Xe.dirtyFields=r.dirtyFields,se=se||(v.dirtyFields||g.dirtyFields)&&ye!==!Ie}if(V){const Ie=ue(r.touchedFields,D);Ie||(rt(r.touchedFields,D,V),Xe.touchedFields=r.touchedFields,se=se||(v.touchedFields||g.touchedFields)&&Ie!==V)}se&&ae&&_.state.next(Xe)}return se?Xe:{}},ie=(D,U,V,le)=>{const ae=ue(r.errors,D),se=(v.isValid||g.isValid)&&Hn(U)&&r.isValid!==U;if(t.delayError&&V?(p=T(()=>X(D,V)),p(t.delayError)):(clearTimeout(m),p=null,V?rt(r.errors,D,V):zt(r.errors,D)),(V?!ua(ae,V):ae)||!fn(le)||se){const ye={...le,...se&&Hn(U)?{isValid:U}:{},errors:r.errors,name:D};r={...r,...ye},_.state.next(ye)}},P=async D=>{O(D,!0);const U=await t.resolver(u,t.context,pz(D||h.mount,s,t.criteriaMode,t.shouldUseNativeValidation));return O(D),U},te=async D=>{const{errors:U}=await P(D);if(D)for(const V of D){const le=ue(U,V);le?rt(r.errors,V,le):zt(r.errors,V)}else r.errors=U;return U},_e=async(D,U,V={valid:!0})=>{for(const le in D){const ae=D[le];if(ae){const{_f:se,...ye}=ae;if(se){const Xe=h.array.has(se.name),Ie=ae._f&&gz(ae._f);Ie&&v.validatingFields&&O([se.name],!0);const $t=await hb(ae,h.disabled,u,N,t.shouldUseNativeValidation&&!U,Xe);if(Ie&&v.validatingFields&&O([se.name]),$t[se.name]&&(V.valid=!1,U))break;!U&&(ue($t,se.name)?Xe?wz(r.errors,$t,se.name):rt(r.errors,se.name,$t[se.name]):zt(r.errors,se.name))}!fn(ye)&&await _e(ye,U,V)}}return V.valid},Ue=()=>{for(const D of h.unMount){const U=ue(s,D);U&&(U._f.refs?U._f.refs.every(V=>!bh(V)):!bh(U._f.ref))&&be(D)}h.unMount=new Set},Ce=(D,U)=>!t.disabled&&(D&&U&&rt(u,D,U),!ua(De(),o)),ce=(D,U,V)=>Fh(D,h,{...f.mount?u:Et(U)?o:Vn(D)?{[D]:U}:U},V,U),he=D=>Bm(ue(f.mount?u:o,D,t.shouldUnregister?ue(o,D,[]):[])),Ee=(D,U,V={})=>{const le=ue(s,D);let ae=U;if(le){const se=le._f;se&&(!se.disabled&&rt(u,D,BS(U,se)),ae=tc(se.ref)&&An(U)?"":U,YS(se.ref)?[...se.ref.options].forEach(ye=>ye.selected=ae.includes(ye.value)):se.refs?so(se.ref)?se.refs.forEach(ye=>{(!ye.defaultChecked||!ye.disabled)&&(Array.isArray(ae)?ye.checked=!!ae.find(Xe=>Xe===ye.value):ye.checked=ae===ye.value||!!ae)}):se.refs.forEach(ye=>ye.checked=ye.value===ae):Gm(se.ref)?se.ref.value="":(se.ref.value=ae,se.ref.type||_.state.next({name:D,values:Vt(u)})))}(V.shouldDirty||V.shouldTouch)&&J(D,ae,V.shouldTouch,V.shouldDirty,!0),V.shouldValidate&&Ae(D)},Te=(D,U,V)=>{for(const le in U){if(!U.hasOwnProperty(le))return;const ae=U[le],se=D+"."+le,ye=ue(s,se);(h.array.has(D)||kt(ae)||ye&&!ye._f)&&!ms(ae)?Te(se,ae,V):Ee(se,ae,V)}},R=(D,U,V={})=>{const le=ue(s,D),ae=h.array.has(D),se=Vt(U);rt(u,D,se),ae?(_.array.next({name:D,values:Vt(u)}),(v.isDirty||v.dirtyFields||g.isDirty||g.dirtyFields)&&V.shouldDirty&&_.state.next({name:D,dirtyFields:wi(o,u),isDirty:Ce(D,se)})):le&&!le._f&&!An(se)?Te(D,se,V):Ee(D,se,V),cb(D,h)&&_.state.next({...r,name:D}),_.state.next({name:f.mount?D:void 0,values:Vt(u)})},K=async D=>{f.mount=!0;const U=D.target;let V=U.name,le=!0;const ae=ue(s,V),se=Ie=>{le=Number.isNaN(Ie)||ms(Ie)&&isNaN(Ie.getTime())||ua(Ie,ue(u,V,Ie))},ye=ob(t.mode),Xe=ob(t.reValidateMode);if(ae){let Ie,$t;const mn=U.type?lb(ae._f):zS(D),Rn=D.type===ec.BLUR||D.type===ec.FOCUS_OUT,ya=!yz(ae._f)&&!t.resolver&&!ue(r.errors,V)&&!ae._f.deps||_z(Rn,ue(r.touchedFields,V),r.isSubmitted,Xe,ye),na=cb(V,h,Rn);rt(u,V,mn),Rn?(!U||!U.readOnly)&&(ae._f.onBlur&&ae._f.onBlur(D),p&&p(0)):ae._f.onChange&&ae._f.onChange(D);const Ut=J(V,mn,Rn),Nn=!fn(Ut)||na;if(!Rn&&_.state.next({name:V,type:D.type,values:Vt(u)}),ya)return(v.isValid||g.isValid)&&(t.mode==="onBlur"?Rn&&x():Rn||x()),Nn&&_.state.next({name:V,...na?{}:Ut});if(!Rn&&na&&_.state.next({...r}),t.resolver){const{errors:Lt}=await P([V]);if(se(mn),le){const Vi=fb(r.errors,s,V),dr=fb(Lt,s,Vi.name||V);Ie=dr.error,V=dr.name,$t=fn(Lt)}}else O([V],!0),Ie=(await hb(ae,h.disabled,u,N,t.shouldUseNativeValidation))[V],O([V]),se(mn),le&&(Ie?$t=!1:(v.isValid||g.isValid)&&($t=await _e(s,!0)));le&&(ae._f.deps&&(!Array.isArray(ae._f.deps)||ae._f.deps.length>0)&&Ae(ae._f.deps),ie(V,$t,Ie,Ut))}},I=(D,U)=>{if(ue(r.errors,U)&&D.focus)return D.focus(),1},Ae=async(D,U={})=>{let V,le;const ae=Hl(D);if(t.resolver){const se=await te(Et(D)?D:ae);V=fn(se),le=D?!ae.some(ye=>ue(se,ye)):V}else D?(le=(await Promise.all(ae.map(async se=>{const ye=ue(s,se);return await _e(ye&&ye._f?{[se]:ye}:ye)}))).every(Boolean),!(!le&&!r.isValid)&&x()):le=V=await _e(s);return _.state.next({...!Vn(D)||(v.isValid||g.isValid)&&V!==r.isValid?{}:{name:D},...t.resolver||!D?{isValid:V}:{},errors:r.errors}),U.shouldFocus&&!le&&Vl(s,I,D?ae:h.mount),le},De=(D,U)=>{let V={...f.mount?u:o};return U&&(V=LS(U.dirtyFields?r.dirtyFields:r.touchedFields,V)),Et(D)?V:Vn(D)?ue(V,D):D.map(le=>ue(V,le))},A=(D,U)=>({invalid:!!ue((U||r).errors,D),isDirty:!!ue((U||r).dirtyFields,D),error:ue((U||r).errors,D),isValidating:!!ue(r.validatingFields,D),isTouched:!!ue((U||r).touchedFields,D)}),$=D=>{D&&Hl(D).forEach(U=>zt(r.errors,U)),_.state.next({errors:D?r.errors:{}})},F=(D,U,V)=>{const le=(ue(s,D,{_f:{}})._f||{}).ref,ae=ue(r.errors,D)||{},{ref:se,message:ye,type:Xe,...Ie}=ae;rt(r.errors,D,{...Ie,...U,ref:le}),_.state.next({name:D,errors:r.errors,isValid:!1}),V&&V.shouldFocus&&le&&le.focus&&le.focus()},ee=(D,U)=>ca(D)?_.state.subscribe({next:V=>"values"in V&&D(ce(void 0,U),V)}):ce(D,U,!0),oe=D=>_.state.subscribe({next:U=>{bz(D.name,U.name,D.exact)&&vz(U,D.formState||v,za,D.reRenderRoot)&&D.callback({values:{...u},...r,...U,defaultValues:o})}}).unsubscribe,Se=D=>(f.mount=!0,g={...g,...D.formState},oe({...D,formState:g})),be=(D,U={})=>{for(const V of D?Hl(D):h.mount)h.mount.delete(V),h.array.delete(V),U.keepValue||(zt(s,V),zt(u,V)),!U.keepError&&zt(r.errors,V),!U.keepDirty&&zt(r.dirtyFields,V),!U.keepTouched&&zt(r.touchedFields,V),!U.keepIsValidating&&zt(r.validatingFields,V),!t.shouldUnregister&&!U.keepDefaultValue&&zt(o,V);_.state.next({values:Vt(u)}),_.state.next({...r,...U.keepDirty?{isDirty:Ce()}:{}}),!U.keepIsValid&&x()},Re=({disabled:D,name:U})=>{(Hn(D)&&f.mount||D||h.disabled.has(U))&&(D?h.disabled.add(U):h.disabled.delete(U))},Ve=(D,U={})=>{let V=ue(s,D);const le=Hn(U.disabled)||Hn(t.disabled);return rt(s,D,{...V||{},_f:{...V&&V._f?V._f:{ref:{name:D}},name:D,mount:!0,...U}}),h.mount.add(D),V?Re({disabled:Hn(U.disabled)?U.disabled:t.disabled,name:D}):B(D,!0,U.value),{...le?{disabled:U.disabled||t.disabled}:{},...t.progressive?{required:!!U.required,min:Ul(U.min),max:Ul(U.max),minLength:Ul(U.minLength),maxLength:Ul(U.maxLength),pattern:Ul(U.pattern)}:{},name:D,onChange:K,onBlur:K,ref:ae=>{if(ae){Ve(D,U),V=ue(s,D);const se=Et(ae.value)&&ae.querySelectorAll&&ae.querySelectorAll("input,select,textarea")[0]||ae,ye=fz(se),Xe=V._f.refs||[];if(ye?Xe.find(Ie=>Ie===se):se===V._f.ref)return;rt(s,D,{_f:{...V._f,...ye?{refs:[...Xe.filter(bh),se,...Array.isArray(ue(o,D))?[{}]:[]],ref:{type:se.type,name:D}}:{ref:se}}}),B(D,!1,void 0,se)}else V=ue(s,D,{}),V._f&&(V._f.mount=!1),(t.shouldUnregister||U.shouldUnregister)&&!(kS(h.array,D)&&f.action)&&h.unMount.add(D)}}},jt=()=>t.shouldFocusError&&Vl(s,I,h.mount),un=D=>{Hn(D)&&(_.state.next({disabled:D}),Vl(s,(U,V)=>{const le=ue(s,V);le&&(U.disabled=le._f.disabled||D,Array.isArray(le._f.refs)&&le._f.refs.forEach(ae=>{ae.disabled=le._f.disabled||D}))},0,!1))},Ft=(D,U)=>async V=>{let le;V&&(V.preventDefault&&V.preventDefault(),V.persist&&V.persist());let ae=Vt(u);if(_.state.next({isSubmitting:!0}),t.resolver){const{errors:se,values:ye}=await P();r.errors=se,ae=Vt(ye)}else await _e(s);if(h.disabled.size)for(const se of h.disabled)zt(ae,se);if(zt(r.errors,"root"),fn(r.errors)){_.state.next({errors:{}});try{await D(ae,V)}catch(se){le=se}}else U&&await U({...r.errors},V),jt(),setTimeout(jt);if(_.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:fn(r.errors)&&!le,submitCount:r.submitCount+1,errors:r.errors}),le)throw le},Ts=(D,U={})=>{ue(s,D)&&(Et(U.defaultValue)?R(D,Vt(ue(o,D))):(R(D,U.defaultValue),rt(o,D,Vt(U.defaultValue))),U.keepTouched||zt(r.touchedFields,D),U.keepDirty||(zt(r.dirtyFields,D),r.isDirty=U.defaultValue?Ce(D,Vt(ue(o,D))):Ce()),U.keepError||(zt(r.errors,D),v.isValid&&x()),_.state.next({...r}))},hn=(D,U={})=>{const V=D?Vt(D):o,le=Vt(V),ae=fn(D),se=ae?o:le;if(U.keepDefaultValues||(o=V),!U.keepValues){if(U.keepDirtyValues){const ye=new Set([...h.mount,...Object.keys(wi(o,u))]);for(const Xe of Array.from(ye))ue(r.dirtyFields,Xe)?rt(se,Xe,ue(u,Xe)):R(Xe,ue(se,Xe))}else{if(Vm&&Et(D))for(const ye of h.mount){const Xe=ue(s,ye);if(Xe&&Xe._f){const Ie=Array.isArray(Xe._f.refs)?Xe._f.refs[0]:Xe._f.ref;if(tc(Ie)){const $t=Ie.closest("form");if($t){$t.reset();break}}}}if(U.keepFieldsRef)for(const ye of h.mount)R(ye,ue(se,ye));else s={}}u=t.shouldUnregister?U.keepDefaultValues?Vt(o):{}:Vt(se),_.array.next({values:{...se}}),_.state.next({values:{...se}})}h={mount:U.keepDirtyValues?h.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},f.mount=!v.isValid||!!U.keepIsValid||!!U.keepDirtyValues||!t.shouldUnregister&&!fn(se),f.watch=!!t.shouldUnregister,f.action=!1,U.keepErrors||(r.errors={}),_.state.next({submitCount:U.keepSubmitCount?r.submitCount:0,isDirty:ae?!1:U.keepDirty?r.isDirty:!!(U.keepDefaultValues&&!ua(D,o)),isSubmitted:U.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:ae?{}:U.keepDirtyValues?U.keepDefaultValues&&u?wi(o,u):r.dirtyFields:U.keepDefaultValues&&D?wi(o,D):U.keepDirty?r.dirtyFields:{},touchedFields:U.keepTouched?r.touchedFields:{},errors:U.keepErrors?r.errors:{},isSubmitSuccessful:U.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},cr=(D,U)=>hn(ca(D)?D(u):D,U),fr=(D,U={})=>{const V=ue(s,D),le=V&&V._f;if(le){const ae=le.refs?le.refs[0]:le.ref;ae.focus&&(ae.focus(),U.shouldSelect&&ca(ae.select)&&ae.select())}},za=D=>{r={...r,...D}},an={control:{register:Ve,unregister:be,getFieldState:A,handleSubmit:Ft,setError:F,_subscribe:oe,_runSchema:P,_focusError:jt,_getWatch:ce,_getDirty:Ce,_setValid:x,_setFieldArray:z,_setDisabledField:Re,_setErrors:q,_getFieldArray:he,_reset:hn,_resetDefaultValues:()=>ca(t.defaultValues)&&t.defaultValues().then(D=>{cr(D,t.resetOptions),_.state.next({isLoading:!1})}),_removeUnmounted:Ue,_disableForm:un,_subjects:_,_proxyFormState:v,get _fields(){return s},get _formValues(){return u},get _state(){return f},set _state(D){f=D},get _defaultValues(){return o},get _names(){return h},set _names(D){h=D},get _formState(){return r},get _options(){return t},set _options(D){t={...t,...D}}},subscribe:Se,trigger:Ae,register:Ve,handleSubmit:Ft,watch:ee,setValue:R,getValues:De,reset:cr,resetField:Ts,clearErrors:$,unregister:be,setError:F,setFocus:fr,getFieldState:A};return{...an,formControl:an}}function Tz(e={}){const t=Z.useRef(void 0),r=Z.useRef(void 0),[s,o]=Z.useState({isDirty:!1,isValidating:!1,isLoading:ca(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:ca(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:s},e.defaultValues&&!ca(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:f,...h}=Ez(e);t.current={...h,formState:s}}const u=t.current.control;return u._options=e,$m(()=>{const f=u._subscribe({formState:u._proxyFormState,callback:()=>o({...u._formState}),reRenderRoot:!0});return o(h=>({...h,isReady:!0})),u._formState.isReady=!0,f},[u]),Z.useEffect(()=>u._disableForm(e.disabled),[u,e.disabled]),Z.useEffect(()=>{e.mode&&(u._options.mode=e.mode),e.reValidateMode&&(u._options.reValidateMode=e.reValidateMode)},[u,e.mode,e.reValidateMode]),Z.useEffect(()=>{e.errors&&(u._setErrors(e.errors),u._focusError())},[u,e.errors]),Z.useEffect(()=>{e.shouldUnregister&&u._subjects.state.next({values:u._getWatch()})},[u,e.shouldUnregister]),Z.useEffect(()=>{if(u._proxyFormState.isDirty){const f=u._getDirty();f!==s.isDirty&&u._subjects.state.next({isDirty:f})}},[u,s.isDirty]),Z.useEffect(()=>{var f;e.values&&!ua(e.values,r.current)?(u._reset(e.values,{keepFieldsRef:!0,...u._options.resetOptions}),!((f=u._options.resetOptions)===null||f===void 0)&&f.keepIsValid||u._setValid(),r.current=e.values,o(h=>({...h}))):u._resetDefaultValues()},[u,e.values]),Z.useEffect(()=>{u._state.mount||(u._setValid(),u._state.mount=!0),u._state.watch&&(u._state.watch=!1,u._subjects.state.next({...u._formState})),u._removeUnmounted()}),t.current.formState=jS(s,u),t.current}const mb=(e,t,r)=>{if(e&&"reportValidity"in e){const s=ue(r,t);e.setCustomValidity(s&&s.message||""),e.reportValidity()}},Gh=(e,t)=>{for(const r in t.fields){const s=t.fields[r];s&&s.ref&&"reportValidity"in s.ref?mb(s.ref,r,e):s&&s.refs&&s.refs.forEach(o=>mb(o,r,e))}},pb=(e,t)=>{t.shouldUseNativeValidation&&Gh(e,t);const r={};for(const s in e){const o=ue(t.fields,s),u=Object.assign(e[s]||{},{ref:o&&o.ref});if(Oz(t.names||Object.keys(e),s)){const f=Object.assign({},ue(r,s));rt(f,"root",u),rt(r,s,f)}else rt(r,s,u)}return r},Oz=(e,t)=>{const r=gb(t);return e.some(s=>gb(s).match(`^${r}\\.\\d+`))};function gb(e){return e.replace(/\]|\[/g,"")}function ne(e,t,r){function s(h,p){if(h._zod||Object.defineProperty(h,"_zod",{value:{def:p,constr:f,traits:new Set},enumerable:!1}),h._zod.traits.has(e))return;h._zod.traits.add(e),t(h,p);const m=f.prototype,v=Object.keys(m);for(let g=0;gr?.Parent&&h instanceof r.Parent?!0:h?._zod?.traits?.has(e)}),Object.defineProperty(f,"name",{value:e}),f}class Ci extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class FS extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const $S={};function _s(e){return $S}function Az(e){const t=Object.values(e).filter(s=>typeof s=="number");return Object.entries(e).filter(([s,o])=>t.indexOf(+s)===-1).map(([s,o])=>o)}function Xh(e,t){return typeof t=="bigint"?t.toString():t}function Im(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Qm(e){return e==null}function Wm(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}const yb=Symbol("evaluating");function ft(e,t,r){let s;Object.defineProperty(e,t,{get(){if(s!==yb)return s===void 0&&(s=yb,s=r()),s},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function xs(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Es(...e){const t={};for(const r of e){const s=Object.getOwnPropertyDescriptors(r);Object.assign(t,s)}return Object.defineProperties({},t)}function vb(e){return JSON.stringify(e)}function Dz(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const qS="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ac(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Cz=Im(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function ql(e){if(ac(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(ac(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function GS(e){return ql(e)?{...e}:Array.isArray(e)?[...e]:e}const Rz=new Set(["string","number","symbol"]);function Dc(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function $r(e,t,r){const s=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(s._zod.parent=e),s}function Me(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Nz(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function Mz(e,t){const r=e._zod.def,s=Es(e._zod.def,{get shape(){const o={};for(const u in t){if(!(u in r.shape))throw new Error(`Unrecognized key: "${u}"`);t[u]&&(o[u]=r.shape[u])}return xs(this,"shape",o),o},checks:[]});return $r(e,s)}function zz(e,t){const r=e._zod.def,s=Es(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const u in t){if(!(u in r.shape))throw new Error(`Unrecognized key: "${u}"`);t[u]&&delete o[u]}return xs(this,"shape",o),o},checks:[]});return $r(e,s)}function kz(e,t){if(!ql(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const o=Es(e._zod.def,{get shape(){const u={...e._zod.def.shape,...t};return xs(this,"shape",u),u},checks:[]});return $r(e,o)}function jz(e,t){if(!ql(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r={...e._zod.def,get shape(){const s={...e._zod.def.shape,...t};return xs(this,"shape",s),s},checks:e._zod.def.checks};return $r(e,r)}function Uz(e,t){const r=Es(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t._zod.def.shape};return xs(this,"shape",s),s},get catchall(){return t._zod.def.catchall},checks:[]});return $r(e,r)}function Lz(e,t,r){const s=Es(t._zod.def,{get shape(){const o=t._zod.def.shape,u={...o};if(r)for(const f in r){if(!(f in o))throw new Error(`Unrecognized key: "${f}"`);r[f]&&(u[f]=e?new e({type:"optional",innerType:o[f]}):o[f])}else for(const f in o)u[f]=e?new e({type:"optional",innerType:o[f]}):o[f];return xs(this,"shape",u),u},checks:[]});return $r(t,s)}function Yz(e,t,r){const s=Es(t._zod.def,{get shape(){const o=t._zod.def.shape,u={...o};if(r)for(const f in r){if(!(f in u))throw new Error(`Unrecognized key: "${f}"`);r[f]&&(u[f]=new e({type:"nonoptional",innerType:o[f]}))}else for(const f in o)u[f]=new e({type:"nonoptional",innerType:o[f]});return xs(this,"shape",u),u},checks:[]});return $r(t,s)}function Ei(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r{var s;return(s=r).path??(s.path=[]),r.path.unshift(e),r})}function Ru(e){return typeof e=="string"?e:e?.message}function Ss(e,t,r){const s={...e,path:e.path??[]};if(!e.message){const o=Ru(e.inst?._zod.def?.error?.(e))??Ru(t?.error?.(e))??Ru(r.customError?.(e))??Ru(r.localeError?.(e))??"Invalid input";s.message=o}return delete s.inst,delete s.continue,t?.reportInput||delete s.input,s}function Pm(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Gl(...e){const[t,r,s]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:s}:{...t}}const IS=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Xh,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Km=ne("$ZodError",IS),Cc=ne("$ZodError",IS,{Parent:Error});function Hz(e,t=r=>r.message){const r={},s=[];for(const o of e.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o))):s.push(t(o));return{formErrors:s,fieldErrors:r}}function Vz(e,t=r=>r.message){const r={_errors:[]},s=o=>{for(const u of o.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(f=>s({issues:f}));else if(u.code==="invalid_key")s({issues:u.issues});else if(u.code==="invalid_element")s({issues:u.issues});else if(u.path.length===0)r._errors.push(t(u));else{let f=r,h=0;for(;h(t,r,s,o)=>{const u=s?Object.assign(s,{async:!1}):{async:!1},f=t._zod.run({value:r,issues:[]},u);if(f instanceof Promise)throw new Ci;if(f.issues.length){const h=new(o?.Err??e)(f.issues.map(p=>Ss(p,u,_s())));throw qS(h,o?.callee),h}return f.value},Bz=Rc(Cc),Nc=e=>async(t,r,s,o)=>{const u=s?Object.assign(s,{async:!0}):{async:!0};let f=t._zod.run({value:r,issues:[]},u);if(f instanceof Promise&&(f=await f),f.issues.length){const h=new(o?.Err??e)(f.issues.map(p=>Ss(p,u,_s())));throw qS(h,o?.callee),h}return f.value},Zz=Nc(Cc),Mc=e=>(t,r,s)=>{const o=s?{...s,async:!1}:{async:!1},u=t._zod.run({value:r,issues:[]},o);if(u instanceof Promise)throw new Ci;return u.issues.length?{success:!1,error:new(e??Km)(u.issues.map(f=>Ss(f,o,_s())))}:{success:!0,data:u.value}},Fz=Mc(Cc),zc=e=>async(t,r,s)=>{const o=s?Object.assign(s,{async:!0}):{async:!0};let u=t._zod.run({value:r,issues:[]},o);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(f=>Ss(f,o,_s())))}:{success:!0,data:u.value}},$z=zc(Cc),qz=e=>(t,r,s)=>{const o=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return Rc(e)(t,r,o)},Gz=e=>(t,r,s)=>Rc(e)(t,r,s),Xz=e=>async(t,r,s)=>{const o=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return Nc(e)(t,r,o)},Iz=e=>async(t,r,s)=>Nc(e)(t,r,s),Qz=e=>(t,r,s)=>{const o=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return Mc(e)(t,r,o)},Wz=e=>(t,r,s)=>Mc(e)(t,r,s),Pz=e=>async(t,r,s)=>{const o=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return zc(e)(t,r,o)},Kz=e=>async(t,r,s)=>zc(e)(t,r,s),Jz=/^[cC][^\s-]{8,}$/,ek=/^[0-9a-z]+$/,tk=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,nk=/^[0-9a-vA-V]{20}$/,ak=/^[A-Za-z0-9]{27}$/,rk=/^[a-zA-Z0-9_-]{21}$/,sk=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ik=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,bb=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,lk=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ok="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function uk(){return new RegExp(ok,"u")}const ck=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,fk=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,dk=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,hk=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,mk=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,QS=/^[A-Za-z0-9_-]*$/,pk=/^\+(?:[0-9]){6,14}[0-9]$/,WS="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",gk=new RegExp(`^${WS}$`);function PS(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function yk(e){return new RegExp(`^${PS(e)}$`)}function vk(e){const t=PS({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const s=`${t}(?:${r.join("|")})`;return new RegExp(`^${WS}T(?:${s})$`)}const bk=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},_k=/^[^A-Z]*$/,Sk=/^[^a-z]*$/,Ma=ne("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),wk=ne("$ZodCheckMaxLength",(e,t)=>{var r;Ma.init(e,t),(r=e._zod.def).when??(r.when=s=>{const o=s.value;return!Qm(o)&&o.length!==void 0}),e._zod.onattach.push(s=>{const o=s._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum{const o=s.value;if(o.length<=t.maximum)return;const f=Pm(o);s.issues.push({origin:f,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),xk=ne("$ZodCheckMinLength",(e,t)=>{var r;Ma.init(e,t),(r=e._zod.def).when??(r.when=s=>{const o=s.value;return!Qm(o)&&o.length!==void 0}),e._zod.onattach.push(s=>{const o=s._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(s._zod.bag.minimum=t.minimum)}),e._zod.check=s=>{const o=s.value;if(o.length>=t.minimum)return;const f=Pm(o);s.issues.push({origin:f,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Ek=ne("$ZodCheckLengthEquals",(e,t)=>{var r;Ma.init(e,t),(r=e._zod.def).when??(r.when=s=>{const o=s.value;return!Qm(o)&&o.length!==void 0}),e._zod.onattach.push(s=>{const o=s._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=s=>{const o=s.value,u=o.length;if(u===t.length)return;const f=Pm(o),h=u>t.length;s.issues.push({origin:f,...h?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:s.value,inst:e,continue:!t.abort})}}),kc=ne("$ZodCheckStringFormat",(e,t)=>{var r,s;Ma.init(e,t),e._zod.onattach.push(o=>{const u=o._zod.bag;u.format=t.format,t.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(s=e._zod).check??(s.check=()=>{})}),Tk=ne("$ZodCheckRegex",(e,t)=>{kc.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ok=ne("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=_k),kc.init(e,t)}),Ak=ne("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Sk),kc.init(e,t)}),Dk=ne("$ZodCheckIncludes",(e,t)=>{Ma.init(e,t);const r=Dc(t.includes),s=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=s,e._zod.onattach.push(o=>{const u=o._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(s)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),Ck=ne("$ZodCheckStartsWith",(e,t)=>{Ma.init(e,t);const r=new RegExp(`^${Dc(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(s=>{const o=s._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=s=>{s.value.startsWith(t.prefix)||s.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:s.value,inst:e,continue:!t.abort})}}),Rk=ne("$ZodCheckEndsWith",(e,t)=>{Ma.init(e,t);const r=new RegExp(`.*${Dc(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(s=>{const o=s._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=s=>{s.value.endsWith(t.suffix)||s.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:s.value,inst:e,continue:!t.abort})}}),Nk=ne("$ZodCheckOverwrite",(e,t)=>{Ma.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class Mk{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const s=t.split(` `).filter(f=>f),o=Math.min(...s.map(f=>f.length-f.trimStart().length)),u=s.map(f=>f.slice(o)).map(f=>" ".repeat(this.indent*2)+f);for(const f of u)this.content.push(f)}compile(){const t=Function,r=this?.args,o=[...(this?.content??[""]).map(u=>` ${u}`)];return new t(...r,o.join(` `))}}const zk={major:4,minor:1,patch:13},Zt=ne("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=zk;const s=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&s.unshift(e);for(const o of s)for(const u of o._zod.onattach)u(e);if(s.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(f,h,p)=>{let m=Ei(f),v;for(const g of h){if(g._zod.def.when){if(!g._zod.def.when(f))continue}else if(m)continue;const _=f.issues.length,N=g._zod.check(f);if(N instanceof Promise&&p?.async===!1)throw new Ci;if(v||N instanceof Promise)v=(v??Promise.resolve()).then(async()=>{await N,f.issues.length!==_&&(m||(m=Ei(f,_)))});else{if(f.issues.length===_)continue;m||(m=Ei(f,_))}}return v?v.then(()=>f):f},u=(f,h,p)=>{if(Ei(f))return f.aborted=!0,f;const m=o(h,s,p);if(m instanceof Promise){if(p.async===!1)throw new Ci;return m.then(v=>e._zod.parse(v,p))}return e._zod.parse(m,p)};e._zod.run=(f,h)=>{if(h.skipChecks)return e._zod.parse(f,h);if(h.direction==="backward"){const m=e._zod.parse({value:f.value,issues:[]},{...h,skipChecks:!0});return m instanceof Promise?m.then(v=>u(v,f,h)):u(m,f,h)}const p=e._zod.parse(f,h);if(p instanceof Promise){if(h.async===!1)throw new Ci;return p.then(m=>o(m,s,h))}return o(p,s,h)}}e["~standard"]={validate:o=>{try{const u=Fz(e,o);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return $z(e,o).then(f=>f.success?{value:f.data}:{issues:f.error?.issues})}},vendor:"zod",version:1}}),Jm=ne("$ZodString",(e,t)=>{Zt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??bk(e._zod.bag),e._zod.parse=(r,s)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),bt=ne("$ZodStringFormat",(e,t)=>{kc.init(e,t),Jm.init(e,t)}),kk=ne("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=ik),bt.init(e,t)}),jk=ne("$ZodUUID",(e,t)=>{if(t.version){const s={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(s===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=bb(s))}else t.pattern??(t.pattern=bb());bt.init(e,t)}),Uk=ne("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=lk),bt.init(e,t)}),Lk=ne("$ZodURL",(e,t)=>{bt.init(e,t),e._zod.check=r=>{try{const s=r.value.trim(),o=new URL(s);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=o.href:r.value=s;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Yk=ne("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=uk()),bt.init(e,t)}),Hk=ne("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=rk),bt.init(e,t)}),Vk=ne("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Jz),bt.init(e,t)}),Bk=ne("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=ek),bt.init(e,t)}),Zk=ne("$ZodULID",(e,t)=>{t.pattern??(t.pattern=tk),bt.init(e,t)}),Fk=ne("$ZodXID",(e,t)=>{t.pattern??(t.pattern=nk),bt.init(e,t)}),$k=ne("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=ak),bt.init(e,t)}),qk=ne("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=vk(t)),bt.init(e,t)}),Gk=ne("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=gk),bt.init(e,t)}),Xk=ne("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=yk(t)),bt.init(e,t)}),Ik=ne("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=sk),bt.init(e,t)}),Qk=ne("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=ck),bt.init(e,t),e._zod.bag.format="ipv4"}),Wk=ne("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=fk),bt.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),Pk=ne("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=dk),bt.init(e,t)}),Kk=ne("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=hk),bt.init(e,t),e._zod.check=r=>{const s=r.value.split("/");try{if(s.length!==2)throw new Error;const[o,u]=s;if(!u)throw new Error;const f=Number(u);if(`${f}`!==u)throw new Error;if(f<0||f>128)throw new Error;new URL(`http://[${o}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function KS(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Jk=ne("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=mk),bt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{KS(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function e3(e){if(!QS.test(e))return!1;const t=e.replace(/[-_]/g,s=>s==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return KS(r)}const t3=ne("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=QS),bt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{e3(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),n3=ne("$ZodE164",(e,t)=>{t.pattern??(t.pattern=pk),bt.init(e,t)});function a3(e,t=null){try{const r=e.split(".");if(r.length!==3)return!1;const[s]=r;if(!s)return!1;const o=JSON.parse(atob(s));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const r3=ne("$ZodJWT",(e,t)=>{bt.init(e,t),e._zod.check=r=>{a3(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),s3=ne("$ZodUnknown",(e,t)=>{Zt.init(e,t),e._zod.parse=r=>r}),i3=ne("$ZodNever",(e,t)=>{Zt.init(e,t),e._zod.parse=(r,s)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function _b(e,t,r){e.issues.length&&t.issues.push(...XS(r,e.issues)),t.value[r]=e.value}const l3=ne("$ZodArray",(e,t)=>{Zt.init(e,t),e._zod.parse=(r,s)=>{const o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);const u=[];for(let f=0;f_b(m,r,f))):_b(p,r,f)}return u.length?Promise.all(u).then(()=>r):r}});function rc(e,t,r,s){e.issues.length&&t.issues.push(...XS(r,e.issues)),e.value===void 0?r in s&&(t.value[r]=void 0):t.value[r]=e.value}function JS(e){const t=Object.keys(e.shape);for(const s of t)if(!e.shape?.[s]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${s}": expected a Zod schema`);const r=Nz(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function ew(e,t,r,s,o,u){const f=[],h=o.keySet,p=o.catchall._zod,m=p.def.type;for(const v in t){if(h.has(v))continue;if(m==="never"){f.push(v);continue}const g=p.run({value:t[v],issues:[]},s);g instanceof Promise?e.push(g.then(_=>rc(_,r,v,t))):rc(g,r,v,t)}return f.length&&r.issues.push({code:"unrecognized_keys",keys:f,input:t,inst:u}),e.length?Promise.all(e).then(()=>r):r}const o3=ne("$ZodObject",(e,t)=>{if(Zt.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const h=t.shape;Object.defineProperty(t,"shape",{get:()=>{const p={...h};return Object.defineProperty(t,"shape",{value:p}),p}})}const s=Im(()=>JS(t));ft(e._zod,"propValues",()=>{const h=t.shape,p={};for(const m in h){const v=h[m]._zod;if(v.values){p[m]??(p[m]=new Set);for(const g of v.values)p[m].add(g)}}return p});const o=ac,u=t.catchall;let f;e._zod.parse=(h,p)=>{f??(f=s.value);const m=h.value;if(!o(m))return h.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),h;h.value={};const v=[],g=f.shape;for(const _ of f.keys){const T=g[_]._zod.run({value:m[_],issues:[]},p);T instanceof Promise?v.push(T.then(x=>rc(x,h,_,m))):rc(T,h,_,m)}return u?ew(v,m,h,p,s.value,e):v.length?Promise.all(v).then(()=>h):h}}),u3=ne("$ZodObjectJIT",(e,t)=>{o3.init(e,t);const r=e._zod.parse,s=Im(()=>JS(t)),o=_=>{const N=new Mk(["shape","payload","ctx"]),T=s.value,x=q=>{const B=vb(q);return`shape[${B}]._zod.run({ value: input[${B}], issues: [] }, ctx)`};N.write("const input = payload.value;");const O=Object.create(null);let z=0;for(const q of T.keys)O[q]=`key_${z++}`;N.write("const newResult = {};");for(const q of T.keys){const B=O[q],J=vb(q);N.write(`const ${B} = ${x(q)};`),N.write(` if (${B}.issues.length) { diff --git a/TrackingToolWebAU/static/index.html b/TrackingToolWebAU/static/index.html index 7d243bd..d958e46 100644 --- a/TrackingToolWebAU/static/index.html +++ b/TrackingToolWebAU/static/index.html @@ -8,7 +8,7 @@